Note: The default ITS GitLab runner is a shared resource and is subject to slowdowns during heavy usage.
You can run your own GitLab runner that is dedicated just to your group if you need to avoid processing delays.

Commit 39cfacb8 authored by Rob Carleski's avatar Rob Carleski 🇮🇸
Browse files

Multiple fixes

- Add custom exception for entity not being found
- Raise new exception when DN cannot be found from search
- Fix fetch method to return empty group object when search brings back
  no results, but preserve exception raise for multiple failed searches
parent 825235ce
......@@ -58,7 +58,9 @@ def get_entity_dn(client, name):
else:
raise MCommError('Searching MCommunity failed.')
else:
raise MCommError('Unable to find "{}" in MCommunity'.format(name))
raise MCommEntityNotFound(
'Unable to find "{}" in MCommunity'.format(name)
)
if data:
for item in data:
......@@ -82,3 +84,7 @@ def get_entity_dn(client, name):
class MCommError(Exception):
pass
class MCommEntityNotFound(Exception):
pass
......@@ -168,7 +168,10 @@ class MCommGroup:
None
"""
self.dn = core.get_entity_dn(self.client, self.name)
try:
self.dn = core.get_entity_dn(self.client, self.name)
except core.MCommEntityNotFound:
self.dn = None
if not self.dn:
return
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment