Skip to content

GSLB "get_all_gslb" just repeats parent zone name #123

Description

@brentrjones

When trying to list all GSLBs in a zone, the 'get_all_gslb' function just repeats the parent zone name for N instances of GSLB under the zone.

To reproduce:
my_zone = Zone('mydomain.com') all_gslb = my_zone.get_all_gslb() print(all_gslb)

Will just print
[<GSLB>: mydomain.com., <GSLB>: mydomain.com., <GSLB>: mydomain.com., <GSLB>: mydomain.com., <GSLB>: mydomain.com., <GSLB>: mydomain.com., <GSLB>: mydomain.com., <GSLB>: mydomain.com.]

In dyn/zones.py, offending section removes the returned zone and fqdn:

def get_all_gslb(self): """Retrieve a list of all :class:GSLB services associated with this :class:Zone`

    :return: A :class:`List` of :class:`GSLB` Services
    """
    uri = '/GSLB/{}/'.format(self._name)
    api_args = {'detail': 'Y'}
    response = DynectSession.get_session().execute(uri, 'GET', api_args)
    gslbs = []
    for gslb_svc in response['data']:
        del gslb_svc['zone']
        del gslb_svc['fqdn']
        gslbs.append(GSLB(self._name, self._fqdn, api=False, **gslb_svc))
    return gslbs`

I'll see if I can restructure that to return intended results, but a lot of the functions seem to be copy-pastad and I'd like to fix all of them, too

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions