Skip to content

Commit

Permalink
serverless: fix broken import
Browse files Browse the repository at this point in the history
  • Loading branch information
pilou- authored and abadger committed Aug 12, 2017
1 parent 94a327d commit c52f355
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
12 changes: 10 additions & 2 deletions lib/ansible/modules/cloud/misc/serverless.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
default: true
notes:
- 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"
'''

Expand Down Expand Up @@ -116,7 +116,12 @@

import os
import traceback
import yaml

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

from ansible.module_utils.basic import AnsibleModule

Expand Down Expand Up @@ -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')
state = module.params.get('state')
functions = module.params.get('functions')
Expand Down
1 change: 0 additions & 1 deletion test/sanity/import/skip.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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/gcdns_record.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/univention/udm_user.py
lib/ansible/modules/cloud/webfaction/webfaction_app.py
Expand Down

0 comments on commit c52f355

Please sign in to comment.