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):
raise MCommError('Searching MCommunity failed.')
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):
class MCommEntityNotFound(Exception):
......@@ -168,7 +168,10 @@ class MCommGroup:
self.dn = core.get_entity_dn(self.client,
self.dn = core.get_entity_dn(self.client,
except core.MCommEntityNotFound:
self.dn = None
if not self.dn:
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