mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Don't try to expand path for None values
This commit is contained in:
parent
445e48b991
commit
7794493952
2 changed files with 12 additions and 5 deletions
|
@ -40,9 +40,12 @@ for x in items:
|
||||||
(k, v) = x.split("=")
|
(k, v) = x.split("=")
|
||||||
params[k] = v
|
params[k] = v
|
||||||
|
|
||||||
src = os.path.expanduser(params['src'])
|
src = params['src']
|
||||||
dest = os.path.expanduser(params['dest'])
|
dest = params['dest']
|
||||||
|
if src:
|
||||||
|
src = os.path.expanduser(src)
|
||||||
|
if dest:
|
||||||
|
dest = os.path.expanduser(dest)
|
||||||
|
|
||||||
# raise an error if there is no src file
|
# raise an error if there is no src file
|
||||||
if not os.path.exists(src):
|
if not os.path.exists(src):
|
||||||
|
|
|
@ -88,8 +88,12 @@ for x in items:
|
||||||
params[k] = v
|
params[k] = v
|
||||||
|
|
||||||
state = params.get('state','file')
|
state = params.get('state','file')
|
||||||
path = os.path.expanduser(params.get('path', params.get('dest', params.get('name', None))))
|
path = params.get('path', params.get('dest', params.get('name', None)))
|
||||||
src = os.path.expanduser(params.get('src', None))
|
if path:
|
||||||
|
path = os.path.expanduser(path)
|
||||||
|
src = params.get('src', None)
|
||||||
|
if src:
|
||||||
|
path = os.path.expanduser(src)
|
||||||
dest = params.get('dest', None)
|
dest = params.get('dest', None)
|
||||||
mode = params.get('mode', None)
|
mode = params.get('mode', None)
|
||||||
owner = params.get('owner', None)
|
owner = params.get('owner', None)
|
||||||
|
|
Loading…
Reference in a new issue