[node-patches] Change in ovirt-node[master]: add check_existing_hostvg check to auto installation

jboggs at redhat.com jboggs at redhat.com
Thu Dec 20 21:23:29 UTC 2012


Joey Boggs has uploaded a new change for review.

Change subject: add check_existing_hostvg check to auto installation
......................................................................

add check_existing_hostvg check to auto installation

rhbz#889198

Change-Id: I10d266949902c68597484594b5421e610af0838e
Signed-off-by: Joey Boggs <jboggs at redhat.com>
---
M scripts/ovirtnode/ovirtfunctions.py
M scripts/ovirtnode/storage.py
2 files changed, 10 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-node refs/changes/91/10291/1

diff --git a/scripts/ovirtnode/ovirtfunctions.py b/scripts/ovirtnode/ovirtfunctions.py
index 0274330..4978065 100644
--- a/scripts/ovirtnode/ovirtfunctions.py
+++ b/scripts/ovirtnode/ovirtfunctions.py
@@ -1139,11 +1139,13 @@
             dm = "/dev/mapper/" + dm
             return dm
 
-def check_existing_hostvg(install_dev):
+def check_existing_hostvg(install_dev, vg_name=None):
+    if vg_name == None:
+        vg_name = "HostVG"
     if install_dev is "":
-        devices_cmd = "pvs --separator=\":\" -o pv_name,vg_name --noheadings 2>/dev/null| grep HostVG |awk -F \":\" {'print $1'}"
+        devices_cmd = "pvs --separator=\":\" -o pv_name,vg_name --noheadings 2>/dev/null| grep %s |awk -F \":\" {'print $1'}" % vg_name
     else:
-        devices_cmd="pvs --separator=: -o pv_name,vg_name --noheadings 2>/dev/null| grep -v '%s' | grep HostVG | awk -F: {'print $1'}" % install_dev
+        devices_cmd="pvs --separator=: -o pv_name,vg_name --noheadings 2>/dev/null| grep -v '%s' | grep %s | awk -F: {'print $1'}" % (install_dev, vg_name)
     devices_cmd = subprocess_closefds(devices_cmd, shell=True, stdout=PIPE, stderr=STDOUT)
     devices = devices_cmd.stdout.read().strip()
     if len(devices) > 0:
@@ -1151,7 +1153,7 @@
         for device in devices.split(":"):
             logger.error(device)
         logger.error("The installation cannot proceed until the device is removed")
-        logger.error("from the system of the HostVG volume group is removed")
+        logger.error("from the system of the %s volume group is removed" % vg_name)
         return devices
     else:
         return False
diff --git a/scripts/ovirtnode/storage.py b/scripts/ovirtnode/storage.py
index ee4c401..834195e 100644
--- a/scripts/ovirtnode/storage.py
+++ b/scripts/ovirtnode/storage.py
@@ -991,6 +991,10 @@
     if not _functions.OVIRT_VARS["OVIRT_INIT"] == "":
         #force root install variable for autoinstalls
         _functions.OVIRT_VARS["OVIRT_ROOT_INSTALL"] = "y"
+        if check_existing_hostvg("") or check_existing_hostvg("","AppVG"):
+            logger.error("HostVG/AppVG exists on a separate disk")
+            logger.error("Manual Intervention required")
+            return False
         if storage.perform_partitioning():
             return True
     else:


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I10d266949902c68597484594b5421e610af0838e
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-node
Gerrit-Branch: master
Gerrit-Owner: Joey Boggs <jboggs at redhat.com>



More information about the node-patches mailing list