[PATCH 00/11] Add system firmware version support.
by Gris Ge
Python part:
* Add new optional argument for System.__init__().
C part:
* Plugin: lsm_system_fw_version_set()
* Client: lsm_system_fw_version_get()
Misc:
* Increase version in configure.ac to 1.3.
* Fix runtest.sh compatible issue with lsmenv.
* Included license of Joe@HP Enterprise.
Please comment on:
https://github.com/libstorage/libstoragemgmt/pull/56/
Gris Ge (11):
Autotool: Mark current code base as version 1.3
C API: New method -- lsm_system_fw_version_get()
Python API: Add new property -- lsm.System.fw_version
lsmcli: Include Firmware version in system listing.
make check: Fix when running with lsmenv.
Test: Add test case for system firmware version.
Simulator Plugin: Add system firmware version support.
Simulator C Plugin: Add system firmware support.
HP SmartArray Plugin: Add system firmware version support.
MegaRAID Plugin: Add system firmware version support.
Add Joe Handzik in author list.
AUTHORS | 1 +
.../libstoragemgmt/libstoragemgmt_capabilities.h | 7 +++-
.../libstoragemgmt/libstoragemgmt_plug_interface.h | 20 +++++++--
.../libstoragemgmt/libstoragemgmt_systems.h | 15 ++++++-
c_binding/lsm_convert.cpp | 21 +++++++++-
c_binding/lsm_datatypes.cpp | 48 +++++++++++++++++++++-
c_binding/lsm_datatypes.hpp | 6 ++-
configure.ac | 4 +-
plugin/hpsa/hpsa.py | 8 +++-
plugin/megaraid/megaraid.py | 14 ++++---
plugin/sim/simarray.py | 2 +-
plugin/sim/simulator.py | 2 +-
plugin/simc/simc_lsmplugin.c | 3 +-
python_binding/lsm/_data.py | 20 ++++++++-
test/plugin_test.py | 15 ++++++-
test/runtests.sh | 7 ++--
test/tester.c | 35 +++++++++++++++-
tools/lsmcli/cmdline.py | 2 +-
tools/lsmcli/data_display.py | 10 ++++-
19 files changed, 211 insertions(+), 29 deletions(-)
--
1.8.3.1
8 years, 6 months
[PATCH] Fix "make check" when running as root.
by Gris Ge
Problem:
"make check" will fail when run it as root with libstoragemgmt user
account exists.
Root cause:
lsmd found libstoragemgmt user and drop privilege to that user.
But the plugin codes are in /root folder where libstoragemgmt user
has no access, which then lead to failure.
Fix:
Copy python modules to /tmp/<random>/python folder as we did to
C lib file.
Signed-off-by: Gris Ge <fge(a)redhat.com>
---
test/runtests.sh | 29 ++++++++++++++++++++---------
1 file changed, 20 insertions(+), 9 deletions(-)
diff --git a/test/runtests.sh b/test/runtests.sh
index f8d28f2..edd008d 100755
--- a/test/runtests.sh
+++ b/test/runtests.sh
@@ -36,7 +36,7 @@ LSMD_TMP_LOG_FILE="$base/lsmd.log"
cleanup() {
#Clean up the daemon if it is running
- if [ $LSMD_PID -ne 65535 ]
+ if [ "CHK$LSMD_PID" != "CHK" ] && [ "CHK$LSMD_PID" != "CHK65535" ]
then
kill -s KILL $LSMD_PID
fi
@@ -106,7 +106,7 @@ fi
plugins=$base/plugins
#Export needed vars
-export PYTHONPATH=$lsm_py_folder
+export PYTHONPATH=$base/python
export LD_LIBRARY_PATH=$base/lib
export LSM_SIM_DATA="$base/lsm_sim_data"
@@ -118,19 +118,30 @@ echo "c_unit= $c_unit"
good "mkdir -p $LSM_UDS_PATH"
good "mkdir -p $plugins"
good "mkdir -p $LD_LIBRARY_PATH"
+good "mkdir -p $PYTHONPATH"
+
+good "chmod 777 $base"
+good "chmod 777 $LSM_UDS_PATH"
+good "chmod 777 $plugins"
+good "chmod 777 $LD_LIBRARY_PATH"
+good "chmod 777 $PYTHONPATH"
#Copy shared libraries
good "cp $shared_libs/*.so.* $LD_LIBRARY_PATH"
-#Link plugin folder as python/lsm/plugin folder
-if [ ! -L "$lsm_py_folder/lsm/plugin" ];then
- good "ln -s $lsm_plugin_py_folder $lsm_py_folder/lsm/"
+# Copy python modules as libstoragemgmt user might not able to access
+# code in other path. This is common when compile as root with libstoragemgmt
+# user account exists.
+good "cp -av $lsm_py_folder/lsm $PYTHONPATH/"
+# In case the plugin and lsmcli link also copyed.
+if [ -e "$PYTHONPATH/lsm/plugin" ];then
+ good "rm $PYTHONPATH/lsm/plugin"
fi
-
-#Link lsmcli folder as python/lsm/lsmcli folder
-if [ ! -L "$lsm_py_folder/lsm/lsmcli" ];then
- good "ln -s $lsmcli_py_folder $lsm_py_folder/lsm/"
+good "cp -av $lsm_plugin_py_folder $PYTHONPATH/lsm/"
+if [ -e "$PYTHONPATH/lsm/lsmcli" ];then
+ good "rm $PYTHONPATH/lsm/lsmcli"
fi
+good "cp -av $lsmcli_py_folder $PYTHONPATH/lsm/"
#Copy plugins to one directory.
good "find $rootdir/ \( ! -regex '.*/\..*' \) -type f -name \*_lsmplugin -exec cp {} $plugins \;"
--
1.8.3.1
8 years, 7 months
[PATCH] ONTAP Plugin: Handle NOT_FOUND_VOLUME error in volume_raid_info().
by Gris Ge
* Run the volume/LUN existence check before checking RAID information.
Signed-off-by: Gris Ge <fge(a)redhat.com>
---
plugin/ontap/ontap.py | 3 +++
1 file changed, 3 insertions(+)
diff --git a/plugin/ontap/ontap.py b/plugin/ontap/ontap.py
index 107f295..4ffad56 100644
--- a/plugin/ontap/ontap.py
+++ b/plugin/ontap/ontap.py
@@ -1306,6 +1306,9 @@ def _raid_type_of_na_aggr(na_aggr):
@handle_ontap_errors
def volume_raid_info(self, volume, flags=0):
+ # Check existance of LUN
+ self.f.luns_get_specific(None, na_lun_name=volume.id);
+
na_vol_name = Ontap._get_volume_from_path(volume.pool_id)
na_vol = self.f.volumes(volume_name=na_vol_name)
if len(na_vol) == 0:
--
1.8.3.1
8 years, 7 months