summaryrefslogtreecommitdiff
path: root/lib/ansible
diff options
context:
space:
mode:
authorJoe Clarke <jclarke@marcuscom.com>2019-08-26 11:32:14 -0400
committeransibot <ansibot@users.noreply.github.com>2019-08-26 11:32:14 -0400
commit0b284c1431592b8031a306488f97f8a41525f47b (patch)
tree296f01de2570a25b6b9968d9f75a2e4a13b25b32 /lib/ansible
parent7cefef9719754082885efc394ddca06f2c2712de (diff)
downloadansible-0b284c1431592b8031a306488f97f8a41525f47b.tar.gz
Cast booleans to strings. (#60544)
This avoids an error when building the API request: TypeError: Argument must be bytes or unicode, got 'bool' This would occur when one explicitly sets async_bool or ignore_owners in a playbook/role.
Diffstat (limited to 'lib/ansible')
-rw-r--r--lib/ansible/modules/storage/netapp/na_ontap_snapshot.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/ansible/modules/storage/netapp/na_ontap_snapshot.py b/lib/ansible/modules/storage/netapp/na_ontap_snapshot.py
index 2ae35fac35..8adda71bab 100644
--- a/lib/ansible/modules/storage/netapp/na_ontap_snapshot.py
+++ b/lib/ansible/modules/storage/netapp/na_ontap_snapshot.py
@@ -201,7 +201,7 @@ class NetAppOntapSnapshot(object):
snapshot_obj.add_new_child("volume", self.parameters['volume'])
# Set up optional variables to create a snapshot
if self.parameters.get('async_bool'):
- snapshot_obj.add_new_child("async", self.parameters['async_bool'])
+ snapshot_obj.add_new_child("async", str(self.parameters['async_bool']))
if self.parameters.get('comment'):
snapshot_obj.add_new_child("comment", self.parameters['comment'])
if self.parameters.get('snapmirror_label'):
@@ -225,7 +225,7 @@ class NetAppOntapSnapshot(object):
snapshot_obj.add_new_child("volume", self.parameters['volume'])
# set up optional variables to delete a snapshot
if self.parameters.get('ignore_owners'):
- snapshot_obj.add_new_child("ignore-owners", self.parameters['ignore_owners'])
+ snapshot_obj.add_new_child("ignore-owners", str(self.parameters['ignore_owners']))
if self.parameters.get('snapshot_instance_uuid'):
snapshot_obj.add_new_child("snapshot-instance-uuid", self.parameters['snapshot_instance_uuid'])
try: