From 231411e97660791e5f022c08c9c46996580fbc8e Mon Sep 17 00:00:00 2001 From: caoyuan Date: Wed, 13 Jun 2018 16:06:22 +0800 Subject: [PATCH] Check passwords.yml exist before init action Change-Id: I6145bf3cc65bbb15eb1426ec5e3dc4e09ada544a --- tools/kolla_actions.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tools/kolla_actions.py b/tools/kolla_actions.py index ae4794c..533017f 100755 --- a/tools/kolla_actions.py +++ b/tools/kolla_actions.py @@ -28,8 +28,10 @@ from kolla_cli.common.utils import get_kolla_etc def _init_keys(path): cmd = 'kolla-genpwd' - if os.path.exists(path): - cmd = ' '.join((cmd, '-p', path)) + if not os.path.exists(path): + raise Exception('The path %s does not exist' % path) + + cmd = ' '.join((cmd, '-p', path)) (_, err) = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate()