Fixed indentation in utils.list_settings
Fixed the indentation in utils.list_settings. Change-Id: I198bc028537f78228a4899afd788e786c95f0ee6
This commit is contained in:
parent
7626bcc857
commit
9ff2b02058
|
@ -252,35 +252,35 @@ def validate_integer_value(value, attr_name, error_msgs):
|
||||||
|
|
||||||
def list_settings(client, namespaces, by_name=True, fqdd_filter=None,
|
def list_settings(client, namespaces, by_name=True, fqdd_filter=None,
|
||||||
name_formatter=None):
|
name_formatter=None):
|
||||||
"""List the configuration settings
|
"""List the configuration settings
|
||||||
|
|
||||||
:param client: an instance of WSManClient.
|
:param client: an instance of WSManClient.
|
||||||
:param namespaces: a list of URI/class pairs to retrieve.
|
:param namespaces: a list of URI/class pairs to retrieve.
|
||||||
:param by_name: controls whether returned dictionary uses
|
:param by_name: controls whether returned dictionary uses
|
||||||
attribute name or instance_id as key.
|
attribute name or instance_id as key.
|
||||||
:param fqdd_filter: An FQDD used to filter the instances. Note that
|
:param fqdd_filter: An FQDD used to filter the instances. Note that
|
||||||
this is only used when by_name is True.
|
this is only used when by_name is True.
|
||||||
:param name_formatter: a method used to format the keys in the
|
:param name_formatter: a method used to format the keys in the
|
||||||
returned dictionary. By default,
|
returned dictionary. By default,
|
||||||
attribute.name will be used.
|
attribute.name will be used.
|
||||||
:returns: a dictionary with the settings using name or instance_id as
|
:returns: a dictionary with the settings using name or instance_id as
|
||||||
the key.
|
the key.
|
||||||
:raises: WSManRequestFailure on request failures
|
:raises: WSManRequestFailure on request failures
|
||||||
:raises: WSManInvalidResponse when receiving invalid response
|
:raises: WSManInvalidResponse when receiving invalid response
|
||||||
:raises: DRACOperationFailed on error reported back by the DRAC
|
:raises: DRACOperationFailed on error reported back by the DRAC
|
||||||
interface
|
interface
|
||||||
"""
|
"""
|
||||||
|
|
||||||
result = {}
|
result = {}
|
||||||
for (namespace, attr_cls) in namespaces:
|
for (namespace, attr_cls) in namespaces:
|
||||||
attribs = _get_config(client, namespace, attr_cls, by_name,
|
attribs = _get_config(client, namespace, attr_cls, by_name,
|
||||||
fqdd_filter, name_formatter)
|
fqdd_filter, name_formatter)
|
||||||
if not set(result).isdisjoint(set(attribs)):
|
if not set(result).isdisjoint(set(attribs)):
|
||||||
raise exceptions.DRACOperationFailed(
|
raise exceptions.DRACOperationFailed(
|
||||||
drac_messages=('Colliding attributes %r' % (
|
drac_messages=('Colliding attributes %r' % (
|
||||||
set(result) & set(attribs))))
|
set(result) & set(attribs))))
|
||||||
result.update(attribs)
|
result.update(attribs)
|
||||||
return result
|
return result
|
||||||
|
|
||||||
|
|
||||||
def _get_config(client, resource, attr_cls, by_name, fqdd_filter,
|
def _get_config(client, resource, attr_cls, by_name, fqdd_filter,
|
||||||
|
|
Loading…
Reference in New Issue