-
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
fix parameters passed as string that should be integer #36818
Conversation
shipit |
bot_status |
Componentslib/ansible/modules/cloud/azure/azure_rm_deployment.py Metadatawaiting_on: ansible |
ready_for_review |
# this is to fix issue #35536 -- it's impossible to pass int parameters | ||
if self.parameters and self.template: | ||
for k in self.parameters: | ||
if self.template['parameters'][k]['type'] == "int": |
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.
So to understand this correctly, the user must specify the type as an int in the parameter definition like so?
- azure_rm_deployment:
template:
parameters:
intFieldParameter:
type: int
value: 123
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.
Are you able to add a test case for this?
agree with @jborean93 . it's necessary to add test to cover the change since azure_rm_deployment module is quite general |
@@ -490,6 +490,12 @@ def deploy_template(self): | |||
uri=self.template_link | |||
) | |||
|
|||
# this is to fix issue #35536 -- it's impossible to pass int parameters | |||
if self.parameters and self.template: |
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.
pls also help to fix in paremeters_link
@zikalino This PR exist conflicting files, Could you help to resolve it? Thanks! |
closing this, as this is not a good fix, a hack really. it needs to be fixed in ansible core. so closing...……... |
SUMMARY
Fixes bug #35536
Converts parameters passed as string to int based on template definition.
Note: template has to be specified via template parameter, for example using lookup instead of template_url
ISSUE TYPE
COMPONENT NAME
azure_rm_deployment
ANSIBLE VERSION
2.4
ADDITIONAL INFORMATION