diff --git a/.gitignore b/.gitignore index a16e43e..1cdb9a7 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -SOURCES/libstoragemgmt-1.2.3.tar.gz +SOURCES/libstoragemgmt-1.3.4.tar.gz diff --git a/.libstoragemgmt.metadata b/.libstoragemgmt.metadata index 391fdaf..99443bf 100644 --- a/.libstoragemgmt.metadata +++ b/.libstoragemgmt.metadata @@ -1 +1 @@ -1f765a49528d20e856ffc879e185b47a860bf896 SOURCES/libstoragemgmt-1.2.3.tar.gz +19efb8f05cc2607849fbfa43030dd2fc0c3fa176 SOURCES/libstoragemgmt-1.3.4.tar.gz diff --git a/SOURCES/libstoragemgmt-1.2.3-cmdline-exit-fix.patch b/SOURCES/libstoragemgmt-1.2.3-cmdline-exit-fix.patch deleted file mode 100644 index b366b79..0000000 --- a/SOURCES/libstoragemgmt-1.2.3-cmdline-exit-fix.patch +++ /dev/null @@ -1,68 +0,0 @@ -diff --git test/cmdtest.py test/cmdtest.py -index f687aee..7fa6599 100755 ---- test/cmdtest.py -+++ test/cmdtest.py -@@ -408,6 +408,13 @@ def display_check(display_list, system_id): - call([cmd, '-H', '-t' + sep, 'list', '--type', 'POOLS']) - - -+def test_exit_code(cap, system_id): -+ """ -+ Make sure we get the expected exit code when the command syntax is wrong -+ """ -+ call([cmd, '-u'], 2) -+ -+ - def test_display(cap, system_id): - """ - Crank through supported display operations making sure we get good -@@ -718,7 +725,7 @@ def pool_member_info_test(cap, system_id): - def volume_raid_create_test(cap, system_id): - if cap['VOLUME_RAID_CREATE']: - out = call( -- [cmd, '-t' + sep, 'volume-create-raid-cap', '--sys', system_id])[1] -+ [cmd, '-t' + sep, 'volume-raid-create-cap', '--sys', system_id])[1] - - if 'RAID1' not in [r[1] for r in parse(out)]: - return -@@ -737,7 +744,7 @@ def volume_raid_create_test(cap, system_id): - exit(10) - - out = call([ -- cmd, '-t' + sep, 'volume-create-raid', '--disk', free_disk_ids[0], -+ cmd, '-t' + sep, 'volume-raid-create', '--disk', free_disk_ids[0], - '--disk', free_disk_ids[1], '--name', 'test_volume_raid_create', - '--raid-type', 'raid1'])[1] - -@@ -770,6 +777,8 @@ def volume_raid_create_test(cap, system_id): - - - def run_all_tests(cap, system_id): -+ -+ test_exit_code(cap, system_id) - test_display(cap, system_id) - test_plugin_list(cap, system_id) - -diff --git tools/lsmcli/cmdline.py tools/lsmcli/cmdline.py -index 809b3bf..b2693e4 100644 ---- tools/lsmcli/cmdline.py -+++ tools/lsmcli/cmdline.py -@@ -64,10 +64,15 @@ def cmd_line_wrapper(c=None): - err_exit = 4 - except KeyboardInterrupt: - err_exit = 1 -+ except SystemExit as se: -+ # argparse raises a SystemExit -+ err_exit = se.code -+ except: -+ # We get *any* other exception don't return a successful error code -+ err_exit = 2 - finally: -- # We got here because of an exception, but we still may have a valid -- # connection to do an orderly shutdown with, lets try it before we -- # just exit closing the connection. -+ # Regardless of what happens, we will try to close the connection if -+ # possible to allow the plugin to clean up gracefully. - if cli: - try: - # This will exit if are successful diff --git a/SOURCES/libstoragemgmt-1.2.3-make-check-root.patch b/SOURCES/libstoragemgmt-1.2.3-make-check-root.patch deleted file mode 100644 index 3c3572f..0000000 --- a/SOURCES/libstoragemgmt-1.2.3-make-check-root.patch +++ /dev/null @@ -1,60 +0,0 @@ -diff --git test/runtests.sh test/runtests.sh -index f8d28f2..edd008d 100755 ---- test/runtests.sh -+++ 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 \;" diff --git a/SOURCES/libstoragemgmt-1.2.3-megaraid-fixes.patch b/SOURCES/libstoragemgmt-1.2.3-megaraid-fixes.patch deleted file mode 100644 index 03d4c3e..0000000 --- a/SOURCES/libstoragemgmt-1.2.3-megaraid-fixes.patch +++ /dev/null @@ -1,59 +0,0 @@ -diff --git plugin/megaraid/megaraid.py plugin/megaraid/megaraid.py -index d921c8e..3a41c78 100644 ---- plugin/megaraid/megaraid.py -+++ plugin/megaraid/megaraid.py -@@ -473,6 +473,8 @@ def pools(self, search_key=None, search_value=None, - dg_show_output = self._storcli_exec( - ["/c%d/dall" % ctrl_num, "show", "all"]) - free_space_list = dg_show_output.get('FREE SPACE DETAILS', []) -+ if 'TOPOLOGY' not in dg_show_output: -+ continue - for dg_top in dg_show_output['TOPOLOGY']: - if dg_top['Arr'] != '-': - continue -@@ -490,6 +492,9 @@ def _vd_to_lsm_vol(vd_id, dg_id, sys_id, vd_basic_info, vd_pd_info_list, - - vol_id = "%s:VD%d" % (sys_id, vd_id) - name = "VD %d" % vd_id -+ if 'Name' in vd_basic_info.keys() and vd_basic_info['Name']: -+ name += ": %s" % vd_basic_info['Name'] -+ - vpd83 = '' # TODO(Gris Ge): Beg LSI to provide this information. - block_size = size_human_2_size_bytes(vd_pd_info_list[0]['SeSz']) - num_of_blocks = vd_prop_info['Number of Blocks'] -@@ -700,19 +705,23 @@ def volume_raid_create(self, name, raid_type, disks, strip_size, - (cur_ctrl_num, cur_enclosure_num, slot_num) = \ - disk.plugin_data.split(':') - -- if ctrl_num and cur_ctrl_num != ctrl_num: -+ cur_ctrl_num = int(cur_ctrl_num) -+ cur_enclosure_num = int(cur_enclosure_num) -+ -+ if ctrl_num is not None and cur_ctrl_num != ctrl_num: - raise LsmError( - ErrorNumber.INVALID_ARGUMENT, - "Illegal input disks argument: disks are not from the " - "same controller/system.") - -- if enclosure_num and cur_enclosure_num != enclosure_num: -+ if enclosure_num is not None and \ -+ cur_enclosure_num != enclosure_num: - raise LsmError( - ErrorNumber.INVALID_ARGUMENT, - "Illegal input disks argument: disks are not from the " - "same disk enclosure.") - -- ctrl_num = int(cur_ctrl_num) -+ ctrl_num = cur_ctrl_num - enclosure_num = cur_enclosure_num - slot_nums.append(slot_num) - -@@ -722,7 +731,7 @@ def volume_raid_create(self, name, raid_type, disks, strip_size, - cmds = [ - "/c%s" % ctrl_num, "add", "vd", mega_raid_type, - 'size=all', "name=%s" % name, -- "drives=%s:%s" % (enclosure_num, ','.join(slot_nums))] -+ "drives=%d:%s" % (enclosure_num, ','.join(slot_nums))] - - if raid_type == Volume.RAID_TYPE_RAID10 or \ - raid_type == Volume.RAID_TYPE_RAID50 or \ diff --git a/SPECS/libstoragemgmt.spec b/SPECS/libstoragemgmt.spec index 2e67bab..d67e81b 100644 --- a/SPECS/libstoragemgmt.spec +++ b/SPECS/libstoragemgmt.spec @@ -1,6 +1,10 @@ +%ifnarch i686 x86_64 +%define skip_mem_check 1 +%endif + Name: libstoragemgmt -Version: 1.2.3 -Release: 4%{?dist} +Version: 1.3.4 +Release: 1%{?dist} Summary: Storage array management library Group: System Environment/Libraries License: LGPLv2+ @@ -15,15 +19,19 @@ BuildRequires: glib2-devel BuildRequires: systemd BuildRequires: bash-completion BuildRequires: libconfig-devel +BuildRequires: systemd-devel +BuildRequires: python-devel +BuildRequires: procps +BuildRequires: chrpath +%if 0%{?skip_mem_check} == 0 +BuildRequires: valgrind +%endif +BuildRequires: python-pyudev Requires: initscripts Requires(post): systemd Requires(preun): systemd Requires(postun): systemd -Patch0: libstoragemgmt-1.2.3-megaraid-fixes.patch -Patch1: libstoragemgmt-1.2.3-cmdline-exit-fix.patch -Patch2: libstoragemgmt-1.2.3-make-check-root.patch - %description The libStorageMgmt library will provide a vendor agnostic open source storage application programming interface (API) that will allow management of storage @@ -44,12 +52,21 @@ developing applications that use %{name}. Summary: Python client libraries and plug-in support for %{name} Group: System Environment/Libraries Requires: %{name} = %{version}-%{release} +Requires: %{name}-python-clibs BuildArch: noarch %description python The %{name}-python package contains python client libraries as well as python framework support and open source plug-ins written in python. +%package python-clibs +Summary: Python C extension module for %{name} +Group: System Environment/Libraries +Requires: %{name} = %{version}-%{release} + +%description python-clibs +The %{name}-python-clibs package contains python client C extension +libraries. %package smis-plugin Summary: Files for SMI-S generic array support for %{name} @@ -119,15 +136,16 @@ The %{name}-megaraid-plugin package contains the plugin for LSI MegaRAID storage management via storcli. %package hpsa-plugin -Summary: Files for HP SmartArray support for %{name} +Summary: Files for HPE SmartArray support for %{name} Group: System Environment/Libraries +Requires: python-pyudev Requires: %{name}-python = %{version}-%{release} Requires(post): %{name}-python = %{version}-%{release} Requires(postun): %{name}-python = %{version}-%{release} BuildArch: noarch %description hpsa-plugin -The %{name}-hpsa-plugin package contains the plugin for HP +The %{name}-hpsa-plugin package contains the plugin for HPE SmartArray storage management via hpssacli. %package udev @@ -141,16 +159,15 @@ uevents generated by the kernel. %prep %setup -q -%patch0 -p0 -b .megaraid-fixes.patch -%patch1 -p0 -b .cmdline-exit-fix.patch -%patch2 -p0 -b .make-check-root.patch - #Make sure you always have a build section, even when you don't #need it, see: https://bugzilla.redhat.com/show_bug.cgi?id=192422 %build #Tell the install program to preserve file date/timestamps -%configure --without-rest-api --disable-static +%configure --disable-static \ +%if 0%{?skip_mem_check} == 1 + --without-mem-leak-test +%endif V=1 make %{?_smp_mflags} @@ -319,6 +336,7 @@ fi %{python_sitelib}/lsm/_iplugin.* %{python_sitelib}/lsm/_pluginrunner.* %{python_sitelib}/lsm/_transport.* +%{python_sitelib}/lsm/_local_disk.* %{python_sitelib}/lsm/version.* %dir %{python_sitelib}/lsm/plugin %{python_sitelib}/lsm/plugin/__init__.* @@ -334,6 +352,10 @@ fi %config(noreplace) %{_sysconfdir}/lsm/pluginconf.d/sim.conf %{_mandir}/man1/sim_lsmplugin.1* +# Compiled C files for python library +%files python-clibs +%{python_sitelib}/lsm/_clib.* + %files smis-plugin %defattr(-,root,root,-) %dir %{python_sitelib}/lsm/plugin/smispy @@ -402,6 +424,30 @@ fi %{_mandir}/man1/hpsa_lsmplugin.1* %changelog +* Wed Aug 03 2016 Gris Ge 1.3.4-1 +- Upgrade to 1.3.4 + +* Wed Jul 13 2016 Gris Ge 1.3.2-7 +- Fix https://bugzilla.redhat.com/show_bug.cgi?id=1355637 + +* Wed Jun 22 2016 Gris Ge 1.3.2-6 +- Apply the forgotten patch6. + +* Wed Jun 22 2016 Gris Ge 1.3.2-5 +- Fix compile warning by removing unused static function _sd_name_of(). + +* Tue Jun 21 2016 Gris Ge 1.3.2-4 +- Fix https://bugzilla.redhat.com/show_bug.cgi?id=1348394 + +* Tue Jun 21 2016 Gris Ge 1.3.2-3 +- Fix https://bugzilla.redhat.com/show_bug.cgi?id=1346898 + +* Fri Jun 17 2016 Gris Ge 1.3.2-2 +- Fix https://bugzilla.redhat.com/show_bug.cgi?id=1346901 + +* Thu May 26 2016 Gris Ge 1.3.2-1 +- New upstream release 1.3.2 + * Tue Sep 8 2015 Tony Asleson 1.2.3-4 - Fix 'make check' when running as root https://bugzilla.redhat.com/show_bug.cgi?id=1260899 @@ -419,7 +465,7 @@ fi - Add build section back to get debug-infos * Wed Jun 24 2015 Tony Asleson 1.2.3-1 -- New upstream release +- New upstream release - New sub-pacakges: * libstoragemgmt-megaraid-plugin * libstoragemgmt-hpsa-plugin @@ -515,7 +561,7 @@ fi * Tue Jan 29 2013 Tony Asleson 0.0.16-1 - New upstream release -* Wed Oct 31 2012 Tony Asleson 0.0.14-1 +* Wed Oct 31 2012 Tony Asleson 0.0.14-1 - Initial RHEL Release - Removed conditional checks for fedora as RHEL7 uses systemd