summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xbin/ansible-galaxy9
-rw-r--r--test/integration/galaxy_roles.yml2
-rw-r--r--test/integration/galaxy_rolesfile2
3 files changed, 8 insertions, 5 deletions
diff --git a/bin/ansible-galaxy b/bin/ansible-galaxy
index 3c624693b3..79594bad97 100755
--- a/bin/ansible-galaxy
+++ b/bin/ansible-galaxy
@@ -343,10 +343,10 @@ def scm_archive_role(scm, role_url, role_version, role_name):
rc = popen.wait()
if rc != 0:
print "Command %s failed" % ' '.join(clone_cmd)
- print "in directory %s" % temp_dir
+ print "in directory %s" % tempdir
return False
- temp_file = tempfile.NamedTemporaryFile(delete=False, suffix='.tar.gz')
+ temp_file = tempfile.NamedTemporaryFile(delete=False, suffix='.tar')
if scm == 'hg':
archive_cmd = ['hg', 'archive', '--prefix', "%s/" % role_name]
if role_version:
@@ -491,7 +491,10 @@ def install_role(role_name, role_version, role_filename, options):
print "Error: the file downloaded was not a tar.gz"
return False
else:
- role_tar_file = tarfile.open(role_filename, "r:gz")
+ if role_filename.endswith('.gz'):
+ role_tar_file = tarfile.open(role_filename, "r:gz")
+ else:
+ role_tar_file = tarfile.open(role_filename, "r")
# verify the role's meta file
meta_file = None
members = role_tar_file.getmembers()
diff --git a/test/integration/galaxy_roles.yml b/test/integration/galaxy_roles.yml
index f354f5985f..cd61006840 100644
--- a/test/integration/galaxy_roles.yml
+++ b/test/integration/galaxy_roles.yml
@@ -1,7 +1,7 @@
- src: git+http://bitbucket.org/willthames/git-ansible-galaxy
version: v1.4
-- src: ssh://hg@bitbucket.org/willthames/hg-ansible-galaxy
+- src: http://bitbucket.org/willthames/hg-ansible-galaxy
scm: hg
- src: https://bitbucket.org/willthames/http-ansible-galaxy/get/master.tar.gz
diff --git a/test/integration/galaxy_rolesfile b/test/integration/galaxy_rolesfile
index 01aa27a52a..a1374925ba 100644
--- a/test/integration/galaxy_rolesfile
+++ b/test/integration/galaxy_rolesfile
@@ -1,3 +1,3 @@
git+http://bitbucket.org/willthames/git-ansible-galaxy,v1.4
-hg+ssh://hg@bitbucket.org/willthames/hg-ansible-galaxy
+hg+http://bitbucket.org/willthames/hg-ansible-galaxy
https://bitbucket.org/willthames/http-ansible-galaxy/get/master.tar.gz,,http-role