mirror of
https://github.com/ARM-software/workload-automation.git
synced 2025-09-01 19:02:31 +01:00
misc
This commit is contained in:
@@ -56,13 +56,16 @@ def main():
|
||||
init_argument_parser(parser)
|
||||
commands = load_commands(parser.add_subparsers(dest='command')) # each command will add its own subparser
|
||||
args = parser.parse_args()
|
||||
settings.set("verbosity", args.verbose)
|
||||
settings.load_user_config()
|
||||
|
||||
#TODO: Set this stuff properly, i.e dont use settings (if possible)
|
||||
#settings.set("verbosity", args.verbose)
|
||||
#settings.load_user_config()
|
||||
#settings.debug = args.debug
|
||||
if args.config:
|
||||
if not os.path.exists(args.config):
|
||||
raise ConfigError("Config file {} not found".format(args.config))
|
||||
settings.load_config_file(args.config)
|
||||
|
||||
for config in args.config:
|
||||
if not os.path.exists(config):
|
||||
raise ConfigError("Config file {} not found".format(config))
|
||||
|
||||
init_logging(settings.verbosity)
|
||||
|
||||
command = commands[args.command]
|
||||
|
@@ -56,7 +56,7 @@ from wlauto.core.resolver import ResourceResolver
|
||||
from wlauto.core.result import ResultManager, IterationResult, RunResult
|
||||
from wlauto.exceptions import (WAError, ConfigError, TimeoutError, InstrumentError,
|
||||
DeviceError, DeviceNotRespondingError)
|
||||
from wlauto.utils.misc import ensure_directory_exists as _d, get_traceback, merge_dicts, format_duration
|
||||
from wlauto.utils.misc import ensure_directory_exists as _d, get_traceback, format_duration
|
||||
from wlauto.utils.serializer import json
|
||||
|
||||
# The maximum number of reboot attempts for an iteration.
|
||||
@@ -92,10 +92,8 @@ class RunInfo(object):
|
||||
def to_dict(self):
|
||||
d = copy(self.__dict__)
|
||||
d['uuid'] = str(self.uuid)
|
||||
del d['config']
|
||||
d = merge_dicts(d, self.config.to_dict())
|
||||
return d
|
||||
|
||||
#TODO: pod
|
||||
|
||||
class ExecutionContext(object):
|
||||
"""
|
||||
|
@@ -26,10 +26,11 @@ from itertools import chain
|
||||
from copy import copy
|
||||
|
||||
from wlauto.exceptions import NotFoundError, LoaderError, ValidationError, ConfigError
|
||||
from wlauto.utils.misc import isiterable, ensure_directory_exists as _d, walk_modules, load_class, merge_dicts, get_article
|
||||
from wlauto.utils.misc import (isiterable, ensure_directory_exists as _d,
|
||||
walk_modules, load_class, merge_dicts_simple, get_article)
|
||||
from wlauto.core.configuration import settings
|
||||
from wlauto.utils.types import identifier, integer, boolean
|
||||
from wlauto.core.configuration import ConfigurationPoint, ConfigurationPointCollection
|
||||
from wlauto.core.configuration import ConfigurationPoint
|
||||
|
||||
MODNAME_TRANS = string.maketrans(':/\\.', '____')
|
||||
|
||||
@@ -711,7 +712,8 @@ class PluginLoader(object):
|
||||
"""
|
||||
real_name, alias_config = self.resolve_alias(name)
|
||||
base_default_config = self.get_plugin_class(real_name).get_default_config()
|
||||
return merge_dicts(base_default_config, alias_config, list_duplicates='last', dict_type=OrderedDict)
|
||||
return merge_dicts_simple(base_default_config, alias_config)
|
||||
|
||||
|
||||
def list_plugins(self, kind=None):
|
||||
"""
|
||||
|
@@ -44,7 +44,7 @@ from datetime import datetime
|
||||
from wlauto.core.plugin import Plugin
|
||||
from wlauto.exceptions import WAError
|
||||
from wlauto.utils.types import numeric
|
||||
from wlauto.utils.misc import enum_metaclass, merge_dicts
|
||||
from wlauto.utils.misc import enum_metaclass, merge_dicts_simple
|
||||
|
||||
|
||||
class ResultManager(object):
|
||||
@@ -263,9 +263,8 @@ class IterationResult(object):
|
||||
self.artifacts = []
|
||||
|
||||
def add_metric(self, name, value, units=None, lower_is_better=False, classifiers=None):
|
||||
classifiers = merge_dicts(self.classifiers, classifiers or {},
|
||||
list_duplicates='last', should_normalize=False)
|
||||
self.metrics.append(Metric(name, value, units, lower_is_better, classifiers))
|
||||
self.metrics.append(Metric(name, value, units, lower_is_better,
|
||||
merge_dicts_simple(self.classifiers, classifiers)))
|
||||
|
||||
def has_metric(self, name):
|
||||
for metric in self.metrics:
|
||||
|
Reference in New Issue
Block a user