new 'show-plc' target for run
authorThierry Parmentelat <thierry.parmentelat@sophia.inria.fr>
Mon, 14 Nov 2011 09:17:11 +0000 (10:17 +0100)
committerThierry Parmentelat <thierry.parmentelat@sophia.inria.fr>
Mon, 14 Nov 2011 09:17:11 +0000 (10:17 +0100)
system/TestPlc.py

index a21f42f..3811ad0 100644 (file)
@@ -129,7 +129,7 @@ class TestPlc:
         return step != SEP and step != SEPSFA
 
     # turn off the sfa-related steps when build has skipped SFA
-    # this is originally for centos5 as recent SFAs won't build on this platformb
+    # this is originally for centos5 as recent SFAs won't build on this platform
     @staticmethod
     def check_whether_build_has_sfa (rpms_url):
         # warning, we're now building 'sface' so let's be a bit more picky
@@ -339,6 +339,18 @@ class TestPlc:
         self.display_pass (2)
         return True
 
+    def show_vplc (self):
+        "print out a shell command that can be cut'n pasted to define the GUEST variable"
+        # these work but the shell prompt does not get displayed..
+        command1="ssh %s vserver %s enter"%(self.plc_spec['host_box'],self.plc_spec['vservername'])
+        command2="ssh root@%s %s"%(socket.gethostname(),command1)
+        # guess local domain from hostname
+        domain=socket.gethostname().split('.',1)[1]
+        fqdn="%s.%s"%(self.plc_spec['host_box'],domain)
+        print "export PLCHOST=%s"%fqdn
+        print "export GUEST=%s"%self.plc_spec['vservername']
+        return True
+
     # entry point
     always_display_keys=['PLC_WWW_HOST','nodes','sites',]
     def display_pass (self,passno):