From 6a75c1a1385a5b7de9cef28d2db57225be5cd234 Mon Sep 17 00:00:00 2001 From: Chris Houseknecht Date: Mon, 15 Jan 2018 11:27:39 -0500 Subject: [PATCH] Fix name param. Remove logging. (#34881) --- lib/ansible/module_utils/k8s/lookup.py | 7 ------- lib/ansible/plugins/lookup/k8s.py | 2 +- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/lib/ansible/module_utils/k8s/lookup.py b/lib/ansible/module_utils/k8s/lookup.py index f5311669c2..6d175eaa63 100644 --- a/lib/ansible/module_utils/k8s/lookup.py +++ b/lib/ansible/module_utils/k8s/lookup.py @@ -64,7 +64,6 @@ class KubernetesLookup(object): self.connection = {} def run(self, terms, variables=None, **kwargs): - self.mylog('Here!') self.kind = kwargs.get('kind') self.name = kwargs.get('resource_name') self.namespace = kwargs.get('namespace') @@ -100,15 +99,10 @@ class KubernetesLookup(object): ) if self.name: - self.mylog("Calling get_object()") return self.get_object() return self.list_objects() - def mylog(self, msg): - with open('loggit.txt', 'a') as f: - f.write(msg + '\n') - def get_helper(self, api_version, kind): try: helper = KubernetesObjectHelper(api_version=api_version, kind=kind, debug=False) @@ -144,7 +138,6 @@ class KubernetesLookup(object): result = self.helper.get_object(self.name, self.namespace) except KubernetesException as exc: raise Exception('Failed to retrieve requested object: {0}'.format(exc.message)) - self.mylog("Got restult") response = [] if result is not None: # Convert Datetime objects to ISO format diff --git a/lib/ansible/plugins/lookup/k8s.py b/lib/ansible/plugins/lookup/k8s.py index d567332347..544a8295ec 100644 --- a/lib/ansible/plugins/lookup/k8s.py +++ b/lib/ansible/plugins/lookup/k8s.py @@ -44,7 +44,7 @@ DOCUMENTATION = """ - Use to specify an object model. If I(resource definition) is provided, the I(kind) from a I(resource_definition) will override this option. required: true - name: + resource_name: description: - Fetch a specific object by name. If I(resource definition) is provided, the I(metadata.name) value from the I(resource_definition) will override this option.