Yuvipanda has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/227423

Change subject: labstore: Do not fail if homedir does not exist
......................................................................

labstore: Do not fail if homedir does not exist

toolwatcher creates them asynchronously. I'll move that in to
this script too shortly, but until then!

Change-Id: I278ca9ce1dcec1376cef0fa8a0a80fc4e766a92a
---
M modules/labstore/files/create-dbusers
1 file changed, 4 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/23/227423/1

diff --git a/modules/labstore/files/create-dbusers 
b/modules/labstore/files/create-dbusers
index ae3e090..9acc4e6 100755
--- a/modules/labstore/files/create-dbusers
+++ b/modules/labstore/files/create-dbusers
@@ -171,12 +171,12 @@
         servicegroups = User.from_ldap_servicegroups(conn, args.project)
         for sg in servicegroups:
             # FIXME: for non tools/maps projects this path is different
-            replica_path = os.path.join(
+            home_path = os.path.join(
                 '/srv/project/', sg.project, 'project',
-                re.sub(r'^%s\.' % sg.project, '', sg.name),
-                'replica.my.cnf'
+                re.sub(r'^%s\.' % sg.project, '', sg.name)
             )
-            if not os.path.exists(replica_path):
+            replica_path = os.path.join(home_path, 'replica.my.cnf')
+            if os.path.exists(home_path) and not os.path.exists(replica_path):
                 if not cgen.check_user_exists(sg):
                     # No replica.my.cnf and no user in db
                     # Generate new creds and put them in there!

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I278ca9ce1dcec1376cef0fa8a0a80fc4e766a92a
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Yuvipanda <yuvipa...@wikimedia.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to