Skip to content

Commit

Permalink
[patch] get_default_storage_classes should always set failed=False (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
durera authored Nov 26, 2024
1 parent 7014f49 commit e04138a
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions ibm/mas_devops/plugins/action/get_default_storage_classes.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,16 @@ def run(self, tmp=None, task_vars=None):
dynClient = get_api_client()
storageClasses = getDefaultStorageClasses(dynClient)

# We don't want to fail if we can't find any default storage classes, doing so will
# result in roles/playbooks failing in environments where none of the default
# storage classes are available. We use the success=false to track when we couldn't
# find a default storage class, which does not trigger Ansible treating the action as
# failed.
if storageClasses.provider is None:
return dict(
message=f"Failed to find default storage classes",
message=f"Failed to find any default supported storage classes",
success=False,
failed=True,
failed=False,
changed=False,
**vars(storageClasses)
)
Expand Down

0 comments on commit e04138a

Please sign in to comment.