[blivet][master] Get rid of the has_lvm function

Martin Kolman mkolman at redhat.com
Wed Jan 21 14:57:39 UTC 2015


On Wed, 2015-01-21 at 14:49 +0100, Vratislav Podzimek wrote:
> It's only used in the tests and since blivet requires lvm tools to be installed
> I doubt any (user) code uses it.
> 
> Signed-off-by: Vratislav Podzimek <vpodzime at redhat.com>
> ---
>  blivet/devicelibs/lvm.py          | 8 --------
>  tests/devicelibs_test/lvm_test.py | 9 ---------
>  2 files changed, 17 deletions(-)
> 
> diff --git a/blivet/devicelibs/lvm.py b/blivet/devicelibs/lvm.py
> index 7e2dbef..290e64d 100644
> --- a/blivet/devicelibs/lvm.py
> +++ b/blivet/devicelibs/lvm.py
> @@ -50,14 +50,6 @@ ThPoolProfile = namedtuple("ThPoolProfile", ["name", "desc"])
>  KNOWN_THPOOL_PROFILES = (ThPoolProfile("thin-generic", N_("Generic")),
>                           ThPoolProfile("thin-performance", N_("Performance")))
>  
> -def has_lvm():
> -    if util.find_program_in_path("lvm"):
> -        for line in open("/proc/devices").readlines():
> -            if "device-mapper" in line.split():
> -                return True
> -
> -    return False
> -
>  # Start config_args handling code
>  #
>  # Theoretically we can handle all that can be handled with the LVM --config
> diff --git a/tests/devicelibs_test/lvm_test.py b/tests/devicelibs_test/lvm_test.py
> index 8f776b2..d88c451 100755
> --- a/tests/devicelibs_test/lvm_test.py
> +++ b/tests/devicelibs_test/lvm_test.py
> @@ -254,15 +254,6 @@ class LVMAsRootTestCase(LVMAsRootTestCaseBase):
>          self.assertEqual(lvm.lvs(vg_name="wrong-vg-name"), {})
>  
>          ##
> -        ## has_lvm
> -        ##
> -        # pass
> -        self.assertEqual(lvm.has_lvm(), True)
> -
> -        # fail
> -        # TODO
> -
> -        ##
>          ## lvremove
>          ##
>          # pass
Looks good to me, ACK!



More information about the anaconda-patches mailing list