]> git.apps.os.sepia.ceph.com Git - teuthology.git/commitdiff
openstack: display reminders before running the suite
authorLoic Dachary <ldachary@redhat.com>
Sun, 29 Nov 2015 19:36:56 +0000 (20:36 +0100)
committerLoic Dachary <ldachary@redhat.com>
Wed, 16 Dec 2015 00:39:09 +0000 (01:39 +0100)
If --wait, it is useful to display the URL/ssh reminders before waiting
for the suite to complete.

Signed-off-by: Loic Dachary <loic@dachary.org>
teuthology/openstack/__init__.py

index 009a1d1a3c93da36ef115192064cdf6eb82b5c05..1eb5066d7b899a47043d281b5e7236f11ec4a91a 100644 (file)
@@ -444,24 +444,16 @@ class TeuthologyOpenStack(OpenStack):
         self.verify_openstack()
         self.setup()
         if self.args.suite:
+            if self.args.wait:
+                self.reminders()
             self.run_suite()
-        if self.args.key_filename:
-            identity = '-i ' + self.args.key_filename + ' '
-        else:
-            identity = ''
-        if self.args.upload:
-            upload = 'upload to    : ' + self.args.archive_upload
-        else:
-            upload = ''
-        log.info("""
-pulpito web interface: http://{ip}:8081/
-ssh access           : ssh {identity}{username}@{ip} # logs in /usr/share/nginx/html
-{upload}""".format(ip=self.instance.get_floating_ip_or_ip(),
-                   username=self.username,
-                   identity=identity,
-                   upload=upload))
+            self.reminders()
         if self.args.teardown:
-            self.teardown()
+            if self.args.suite and not self.args.wait:
+                log.error("it does not make sense to teardown a cluster"
+                          " right after a suite is scheduled")
+            else:
+                self.teardown()
 
     def run_suite(self):
         """
@@ -491,6 +483,23 @@ ssh access           : ssh {identity}{username}@{ip} # logs in /usr/share/nginx/
         )
         print self.ssh(command)
 
+    def reminders(self):
+        if self.args.key_filename:
+            identity = '-i ' + self.args.key_filename + ' '
+        else:
+            identity = ''
+        if self.args.upload:
+            upload = 'upload to    : ' + self.args.archive_upload
+        else:
+            upload = ''
+        log.info("""
+pulpito web interface: http://{ip}:8081/
+ssh access           : ssh {identity}{username}@{ip} # logs in /usr/share/nginx/html
+{upload}""".format(ip=self.instance.get_floating_ip_or_ip(),
+                   username=self.username,
+                   identity=identity,
+                   upload=upload))
+
     def setup(self):
         self.instance = OpenStackInstance(self.args.name)
         if not self.instance.exists():