Skip to content

retrieve the Monitor object in the GSLB._build() method #113

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion dyn/tm/services/gslb.py
Original file line number Diff line number Diff line change
Expand Up @@ -811,8 +811,12 @@ def _build(self, data, region=True):
region_code = region.pop('region_code', None)
self._region.append(GSLBRegion(self._zone, self._fqdn,
region_code, **region))
elif key == 'monitor' and not val:
self._monitor = None
elif key == 'monitor':
# We already have the monitor object, no need to rebuild it
self._monitor = Monitor(protocol=val['protocol'], interval=val['interval'])
for attr, v in val.items():
setattr(self._monitor, '_'+attr, v)
pass
elif key == "task_id" and not val:
self._task_id = None
Expand Down