Skip to content

Commit

Permalink
Added a default retry interval for set_retry
Browse files Browse the repository at this point in the history
If we have an interval passed then we use it, otherwise use the default
as set up in the constant
  • Loading branch information
syncrou committed Sep 11, 2018
1 parent 066f1bb commit 51209ff
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion library/manageiq_automate.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
'status': ['preview'],
'supported_by': 'community'}

DEFAULT_RETRY_INTERVAL = 60

DOCUMENTATION = '''
module: manageiq_automate
Expand Down Expand Up @@ -339,15 +340,20 @@ def set_retry(self, dict_options):
"""
Set Retry
"""
retry_interval = dict_options.get('interval') or DEFAULT_RETRY_INTERVAL

attributes = dict()
attributes['object'] = 'root'
attributes['attributes'] = dict(ae_result='retry', ae_retry_interval=dict_options['interval'])
attributes['attributes'] = dict(ae_result='retry', ae_retry_interval=retry_interval)

self.set_attributes(attributes)
return self.set_or_commit()


def set_encrypted_attribute(self, dict_options):
"""
Set encrypted attribute
"""
encrypted_attribute = self.encrypt(dict_options)
return dict(changed=True, value=encrypted_attribute)

Expand Down

0 comments on commit 51209ff

Please sign in to comment.