Skip to content
This repository has been archived by the owner on Oct 30, 2018. It is now read-only.

Commit

Permalink
kubernetes: handle situation when target host does not have yaml libr…
Browse files Browse the repository at this point in the history
…ary (fixes #3301) (#3449)
  • Loading branch information
krzysztof-magosa authored and ryansb committed Dec 5, 2016
1 parent 8d0052a commit 0baef3c
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion clustering/kubernetes.py
Expand Up @@ -150,9 +150,14 @@
phase: "Active"
'''

import yaml
import base64

try:
import yaml
has_lib_yaml = True
except ImportError:
has_lib_yaml = False

############################################################################
############################################################################
# For API coverage, this Anislbe module provides capability to operate on
Expand Down Expand Up @@ -325,6 +330,9 @@ def main():
required_one_of = (('file_reference', 'inline_data'),),
)

if not has_lib_yaml:
module.fail_json(msg="missing python library: yaml")

decode_cert_data(module)

api_endpoint = module.params.get('api_endpoint')
Expand Down

0 comments on commit 0baef3c

Please sign in to comment.