1
0
mirror of https://github.com/ARM-software/workload-automation.git synced 2025-01-18 20:11:20 +00:00

Merge pull request #374 from marcbonnici/misc_fixes

Misc fixes
This commit is contained in:
setrofim 2017-03-22 17:40:12 +00:00 committed by GitHub
commit 044aef2535
4 changed files with 13 additions and 14 deletions

View File

@ -128,7 +128,7 @@ class LoggingConfig(dict):
self['color'] = config.pop('colour_enabled', self.defaults['color']) # legacy
self['color'] = config.pop('color', self.defaults['color'])
if config:
message = 'Unexpected logging configuation parameters: {}'
message = 'Unexpected logging configuration parameters: {}'
raise ValueError(message.format(bad_vals=', '.join(config.keys())))
elif config is None:
for k, v in self.defaults.iteritems():
@ -267,7 +267,7 @@ class ConfigurationPoint(object):
article = get_article(typename)
raise ConfigError(msg.format(value, self.name, article, typename))
if value is not None:
self.validate_value(obj.name, value)
self.validate_value(self.name, value)
if self.merge and hasattr(obj, self.name):
value = merge_config_values(getattr(obj, self.name), value)
setattr(obj, self.name, value)
@ -401,7 +401,7 @@ class RuntimeParameterManager(object):
"""
Validate values that do not require a active device connection.
This method should also pop all runtime parameters meant for this manager
from params, even if they are not beign statically validated.
from params, even if they are not being statically validated.
"""
pass
@ -743,7 +743,7 @@ class RunConfiguration(Configuration):
default=['FAILED', 'PARTIAL'],
allowed_values=Status.values[Status.RUNNING.value:],
description='''
This is list of statuses on which a job will be cosidered to have
This is list of statuses on which a job will be considered to have
failed and will be automatically retried up to ``max_retries``
times. This defaults to ``["FAILED", "PARTIAL"]`` if not set.
Possible values are::
@ -758,7 +758,7 @@ class RunConfiguration(Configuration):
The workload itself has failed.
``"ABORTED"``
The user interupted the workload
The user interrupted the workload
''',
),
ConfigurationPoint(
@ -799,7 +799,7 @@ class RunConfiguration(Configuration):
"""
# pylint: disable=no-member
if self.device is None:
msg = 'Attemting to merge device config with unspecified device'
msg = 'Attempting to merge device config with unspecified device'
raise RuntimeError(msg)
self.device_config = plugin_cache.get_plugin_config(self.device,
generic_name="device_config")
@ -1068,7 +1068,7 @@ def create_job_spec(workload_entry, sections, target_manager, plugin_cache,
# PHASE 2.2: Merge global, section and workload entry "workload_parameters"
job_spec.merge_workload_parameters(plugin_cache)
# TODO: PHASE 2.3: Validate device runtime/boot paramerers
# TODO: PHASE 2.3: Validate device runtime/boot parameters
job_spec.merge_runtime_parameters(plugin_cache, target_manager)
target_manager.validate_runtime_parameters(job_spec.runtime_parameters)

View File

@ -155,7 +155,7 @@ class AgendaParser(object):
for section in sections:
workloads = []
for workload_entry in section.pop("workloads", []):
workload = _process_workload_entry(workload_entry, seen_workload_ids,
workload = _process_workload_entry(workload_entry, seen_wkl_ids,
state.jobs_config)
workloads.append(workload)
@ -224,8 +224,8 @@ def _pop_aliased(d, names, entry_id):
name_count = sum(1 for n in names if n in d)
if name_count > 1:
names_list = ', '.join(names)
msg = 'Inivalid workload entry "{}": at moust one of ({}}) must be specified.'
raise ConfigError(msg.format(workload_entry['id'], names_list))
msg = 'Invalid workload entry "{}": at most one of ({}}) must be specified.'
raise ConfigError(msg.format(entry_id, names_list))
for name in names:
if name in d:
return d.pop(name)

View File

@ -155,7 +155,7 @@ class ApkFile(Resource):
version_matches = apk_version_matches(path, self.version)
if self.variant is not None:
name_matches = file_name_matches(path, self.variant)
return name_matches and version_matches:
return name_matches and version_matches
def __str__(self):
text = '<{}\'s apk'.format(self.owner)

View File

@ -8,7 +8,7 @@ from wa.framework import pluginloader
from wa.framework.exception import PluginLoaderError
from wa.framework.plugin import Plugin, Parameter
from wa.utils.types import list_of_strings, list_of_ints
from wa.utils.misc import isiterable
def get_target_descriptions(loader=pluginloader):
targets = {}
@ -18,7 +18,7 @@ def get_target_descriptions(loader=pluginloader):
if desc.name in targets:
msg = 'Duplicate target "{}" returned by {} and {}'
prev_dtor = targets[desc.name].source
raise PluginLoaderError(msg.format(dsc.name, prev_dtor.name,
raise PluginLoaderError(msg.format(desc.name, prev_dtor.name,
descriptor.name))
targets[desc.name] = desc
return targets.values()
@ -290,4 +290,3 @@ class DefaultTargetDescriptor(TargetDescriptor):
raise ValueError('Unexpected default "{}"'.format(name))
param_map[name].default = value
return cls, param_map.values()