mirror of
https://github.com/ARM-software/workload-automation.git
synced 2025-02-21 12:28:44 +00:00
ConfigurationPoint: Removed convert_types
Now always done by default because we never had a situation where this was not necessary.
This commit is contained in:
parent
6798a54a61
commit
cddc29af05
@ -121,6 +121,14 @@ class LoggingConfig(dict):
|
|||||||
raise ValueError(config)
|
raise ValueError(config)
|
||||||
|
|
||||||
|
|
||||||
|
# Mapping for kind conversion; see docs for convert_types below
|
||||||
|
KIND_MAP = {
|
||||||
|
int: integer,
|
||||||
|
bool: boolean,
|
||||||
|
dict: OrderedDict,
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
class ConfigurationPoint(object):
|
class ConfigurationPoint(object):
|
||||||
"""
|
"""
|
||||||
This defines a generic configuration point for workload automation. This is
|
This defines a generic configuration point for workload automation. This is
|
||||||
@ -128,13 +136,6 @@ class ConfigurationPoint(object):
|
|||||||
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
# Mapping for kind conversion; see docs for convert_types below
|
|
||||||
kind_map = {
|
|
||||||
int: integer,
|
|
||||||
bool: boolean,
|
|
||||||
dict: OrderedDict,
|
|
||||||
}
|
|
||||||
|
|
||||||
def __init__(self, name,
|
def __init__(self, name,
|
||||||
kind=None,
|
kind=None,
|
||||||
mandatory=None,
|
mandatory=None,
|
||||||
@ -144,8 +145,7 @@ class ConfigurationPoint(object):
|
|||||||
description=None,
|
description=None,
|
||||||
constraint=None,
|
constraint=None,
|
||||||
merge=False,
|
merge=False,
|
||||||
aliases=None,
|
aliases=None):
|
||||||
convert_types=True):
|
|
||||||
"""
|
"""
|
||||||
Create a new Parameter object.
|
Create a new Parameter object.
|
||||||
|
|
||||||
@ -193,20 +193,12 @@ class ConfigurationPoint(object):
|
|||||||
``merge_config_values`` documentation for details.
|
``merge_config_values`` documentation for details.
|
||||||
:param aliases: Alternative names for the same configuration point.
|
:param aliases: Alternative names for the same configuration point.
|
||||||
These are largely for backwards compatibility.
|
These are largely for backwards compatibility.
|
||||||
:param convert_types: If ``True`` (the default), will automatically
|
|
||||||
convert ``kind`` values from native Python
|
|
||||||
types to WA equivalents. This allows more
|
|
||||||
ituitive interprestation of parameter values,
|
|
||||||
e.g. the string ``"false"`` being interpreted
|
|
||||||
as ``False`` when specifed as the value for
|
|
||||||
a boolean Parameter.
|
|
||||||
|
|
||||||
"""
|
"""
|
||||||
self.name = identifier(name)
|
self.name = identifier(name)
|
||||||
if kind is not None and not callable(kind):
|
if kind is not None and not callable(kind):
|
||||||
raise ValueError('Kind must be callable.')
|
raise ValueError('Kind must be callable.')
|
||||||
if convert_types and kind in self.kind_map:
|
if kind in KIND_MAP:
|
||||||
kind = self.kind_map[kind]
|
kind = KIND_MAP[kind]
|
||||||
self.kind = kind
|
self.kind = kind
|
||||||
self.mandatory = mandatory
|
self.mandatory = mandatory
|
||||||
self.default = default
|
self.default = default
|
||||||
|
Loading…
x
Reference in New Issue
Block a user