[Ovirt-devel] [PATCH node] Checks if storage is setup before setting the admin password. BZ#509339

Darryl L. Pierce dpierce at redhat.com
Wed Jun 3 17:56:28 UTC 2009


When the o-c-password script starts, it checks to see if there's a
Config logical volume. If there is not one, then it assumes local
storage is not configured and exits the script with a warning message.

Signed-off-by: Darryl L. Pierce <dpierce at redhat.com>
---
 scripts/ovirt-config-password |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/scripts/ovirt-config-password b/scripts/ovirt-config-password
index 7abfb3b..45b5d8c 100755
--- a/scripts/ovirt-config-password
+++ b/scripts/ovirt-config-password
@@ -8,6 +8,13 @@
 trap '__st=$?; stop_log; exit $__st' 0
 trap 'exit $?' 1 2 13 15
 
+warn() { printf '%s\n' "$*" >&2; }
+
+if [[ ! "Config" =~ $(lvdisplay -C | awk '{ print $1 }') ]]; then
+    warn "Local storage must be configured prior to setting the administrator password."
+    exit 99
+fi
+
 # Usage: set_sasl_password USER
 # Prompt(twice) for a password for the specified USER.
 # If they match, set that user's system password,
-- 
1.6.0.6




More information about the ovirt-devel mailing list