diff options
author | Kevin Carter <kevin.carter@rackspace.com> | 2015-06-01 15:15:37 -0500 |
---|---|---|
committer | Kevin Carter <kevin.carter@rackspace.com> | 2015-06-01 15:15:37 -0500 |
commit | 61aab829ed4801c3c86ae10a5142400fd2e67d0f (patch) | |
tree | 10c3399ad1142937bbba6799c005d7d944e8fbfc /cloud/lxc | |
parent | 307424c69419a57d7be50b2a85fb109293f5d91f (diff) | |
download | ansible-modules-extras-61aab829ed4801c3c86ae10a5142400fd2e67d0f.tar.gz |
lxc_container: remove BabyJSON
Removed the usage of baby json. This is in response to the fact
that the baby json functionality was removed in Ansible 1.8
Ref: https://github.com/ansible/ansible-modules-extras/issues/430
Diffstat (limited to 'cloud/lxc')
-rw-r--r-- | cloud/lxc/lxc_container.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/cloud/lxc/lxc_container.py b/cloud/lxc/lxc_container.py index 119d4506..b2dba211 100644 --- a/cloud/lxc/lxc_container.py +++ b/cloud/lxc/lxc_container.py @@ -383,9 +383,7 @@ EXAMPLES = """ try: import lxc except ImportError: - msg = 'The lxc module is not importable. Check the requirements.' - print("failed=True msg='%s'" % msg) - raise SystemExit(msg) + HAS_LXC = False # LXC_COMPRESSION_MAP is a map of available compression types when creating @@ -1706,6 +1704,11 @@ def main(): supports_check_mode=False, ) + if not HAS_LXC: + module.fail_json( + msg='The `lxc` module is not importable. Check the requirements.' + ) + lv_name = module.params.get('lv_name') if not lv_name: module.params['lv_name'] = module.params.get('name') |