]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
qa/vstart_runner.py: fix get_keyring_path()
authorRishabh Dave <ridave@redhat.com>
Tue, 6 Aug 2019 14:20:50 +0000 (19:50 +0530)
committerRishabh Dave <ridave@redhat.com>
Wed, 6 Nov 2019 06:06:10 +0000 (11:36 +0530)
Return "keyring" file in build directory in source repo when the
expected keyring file is absent.

Signed-off-by: Rishabh Dave <ridave@redhat.com>
qa/tasks/vstart_runner.py

index 52bbec8bf6985c3731aec09c39c01801b0a3b9f7..bc95a450e3f6e0d0478f009d410383bcaa23d525 100644 (file)
@@ -499,7 +499,13 @@ class LocalKernelMount(KernelMount):
     def get_keyring_path(self):
         # This is going to end up in a config file, so use an absolute path
         # to avoid assumptions about daemons' pwd
-        return os.path.abspath("./client.{0}.keyring".format(self.client_id))
+        keyring_path = "./client.{0}.keyring".format(self.client_id)
+        try:
+            os.stat(keyring_path)
+        except OSError:
+            return os.path.join(os.getcwd(), 'keyring')
+        else:
+            return keyring_path
 
     def run_shell(self, args, wait=True, stdin=None, check_status=True, omit_sudo=True):
         # FIXME maybe should add a pwd arg to teuthology.orchestra so that