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

add better error message for missing datastore #2103

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

mikemorency
Copy link
Contributor

@mikemorency mikemorency commented Jun 25, 2024

SUMMARY

If you try to add a datastore that does not exist to the allowed datastores list in the vCLS config, you get a cryptic error message. If a user encounters the error, its really not clear what went wrong.

This change adds a more descriptive error message in the case that the datastore a user tries to add cannot be found.
I deconstructed the existing method a bit as well, since it was beginning to get large and complex.

ISSUE TYPE
  • Feature Pull Request
COMPONENT NAME

vmware_cluster_vcls

ADDITIONAL INFORMATION

Test Playbook:

- hosts: localhost
  gather_facts: false
  tasks:
  - name: Configure vCLS Datastore Settings
    community.vmware.vmware_cluster_vcls:
      hostname: foo
      username: foo
      password: foo
      datacenter_name: foo
      cluster_name: foo
      allowed_datastores: ["doesnotexist"]

Before:

TASK [Configure vCLS Datastore Settings] ********************************************************************************
fatal: [mikemorency]: FAILED! => {"changed": false, "msg": "('A specified parameter was not correct: spec.systemVMsConfig.allowedDatastores[1].key', None)"}

After:

TASK [Configure vCLS Datastore Settings] ********************************************************************************
fatal: [mikemorency]: FAILED! => {"changed": false, "msg": "Failed to add datastore 'doesnotexist' because it does not exist."}

@mikemorency
Copy link
Contributor Author

@mariolenz hoping i didnt miss the june release cutoff 🤞

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant