From 50bece6549e6a51b419961f460fea692eb650de4 Mon Sep 17 00:00:00 2001 From: Mike Hiretsky Date: Tue, 2 Aug 2011 10:57:59 +0400 Subject: [PATCH] Add function for refresh information in udev and about LVM. --- pym/cl_utils.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/pym/cl_utils.py b/pym/cl_utils.py index bea797c..11bf591 100644 --- a/pym/cl_utils.py +++ b/pym/cl_utils.py @@ -1301,3 +1301,21 @@ def getOsProberHash(getContentFunc=None): else: osProberHash = {} return osProberHash + +def refreshLVM(): + """Run command which refresh information about LVM""" + vgscan = getProgPath('/sbin/vgscan') + vgchange = getProgPath('/sbin/vgchange') + lvchange = getProgPath('/sbin/lvchange') + + if vgscan and vgchange and lvchange: + process(vgscan).success() + process(vgchange,'-ay','--refresh').success() + for group in getLvmGroups(): + process(lvchange,'-ay','--refresh',group).success() + +def refreshUdev(): + """Run command which refresh information about device in udev""" + udevadm = getProgPath('/sbin/udevadm') + if udevadm: + process(udevadm,"trigger","--subsystem-match","block").success()