Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Apply updates to the manageiq-automate Ansible role #454

Merged
merged 2 commits into from
Oct 26, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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