Federico Simoncelli has uploaded a new change for review. Change subject: supervdsm: remove unused md_utils module ......................................................................
supervdsm: remove unused md_utils module The method getMdDeviceUuidMap was added in commit b9b6ca2 without any explanation on why it's needed. I couldn't find any trace of this being ever used. Change-Id: I18b0406418249225dd6107d1f419f879868a019d Signed-off-by: Federico Simoncelli <[email protected]> --- M debian/vdsm.install M tests/Makefile.am D tests/md_utils_tests.py M vdsm.spec.in M vdsm/Makefile.am D vdsm/md_utils.py M vdsm/supervdsmServer 7 files changed, 0 insertions(+), 92 deletions(-) git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/23/29823/1 diff --git a/debian/vdsm.install b/debian/vdsm.install index d9d513d..ecc6564 100644 --- a/debian/vdsm.install +++ b/debian/vdsm.install @@ -56,7 +56,6 @@ ./usr/share/vdsm/ksm.py ./usr/share/vdsm/logUtils.py ./usr/share/vdsm/lsblk.py -./usr/share/vdsm/md_utils.py ./usr/share/vdsm/mk_sysprep_floppy ./usr/share/vdsm/mkimage.py ./usr/share/vdsm/momIF.py diff --git a/tests/Makefile.am b/tests/Makefile.am index 4ef8f7d..4b338e6 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -47,7 +47,6 @@ lsblkTests.py \ lvmTests.py \ main.py \ - md_utils_tests.py \ miscTests.py \ mkimageTests.py \ monkeypatchTests.py \ diff --git a/tests/md_utils_tests.py b/tests/md_utils_tests.py deleted file mode 100644 index bf02743..0000000 --- a/tests/md_utils_tests.py +++ /dev/null @@ -1,42 +0,0 @@ -# -# Copyright 2012 Red Hat, Inc. -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -# -# Refer to the README and COPYING files for full details of the license -# - -from testrunner import VdsmTestCase as TestCaseBase -import md_utils as mdutils - - -class MdUtilsTests(TestCaseBase): - def test_parseMdDeviceMap(self): - lines = ['md1 1.2 12345695:0b784539:a73e011c:c555adf3 /dev/md/1', - 'md0 1.2 123456e3:a89f1a62:e40e6a27:5f6bbca1 /dev/md/0', - 'md2 1.2 1234566d:9f136504:efb8e4be:12810206 /dev/md2'] - - devUuidMap = mdutils._parseMdDeviceMap(lines) - self.assertTrue(devUuidMap) - for dev, uuid in devUuidMap.iteritems(): - if dev in ['/dev/md1', '/dev/md/1']: - self.assertEquals(uuid, '12345695:0b784539:a73e011c:c555adf3') - elif dev in ['/dev/md0', '/dev/md/0']: - self.assertEquals(uuid, '123456e3:a89f1a62:e40e6a27:5f6bbca1') - elif dev == '/dev/md2': - self.assertEquals(uuid, '1234566d:9f136504:efb8e4be:12810206') - else: - self.assertIn(dev, ['/dev/md1', '/dev/md/1', '/dev/md0', - '/dev/md/0', '/dev/md2']) diff --git a/vdsm.spec.in b/vdsm.spec.in index 2b67962..65a9e08 100644 --- a/vdsm.spec.in +++ b/vdsm.spec.in @@ -924,7 +924,6 @@ %{_datadir}/%{vdsm_name}/hooking.py* %{_datadir}/%{vdsm_name}/hooks.py* %{_datadir}/%{vdsm_name}/lsblk.py* -%{_datadir}/%{vdsm_name}/md_utils.py* %{_datadir}/%{vdsm_name}/mk_sysprep_floppy %{_datadir}/%{vdsm_name}/parted_utils.py* %{_datadir}/%{vdsm_name}/mkimage.py* diff --git a/vdsm/Makefile.am b/vdsm/Makefile.am index 96deef2..ab2f0cf 100644 --- a/vdsm/Makefile.am +++ b/vdsm/Makefile.am @@ -36,7 +36,6 @@ ksm.py \ logUtils.py \ lsblk.py \ - md_utils.py \ mkimage.py \ momIF.py \ numaUtils.py \ diff --git a/vdsm/md_utils.py b/vdsm/md_utils.py deleted file mode 100644 index de8caed..0000000 --- a/vdsm/md_utils.py +++ /dev/null @@ -1,41 +0,0 @@ -# -# Copyright 2012 Red Hat, Inc. -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -# -# Refer to the README and COPYING files for full details of the license -# - -import os - - -def _parseMdDeviceMap(lines): - mdUuidMap = {} - for l in lines: - tokens = l.strip().split() - mdUuidMap[os.path.realpath(tokens[-1])] = tokens[-2] - return mdUuidMap - - -def getMdDeviceUuidMap(): - """ - returns all md/uuid map eg. - {'DEVICE': 'UUID', ...} - """ - try: - with open('/dev/md/md-device-map') as f: - return _parseMdDeviceMap(f.readlines()) - except IOError: - return {} diff --git a/vdsm/supervdsmServer b/vdsm/supervdsmServer index a63caa2..a59c378 100755 --- a/vdsm/supervdsmServer +++ b/vdsm/supervdsmServer @@ -54,7 +54,6 @@ from vdsm import utils from vdsm.tool import restore_nets from parted_utils import getDevicePartedInfo as _getDevicePartedInfo -from md_utils import getMdDeviceUuidMap as _getMdDeviceUuidMap from lsblk import getLsBlk as _getLsBlk from network import sourceroutethread @@ -139,10 +138,6 @@ @logDecorator def getDevicePartedInfo(self, *args, **kwargs): return _getDevicePartedInfo(*args, **kwargs) - - @logDecorator - def getMdDeviceUuidMap(self, *args, **kwargs): - return _getMdDeviceUuidMap(*args, **kwargs) @logDecorator def getLsBlk(self, *args, **kwargs): -- To view, visit http://gerrit.ovirt.org/29823 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I18b0406418249225dd6107d1f419f879868a019d Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Federico Simoncelli <[email protected]> _______________________________________________ vdsm-patches mailing list [email protected] https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
