-
Notifications
You must be signed in to change notification settings - Fork 52
Description
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