Rfaulk has submitted this change and it was merged.

Change subject: mod. add method _remove_lock.
......................................................................


mod. add method _remove_lock.

Change-Id: I09e78b5373e8ee68bb366ea05858e28673fb5a1f
---
M sartoris/sartoris.py
1 file changed, 9 insertions(+), 4 deletions(-)

Approvals:
  Rfaulk: Verified; Looks good to me, approved
  jenkins-bot: Checked



diff --git a/sartoris/sartoris.py b/sartoris/sartoris.py
index 2ce2e0a..821e3c3 100755
--- a/sartoris/sartoris.py
+++ b/sartoris/sartoris.py
@@ -254,6 +254,14 @@
             self.config['path'],
             self.DEPLOY_DIR))
 
+    def _remove_lock(self):
+        os.system("ssh {0}@{1} rm {2}/{3}/{4}".format(
+            self.config['user'],
+            self.config['target'],
+            self.config['path'],
+            self.DEPLOY_DIR,
+            self.LOCK_FILE_HANDLE))
+
     def _get_commit_sha_for_tag(self, tag):
         """ Obtain the commit sha of an associated tag
                 e.g. `git rev-list $TAG | head -n 1` """
@@ -388,10 +396,7 @@
                 raise SartorisError(message=exit_codes[5], exit_code=5)
 
         # Remove lock file
-        if os.listdir(self.DEPLOY_DIR).__contains__(self.LOCK_FILE_HANDLE):
-            os.remove(self.DEPLOY_DIR + self.LOCK_FILE_HANDLE)
-        else:
-            raise SartorisError(message=exit_codes[4])
+        self._remove_lock()
         return 0
 
     def sync(self, args, no_deps=False, force=False):

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I09e78b5373e8ee68bb366ea05858e28673fb5a1f
Gerrit-PatchSet: 1
Gerrit-Project: sartoris
Gerrit-Branch: master
Gerrit-Owner: Rfaulk <[email protected]>
Gerrit-Reviewer: Rfaulk <[email protected]>
Gerrit-Reviewer: jenkins-bot

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

Reply via email to