Skip to content

Commit

Permalink
Merge pull request #454 from syncrou/add_manageiq_automate_changes
Browse files Browse the repository at this point in the history
  • Loading branch information
gmcculloug authored and simaishi committed Nov 5, 2018
1 parent 35e93a3 commit 271bfd9
Showing 1 changed file with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
'status': ['preview'],
'supported_by': 'community'}

DEFAULT_RETRY_INTERVAL = 60


DOCUMENTATION = '''
module: manageiq_automate
Expand Down Expand Up @@ -50,6 +52,8 @@ def url(self):
The url to connect to the workspace
"""
url_str = self._module.params['manageiq_connection']['automate_workspace']
if url_str is None:
self._module.fail_json(msg='Required parameter \'automate_workspace\' is not specified')
return self._api_url + '/' + url_str


Expand All @@ -71,6 +75,8 @@ def get(self, alt_url=None):
url = self.url()

result, _info = fetch_url(self._module, url, None, self._headers, 'get')
if result is None:
self._module.fail_json(msg=_info['msg'])
return json.loads(result.read())


Expand Down Expand Up @@ -321,15 +327,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_limit=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 271bfd9

Please sign in to comment.