validate that existing dest is valid directory
(cherry picked from commit 83dec70ad8)
This commit is contained in:
committed by
Toshio Kuratomi
parent
c73543ef8d
commit
d651bcbc06
@ -132,6 +132,9 @@ class PullCLI(CLI):
|
||||
self.options.dest = os.path.join('~/.ansible/pull', hostname)
|
||||
self.options.dest = os.path.expandvars(os.path.expanduser(self.options.dest))
|
||||
|
||||
if os.path.exists(self.options.dest) and not os.path.isdir(self.options.dest):
|
||||
raise AnsibleOptionsError("%s is not a valid or accessible directory." % self.options.dest)
|
||||
|
||||
if self.options.sleep:
|
||||
try:
|
||||
secs = random.randint(0, int(self.options.sleep))
|
||||
|
||||
Reference in New Issue
Block a user