Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

raise error when unknown 'install_type' is used in Tarball easyblock + fix log messages #2049

Merged
merged 2 commits into from
Apr 30, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 7 additions & 10 deletions easybuild/easyblocks/generic/tarball.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@

from easybuild.framework.easyblock import EasyBlock
from easybuild.framework.easyconfig import CUSTOM
from easybuild.tools.build_log import EasyBuildError
from easybuild.tools.filetools import copy_dir, remove_dir
from easybuild.tools.run import run_cmd

Expand All @@ -60,10 +61,6 @@ def extra_options(extra_vars=None):
})
return extra_vars

def __init__(self, *args, **kwargs):
"""Initialize easyblock."""
super(Tarball, self).__init__(*args, **kwargs)

def configure_step(self):
"""
Dummy configure method
Expand Down Expand Up @@ -102,16 +99,16 @@ def install_step(self, src=None):
# Enable merging with root of existing installdir
install_path = self.installdir
dirs_exist_ok = True
install_logmsg = "Merging tarball contents of %s to %s..."
else:
if self.cfg['install_type']:
self.log.warning("Ignoring unknown option '%s' for index_type." % self.cfg['install_type'])
install_logmsg = "Merging tarball contents of %s into %s..."
elif self.cfg['install_type'] is None:
# Wipe and copy root of installation directory (default)
install_path = self.installdir
dirs_exist_ok = False
install_logmsg = "Wiping %s and copying tarball contents of %s into it..."
install_logmsg = "Copying tarball contents of %s into %s after wiping it..."
else:
raise EasyBuildError("Unknown option '%s' for index_type.", self.cfg['install_type'])

self.log.info(install_logmsg % (self.name, install_path))
self.log.info(install_logmsg, self.name, install_path)

if not dirs_exist_ok:
remove_dir(install_path)
Expand Down