[verification] Fix small bugs in verification component

Co-Authored-By: Yaroslav Lobankov <ylobankov@mirantis.com>

Change-Id: I654cedd465b4efacb3e28124ec5752a46060cc66
This commit is contained in:
Andrey Kurilin 2016-12-28 16:44:51 +02:00 committed by Yaroslav Lobankov
parent fcdc0286af
commit f080abfbab
2 changed files with 9 additions and 6 deletions

View File

@ -57,6 +57,9 @@ class TempestManager(testr.TestrLauncher):
return config.read_configfile(self.configfile) return config.read_configfile(self.configfile)
def configure(self, extra_options=None): def configure(self, extra_options=None):
if not os.path.isdir(os.path.dirname(self.configfile)):
os.makedirs(os.path.dirname(self.configfile))
cm = config.TempestConfigfileManager(self.verifier.deployment) cm = config.TempestConfigfileManager(self.verifier.deployment)
raw_configfile = cm.create(self.configfile, extra_options) raw_configfile = cm.create(self.configfile, extra_options)
return raw_configfile return raw_configfile
@ -68,13 +71,12 @@ class TempestManager(testr.TestrLauncher):
with open(self.configfile, "w") as f: with open(self.configfile, "w") as f:
f.write(new_content) f.write(new_content)
def install_extension(self, source, version=None, extra=None): def install_extension(self, source, version=None, extra_settings=None):
"""Install a Tempest plugin.""" """Install a Tempest plugin."""
if extra: if extra_settings:
raise NotImplementedError( raise NotImplementedError(
_LE("'%s' verifiers don't support extra options for " _LE("'%s' verifiers don't support extra installation settings "
"extension installations.") "for extensions.") % self.get_name())
% self.get_name())
version = version or "master" version = version or "master"
egg = re.sub("\.git$", "", os.path.basename(source.strip("/"))) egg = re.sub("\.git$", "", os.path.basename(source.strip("/")))
full_source = "git+{0}@{1}#egg={2}".format(source, version, egg) full_source = "git+{0}@{1}#egg={2}".format(source, version, egg)

View File

@ -88,7 +88,8 @@ class TempestManagerTestCase(test.TestCase):
system_wide=True)) system_wide=True))
e = self.assertRaises(NotImplementedError, tempest.install_extension, e = self.assertRaises(NotImplementedError, tempest.install_extension,
None, None, {"key": "value"}) None, None, {"key": "value"})
self.assertIn("verifiers don't support extra options", "%s" % e) self.assertIn("verifiers don't support extra installation settings",
"%s" % e)
# case #1 system-wide installation # case #1 system-wide installation
source = "https://github.com/example/example" source = "https://github.com/example/example"