|
|
@ -145,6 +145,7 @@ def main():
|
|
|
|
argument_spec = dict(
|
|
|
|
argument_spec = dict(
|
|
|
|
state = dict(choices=['file','directory','link','hard','touch','absent'], default=None),
|
|
|
|
state = dict(choices=['file','directory','link','hard','touch','absent'], default=None),
|
|
|
|
path = dict(aliases=['dest', 'name'], required=True),
|
|
|
|
path = dict(aliases=['dest', 'name'], required=True),
|
|
|
|
|
|
|
|
original_basename = dict(required=False), # Internal use only, for recursive ops
|
|
|
|
recurse = dict(default='no', type='bool'),
|
|
|
|
recurse = dict(default='no', type='bool'),
|
|
|
|
force = dict(required=False,default=False,type='bool'),
|
|
|
|
force = dict(required=False,default=False,type='bool'),
|
|
|
|
diff_peek = dict(default=None),
|
|
|
|
diff_peek = dict(default=None),
|
|
|
@ -200,7 +201,11 @@ def main():
|
|
|
|
src = os.path.expanduser(src)
|
|
|
|
src = os.path.expanduser(src)
|
|
|
|
|
|
|
|
|
|
|
|
if src is not None and os.path.isdir(path) and state not in ["link", "absent"]:
|
|
|
|
if src is not None and os.path.isdir(path) and state not in ["link", "absent"]:
|
|
|
|
params['path'] = path = os.path.join(path, os.path.basename(src))
|
|
|
|
if params['original_basename']:
|
|
|
|
|
|
|
|
basename = params['original_basename']
|
|
|
|
|
|
|
|
else:
|
|
|
|
|
|
|
|
basename = os.path.basename(src)
|
|
|
|
|
|
|
|
params['path'] = path = os.path.join(path, basename)
|
|
|
|
|
|
|
|
|
|
|
|
file_args = module.load_file_common_arguments(params)
|
|
|
|
file_args = module.load_file_common_arguments(params)
|
|
|
|
|
|
|
|
|
|
|
|