serverless: fix broken import

pull/28115/head
Pierre-Louis Bonicoli 7 years ago committed by Toshio Kuratomi
parent 94a327dd09
commit c52f355bcb

@ -58,7 +58,7 @@ options:
default: true default: true
notes: notes:
- Currently, the `serverless` command must be in the path of the node executing the task. In the future this may be a flag. - Currently, the `serverless` command must be in the path of the node executing the task. In the future this may be a flag.
requirements: [ "serverless" ] requirements: [ "serverless", "yaml" ]
author: "Ryan Scott Brown @ryansb" author: "Ryan Scott Brown @ryansb"
''' '''
@ -116,7 +116,12 @@ command:
import os import os
import traceback import traceback
try:
import yaml import yaml
HAS_YAML = True
except ImportError:
HAS_YAML = False
from ansible.module_utils.basic import AnsibleModule from ansible.module_utils.basic import AnsibleModule
@ -159,6 +164,9 @@ def main():
), ),
) )
if not HAS_YAML:
module.fail_json(msg='yaml is required for this module')
service_path = module.params.get('service_path') service_path = module.params.get('service_path')
state = module.params.get('state') state = module.params.get('state')
functions = module.params.get('functions') functions = module.params.get('functions')

@ -43,7 +43,6 @@ lib/ansible/modules/cloud/dimensiondata/dimensiondata_network.py
lib/ansible/modules/cloud/google/gc_storage.py lib/ansible/modules/cloud/google/gc_storage.py
lib/ansible/modules/cloud/google/gcdns_record.py lib/ansible/modules/cloud/google/gcdns_record.py
lib/ansible/modules/cloud/google/gcdns_zone.py lib/ansible/modules/cloud/google/gcdns_zone.py
lib/ansible/modules/cloud/misc/serverless.py
lib/ansible/modules/cloud/ovirt/ovirt_disks.py lib/ansible/modules/cloud/ovirt/ovirt_disks.py
lib/ansible/modules/cloud/univention/udm_user.py lib/ansible/modules/cloud/univention/udm_user.py
lib/ansible/modules/cloud/webfaction/webfaction_app.py lib/ansible/modules/cloud/webfaction/webfaction_app.py

Loading…
Cancel
Save