diff --git a/lib/ansible/module_utils/cloudstack.py b/lib/ansible/module_utils/cloudstack.py index f6760681cc..70d4acc81e 100644 --- a/lib/ansible/module_utils/cloudstack.py +++ b/lib/ansible/module_utils/cloudstack.py @@ -157,7 +157,17 @@ class AnsibleCloudStack(object): continue if key in current_dict: - if isinstance(current_dict[key], (int, long, float, complex)): + if isinstance(value, (int, float, long, complex)): + # ensure we compare the same type + if isinstance(value, int): + current_dict[key] = int(current_dict[key]) + elif isinstance(value, float): + current_dict[key] = float(current_dict[key]) + elif isinstance(value, long): + current_dict[key] = long(current_dict[key]) + elif isinstance(value, complex): + current_dict[key] = complex(current_dict[key]) + if value != current_dict[key]: return True else: