Merge "Improve Rally Logging (part 2)"
This commit is contained in:
commit
d039c859f2
@ -84,7 +84,7 @@ implement the Context API: the *setup()* method that creates a flavor and the
|
|||||||
ram=self.config.get("ram", 1),
|
ram=self.config.get("ram", 1),
|
||||||
vcpus=self.config.get("vcpus", 1),
|
vcpus=self.config.get("vcpus", 1),
|
||||||
disk=self.config.get("disk", 1)).to_dict()
|
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:
|
except Exception as e:
|
||||||
msg = "Can't create flavor: %s" % e.message
|
msg = "Can't create flavor: %s" % e.message
|
||||||
if logging.is_debug():
|
if logging.is_debug():
|
||||||
@ -97,7 +97,7 @@ implement the Context API: the *setup()* method that creates a flavor and the
|
|||||||
try:
|
try:
|
||||||
nova = osclients.Clients(self.context["admin"]["credential"]).nova()
|
nova = osclients.Clients(self.context["admin"]["credential"]).nova()
|
||||||
nova.flavors.delete(self.context["flavor"]["id"])
|
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:
|
except Exception as e:
|
||||||
msg = "Can't delete flavor: %s" % e.message
|
msg = "Can't delete flavor: %s" % e.message
|
||||||
if logging.is_debug():
|
if logging.is_debug():
|
||||||
|
@ -32,7 +32,6 @@ Inherit a class for your plugin from the base *SLA* class and implement its API
|
|||||||
.. code-block:: python
|
.. code-block:: python
|
||||||
|
|
||||||
from rally.task import sla
|
from rally.task import sla
|
||||||
from rally.common.i18n import _
|
|
||||||
|
|
||||||
@sla.configure(name="max_duration_range")
|
@sla.configure(name="max_duration_range")
|
||||||
class MaxDurationRange(sla.SLA):
|
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
|
return self.success
|
||||||
|
|
||||||
def details(self):
|
def details(self):
|
||||||
return (_("%s - Maximum allowed duration range: %.2f%% <= %.2f%%") %
|
return ("%s - Maximum allowed duration range: %.2f%% <= %.2f%%"
|
||||||
(self.status(), self._max - self._min, self.criterion_value))
|
% (self.status(), self._max - self._min, self.criterion_value))
|
||||||
|
|
||||||
|
|
||||||
Usage
|
Usage
|
||||||
|
@ -243,7 +243,7 @@ def _read_requirements():
|
|||||||
"""Read all rally requirements."""
|
"""Read all rally requirements."""
|
||||||
LOG.info("Reading rally requirements...")
|
LOG.info("Reading rally requirements...")
|
||||||
for file_name in RALLY_REQUIREMENTS_FILES:
|
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:
|
with open(file_name) as f:
|
||||||
data = f.read()
|
data = f.read()
|
||||||
LOG.info("Parsing requirements from %s." % file_name)
|
LOG.info("Parsing requirements from %s." % file_name)
|
||||||
@ -263,7 +263,7 @@ def _sync():
|
|||||||
LOG.info("Obtaining global-requirements...")
|
LOG.info("Obtaining global-requirements...")
|
||||||
for i in range(0, len(GLOBAL_REQUIREMENTS_LOCATIONS)):
|
for i in range(0, len(GLOBAL_REQUIREMENTS_LOCATIONS)):
|
||||||
url = GLOBAL_REQUIREMENTS_LOCATIONS[i] + GLOBAL_REQUIREMENTS_FILENAME
|
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:
|
try:
|
||||||
raw_gr = requests.get(url).text
|
raw_gr = requests.get(url).text
|
||||||
except requests.ConnectionError as e:
|
except requests.ConnectionError as e:
|
||||||
@ -309,7 +309,7 @@ def format_requirements():
|
|||||||
def add_uppers():
|
def add_uppers():
|
||||||
"""Obtains latest version of packages and put them to requirements."""
|
"""Obtains latest version of packages and put them to requirements."""
|
||||||
for filename, requirements in _sync():
|
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:
|
for req in requirements:
|
||||||
if isinstance(req, Requirement):
|
if isinstance(req, Requirement):
|
||||||
if isinstance(req.version, dict) and not req.version["max"]:
|
if isinstance(req.version, dict) and not req.version["max"]:
|
||||||
|
Loading…
Reference in New Issue
Block a user