Bug 1176784 - reconfigs should not rely on seta server r=kmoir
authorKim Moir <kmoir@mozilla.com>
Thu, 01 Dec 2016 16:30:53 -0500
changeset 7189 93bf2ed7b806
parent 7188 cca3e54cc984
child 7190 53004a697e18
push id5359
push userkmoir@mozilla.com
push date2016-12-01 21:30 +0000
reviewerskmoir
bugs1176784
Bug 1176784 - reconfigs should not rely on seta server r=kmoir
buildfarm/maintenance/update_seta.py
--- a/buildfarm/maintenance/update_seta.py
+++ b/buildfarm/maintenance/update_seta.py
@@ -7,17 +7,17 @@ import shutil
 import subprocess
 import sys
 from sys import path
 sys.path.append(os.path.join(os.path.dirname(__file__), "../../lib/python"))
 
 import logging
 log = logging.getLogger(__name__)
 
-from util.hg import mercurial, clone, commit, run_cmd
+from util.hg import mercurial, commit, run_cmd
 
 seta_branches = ['mozilla-inbound', 'autoland', 'graphics']
 
 def wfetch(url, retries=5):
     while True:
         try:
             response = urllib2.urlopen(url, timeout=30)
             return json.loads(response.read())
@@ -78,24 +78,31 @@ if __name__ == '__main__':
     today = date.today().strftime("%Y-%m-%d")
     remote = "ssh://hg.mozilla.org/build/buildbot-configs"
     ssh_key = "/home/cltbld/.ssh/ffxbld_rsa"
     ssh_username = "ffxbld"
     revision = "default"
     localrepo = "/tmp/buildbot-configs"
     configs_path = localrepo + "/mozilla-tests/"
     msg = "updating seta data for " + today
+    ssh_line = "\"ssh -l " + ssh_username + " -i " + ssh_key + "\""
 
     if os.path.exists(localrepo):
         shutil.rmtree(localrepo)
     os.mkdir(localrepo)
-    clone(remote, localrepo, revision)
+    #clone(remote, localrepo, revision)
+    # hg -R ssh://hg.mozilla.org/build/buildbot-configs clone -e "ssh -l ffxbld
+    # -i /home/cltbld/.ssh/ffxbld_rsa"
+    # ssh://hg.mozilla.org/build/buildbot-configs
     #assume data could not be fetched
+    clone_cmd = ['hg', '-R', remote, 'clone', '-e', ssh_line, remote]
+    clone_value = run_cmd(clone_cmd, cwd=localrepo)
+
     status = False
     for branch in seta_branches:
         status = update_seta_data(branch, configs_path)
     if not status:
         log.warning("Could not fetch seta data")
     revision = commit(localrepo, msg, user=ssh_username)
-    push_cmd = ['hg', 'push']
+    push_cmd = ['hg', 'push', ssh_line]
     push_value = run_cmd(push_cmd, cwd=localrepo)
     if push_value != 0:
         log.warning("Could not push new seta data")