From 4f151e174b9d655e570f5e6625d5f5002e49cf33 Mon Sep 17 00:00:00 2001 From: Aleksandr Malyavin Date: Fri, 1 Apr 2022 12:01:44 +0300 Subject: [PATCH] Some changes --- library/decort_k8s.py | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/library/decort_k8s.py b/library/decort_k8s.py index 24ba4c9..cdd2813 100644 --- a/library/decort_k8s.py +++ b/library/decort_k8s.py @@ -7,7 +7,7 @@ # # -# Author: Sergey Shubin (sergey.shubin@digitalenergy.online) +# Author: Aleksandr Malyavin (aleksandr.malyavin@digitalenergy.online) # ANSIBLE_METADATA = {'metadata_version': '1.1', @@ -22,10 +22,10 @@ from ansible.module_utils.decort_utils import * def decort_k8s_package_facts(arg_k8s_facts, arg_check_mode=False): - """Package a dictionary of RG facts according to the decort_rg module specification. This dictionary will + """Package a dictionary of k8s facts according to the decort_k8s module specification. This dictionary will be returned to the upstream Ansible engine at the completion of the module run. - @param arg_k8s_facts: dictionary with RG facts as returned by API call to .../rg/get + @param arg_k8s_facts: dictionary with k8s facts as returned by API call to .../k8s/get @param arg_check_mode: boolean that tells if this Ansible module is run in check mode """ @@ -51,7 +51,7 @@ def decort_k8s_package_facts(arg_k8s_facts, arg_check_mode=False): return ret_dict def decort_k8s_parameters(): - """Build and return a dictionary of parameters expected by decort_rg module in a form accepted + """Build and return a dictionary of parameters expected by decort_k8s module in a form accepted by AnsibleModule utility class.""" return dict( @@ -130,12 +130,8 @@ def main(): decon = DecortController(amodule) k8s_id, k8s_facts = decon.k8s_find(arg_k8s_name=amodule.params['k8s_name'], arg_check_state=False) - k8s_should_exist = True - #TODO check variables - - #TODO check rg rss if k8s_id: if k8s_facts['status'] in ["MODELED", "DISABLING", "ENABLING", "DELETING", "DESTROYING", "CREATING", "RESTORING"] and amodule.params['state'] != "present":