From cae2746ae37efb53ff9f9421d40b3d374ca7cb9b Mon Sep 17 00:00:00 2001 From: Anastasia Kuznetsova Date: Mon, 7 Sep 2015 16:53:23 +0300 Subject: [PATCH] Add usage of os.path.expanduser to Murano context Fix Murano context and make it possible to find packages by paths which starts with tilda Change-Id: If6c9cb92b64c4b10143adfeeea186c2b95460d63 --- .../openstack/context/murano/murano_packages.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/rally/plugins/openstack/context/murano/murano_packages.py b/rally/plugins/openstack/context/murano/murano_packages.py index 68a3eed3..9e571658 100644 --- a/rally/plugins/openstack/context/murano/murano_packages.py +++ b/rally/plugins/openstack/context/murano/murano_packages.py @@ -50,14 +50,15 @@ class PackageGenerator(context.Context): @utils.log_task_wrapper(LOG.info, _("Enter context: `Murano packages`")) def setup(self): is_config_app_dir = False - if zipfile.is_zipfile(self.config["app_package"]): - zip_name = self.config["app_package"] - elif os.path.isdir(self.config["app_package"]): + pckg_path = os.path.expanduser(self.config["app_package"]) + if zipfile.is_zipfile(pckg_path): + zip_name = pckg_path + elif os.path.isdir(pckg_path): is_config_app_dir = True - zip_name = fileutils.pack_dir(self.config["app_package"]) + zip_name = fileutils.pack_dir(pckg_path) else: msg = (_LE("There is no zip archive or directory by this path:" - " %s") % self.config["app_package"]) + " %s") % pckg_path) raise exceptions.ContextSetupFailure(msg=msg, ctx_name=self.get_name())