summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Coca <brian.coca+git@gmail.com>2015-10-29 09:02:11 -0400
committerBrian Coca <brian.coca+git@gmail.com>2015-10-29 16:28:46 -0400
commit40d22be2ef8519d90dee293e399552e8d1c92dd7 (patch)
treea348d069471fde54a03750729de20c9e44d5ac0a
parentb73941b95faba2c05df8f25677e9c528a1fd7267 (diff)
downloadansible-40d22be2ef8519d90dee293e399552e8d1c92dd7.tar.gz
fixes options for ansible pull
* remove requirement for host patterns, use the defaults * require destination directory (None in cwd is not a good default) * fixed usage messages * updated default inventory to use , and not deprecated :
-rw-r--r--lib/ansible/cli/pull.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/ansible/cli/pull.py b/lib/ansible/cli/pull.py
index 6caa8525db..0e10b59cba 100644
--- a/lib/ansible/cli/pull.py
+++ b/lib/ansible/cli/pull.py
@@ -50,7 +50,7 @@ class PullCLI(CLI):
''' create an options parser for bin/ansible '''
self.parser = CLI.base_parser(
- usage='%prog <host-pattern> [options]',
+ usage='%prog -d <destdir> -U <repository> [options]',
connect_opts=True,
vault_opts=True,
runtask_opts=True,
@@ -91,8 +91,8 @@ class PullCLI(CLI):
if not self.options.url:
raise AnsibleOptionsError("URL for repository not specified, use -h for help")
- if len(self.args) != 1:
- raise AnsibleOptionsError("Missing target hosts")
+ if not self.options.dest:
+ raise AnsibleOptionsError("Destination directory for checkout not specified, use -h for help")
if self.options.module_name not in self.SUPPORTED_REPO_MODULES:
raise AnsibleOptionsError("Unsuported repo module %s, choices are %s" % (self.options.module_name, ','.join(self.SUPPORTED_REPO_MODULES)))
@@ -114,7 +114,7 @@ class PullCLI(CLI):
# Now construct the ansible command
node = platform.node()
host = socket.getfqdn()
- limit_opts = 'localhost:%s:127.0.0.1' % ':'.join(set([host, node, host.split('.')[0], node.split('.')[0]]))
+ limit_opts = 'localhost,%s,127.0.0.1' % ','.join(set([host, node, host.split('.')[0], node.split('.')[0]]))
base_opts = '-c local "%s"' % limit_opts
if self.options.verbosity > 0:
base_opts += ' -%s' % ''.join([ "v" for x in range(0, self.options.verbosity) ])