Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
ec2_ami: Typecast NoDevice value to string #55565
BOTO register_image API requires the
referenced this pull request
Apr 20, 2019
s-hertel left a comment •
Do you mind adding a test for this? https://github.com/ansible/ansible/tree/devel/test/integration/targets/ec2_ami
I'm getting this vague error with the reproducer in the bug report and I'm not sure if it's a problem with the module or perhaps something I'm doing wrong
I dug around a little bit out of curiosity. To successfully suppress devices I had to set NoDevice to an empty string like:
false/true, 'false'/'true', 'False'/'True', all cause an InvalidRequest error. This seems to be a clarity problem with the AWS documentation. Using an empty string to indicate true appears to be backed up by what boto was doing in the 2.4 version of this module (https://github.com/boto/boto/blob/develop/boto/ec2/blockdevicemapping.py#L142-L143).
So I guess, if true is provided, turn it into an empty str. If false, pop the NoDevice option out of the device dict.