-
Notifications
You must be signed in to change notification settings - Fork 52
feat(public cloud disk utils): Volume extend and info modules #115
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
base: master
Are you sure you want to change the base?
feat(public cloud disk utils): Volume extend and info modules #115
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your PR
changed=True, | ||
**result) | ||
|
||
except APIError as api_error: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Exceptions are catched in the OVH class
region = module.params['region'] | ||
size = module.params['size'] | ||
name = module.params['name'] | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should add a check_mode option before running for real
try: | ||
result = client.wrap_call( | ||
"POST", | ||
'/cloud/project/%s/volume/%s/upsize' % (service_name, volume_id), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use fstring
result = [volume for volume in result if volume['name'] == module.params['name']][0] | ||
module.exit_json(changed=False, **result) | ||
|
||
except APIError as api_error: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here, exceptions are handled in the OVH class
|
||
module = AnsibleModule( | ||
argument_spec=module_args, | ||
supports_check_mode=True |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As this is only returning informations, the check mode could be set to false.
Otherwise you should add a check mode
Adding the ability to extend/resize volumes and obtain volume info