From 5f01cd440262915d6a5291fb4eb32ba53d5029ad Mon Sep 17 00:00:00 2001 From: Tim Rupp Date: Tue, 14 Feb 2017 11:29:43 -0800 Subject: [PATCH] [cloud][serverless] Removes manual expanduser call in favor of type `path` (#21418) Removes the usage of expanduser because it is handled automatically by type 'path'. Related to #12263 --- lib/ansible/modules/cloud/misc/serverless.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/ansible/modules/cloud/misc/serverless.py b/lib/ansible/modules/cloud/misc/serverless.py index a075a2b49b..b5a580a11f 100644 --- a/lib/ansible/modules/cloud/misc/serverless.py +++ b/lib/ansible/modules/cloud/misc/serverless.py @@ -114,7 +114,7 @@ import yaml def read_serverless_config(module): - path = os.path.expanduser(module.params.get('service_path')) + path = module.params.get('service_path') try: with open(os.path.join(path, 'serverless.yml')) as sls_config: @@ -141,7 +141,7 @@ def get_service_name(module, stage): def main(): module = AnsibleModule( argument_spec=dict( - service_path = dict(required=True), + service_path = dict(required=True, type='path'), state = dict(default='present', choices=['present', 'absent'], required=False), functions = dict(type='list', required=False), region = dict(default='', required=False), @@ -150,7 +150,7 @@ def main(): ), ) - service_path = os.path.expanduser(module.params.get('service_path')) + service_path = module.params.get('service_path') state = module.params.get('state') functions = module.params.get('functions') region = module.params.get('region')