Skip to content
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

Bug/cluster UUID issue68 #72

Merged
merged 3 commits into from
Feb 9, 2022
Merged
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
3 changes: 1 addition & 2 deletions .github/workflows/unit_testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,7 @@ jobs:
run: |
cd /home/${USER}/.ansible/collections/ansible_collections/${{ env.NAMESPACE }}/${{ env.COLLECTION_NAME }}
ansible-test units --docker default --python ${{ matrix.python-version }} --coverage -v
ansible-test coverage report > coverage.txt

ansible-test coverage report --include */plugins/* --omit */utils.py* > coverage.txt
- name: Code Coverage Check
run: |
cd /home/${USER}/.ansible/collections/ansible_collections/${{ env.NAMESPACE }}/${{ env.COLLECTION_NAME }}
Expand Down
7 changes: 5 additions & 2 deletions plugins/module_utils/entity.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,11 @@ def get_spec(self):
def get_uuid(self, name):
data = {"filter": "name=={0}".format(name), "length": 1}
resp, status = self.list(data)
if resp and resp.get("entities"):
return resp["entities"][0]["metadata"]["uuid"]
entities = resp.get("entities") if resp else None
if entities:
for entity in entities:
if entity["spec"]["name"] == name:
return entity["metadata"]["uuid"]
return None

def _build_url(self, module, scheme, resource_type):
Expand Down