Skip to content

Commit

Permalink
Add .gitignore
Browse files Browse the repository at this point in the history
Signed-off-by: Rabin Yasharzadehe <[email protected]>
  • Loading branch information
rabin-io committed May 15, 2024
1 parent 82da50c commit 7b0297e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 14 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
**/__pycache__
16 changes: 5 additions & 11 deletions plugins/modules/install_cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@
from ansible_collections.rhpds.assisted_installer.plugins.module_utils import api
from ansible_collections.rhpds.assisted_installer.plugins.module_utils import defaults

import logging
import logging.handlers
my_logger = logging.getLogger('MyLogger')
my_logger.setLevel(logging.DEBUG)

handler = logging.handlers.SysLogHandler(address = '/dev/log')

my_logger.addHandler(handler)

DOCUMENTATION = r'''
Expand Down Expand Up @@ -123,14 +123,9 @@ def run_module():
})
result['access_token'] = response.json()["access_token"]

my_logger.debug(f"GET module.params['ai_api_endpoint'] + '/' + api.REGISTER_CLUSTER + "/" + module.params['cluster_id']")
response = session.get(
module.params['ai_api_endpoint'] + '/' + api.REGISTER_CLUSTER + "/" + module.params['cluster_id'],
headers=headers,
)

### TODO: Can we make idempotent?
response = session.post(
module.params['ai_api_endpoint'] + '/' + api.REGISTER_CLUSTER + "/" + module.params['cluster_id'] + "/actions/install",
f"{module.params['ai_api_endpoint']}/{api.REGISTER_CLUSTER}/{module.params['cluster_id']}/actions/install",
headers=headers,
)
if "code" in response.json():
Expand Down Expand Up @@ -161,8 +156,7 @@ def run_module():
# manipulate or modify the state as needed (this is going to be the
# part where your module will do what it needs to do)
response = session.get(
# "https://api.openshift.com/api/assisted-install/v2/clusters/" + module.params['cluster_id'],
module.params['ai_api_endpoint'] + '/' + api.REGISTER_CLUSTER + "/" + module.params['cluster_id'],
f"{module.params['ai_api_endpoint']}/{api.REGISTER_CLUSTER}/{module.params['cluster_id']}",
headers=headers,
)
if "code" in response.json():
Expand Down
3 changes: 0 additions & 3 deletions plugins/modules/wait_for_hosts.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,9 @@

import logging
import logging.handlers

my_logger = logging.getLogger('MyLogger')
my_logger.setLevel(logging.DEBUG)

handler = logging.handlers.SysLogHandler(address = '/dev/log')

my_logger.addHandler(handler)

DOCUMENTATION = r'''
Expand Down

0 comments on commit 7b0297e

Please sign in to comment.