Fail when model not found (#34227)

pull/34229/head
Chris Houseknecht 7 years ago committed by GitHub
parent 54396a95c2
commit ec3c31b1f4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -134,7 +134,7 @@ class KubernetesAnsibleModule(AnsibleModule):
helper.get_model(api_version, kind)
return helper
except KubernetesException as exc:
self.fail_json(msg="Error initializing module helper {0}".format(exc.message))
self.fail_json(msg="Error initializing module helper: {0}".format(exc.message))
def execute_module(self):
if self.resource_definition:
@ -355,7 +355,7 @@ class OpenShiftAnsibleModule(KubernetesAnsibleModule):
helper.get_model(api_version, kind)
return helper
except KubernetesException as exc:
self.exit_json(msg="Error initializing module helper {}".format(exc.message))
self.fail_json(msg="Error initializing module helper: {0}".format(exc.message))
def _create(self, namespace):
if self.kind.lower() == 'project':

Loading…
Cancel
Save