Merge "Improve Rally Logging (part 2)"

This commit is contained in:
Jenkins 2017-10-06 02:15:04 +00:00 committed by Gerrit Code Review
commit d039c859f2
3 changed files with 7 additions and 8 deletions

View File

@ -84,7 +84,7 @@ implement the Context API: the *setup()* method that creates a flavor and the
ram=self.config.get("ram", 1),
vcpus=self.config.get("vcpus", 1),
disk=self.config.get("disk", 1)).to_dict()
LOG.debug("Flavor with id '%s'", self.context["flavor"]["id"])
LOG.debug("Flavor with id '%s'" % self.context["flavor"]["id"])
except Exception as e:
msg = "Can't create flavor: %s" % e.message
if logging.is_debug():
@ -97,7 +97,7 @@ implement the Context API: the *setup()* method that creates a flavor and the
try:
nova = osclients.Clients(self.context["admin"]["credential"]).nova()
nova.flavors.delete(self.context["flavor"]["id"])
LOG.debug("Flavor '%s' deleted", self.context["flavor"]["id"])
LOG.debug("Flavor '%s' deleted" % self.context["flavor"]["id"])
except Exception as e:
msg = "Can't delete flavor: %s" % e.message
if logging.is_debug():

View File

@ -32,7 +32,6 @@ Inherit a class for your plugin from the base *SLA* class and implement its API
.. code-block:: python
from rally.task import sla
from rally.common.i18n import _
@sla.configure(name="max_duration_range")
class MaxDurationRange(sla.SLA):
@ -62,8 +61,8 @@ Inherit a class for your plugin from the base *SLA* class and implement its API
return self.success
def details(self):
return (_("%s - Maximum allowed duration range: %.2f%% <= %.2f%%") %
(self.status(), self._max - self._min, self.criterion_value))
return ("%s - Maximum allowed duration range: %.2f%% <= %.2f%%"
% (self.status(), self._max - self._min, self.criterion_value))
Usage

View File

@ -243,7 +243,7 @@ def _read_requirements():
"""Read all rally requirements."""
LOG.info("Reading rally requirements...")
for file_name in RALLY_REQUIREMENTS_FILES:
LOG.debug("Try to read '%s'.", file_name)
LOG.debug("Try to read '%s'." % file_name)
with open(file_name) as f:
data = f.read()
LOG.info("Parsing requirements from %s." % file_name)
@ -263,7 +263,7 @@ def _sync():
LOG.info("Obtaining global-requirements...")
for i in range(0, len(GLOBAL_REQUIREMENTS_LOCATIONS)):
url = GLOBAL_REQUIREMENTS_LOCATIONS[i] + GLOBAL_REQUIREMENTS_FILENAME
LOG.debug("Try to obtain global-requirements from %s", url)
LOG.debug("Try to obtain global-requirements from %s" % url)
try:
raw_gr = requests.get(url).text
except requests.ConnectionError as e:
@ -309,7 +309,7 @@ def format_requirements():
def add_uppers():
"""Obtains latest version of packages and put them to requirements."""
for filename, requirements in _sync():
LOG.info("Obtaining latest versions of packages for %s.", filename)
LOG.info("Obtaining latest versions of packages for %s." % filename)
for req in requirements:
if isinstance(req, Requirement):
if isinstance(req.version, dict) and not req.version["max"]: