Repository :
http://git.fedorahosted.org/cgit/cura-tools.git
On branch : openlmi-tools-lmiwbem
---------------------------------------------------------------
commit 2a0a6b8bb5810b78fcfff1e415bf95bcb9c68047
Author: Peter Hatina <phatina(a)redhat.com>
Date: Mon May 26 09:38:31 2014 +0200
code cleanup
---------------------------------------------------------------
cli/lmi/shell/LMIBaseClient.py | 6 +++---
cli/lmi/shell/LMIClass.py | 6 +++---
cli/lmi/shell/LMIConsole.py | 4 ++--
cli/lmi/shell/LMIConstantValues.py | 4 ++--
cli/lmi/shell/LMIFormatter.py | 2 +-
cli/lmi/shell/LMIInstance.py | 2 +-
cli/lmi/shell/LMIMethod.py | 4 ++--
cli/lmi/shell/LMIUtil.py | 2 +-
8 files changed, 15 insertions(+), 15 deletions(-)
diff --git a/cli/lmi/shell/LMIBaseClient.py b/cli/lmi/shell/LMIBaseClient.py
index f300d66..54f70d9 100644
--- a/cli/lmi/shell/LMIBaseClient.py
+++ b/cli/lmi/shell/LMIBaseClient.py
@@ -163,7 +163,7 @@ class LMIBaseClient(object):
inst_name_list_filtered = []
for inst_name in inst_name_list:
append = True
- for (filter_key, filter_value) in inst_filter.iteritems():
+ for filter_key, filter_value in inst_filter.iteritems():
if inst_name[filter_key] != filter_value:
append = False
break
@@ -266,7 +266,7 @@ class LMIBaseClient(object):
if inst_filter:
more = False
query += " where"
- for (filter_key, filter_value) in inst_filter.iteritems():
+ for filter_key, filter_value in inst_filter.iteritems():
if more:
query += " and"
quotes = isinstance(filter_value, basestring)
@@ -292,7 +292,7 @@ class LMIBaseClient(object):
if inst_list and inst_filter:
inst_list_filtered = []
for inst in inst_list:
- for (filter_key, filter_value) in inst_filter.iteritems():
+ for filter_key, filter_value in inst_filter.iteritems():
if not filter_key in inst.properties or \
inst.properties[filter_key].value != filter_value:
break
diff --git a/cli/lmi/shell/LMIClass.py b/cli/lmi/shell/LMIClass.py
index 0b3d856..72fa765 100644
--- a/cli/lmi/shell/LMIClass.py
+++ b/cli/lmi/shell/LMIClass.py
@@ -95,7 +95,7 @@ class LMIClass(LMIWrapperBaseObject):
properties = properties if not properties is None else {}
qualifiers = qualifiers if not qualifiers is None else {}
self_properties = self._cim_class.properties
- for (key, value) in properties.iteritems():
+ for key, value in properties.iteritems():
if not key in self._cim_class.properties:
errorstr = "No such instance property '%s'" % key
lmi_raise_or_dump_exception(LMIUnknownPropertyError(errorstr))
@@ -164,7 +164,7 @@ class LMIClass(LMIWrapperBaseObject):
if full_fetch:
self._cim_class_full_fetch = full_fetch
# Store the constant values as a list. This can consume some time, if
computed on demand.
- self._valuemap_properties_list = [k for (k, v) in
self._cim_class.properties.iteritems() \
+ self._valuemap_properties_list = [k for k, v in
self._cim_class.properties.iteritems() \
if "ValueMap" in v.qualifiers and "Values" in
v.qualifiers]
# NOTE: usage with Key=something, Value=something is deprecated
@@ -353,7 +353,7 @@ class LMIClass(LMIWrapperBaseObject):
# can be called in the synchronous way. One type of such method is the
# method, which has its "counterpart" class
__MethodParameters_<Method>.
# The other one is the method, which defines a Job return paremeter.
- for (name, method) in self._cim_class.methods.iteritems():
+ for name, method in self._cim_class.methods.iteritems():
if "__MethodParameters_" + name in class_names or \
"Job" in method.parameters:
methods_lst.append("Sync" + name)
diff --git a/cli/lmi/shell/LMIConsole.py b/cli/lmi/shell/LMIConsole.py
index 325828e..c9b04c7 100644
--- a/cli/lmi/shell/LMIConsole.py
+++ b/cli/lmi/shell/LMIConsole.py
@@ -146,7 +146,7 @@ class LMIConsole(code.InteractiveConsole):
if locals is None:
locals = {}
else:
- for (k, v) in locals.iteritems():
+ for k, v in locals.iteritems():
if isinstance(v, LMIConnection):
locals[k]._client.interactive = True
locals["clear_history"] = self.clear_history
@@ -239,7 +239,7 @@ class LMIConsole(code.InteractiveConsole):
if locals is None:
locals = {}
else:
- for (k, v) in locals.iteritems():
+ for k, v in locals.iteritems():
if isinstance(v, LMIConnection):
locals[k]._client.interactive = False
locals["connect"] = connect
diff --git a/cli/lmi/shell/LMIConstantValues.py b/cli/lmi/shell/LMIConstantValues.py
index 2f4a61d..5642cb9 100644
--- a/cli/lmi/shell/LMIConstantValues.py
+++ b/cli/lmi/shell/LMIConstantValues.py
@@ -44,7 +44,7 @@ class LMIConstantValues(object):
self._cast_type = cast_type
# Fill two dictionaries for bidirectional access to constant values.
cnt = 1
- for (key, value) in items:
+ for key, value in items:
try:
# Cast constant value first. If we get ValueError, no key
# modifications are necessary.
@@ -75,7 +75,7 @@ class LMIConstantValues(object):
:returns: pretty string
"""
result = ""
- for (k, v) in self._value_map.iteritems():
+ for k, v in self._value_map.iteritems():
result += "%s = %s\n" % (k, v)
return result[:-1]
diff --git a/cli/lmi/shell/LMIFormatter.py b/cli/lmi/shell/LMIFormatter.py
index c8193a6..47d5276 100644
--- a/cli/lmi/shell/LMIFormatter.py
+++ b/cli/lmi/shell/LMIFormatter.py
@@ -37,7 +37,7 @@ def _which(program):
:returns: full path of a selected executable
:rtype: string
"""
- (fpath, fname) = os.path.split(program)
+ fpath, fname = os.path.split(program)
if fpath:
if _is_executable(program):
return program
diff --git a/cli/lmi/shell/LMIInstance.py b/cli/lmi/shell/LMIInstance.py
index 118d45c..9085ef7 100644
--- a/cli/lmi/shell/LMIInstance.py
+++ b/cli/lmi/shell/LMIInstance.py
@@ -599,7 +599,7 @@ class LMIInstance(LMIWrapperBaseObject):
**Usage:** :ref:`instances_properties`.
"""
- for (name, prop) in self._cim_instance.properties.iteritems():
+ for name, prop in self._cim_instance.properties.iteritems():
value = str(prop.value)
if isinstance(prop.value, basestring):
value = "'%s'" % value
diff --git a/cli/lmi/shell/LMIMethod.py b/cli/lmi/shell/LMIMethod.py
index c612641..1cc84d5 100644
--- a/cli/lmi/shell/LMIMethod.py
+++ b/cli/lmi/shell/LMIMethod.py
@@ -179,7 +179,7 @@ class LMIMethod(LMIWrapperBaseObject):
self._lmi_instance._lmi_class.fetch(True)
self._method = self._lmi_instance._lmi_class._cim_class.methods[method]
# Store the constant values as a list. This can consume some time, if computed on
demand.
- self._valuemap_parameters_list = [k for (k, v) in
self._method.parameters.iteritems() \
+ self._valuemap_parameters_list = [k for k, v in
self._method.parameters.iteritems() \
if "ValueMap" in v.qualifiers]
# For simplicity, we add return value constants to the same list
if "ValueMap" in self._method.qualifiers:
@@ -526,7 +526,7 @@ class LMIMethod(LMIWrapperBaseObject):
if method_args is None:
method_args = {}
method_args.update(kwargs)
- for (param, value) in method_args.iteritems():
+ for param, value in method_args.iteritems():
if param in self._method.parameters:
# Cast input parameters into acceptable CIM types
t = self._method.parameters[param].type
diff --git a/cli/lmi/shell/LMIUtil.py b/cli/lmi/shell/LMIUtil.py
index cb41d83..7e6dc6f 100644
--- a/cli/lmi/shell/LMIUtil.py
+++ b/cli/lmi/shell/LMIUtil.py
@@ -359,7 +359,7 @@ def lmi_associators(assoc_classes):
# Reference properties
ref_props = [
ref_prop_name \
- for (ref_prop_name, ref_prop) in
assoc_class._cim_class.properties.iteritems() \
+ for ref_prop_name, ref_prop in assoc_class._cim_class.properties.iteritems()
\
if ref_prop.type == "reference"
]