Rfaulk has uploaded a new change for review.

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


Change subject: fix - calls in _default_sync + logging.
......................................................................

fix - calls in _default_sync + logging.

Change-Id: Ib8ebef24faf8b412b8271f544dae9c6fb3441382
---
M sartoris/sartoris.py
1 file changed, 23 insertions(+), 15 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/sartoris refs/changes/91/83391/1

diff --git a/sartoris/sartoris.py b/sartoris/sartoris.py
index 2baf72a..4ad724a 100755
--- a/sartoris/sartoris.py
+++ b/sartoris/sartoris.py
@@ -417,29 +417,37 @@
         #
         log.info('{0} :: Calling default sync - '
                  'pushing changes ... '.format(__name__))
-
         proc = subprocess.Popen(['{0}{1}default-client-push.py'.format(
-            self.config['client-path'], self.config['hook-dir']
-        ), self.config['remote'], self.config['branch']])
-        proc_out = proc.communicate()[0]
-        log.info(proc_out)
-
-        # TODO - push tags
+            self.config['client_path'],
+            self.config['hook_dir']),
+            self.config['remote'],
+            self.config['branch']],
+            stdout=subprocess.PIPE,
+            stderr=subprocess.PIPE)
+        log.info('PUSH -> ' + '; '.join(
+            filter(lambda x: x, proc.communicate())))
 
         #
         # Call deploy hook on remote
         #
-        #   {% PATH %}/.git/deploy/hooks/default-client-pull origin master
+        #   ssh user@target {% PATH %}/.git/deploy/hooks/default-client-pull \
+        #       origin master
         #
         log.info('{0} :: Calling default sync - '
                  'pulling to target'.format(__name__))
-        proc = subprocess.Popen(['{0}{1}default-client-pull.py'.format(
-            self.config['path'], self.config['hook-dir']
-        ), self.config['remote'], self.config['branch']])
-        proc_out = proc.communicate()[0]
-        log.info(proc_out)
-
-        return
+        proc = subprocess.Popen(['ssh',
+                                 '{0}@{1}'.format(
+                                     self.config['user'],
+                                     self.config['target']),
+                                 '{0}{1}default-client-pull.py'.format(
+                                     self.config['path'],
+                                     self.config['hook_dir']),
+                                 self.config['remote'],
+                                 self.config['branch']],
+                                stdout=subprocess.PIPE,
+                                stderr=subprocess.PIPE)
+        log.info('PULL -> ' + '; '.join(
+            filter(lambda x: x, proc.communicate())))
 
     def resync(self, args):
         """

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib8ebef24faf8b412b8271f544dae9c6fb3441382
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