mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
[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
This commit is contained in:
parent
e1a2c6e1d3
commit
5f01cd4402
1 changed files with 3 additions and 3 deletions
|
@ -114,7 +114,7 @@ import yaml
|
||||||
|
|
||||||
|
|
||||||
def read_serverless_config(module):
|
def read_serverless_config(module):
|
||||||
path = os.path.expanduser(module.params.get('service_path'))
|
path = module.params.get('service_path')
|
||||||
|
|
||||||
try:
|
try:
|
||||||
with open(os.path.join(path, 'serverless.yml')) as sls_config:
|
with open(os.path.join(path, 'serverless.yml')) as sls_config:
|
||||||
|
@ -141,7 +141,7 @@ def get_service_name(module, stage):
|
||||||
def main():
|
def main():
|
||||||
module = AnsibleModule(
|
module = AnsibleModule(
|
||||||
argument_spec=dict(
|
argument_spec=dict(
|
||||||
service_path = dict(required=True),
|
service_path = dict(required=True, type='path'),
|
||||||
state = dict(default='present', choices=['present', 'absent'], required=False),
|
state = dict(default='present', choices=['present', 'absent'], required=False),
|
||||||
functions = dict(type='list', required=False),
|
functions = dict(type='list', required=False),
|
||||||
region = dict(default='', 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')
|
state = module.params.get('state')
|
||||||
functions = module.params.get('functions')
|
functions = module.params.get('functions')
|
||||||
region = module.params.get('region')
|
region = module.params.get('region')
|
||||||
|
|
Loading…
Reference in a new issue