From fdeca3725785f9e5ee6554b05852f927f1cc8e82 Mon Sep 17 00:00:00 2001 From: Brian Coca Date: Tue, 9 Jun 2015 17:29:46 -0400 Subject: [PATCH] switched to argv[0] from __file__ as it is what we actually wanted --- bin/ansible | 2 +- lib/ansible/cli/pull.py | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/bin/ansible b/bin/ansible index 12ad89fcff3..8fbc5090471 100755 --- a/bin/ansible +++ b/bin/ansible @@ -44,7 +44,7 @@ if __name__ == '__main__': cli = None display = Display() - me = os.path.basename(__file__) + me = os.path.basename(sys.argv[0]) try: if me == 'ansible-playbook': diff --git a/lib/ansible/cli/pull.py b/lib/ansible/cli/pull.py index 0275a8c3475..76cba0749fb 100644 --- a/lib/ansible/cli/pull.py +++ b/lib/ansible/cli/pull.py @@ -131,7 +131,7 @@ class PullCLI(CLI): if path is None: raise AnsibleOptionsError(("module '%s' not found.\n" % self.options.module_name)) - bin_path = os.path.dirname(os.path.abspath(__file__)) + bin_path = os.path.dirname(os.path.abspath(sys.argv[0])) cmd = '%s/ansible localhost -i "%s" %s -m %s -a "%s"' % ( bin_path, inv_opts, base_opts, self.options.module_name, repo_opts ) @@ -144,6 +144,8 @@ class PullCLI(CLI): self.display.display("Sleeping for %d seconds..." % self.options.sleep) time.sleep(self.options.sleep); + import q + q(cmd) # RUN the Checkout command rc, out, err = run_cmd(cmd, live=True)