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
No related tags found
No related merge requests found
...@@ -3,7 +3,6 @@ ...@@ -3,7 +3,6 @@
RETURN = '''# ''' RETURN = '''# '''
from subprocess import call from subprocess import call
import string
try: try:
import gitlab import gitlab
...@@ -73,7 +72,7 @@ def main(): ...@@ -73,7 +72,7 @@ def main():
'namespace_id': cgroup.id, 'namespace_id': cgroup.id,
}) })
# Add remote repo to etckeeper git repo # 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') call(cmd, cwd='/etc')
project = git.projects.get(gproject.id) # type: gitlab.Project project = git.projects.get(gproject.id) # type: gitlab.Project
...@@ -83,7 +82,7 @@ def main(): ...@@ -83,7 +82,7 @@ def main():
'can_push': True, 'can_push': True,
}) })
except Exception as e: 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 return
module.exit_json(changed=changed, result="Successfully created project %s/ansible-inventories/hosts/%s/%s" % (server_url, company, hostname)) 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