-
Notifications
You must be signed in to change notification settings - Fork 23.7k
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
cloudstack: fix spelling of "affinity_type" #33231
Conversation
The test
|
Unsure about the best way to fix this E309 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.
Salut @vincentbernat
It looks I screwed... with the argument name, didn't I? :)
I would suggest to deprecate the old argument and add some infos in the description. The old agument has to be kept for 4 releases according policy. That is why we can remove it in 2.9 (2.5-2.8).
Optionally, a pass a set of the two args as mutually_exclusive
to AnsibleModule, to ensure only one could be used (see https://github.com/ansible/ansible/blob/devel/lib/ansible/module_utils/basic.py#L774).
Thanks!
@@ -160,7 +160,7 @@ def get_affinity_group(self): | |||
return self.affinity_group | |||
|
|||
def get_affinity_type(self): | |||
affinity_type = self.module.params.get('affinty_type') | |||
affinity_type = self.module.params.get('affinity_type') |
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.
- affinity_type = self.module.params.get('affinty_type')
+ affinity_type = self.module.params.get('affinity_type') or self.module.params.get('affinty_type')
@@ -217,7 +217,7 @@ def main(): | |||
argument_spec = cs_argument_spec() | |||
argument_spec.update(dict( | |||
name=dict(required=True), | |||
affinty_type=dict(), | |||
affinity_type=dict(aliases=['affinty_type']), |
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.
Lets deprecate the "old" param:
- affinty_type=dict(),
+ affinty_type=dict(removed_in_version='2.9'),
+ affinity_type=dict(),
@@ -36,7 +36,7 @@ | |||
description: | |||
- Name of the affinity group. | |||
required: true | |||
affinty_type: | |||
affinity_type: | |||
description: | |||
- Type of the affinity group. If not specified, first found affinity type is used. | |||
required: false |
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 add the old value as an alias here:
...
- Type of the affinity group. If not specified, first found affinity type is used.
+ - The misspelled C(affinty_type) has been corrected in 2.5. For backwards compatibility it is used as an alias and will be removed in version 2.9.
required: false
+ aliases: [ affinty_type ]
The previous spelling, "affinty_type" is marked as deprecated and will be removed in Ansible 2.9. Both spelling are mutually exclusives.
5c5092e
to
e39d92f
Compare
I have updated the commit with the requested changes. |
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.
shipit
Thanks. |
SUMMARY
Fix spelling of
affinity_type
(notaffinty_type
).However, to not break existing playbook, add an undocumented alias for
affinty_type
.ISSUE TYPE
COMPONENT NAME
cloudstack
ANSIBLE VERSION
2.4.0.0