Skip to content
Open
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion dyn/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ def _retry(self, msgs, final=False):
# Get the task id
task = next(pat.match(i['INFO']).group(1) for i in msgs
if pat.match(i.get('INFO', '')))
except:
except Exception:
# Task id could not be recovered
wait = 1
else:
Expand Down
15 changes: 14 additions & 1 deletion dyn/tm/services/dsf.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,19 @@
'TrafficDirector']


def get_dsf(service):
"""
:param service: a dsf_id string, or :class:`TrafficDirector`
:return: :class:`TrafficDirector` Service
"""
_service_id = _check_type(service)
uri = '/DSF/{}'.format(_service_id)
api_args = {'detail': 'Y'}
response = DynectSession.get_session().execute(uri, 'GET', api_args)
director = TrafficDirector(None, api=False, **response['data'])
return director


def get_all_dsf_services():
""":return: A ``list`` of :class:`TrafficDirector` Services"""
uri = '/DSF/'
Expand Down Expand Up @@ -419,7 +432,7 @@ def _build(self, data):
self._rdata_class.lower()):
for k, v in rdata_v.items():
setattr(self, '_' + k, v)
except:
except Exception:
pass
else:
setattr(self, '_' + key, val)
Expand Down