From 000e799800b3a4034d6ab90859ba89f5d6819b70 Mon Sep 17 00:00:00 2001 From: Douglas Clowes Date: Wed, 22 Oct 2014 12:47:30 +1100 Subject: [PATCH] Add whatsthere.py to RELEASE-3_2 --- site_ansto/instrument/util/whatsthere.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/site_ansto/instrument/util/whatsthere.py b/site_ansto/instrument/util/whatsthere.py index a09f912e..79427a65 100755 --- a/site_ansto/instrument/util/whatsthere.py +++ b/site_ansto/instrument/util/whatsthere.py @@ -38,14 +38,14 @@ class Instrument(object): self.full_deployed_hash = None self.full_built_hash = None try: - self.full_deployed_hash = repo.commit(self.deployed_hash).hexsha + self.full_deployed_hash = repo.commit(self.deployed_hash.split('+')[0]).hexsha for ref in repo.refs: if ref.commit.hexsha == self.full_deployed_hash: self.deployed_refs.append(ref) except: pass try: - self.full_built_hash = repo.commit(self.built_hash).hexsha + self.full_built_hash = repo.commit(self.built_hash.split('+')[0]).hexsha for ref in repo.refs: if ref.commit.hexsha == self.full_built_hash: self.built_refs.append(ref) @@ -145,6 +145,7 @@ def main_program(): parser.add_argument("-n", "--newserver", action="store_true", help="use newserver instead of server") parser.add_argument("-t", "--test", action="store_true", help="add -test to host") parser.add_argument("-v", "--verbose", action="store_true", help="more output") + parser.add_argument("-d", "--directory", default="server", help="use directory instead of server [server]") parser.add_argument("targets", nargs="*", help="select host target") args = parser.parse_args() Test = False @@ -161,10 +162,10 @@ def main_program(): cmd_list += ["stat --printf=%y" + "\\" * 4 + "n /usr/local/sics/newserver/SICServer"] else: cmd_list = [] - cmd_list += ["cat /usr/local/sics/server/DEPLOYMENT.TXT"] - cmd_list += ["/usr/local/sics/server/SICServer -v"] - cmd_list += ["stat --printf=%y" + "\\" * 4 + "n /usr/local/sics/server/SICServer"] - + cmd_list += ["cat /usr/local/sics/%s/DEPLOYMENT.TXT" % args.directory] + cmd_list += ["/usr/local/sics/%s/SICServer -v" % args.directory] + cmd_list += ["stat --printf=%y" + ("\\" * 4 + "n") + (" /usr/local/sics/%s/SICServer" % args.directory)] + repo = git.Repo() if len(args.targets) > 0: selected_hosts = []