Joey Boggs
2010-Feb-11 16:19 UTC
[Ovirt-devel] [PATCH node] remove ipv4 validation for ntp and rely on actual ntp verification
---
scripts/ovirt-config-networking | 13 ++++++-------
scripts/ovirt-functions | 16 ++++++++++++++++
2 files changed, 22 insertions(+), 7 deletions(-)
diff --git a/scripts/ovirt-config-networking b/scripts/ovirt-config-networking
index ec154c2..40a2d2c 100755
--- a/scripts/ovirt-config-networking
+++ b/scripts/ovirt-config-networking
@@ -414,12 +414,7 @@ function configure_ntp
read -ep "Enter an NTP server (hit return when finished): "
if [ -z "$REPLY" ]; then break; fi
-
- if is_valid_ipv4 $REPLY; then
- NTPSERVERS="${NTPSERVERS}:${REPLY}"
- else
- printf "${REPLY} is an invalid address.\n"
- fi
+ NTPSERVERS="${NTPSERVERS}:${REPLY}"
done
fi
fi
@@ -560,5 +555,9 @@ if [ "$net_configured" = 1 ]; then
ifconfig $i down
brctl delbr $i
done
- service network start
+ service network start 2> /dev/null
+ if [ $NTPSERVERS ]; then
+ log "Testing NTP Configuration"
+ test_ntp_configuration
+ fi
fi
diff --git a/scripts/ovirt-functions b/scripts/ovirt-functions
index 6435387..48d0e39 100644
--- a/scripts/ovirt-functions
+++ b/scripts/ovirt-functions
@@ -729,6 +729,22 @@ is_valid_ipv4 () {
return $result
}
+test_ntp_configuration () {
+ # stop ntpd service for testing
+ service ntpd stop > /dev/null 2>&1
+ SERVERS=$(echo $NTPSERVERS | awk 'BEGIN{FS=":"}{for (i=1;
i<=NF; i++) print $i}')
+ for server in $SERVERS; do
+ ntpdate $server > /dev/null 2>&1
+ result=$?
+ if [ $result -ne 0 ]; then
+ printf "\n Unable to verify NTP server: $server \n"
+ else
+ printf "\n Verified NTP server: $server \n"
+ fi
+ done
+
+}
+
# execute a function if called as a script, e.g.
# ovirt-functions ovirt_store_config /etc/hosts
--
1.6.6
Joey Boggs
2010-Feb-11 16:19 UTC
[Ovirt-devel] [PATCH node] update filtering of nics for ovirt-config-networking
This updates the filtering model to only display nics that have kernel modules
associated with them, which filters out all nonphysical devices.
---
scripts/ovirt-config-networking | 10 +++++++---
1 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/scripts/ovirt-config-networking b/scripts/ovirt-config-networking
index 40a2d2c..96e425f 100755
--- a/scripts/ovirt-config-networking
+++ b/scripts/ovirt-config-networking
@@ -455,7 +455,7 @@ function setup_menu
fi
# Add virtio NICs that were possibly not detected by hal
- NICS="$NICS $(ifconfig -a | awk '/Ethernet/ {print $1}' | grep
-v -E "^br|^bond|^vnet|^virbr|\." | xargs)"
+ NICS="$(ifconfig -a | awk '/Ethernet/ {print $1}'|xargs)"
NICS=$(echo $NICS | tr ' ' '\n' | sort -u | xargs)
PS3="Please select an interface or configuration option: "
@@ -481,6 +481,7 @@ else
printf "***** WARNING *****\n"
printf "\nPhysical Networking Devices (*=PXE boot
interface)\n"
printf " %-10s %-12s %-18s\n" "Name"
"Driver" "MAC"
+ PHY_NICS=""
for nic in $NICS; do
driver=$(basename $(readlink /sys/class/net/$nic/device/driver)
2>/dev/null)
mac=$(cat /sys/class/net/$nic/address)
@@ -489,14 +490,17 @@ else
else
pxe=" "
fi
- printf "%s%-10s %-12s %-18s\n" "$pxe"
"$nic" "$driver" "$mac"
+ if [ -n "$driver" ]; then
+ PHY_NICS="$PHY_NICS $nic"
+ printf "%s%-10s %-12s %-18s\n" "$pxe"
"$nic" "$driver" "$mac"
+ fi
done
DNS="DNS"
NTP="NTP"
Abort="Abort"
Save="Save And Return To Menu"
- select NIC in $NICS "$DNS" "$NTP"
"$Abort" "$Save"
+ select NIC in $PHY_NICS "$DNS" "$NTP"
"$Abort" "$Save"
do
printf "\n"
case "$NIC" in
--
1.6.6
Darryl L. Pierce
2010-Mar-03 20:23 UTC
[Ovirt-devel] [PATCH node] remove ipv4 validation for ntp and rely on actual ntp verification
On Thu, Feb 11, 2010 at 11:19:27AM -0500, Joey Boggs wrote:> --- > scripts/ovirt-config-networking | 13 ++++++------- > scripts/ovirt-functions | 16 ++++++++++++++++ > 2 files changed, 22 insertions(+), 7 deletions(-)ACK. -- Darryl L. Pierce, Sr. Software Engineer @ Red Hat, Inc. Delivering value year after year. Red Hat ranks #1 in value among software vendors. http://www.redhat.com/promo/vendor/ -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 198 bytes Desc: not available URL: <http://listman.redhat.com/archives/ovirt-devel/attachments/20100303/fe6e4345/attachment.sig>
Darryl L. Pierce
2010-Mar-03 20:35 UTC
[Ovirt-devel] [PATCH node] update filtering of nics for ovirt-config-networking
On Thu, Feb 11, 2010 at 11:19:28AM -0500, Joey Boggs wrote:> This updates the filtering model to only display nics that have kernel modules associated with them, which filters out all nonphysical devices. > --- > scripts/ovirt-config-networking | 10 +++++++--- > 1 files changed, 7 insertions(+), 3 deletions(-) > > diff --git a/scripts/ovirt-config-networking b/scripts/ovirt-config-networking > index 40a2d2c..96e425f 100755 > --- a/scripts/ovirt-config-networking > +++ b/scripts/ovirt-config-networking > @@ -455,7 +455,7 @@ function setup_menu > fi > > # Add virtio NICs that were possibly not detected by hal > - NICS="$NICS $(ifconfig -a | awk '/Ethernet/ {print $1}' | grep -v -E "^br|^bond|^vnet|^virbr|\." | xargs)" > + NICS="$(ifconfig -a | awk '/Ethernet/ {print $1}'|xargs)" > NICS=$(echo $NICS | tr ' ' '\n' | sort -u | xargs) > > PS3="Please select an interface or configuration option: " > @@ -481,6 +481,7 @@ else > printf "***** WARNING *****\n" > printf "\nPhysical Networking Devices (*=PXE boot interface)\n" > printf " %-10s %-12s %-18s\n" "Name" "Driver" "MAC" > + PHY_NICS="" > for nic in $NICS; do > driver=$(basename $(readlink /sys/class/net/$nic/device/driver) 2>/dev/null) > mac=$(cat /sys/class/net/$nic/address) > @@ -489,14 +490,17 @@ else > else > pxe=" " > fi > - printf "%s%-10s %-12s %-18s\n" "$pxe" "$nic" "$driver" "$mac" > + if [ -n "$driver" ]; then > + PHY_NICS="$PHY_NICS $nic" > + printf "%s%-10s %-12s %-18s\n" "$pxe" "$nic" "$driver" "$mac" > + fi > done > > DNS="DNS" > NTP="NTP" > Abort="Abort" > Save="Save And Return To Menu" > - select NIC in $NICS "$DNS" "$NTP" "$Abort" "$Save" > + select NIC in $PHY_NICS "$DNS" "$NTP" "$Abort" "$Save" > do > printf "\n" > case "$NIC" in > -- > 1.6.6 > > _______________________________________________ > Ovirt-devel mailing list > Ovirt-devel at redhat.com > https://www.redhat.com/mailman/listinfo/ovirt-develACK. -- Darryl L. Pierce, Sr. Software Engineer @ Red Hat, Inc. Delivering value year after year. Red Hat ranks #1 in value among software vendors. http://www.redhat.com/promo/vendor/ -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 198 bytes Desc: not available URL: <http://listman.redhat.com/archives/ovirt-devel/attachments/20100303/e9ac5088/attachment.sig>