cloudstack: cs_snapshot_policy: ignore intervaltype in has_changed (#3499)
Fixes ValueError: invalid literal for int() with base 10: 'daily'
This commit is contained in:
parent
5940c705a3
commit
3b60cb3847
1 changed files with 6 additions and 5 deletions
|
@ -230,13 +230,14 @@ class AnsibleCloudStackSnapshotPolicy(AnsibleCloudStack):
|
||||||
|
|
||||||
policy = self.get_snapshot_policy()
|
policy = self.get_snapshot_policy()
|
||||||
args = {
|
args = {
|
||||||
|
'id': policy.get('id') if policy else None,
|
||||||
'intervaltype': self.module.params.get('interval_type'),
|
'intervaltype': self.module.params.get('interval_type'),
|
||||||
'schedule': self.module.params.get('schedule'),
|
'schedule': self.module.params.get('schedule'),
|
||||||
'maxsnaps': self.module.params.get('max_snaps'),
|
'maxsnaps': self.module.params.get('max_snaps'),
|
||||||
'timezone': self.module.params.get('time_zone'),
|
'timezone': self.module.params.get('time_zone'),
|
||||||
'volumeid': self.get_volume(key='id')
|
'volumeid': self.get_volume(key='id')
|
||||||
}
|
}
|
||||||
if not policy or (policy and self.has_changed(policy, args)):
|
if not policy or (policy and self.has_changed(policy, args, only_keys=['schedule', 'maxsnaps', 'timezone'])):
|
||||||
self.result['changed'] = True
|
self.result['changed'] = True
|
||||||
if not self.module.check_mode:
|
if not self.module.check_mode:
|
||||||
res = self.cs.createSnapshotPolicy(**args)
|
res = self.cs.createSnapshotPolicy(**args)
|
||||||
|
|
Loading…
Reference in a new issue