Skip to content
Snippets Groups Projects
Commit 5d91cb2c authored by jurgenhaas's avatar jurgenhaas
Browse files

Bug fix python 3

parent 61eaf1ec
No related branches found
Tags v0.1.0
No related merge requests found
......@@ -3,7 +3,6 @@
RETURN = '''# '''
from subprocess import call
import string
try:
import gitlab
......@@ -73,7 +72,7 @@ def main():
'namespace_id': cgroup.id,
})
# Add remote repo to etckeeper git repo
cmd = ['git', 'remote', 'add', 'origin', '%s:ansible-inventories/hosts/%s/%s.git' % (string.replace(server_url, 'https://', 'git@'), company, hostname)]
cmd = ['git', 'remote', 'add', 'origin', '%s:ansible-inventories/hosts/%s/%s.git' % (server_url.replace('https://', 'git@'), company, hostname)]
call(cmd, cwd='/etc')
project = git.projects.get(gproject.id) # type: gitlab.Project
......@@ -83,7 +82,7 @@ def main():
'can_push': True,
})
except Exception as e:
module.fail_json(msg="Creating new host project failed: %s" % e.message, response=e)
module.fail_json(msg="Creating new host project failed: %s" % str(e), response=e)
return
module.exit_json(changed=changed, result="Successfully created project %s/ansible-inventories/hosts/%s/%s" % (server_url, company, hostname))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment