Rfaulk has uploaded a new change for review.

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


Change subject: add - implement _get_current_lock_user.
......................................................................

add - implement _get_current_lock_user.

Change-Id: Ib8e3f147a33f2b60c7eacb9cd5b639bdc8cad354
---
M sartoris/sartoris.py
1 file changed, 14 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/sartoris refs/changes/18/82218/1

diff --git a/sartoris/sartoris.py b/sartoris/sartoris.py
index 7c32539..5af53ec 100755
--- a/sartoris/sartoris.py
+++ b/sartoris/sartoris.py
@@ -235,7 +235,20 @@
         self.config['sync_dir'] = '{0}/sync'.format(self.config['hook_dir'])
 
     def _get_current_lock_user(self):
-        return self.config['user']
+        """
+        Pulls the expected lock user from lock file
+        """
+        cmd = "ssh {0}@{1} cat {2}/{3}/{4}".format(
+            self.config['user'],
+            self.config['target'],
+            self.config['path'],
+            self.DEPLOY_DIR,
+            self.LOCK_FILE_HANDLE)
+
+        proc = subprocess.Popen(cmd.split(),
+                                stdout=subprocess.PIPE,
+                                stderr=subprocess.PIPE)
+        return proc.communicate()[0].strip('\n')
 
     def _check_lock(self):
         """ Returns boolean flag on lock file existence """

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib8e3f147a33f2b60c7eacb9cd5b639bdc8cad354
Gerrit-PatchSet: 1
Gerrit-Project: sartoris
Gerrit-Branch: master
Gerrit-Owner: Rfaulk <[email protected]>

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

Reply via email to