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
This commit is contained in:
parent
24bd299ac7
commit
cae2746ae3
@ -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())
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user