Gris Ge
2014-08-21 10:19:44 UTC
* Remove lsm.ErrorNumber.NO_MAPPING and LSM_ERR_NO_MAPPING.
* Change volume_unmask() to use NO_STATE_CHANGE in stead of NO_MAPPING.
Signed-off-by: Gris Ge <***@redhat.com>
---
c_binding/include/libstoragemgmt/libstoragemgmt_error.h | 1 -
c_binding/lsm_plugin_ipc.cpp | 2 +-
plugin/nstor/nstor.py | 6 +++---
plugin/sim/simarray.py | 4 +++-
plugin/simc/simc_lsmplugin.c | 2 +-
python_binding/lsm/_common.py | 1 -
6 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/c_binding/include/libstoragemgmt/libstoragemgmt_error.h b/c_binding/include/libstoragemgmt/libstoragemgmt_error.h
index fdb6ffa..d1c3cb7 100644
--- a/c_binding/include/libstoragemgmt/libstoragemgmt_error.h
+++ b/c_binding/include/libstoragemgmt/libstoragemgmt_error.h
@@ -62,7 +62,6 @@ typedef enum {
LSM_ERR_HOSTDOWN = 141, /**< Host unreachable on network */
LSM_ERR_NETWORK_ERROR = 142, /**< Generic network error */
- LSM_ERR_NO_MAPPING = 151, /**< There is no access for initiator and volume */
LSM_ERR_NO_MEMORY = 152, /**< Memory allocation failure */
LSM_ERR_NO_SUPPORT = 153, /**< Feature not supported */
diff --git a/c_binding/lsm_plugin_ipc.cpp b/c_binding/lsm_plugin_ipc.cpp
index fb002f9..34a8cdd 100644
--- a/c_binding/lsm_plugin_ipc.cpp
+++ b/c_binding/lsm_plugin_ipc.cpp
@@ -1477,7 +1477,7 @@ static int fs_delete(lsm_plugin_ptr p, Value ¶ms, Value &response)
}
lsm_fs_record_free(fs);
} else {
- rc = LSM_ERR_NO_MAPPING;
+ rc = LSM_ERR_NOT_FOUND_FS;
}
} else {
diff --git a/plugin/nstor/nstor.py b/plugin/nstor/nstor.py
index b23a452..3188962 100644
--- a/plugin/nstor/nstor.py
+++ b/plugin/nstor/nstor.py
@@ -668,9 +668,9 @@ class NexentaStor(INfs, IStorageAreaNetwork):
if view['host_group'] == access_group.name:
view_number = view['entry_number']
if view_number == -1:
- raise LsmError(ErrorNumber.NO_MAPPING, "There is no such mapping "
- "for volume %s" %
- volume.name)
+ raise LsmError(ErrorNumber.NO_STATE_CHANGE,
+ "There is no such mapping for volume %s" %
+ volume.name)
self._request("remove_lun_mapping_entry", "scsidisk",
[volume.name, view_number])
diff --git a/plugin/sim/simarray.py b/plugin/sim/simarray.py
index 9c22546..3e0c755 100644
--- a/plugin/sim/simarray.py
+++ b/plugin/sim/simarray.py
@@ -1210,7 +1210,9 @@ class SimData(object):
raise LsmError(ErrorNumber.NOT_FOUND_VOLUME,
"No such Volume: %s" % vol_id)
if 'mask' not in self.vol_dict[vol_id].keys():
- return None
+ raise LsmError(ErrorNumber.NO_STATE_CHANGE, "Volume not "
+ "masked to access "
+ "group")
if ag_id not in self.vol_dict[vol_id]['mask'].keys():
raise LsmError(ErrorNumber.NO_STATE_CHANGE, "Volume not "
diff --git a/plugin/simc/simc_lsmplugin.c b/plugin/simc/simc_lsmplugin.c
index 39255c8..53fd94b 100644
--- a/plugin/simc/simc_lsmplugin.c
+++ b/plugin/simc/simc_lsmplugin.c
@@ -1220,7 +1220,7 @@ static int volume_unmask(lsm_plugin_ptr c,
lsm_volume *volume,
lsm_flag flags)
{
- int rc = LSM_ERR_NO_MAPPING;
+ int rc = LSM_ERR_NO_STATE_CHANGE;
struct plugin_data *pd = (struct plugin_data*)lsm_private_data_get(c);
struct allocated_ag *find = (struct allocated_ag *)
diff --git a/python_binding/lsm/_common.py b/python_binding/lsm/_common.py
index 6cc928b..4aedbd1 100644
--- a/python_binding/lsm/_common.py
+++ b/python_binding/lsm/_common.py
@@ -440,7 +440,6 @@ class ErrorNumber(object):
NETWORK_HOSTDOWN = 141 # Host unreachable on network
NETWORK_ERROR = 142 # Generic network error
- NO_MAPPING = 151
NO_MEMORY = 152
NO_SUPPORT = 153
* Change volume_unmask() to use NO_STATE_CHANGE in stead of NO_MAPPING.
Signed-off-by: Gris Ge <***@redhat.com>
---
c_binding/include/libstoragemgmt/libstoragemgmt_error.h | 1 -
c_binding/lsm_plugin_ipc.cpp | 2 +-
plugin/nstor/nstor.py | 6 +++---
plugin/sim/simarray.py | 4 +++-
plugin/simc/simc_lsmplugin.c | 2 +-
python_binding/lsm/_common.py | 1 -
6 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/c_binding/include/libstoragemgmt/libstoragemgmt_error.h b/c_binding/include/libstoragemgmt/libstoragemgmt_error.h
index fdb6ffa..d1c3cb7 100644
--- a/c_binding/include/libstoragemgmt/libstoragemgmt_error.h
+++ b/c_binding/include/libstoragemgmt/libstoragemgmt_error.h
@@ -62,7 +62,6 @@ typedef enum {
LSM_ERR_HOSTDOWN = 141, /**< Host unreachable on network */
LSM_ERR_NETWORK_ERROR = 142, /**< Generic network error */
- LSM_ERR_NO_MAPPING = 151, /**< There is no access for initiator and volume */
LSM_ERR_NO_MEMORY = 152, /**< Memory allocation failure */
LSM_ERR_NO_SUPPORT = 153, /**< Feature not supported */
diff --git a/c_binding/lsm_plugin_ipc.cpp b/c_binding/lsm_plugin_ipc.cpp
index fb002f9..34a8cdd 100644
--- a/c_binding/lsm_plugin_ipc.cpp
+++ b/c_binding/lsm_plugin_ipc.cpp
@@ -1477,7 +1477,7 @@ static int fs_delete(lsm_plugin_ptr p, Value ¶ms, Value &response)
}
lsm_fs_record_free(fs);
} else {
- rc = LSM_ERR_NO_MAPPING;
+ rc = LSM_ERR_NOT_FOUND_FS;
}
} else {
diff --git a/plugin/nstor/nstor.py b/plugin/nstor/nstor.py
index b23a452..3188962 100644
--- a/plugin/nstor/nstor.py
+++ b/plugin/nstor/nstor.py
@@ -668,9 +668,9 @@ class NexentaStor(INfs, IStorageAreaNetwork):
if view['host_group'] == access_group.name:
view_number = view['entry_number']
if view_number == -1:
- raise LsmError(ErrorNumber.NO_MAPPING, "There is no such mapping "
- "for volume %s" %
- volume.name)
+ raise LsmError(ErrorNumber.NO_STATE_CHANGE,
+ "There is no such mapping for volume %s" %
+ volume.name)
self._request("remove_lun_mapping_entry", "scsidisk",
[volume.name, view_number])
diff --git a/plugin/sim/simarray.py b/plugin/sim/simarray.py
index 9c22546..3e0c755 100644
--- a/plugin/sim/simarray.py
+++ b/plugin/sim/simarray.py
@@ -1210,7 +1210,9 @@ class SimData(object):
raise LsmError(ErrorNumber.NOT_FOUND_VOLUME,
"No such Volume: %s" % vol_id)
if 'mask' not in self.vol_dict[vol_id].keys():
- return None
+ raise LsmError(ErrorNumber.NO_STATE_CHANGE, "Volume not "
+ "masked to access "
+ "group")
if ag_id not in self.vol_dict[vol_id]['mask'].keys():
raise LsmError(ErrorNumber.NO_STATE_CHANGE, "Volume not "
diff --git a/plugin/simc/simc_lsmplugin.c b/plugin/simc/simc_lsmplugin.c
index 39255c8..53fd94b 100644
--- a/plugin/simc/simc_lsmplugin.c
+++ b/plugin/simc/simc_lsmplugin.c
@@ -1220,7 +1220,7 @@ static int volume_unmask(lsm_plugin_ptr c,
lsm_volume *volume,
lsm_flag flags)
{
- int rc = LSM_ERR_NO_MAPPING;
+ int rc = LSM_ERR_NO_STATE_CHANGE;
struct plugin_data *pd = (struct plugin_data*)lsm_private_data_get(c);
struct allocated_ag *find = (struct allocated_ag *)
diff --git a/python_binding/lsm/_common.py b/python_binding/lsm/_common.py
index 6cc928b..4aedbd1 100644
--- a/python_binding/lsm/_common.py
+++ b/python_binding/lsm/_common.py
@@ -440,7 +440,6 @@ class ErrorNumber(object):
NETWORK_HOSTDOWN = 141 # Host unreachable on network
NETWORK_ERROR = 142 # Generic network error
- NO_MAPPING = 151
NO_MEMORY = 152
NO_SUPPORT = 153
--
2.1.0
2.1.0