Discussion:
[Libstoragemgmt-devel] [PATCH 1/3] smis_sys.py: Change variable name to not match method
Tony Asleson
2014-11-13 22:58:22 UTC
Permalink
Removes any doubt which value we are returning.

Signed-off-by: Tony Asleson <***@redhat.com>
---
plugin/smispy/smis_sys.py | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/plugin/smispy/smis_sys.py b/plugin/smispy/smis_sys.py
index 4101137..6915eea 100644
--- a/plugin/smispy/smis_sys.py
+++ b/plugin/smispy/smis_sys.py
@@ -95,9 +95,9 @@ def cim_sys_pros():
"""
Return a list of properties required to create a LSM System
"""
- cim_sys_pros = cim_sys_id_pros()
- cim_sys_pros.extend(['ElementName', 'OperationalStatus'])
- return cim_sys_pros
+ cim_sys_properties = cim_sys_id_pros()
+ cim_sys_properties.extend(['ElementName', 'OperationalStatus'])
+ return cim_sys_properties


_LSM_SYS_OP_STATUS_CONV = {
--
1.8.2.1
Tony Asleson
2014-11-13 22:58:23 UTC
Permalink
Signed-off-by: Tony Asleson <***@redhat.com>
---
plugin/smispy/smis_cap.py | 2 +-
plugin/smispy/smis_common.py | 27 ++++++++++-----------------
plugin/smispy/smis_pool.py | 2 +-
plugin/smispy/smis_vol.py | 1 +
4 files changed, 13 insertions(+), 19 deletions(-)

diff --git a/plugin/smispy/smis_cap.py b/plugin/smispy/smis_cap.py
index 1fee9a8..e027a22 100644
--- a/plugin/smispy/smis_cap.py
+++ b/plugin/smispy/smis_cap.py
@@ -42,7 +42,7 @@ def _rs_supported_capabilities(smis_common, system_id, cap):
sync_actions = rs_cap['SupportedSynchronousActions']

if dmtf.REPLICA_CAP_ACTION_CREATE_ELEMENT in async_actions or \
- dmtf.REPLICA_CAP_ACTION_CREATE_ELEMENT in sync_actions :
+ dmtf.REPLICA_CAP_ACTION_CREATE_ELEMENT in sync_actions:
cap.set(Capabilities.VOLUME_REPLICATE)
else:
return
diff --git a/plugin/smispy/smis_common.py b/plugin/smispy/smis_common.py
index 33d464c..2dadcc8 100644
--- a/plugin/smispy/smis_common.py
+++ b/plugin/smispy/smis_common.py
@@ -155,7 +155,6 @@ class SmisCommon(object):
SNIA_INVOKE_FAILED = 4
SNIA_INVOKE_ASYNC = 4096

-
SNIA_BLK_ROOT_PROFILE = 'Array'
SNIA_BLK_SRVS_PROFILE = 'Block Services'
SNIA_DISK_LITE_PROFILE = 'Disk Drive Lite'
@@ -213,12 +212,10 @@ class SmisCommon(object):
# MegaRAID SMI-S profile support status will not change for a while.
self._profile_dict = {
# Provide a fake profile support status to pass the check.
- SmisCommon.SNIA_BLK_ROOT_PROFILE: \
- SmisCommon.SMIS_SPEC_VER_1_4,
- SmisCommon.SNIA_BLK_SRVS_PROFILE: \
- SmisCommon.SMIS_SPEC_VER_1_4,
- SmisCommon.SNIA_DISK_LITE_PROFILE: \
- SmisCommon.SMIS_SPEC_VER_1_4,
+ SmisCommon.SNIA_BLK_ROOT_PROFILE: SmisCommon.SMIS_SPEC_VER_1_4,
+ SmisCommon.SNIA_BLK_SRVS_PROFILE: SmisCommon.SMIS_SPEC_VER_1_4,
+ SmisCommon.SNIA_DISK_LITE_PROFILE:
+ SmisCommon.SMIS_SPEC_VER_1_4,
}
self._vendor_product = SmisCommon._PRODUCT_MEGARAID
else:
@@ -274,7 +271,7 @@ class SmisCommon(object):
if self._wbem_conn.default_namespace in dmtf.INTEROP_NAMESPACES:
# We have to enumerate in vendor namespace
self._wbem_conn.default_namespace = self._vendor_namespace()
- params['LocalOnly']=False
+ params['LocalOnly'] = False
return self._wbem_conn.EnumerateInstances(
ClassName, namespace, **params)

@@ -282,7 +279,7 @@ class SmisCommon(object):
if self._wbem_conn.default_namespace in dmtf.INTEROP_NAMESPACES:
# We have to enumerate in vendor namespace
self._wbem_conn.default_namespace = self._vendor_namespace()
- params['LocalOnly']=False
+ params['LocalOnly'] = False
return self._wbem_conn.EnumerateInstanceNames(
ClassName, namespace, **params)

@@ -293,7 +290,7 @@ class SmisCommon(object):
return self._wbem_conn.AssociatorNames(ObjectName, **params)

def GetInstance(self, InstanceName, **params):
- params['LocalOnly']=False
+ params['LocalOnly'] = False
return self._wbem_conn.GetInstance(InstanceName, **params)

def InvokeMethod(self, MethodName, ObjectName, **params):
@@ -445,7 +442,7 @@ class SmisCommon(object):
except Exception:
tb = traceback.format_exc()
raise LsmError(ErrorNumber.PLUGIN_BUG,
- "Error: %s rc= %s" % (cmd, str(rc))+
+ "Error: %s rc= %s" % (cmd, str(rc)) +
" Debug data exception: %s" % str(tb))

raise LsmError(ErrorNumber.PLUGIN_BUG,
@@ -479,18 +476,16 @@ class SmisCommon(object):
"Cannot find any '%s' for requested systemd ID" % srv_name)
return None

-
def cim_scs_of_sys_id(self, sys_id, raise_error=True):
"""
- Return a CIMInstance of CIM_StorageConfigurationService for given system
- id.
+ Return a CIMInstance of CIM_StorageConfigurationService for given
+ system id.
Using 'SystemName' property as system id of a service which is defined
by DMTF CIM_Service.
"""
return self._cim_srv_of_sys_id(
'CIM_StorageConfigurationService', sys_id, raise_error)

-
def cim_rs_of_sys_id(self, sys_id, raise_error=True):
"""
Return a CIMInstance of CIM_ReplicationService for given system id.
@@ -500,7 +495,6 @@ class SmisCommon(object):
return self._cim_srv_of_sys_id(
'CIM_ReplicationService', sys_id, raise_error)

-
def cim_gmms_of_sys_id(self, sys_id, raise_error=True):
"""
Return a CIMInstance of CIM_GroupMaskingMappingService for given system
@@ -511,7 +505,6 @@ class SmisCommon(object):
return self._cim_srv_of_sys_id(
'CIM_GroupMaskingMappingService', sys_id, raise_error)

-
def cim_ccs_of_sys_id(self, sys_id, raise_error=True):
"""
Return a CIMInstance of CIM_ControllerConfigurationService for given
diff --git a/plugin/smispy/smis_pool.py b/plugin/smispy/smis_pool.py
index c9f4345..6ef7dcc 100644
--- a/plugin/smispy/smis_pool.py
+++ b/plugin/smispy/smis_pool.py
@@ -120,7 +120,7 @@ def _pool_element_type(smis_common, cim_pool):
For MegaRAID, just return (Pool.ELEMENT_TYPE_VOLUME, 0)
"""
if smis_common.is_megaraid():
- return Pool.ELEMENT_TYPE_VOLUME|Pool.ELEMENT_TYPE_VOLUME_FULL, 0
+ return Pool.ELEMENT_TYPE_VOLUME | Pool.ELEMENT_TYPE_VOLUME_FULL, 0

element_type = 0
unsupported = 0
diff --git a/plugin/smispy/smis_vol.py b/plugin/smispy/smis_vol.py
index fa52c88..4581e7b 100644
--- a/plugin/smispy/smis_vol.py
+++ b/plugin/smispy/smis_vol.py
@@ -28,6 +28,7 @@ from lsm.plugin.smispy.utils import (
merge_list, cim_path_to_path_str, path_str_to_cim_path)
from lsm.plugin.smispy import dmtf

+
def cim_vol_id_pros():
"""
Return the property of CIM_StorageVolume required to generate
--
1.8.2.1
Tony Asleson
2014-11-13 22:58:24 UTC
Permalink
Signed-off-by: Tony Asleson <***@redhat.com>
---
plugin/smispy/smis.py | 6 +++---
plugin/smispy/smis_ag.py | 4 ++--
plugin/smispy/smis_common.py | 4 ++--
plugin/smispy/smis_disk.py | 6 +++---
plugin/smispy/smis_pool.py | 2 +-
plugin/smispy/smis_sys.py | 2 +-
6 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/plugin/smispy/smis.py b/plugin/smispy/smis.py
index 660521e..189289e 100644
--- a/plugin/smispy/smis.py
+++ b/plugin/smispy/smis.py
@@ -147,7 +147,7 @@ class Smis(IStorageAreaNetwork):
Return None when error and raise_error is False
"""
class_name = Smis._cim_class_name_of(class_type)
- error_numer = Smis._not_found_error_of_class(class_type)
+ error_number = Smis._not_found_error_of_class(class_type)
id_pros = Smis._property_list_of_id(class_type, property_list)

if property_list is None:
@@ -167,7 +167,7 @@ class Smis(IStorageAreaNetwork):
if raise_error is False:
return None

- raise LsmError(error_numer,
+ raise LsmError(error_number,
"Cannot find %s Instance with " % class_name +
"%s ID '%s'" % (class_type, org_requested_id))

@@ -180,7 +180,7 @@ class Smis(IStorageAreaNetwork):
2. if nothing found, then
Enumerate CIM_RegisteredProfile in 'root/interop' namespace.
3. if nothing found, then
- Enumerate CIM_RegisteredProfile in userdefined namespace.
+ Enumerate CIM_RegisteredProfile in user defined namespace.
"""
protocol = 'http'
port = SmisCommon.IAAN_WBEM_HTTP_PORT
diff --git a/plugin/smispy/smis_ag.py b/plugin/smispy/smis_ag.py
index 43aa7ac..42d27b4 100644
--- a/plugin/smispy/smis_ag.py
+++ b/plugin/smispy/smis_ag.py
@@ -62,7 +62,7 @@ def _init_id_and_type_of(cim_inits):

def cim_spc_pros():
"""
- Return the property of CIM_SCSIProtocolController required to gernarate
+ Return the property of CIM_SCSIProtocolController required to generate
lsm.AccessGroup
'EMCAdapterRole' is for EMC VNX only.
"""
@@ -72,7 +72,7 @@ def cim_spc_pros():

def cim_init_mg_pros():
"""
- Return the property of CIM_InitiatorMaskingGroup required to gernarate
+ Return the property of CIM_InitiatorMaskingGroup required to generate
lsm.AccessGroup
"""
return ['ElementName', 'InstanceID']
diff --git a/plugin/smispy/smis_common.py b/plugin/smispy/smis_common.py
index 2dadcc8..5343865 100644
--- a/plugin/smispy/smis_common.py
+++ b/plugin/smispy/smis_common.py
@@ -44,7 +44,7 @@ def _profile_register_load(wbem_conn):
'Block Service Profile': 1.4,
}
The 'root_blk_cim_rp' is the 'Array' profile of CIM_RegisteredProfile
- with hightest version number.
+ with highest version number.
"""
profile_dict = {}
root_blk_cim_rp = None
@@ -473,7 +473,7 @@ class SmisCommon(object):
if raise_error:
raise LsmError(
ErrorNumber.NO_SUPPORT,
- "Cannot find any '%s' for requested systemd ID" % srv_name)
+ "Cannot find any '%s' for requested system ID" % srv_name)
return None

def cim_scs_of_sys_id(self, sys_id, raise_error=True):
diff --git a/plugin/smispy/smis_disk.py b/plugin/smispy/smis_disk.py
index 12513a4..6b476f1 100644
--- a/plugin/smispy/smis_disk.py
+++ b/plugin/smispy/smis_disk.py
@@ -138,12 +138,12 @@ def _pri_cim_ext_of_cim_disk(smis_common, cim_disk_path, property_list=None):


# LSIESG_DiskDrive['MediaType']
-# Value was retrived from MOF file of MegaRAID SMI-S provider.
+# Value was retrieved from MOF file of MegaRAID SMI-S provider.
_MEGARAID_DISK_MEDIA_TYPE_SSD = 1
_MEGARAID_DISK_MEDIA_TYPE_SSD_FLASH = 2

# LSIESG_DiskDrive['Type']
-# Value was retrived from LSI engineer with content of LGPL2.1+ license.
+# Value was retrieved from LSI engineer with content of LGPL2.1+ license.
_MEGARAID_DISK_TYPE_SCSI = 1
_MEGARAID_DISK_TYPE_SAS = 2
_MEGARAID_DISK_TYPE_SATA = 3
@@ -172,7 +172,7 @@ def cim_disk_to_lsm_disk(smis_common, cim_disk):
Convert CIM_DiskDrive to lsm.Disk.
"""
# CIM_DiskDrive does not have disk size information.
- # We have to find out the Primodial CIM_StorageExtent for that.
+ # We have to find out the Primordial CIM_StorageExtent for that.
cim_ext = _pri_cim_ext_of_cim_disk(
smis_common, cim_disk.path,
property_list=['BlockSize', 'NumberOfBlocks'])
diff --git a/plugin/smispy/smis_pool.py b/plugin/smispy/smis_pool.py
index 6ef7dcc..cb06867 100644
--- a/plugin/smispy/smis_pool.py
+++ b/plugin/smispy/smis_pool.py
@@ -264,5 +264,5 @@ def pool_id_of_cim_vol(smis_common, cim_vol_path):
ErrorNumber.PLUGIN_BUG,
"pool_id_of_cim_vol(): Got unexpected count(%d) of cim_pool " %
len(cim_pools) +
- "assocated to cim_vol: %s, %s" % (cim_vol_path, cim_pools))
+ "associated to cim_vol: %s, %s" % (cim_vol_path, cim_pools))
return pool_id_of_cim_pool(cim_pools[0])
diff --git a/plugin/smispy/smis_sys.py b/plugin/smispy/smis_sys.py
index 6915eea..b3ebe60 100644
--- a/plugin/smispy/smis_sys.py
+++ b/plugin/smispy/smis_sys.py
@@ -22,7 +22,7 @@ from lsm import System, LsmError, ErrorNumber

def cim_sys_id_pros():
"""
- Return the property of CIM_ComputerSystem required to gernarate
+ Return the property of CIM_ComputerSystem required to generate
lsm.System.id
"""
return ['Name']
--
1.8.2.1
Loading...