Federico Simoncelli has uploaded a new change for review.

Change subject: supervdsm: remove unused lsblk module
......................................................................

supervdsm: remove unused lsblk module

Change-Id: I850637caab0a91c1e15ed2b1d0533d7f779f6621
Signed-off-by: Federico Simoncelli <[email protected]>
---
M configure.ac
M debian/vdsm.install
M lib/vdsm/constants.py.in
M tests/Makefile.am
D tests/lsblkTests.py
M vdsm.spec.in
M vdsm/Makefile.am
D vdsm/lsblk.py
M vdsm/supervdsmServer
9 files changed, 0 insertions(+), 104 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/12/30212/1

diff --git a/configure.ac b/configure.ac
index d741c1b..94e84d1 100644
--- a/configure.ac
+++ b/configure.ac
@@ -211,7 +211,6 @@
 AC_PATH_PROG([IP_PATH], [ip], [/sbin/ip])
 AC_PATH_PROG([ISCSIADM_PATH], [iscsiadm], [/sbin/iscsiadm])
 AC_PATH_PROG([KILL_PATH], [kill], [/bin/kill])
-AC_PATH_PROG([LSBLK_PATH], [lsblk], [/bin/lsblk])
 AC_PATH_PROG([LVM_PATH], [lvm], [/sbin/lvm])
 AC_PATH_PROG([MKFS_MSDOS_PATH], [mkfs.msdos], [/sbin/mkfs.msdos])
 AC_PATH_PROG([MKFS_PATH], [mkfs], [/sbin/mkfs])
diff --git a/debian/vdsm.install b/debian/vdsm.install
index 6336232..99ef62f 100644
--- a/debian/vdsm.install
+++ b/debian/vdsm.install
@@ -55,7 +55,6 @@
 ./usr/share/vdsm/kaxmlrpclib.py
 ./usr/share/vdsm/ksm.py
 ./usr/share/vdsm/logUtils.py
-./usr/share/vdsm/lsblk.py
 ./usr/share/vdsm/mk_sysprep_floppy
 ./usr/share/vdsm/mkimage.py
 ./usr/share/vdsm/momIF.py
diff --git a/lib/vdsm/constants.py.in b/lib/vdsm/constants.py.in
index 01c170a..ee379d6 100644
--- a/lib/vdsm/constants.py.in
+++ b/lib/vdsm/constants.py.in
@@ -122,7 +122,6 @@
 
 EXT_KILL = '@KILL_PATH@'
 
-EXT_LSBLK = '@LSBLK_PATH@'
 EXT_LVM = '@LVM_PATH@'
 
 EXT_MKFS = '@MKFS_PATH@'
diff --git a/tests/Makefile.am b/tests/Makefile.am
index e43e1c9..aa4a45e 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -44,7 +44,6 @@
        jsonRpcTests.py \
        ksmTests.py \
        libvirtconnectionTests.py \
-       lsblkTests.py \
        lvmTests.py \
        main.py \
        miscTests.py \
diff --git a/tests/lsblkTests.py b/tests/lsblkTests.py
deleted file mode 100644
index ff92b7e..0000000
--- a/tests/lsblkTests.py
+++ /dev/null
@@ -1,43 +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 lsblk
-
-from testlib import VdsmTestCase as TestCaseBase
-
-output = """\
-KNAME="sda" FSTYPE="" UUID=""
-KNAME="sda1" FSTYPE="ext4" UUID="12345678-0c05-1111-2222-1234567890d6"
-KNAME="sda2" FSTYPE="swap" UUID="12345678-1111-2222-3333-12345678903c"
-"""
-
-
-class TestLsblk(TestCaseBase):
-
-    def testParseLsBlk(self):
-        blkDict = lsblk._parseLsBlk(output.splitlines())
-        expected = {'sda': {'FSTYPE': '', 'KNAME': 'sda', 'UUID': ''},
-                    'sda1': {'FSTYPE': 'ext4',
-                             'KNAME': 'sda1',
-                             'UUID': '12345678-0c05-1111-2222-1234567890d6'},
-                    'sda2': {'FSTYPE': 'swap',
-                             'KNAME': 'sda2',
-                             'UUID': '12345678-1111-2222-3333-12345678903c'}}
-        self.assertEqual(expected, blkDict)
diff --git a/vdsm.spec.in b/vdsm.spec.in
index 03ec15e..bf5faa7 100644
--- a/vdsm.spec.in
+++ b/vdsm.spec.in
@@ -923,7 +923,6 @@
 %{_datadir}/%{vdsm_name}/API.py*
 %{_datadir}/%{vdsm_name}/hooking.py*
 %{_datadir}/%{vdsm_name}/hooks.py*
-%{_datadir}/%{vdsm_name}/lsblk.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 ab2f0cf..2afdd00 100644
--- a/vdsm/Makefile.am
+++ b/vdsm/Makefile.am
@@ -35,7 +35,6 @@
        kaxmlrpclib.py \
        ksm.py \
        logUtils.py \
-       lsblk.py \
        mkimage.py \
        momIF.py \
        numaUtils.py \
diff --git a/vdsm/lsblk.py b/vdsm/lsblk.py
deleted file mode 100644
index 92745ee..0000000
--- a/vdsm/lsblk.py
+++ /dev/null
@@ -1,50 +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 vdsm import utils
-from vdsm import constants
-
-
-class LsBlkException(Exception):
-    def __init__(self, rc):
-        self.rc = rc
-        self.message = 'lsblk execution failed with error code %s' % self.rc
-
-    def __str__(self):
-        return self.message
-
-
-def _parseLsBlk(out):
-    blkDict = {}
-    for l in out:
-        d = {}
-        for t in l.split():
-            k, v = t.split('=', 1)
-            d[k] = v[1:-1]
-        blkDict[d['KNAME']] = d
-    return blkDict
-
-
-def getLsBlk():
-    rc, out, err = utils.execCmd([constants.EXT_LSBLK, '--all', '--bytes',
-                                  '--pairs', '--output', 'KNAME,FSTYPE,UUID'])
-    if rc:
-        raise LsBlkException(rc)
-    return _parseLsBlk(out)
diff --git a/vdsm/supervdsmServer b/vdsm/supervdsmServer
index a59c378..aa58a13 100755
--- a/vdsm/supervdsmServer
+++ b/vdsm/supervdsmServer
@@ -55,7 +55,6 @@
 from vdsm.tool import restore_nets
 from parted_utils import getDevicePartedInfo as _getDevicePartedInfo
 
-from lsblk import getLsBlk as _getLsBlk
 from network import sourceroutethread
 from network.api import (addNetwork, delNetwork, editNetwork, setupNetworks,
                          setSafeNetworkConfig)
@@ -138,10 +137,6 @@
     @logDecorator
     def getDevicePartedInfo(self, *args, **kwargs):
         return _getDevicePartedInfo(*args, **kwargs)
-
-    @logDecorator
-    def getLsBlk(self, *args, **kwargs):
-        return _getLsBlk(*args, **kwargs)
 
     @logDecorator
     def readMultipathConf(self):


-- 
To view, visit http://gerrit.ovirt.org/30212
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I850637caab0a91c1e15ed2b1d0533d7f779f6621
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

Reply via email to