ArielGlenn has submitted this change and it was merged.

Change subject: deployment server init should configure repo every time
......................................................................


deployment server init should configure repo every time

formerly it would refuse to configure a git repo with .git dir in it
with this change it will configure an existing repo properly
it should also and now does fix up group perms on the repo, when one
exists and not only if there is no .git dir present.

Change-Id: I49f624367d6457f30c7e8ab0efa0b783501e5a66
---
M modules/deployment/files/modules/deploy.py
1 file changed, 30 insertions(+), 30 deletions(-)

Approvals:
  ArielGlenn: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/modules/deployment/files/modules/deploy.py 
b/modules/deployment/files/modules/deploy.py
index afd860b..d12e3d8 100644
--- a/modules/deployment/files/modules/deploy.py
+++ b/modules/deployment/files/modules/deploy.py
@@ -240,38 +240,38 @@
                 continue
             # git clone does ignore umask and does explicit mkdir with 755
             __salt__['file.set_mode'](config['location'], 2775)
-            # Set the repo name in the repo's config
-            cmd = 'git config deploy.repo-name %s' % repo
-            status = __salt__['cmd.retcode'](cmd, cwd=config['location'],
-                                             runas=deploy_user, umask=002)
+
+        # Set the repo name in the repo's config
+        cmd = 'git config deploy.repo-name %s' % repo
+        status = __salt__['cmd.retcode'](cmd, cwd=config['location'],
+                                         runas=deploy_user, umask=002)
+        if status != 0:
+            ret_status = 1
+            continue
+        # Ensure checkout-submodules is also configured for trigger
+        if config['checkout_submodules']:
+            cmd = 'git config deploy.checkout-submodules true'
+        else:
+            cmd = 'git config deploy.checkout-submodules false'
+        status = __salt__['cmd.retcode'](cmd, cwd=config['location'],
+                                         runas=deploy_user, umask=002)
+        if status != 0:
+            ret_status = 1
+            continue
+
+        # Override deploy_group with repo specific value set
+        # in deployment_config pillar
+        if config['deployment_repo_group']:
+            deploy_group = config['deployment_repo_group']
+
+        if deploy_group is not None:
+            cmd = 'chown -R %s:%s %s' % (deploy_user,
+                                         deploy_group,
+                                         config['location'])
+            status = __salt__['cmd.retcode'](cmd,
+                                             cwd=config['location'])
             if status != 0:
                 ret_status = 1
-                continue
-            # Ensure checkout-submodules is also configured for trigger
-            if config['checkout_submodules']:
-                cmd = 'git config deploy.checkout-submodules true'
-            else:
-                cmd = 'git config deploy.checkout-submodules false'
-            status = __salt__['cmd.retcode'](cmd, cwd=config['location'],
-                                             runas=deploy_user, umask=002)
-            if status != 0:
-                ret_status = 1
-                continue
-
-            # Override deploy_group with repo specific value set
-            # in deployment_config pillar
-            if config['deployment_repo_group']:
-                deploy_group = config['deployment_repo_group']
-
-            if deploy_group is not None:
-                cmd = 'chown -R %s:%s %s' % (deploy_user,
-                                             deploy_group,
-                                             config['location'])
-                status = __salt__['cmd.retcode'](cmd,
-                                                 cwd=config['location'])
-                if status != 0:
-                    ret_status = 1
-
     return ret_status
 
 

-- 
To view, visit https://gerrit.wikimedia.org/r/211435
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I49f624367d6457f30c7e8ab0efa0b783501e5a66
Gerrit-PatchSet: 6
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: ArielGlenn <[email protected]>
Gerrit-Reviewer: ArielGlenn <[email protected]>
Gerrit-Reviewer: Cscott <[email protected]>
Gerrit-Reviewer: Dzahn <[email protected]>
Gerrit-Reviewer: Ryan Lane <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to