From ee3dedc6ea514ea44099b077befb6d19dd1e940c Mon Sep 17 00:00:00 2001 From: Rishabh Dave Date: Tue, 6 Aug 2019 19:50:50 +0530 Subject: [PATCH] qa/vstart_runner.py: fix get_keyring_path() Return "keyring" file in build directory in source repo when the expected keyring file is absent. Signed-off-by: Rishabh Dave --- qa/tasks/vstart_runner.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/qa/tasks/vstart_runner.py b/qa/tasks/vstart_runner.py index 52bbec8bf69..bc95a450e3f 100644 --- a/qa/tasks/vstart_runner.py +++ b/qa/tasks/vstart_runner.py @@ -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 -- 2.39.5