From e661f96054f412cf6a7233601c5ccd8566459734 Mon Sep 17 00:00:00 2001 From: Chris Church Date: Mon, 26 Aug 2013 10:29:46 -0400 Subject: [PATCH] AC-132 Minor updates after testing via API, notes on remaining items to implement. --- awx/main/models/__init__.py | 9 +++++++++ awx/main/tasks.py | 10 +++------- awx/main/urls.py | 2 +- awx/playbooks/project_update.yml | 2 +- 4 files changed, 14 insertions(+), 9 deletions(-) diff --git a/awx/main/models/__init__.py b/awx/main/models/__init__.py index 98d03a41c4..1f23c720c4 100644 --- a/awx/main/models/__init__.py +++ b/awx/main/models/__init__.py @@ -603,6 +603,15 @@ class Project(CommonModel): default=False, editable=False, ) + + # FIXME: Still need to implement: + # - some scm_url validation + # - scm_update_on_launch + # - prompt for passwords for project update + # - prompt for passwords when running job when scm_update_on_launch set + # - prevent simultaneous updates of project and running jobs using project + # - prevent manually setting local path when scm_type is set + # - masking passwords in project update args/stdout def save(self, *args, **kwargs): # Check if scm_type or scm_url changes. diff --git a/awx/main/tasks.py b/awx/main/tasks.py index 756fa109bc..9c8c00b8f9 100644 --- a/awx/main/tasks.py +++ b/awx/main/tasks.py @@ -371,14 +371,10 @@ class RunProjectUpdate(BaseTask): args.append('project_update.yml') ssh_key_path = kwargs.get('ssh_key_path', '') - subcmds = [ - ('ssh-add', '-D'), - args, - ] if ssh_key_path: - subcmds.insert(1, ('ssh-add', ssh_key_path)) - cmd = ' && '.join([subprocess.list2cmdline(x) for x in subcmds]) - args = ['ssh-agent', 'sh', '-c', cmd] + subcmds = [('ssh-add', ssh_key_path), args] + cmd = ' && '.join([subprocess.list2cmdline(x) for x in subcmds]) + args = ['ssh-agent', 'sh', '-c', cmd] return args def build_cwd(self, project_update, **kwargs): diff --git a/awx/main/urls.py b/awx/main/urls.py index c0c4b4c879..1fae981a0a 100644 --- a/awx/main/urls.py +++ b/awx/main/urls.py @@ -37,7 +37,7 @@ project_urls = patterns('awx.main.views', url(r'^(?P[0-9]+)/organizations/$', 'project_organizations_list'), url(r'^(?P[0-9]+)/teams/$', 'project_teams_list'), url(r'^(?P[0-9]+)/update/$', 'project_update_view'), - url(r'^(?P[0-9]+)/updates/$', 'project_updates_list'), + url(r'^(?P[0-9]+)/project_updates/$', 'project_updates_list'), ) project_update_urls = patterns('awx.main.views', diff --git a/awx/playbooks/project_update.yml b/awx/playbooks/project_update.yml index f20d62a6a9..4d6fcd587a 100644 --- a/awx/playbooks/project_update.yml +++ b/awx/playbooks/project_update.yml @@ -15,7 +15,7 @@ - name: delete project directory before update file: path={{project_path}} state=absent - when: scm_delete_on_update + when: scm_delete_on_update|default('') - name: update project using git git: dest={{project_path}} repo={{scm_url}} version={{scm_branch}} force={{scm_clean}}