Rfaulk has submitted this change and it was merged.

Change subject: mod. simplify _create_lock, more logging.
......................................................................


mod. simplify _create_lock, more logging.

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

Approvals:
  Rfaulk: Verified; Looks good to me, approved



diff --git a/sartoris/sartoris.py b/sartoris/sartoris.py
index ced2fca..35a5b14 100755
--- a/sartoris/sartoris.py
+++ b/sartoris/sartoris.py
@@ -237,10 +237,11 @@
 
     def _check_lock(self):
         """ Returns boolean flag on lock file existence """
-        cmd = "ssh {0}@{1} ls {2}/{3}".format(
+        cmd = "ssh {0}@{1} ls {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,
@@ -260,17 +261,12 @@
         """ Create a lock file """
 
         log.info('{0}::SSH Lock create.'.format(__name__))
-        os.system("ssh {0}@{1} touch {2}".format(
-            self.config['user'],
-            self.config['target'],
-            self.LOCK_FILE_HANDLE))
-
-        log.info('{0}::SSH Lock place.'.format(__name__))
-        os.system("ssh {0}@{1} mv lock {2}/{3}".format(
+        os.system("ssh {0}@{1} touch {2}/{3}/{4}".format(
             self.config['user'],
             self.config['target'],
             self.config['path'],
-            self.DEPLOY_DIR))
+            self.DEPLOY_DIR,
+            self.LOCK_FILE_HANDLE))
 
     def _remove_lock(self):
         """ Remove the lock file """
@@ -462,6 +458,8 @@
 
         #TODO: use a pluggable sync system rather than shelling out
         if os.path.exists(sync_script):
+            log.info('{0}::Calling sync script at {1}'.format(__name__,
+                                                              sync_script))
             proc = subprocess.Popen([sync_script,
                                      '--repo="{0}"'.format(repo_name),
                                      '--tag="{0}"'.format(self._tag),

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

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

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

Reply via email to