diff --git a/lib/ansible/cli/pull.py b/lib/ansible/cli/pull.py index 6caa8525dbf..0e10b59cbad 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) ])