Darryl L. Pierce
2009-Jan-07 21:50 UTC
[Ovirt-devel] [PATCH node] Fix o-c-networking to only show physical networking devices.
Only those devices which have a physical layer are presented for configuration. Signed-off-by: Darryl L. Pierce <dpierce at redhat.com> --- scripts/ovirt-config-networking | 11 ++++++++++- 1 files changed, 10 insertions(+), 1 deletions(-) diff --git a/scripts/ovirt-config-networking b/scripts/ovirt-config-networking index 6609d0a..c322868 100755 --- a/scripts/ovirt-config-networking +++ b/scripts/ovirt-config-networking @@ -153,7 +153,16 @@ function configure_interface function setup_menu { - NICS=$(hal-device | awk '/net.interface/ {match($0, "= '"'"'(.*)'"'"' ", nic); printf("%s ", nic[1]); }') + udi_list=$(hal-device | awk '/net.interface/ {match($0, "= '"'"'(.*)'"'"' ", nic); printf("%s ", nic[1]); }') + udi_list=$(hal-find-by-capability --capability net.80203 && hal-find-by-capability --capability net.80211) + if [ -z "$udi_list" ]; then + warn "ERROR: no usable network devices were found" + exit 1 + fi + + NICS="" + for d in $udi_list; do NICS="$NICS $(hal-get-property --udi "$d" --key net.interface)"; done + NICS="$NICS Save Quit" PS3="Please select a network interface to configure: " } -- 1.6.0.6
Darryl L. Pierce
2009-Jan-07 21:55 UTC
[Ovirt-devel] [PATCH node] Fix o-c-networking to only show physical networking devices.
NOTE: This patch supercedes the previous one which had a line of code in it that, while not affecting functionality, didn't need to be there. Only those devices which have a physical layer are presented for configuration. Signed-off-by: Darryl L. Pierce <dpierce at redhat.com> --- scripts/ovirt-config-networking | 10 +++++++++- 1 files changed, 9 insertions(+), 1 deletions(-) diff --git a/scripts/ovirt-config-networking b/scripts/ovirt-config-networking index 6609d0a..8b8879e 100755 --- a/scripts/ovirt-config-networking +++ b/scripts/ovirt-config-networking @@ -153,7 +153,15 @@ function configure_interface function setup_menu { - NICS=$(hal-device | awk '/net.interface/ {match($0, "= '"'"'(.*)'"'"' ", nic); printf("%s ", nic[1]); }') + udi_list=$(hal-find-by-capability --capability net.80203 && hal-find-by-capability --capability net.80211) + if [ -z "$udi_list" ]; then + warn "ERROR: no usable network devices were found" + exit 1 + fi + + NICS="" + for d in $udi_list; do NICS="$NICS $(hal-get-property --udi "$d" --key net.interface)"; done + NICS="$NICS Save Quit" PS3="Please select a network interface to configure: " } -- 1.6.0.6
Darryl L. Pierce
2009-Jan-07 22:01 UTC
[Ovirt-devel] [PATCH node] Fix o-c-networking to only show physical networking devices.
NOTE: Removed the 802.11 iface portion. Now only wired NICs are reported. Only those devices which have a physical layer are presented for configuration. Signed-off-by: Darryl L. Pierce <dpierce at redhat.com> --- scripts/ovirt-config-networking | 10 +++++++++- 1 files changed, 9 insertions(+), 1 deletions(-) diff --git a/scripts/ovirt-config-networking b/scripts/ovirt-config-networking index 6609d0a..52af071 100755 --- a/scripts/ovirt-config-networking +++ b/scripts/ovirt-config-networking @@ -153,7 +153,15 @@ function configure_interface function setup_menu { - NICS=$(hal-device | awk '/net.interface/ {match($0, "= '"'"'(.*)'"'"' ", nic); printf("%s ", nic[1]); }') + udi_list=$(hal-find-by-capability --capability net.80203) + if [ -z "$udi_list" ]; then + warn "ERROR: no usable network devices were found" + exit 1 + fi + + NICS="" + for d in $udi_list; do NICS="$NICS $(hal-get-property --udi "$d" --key net.interface)"; done + NICS="$NICS Save Quit" PS3="Please select a network interface to configure: " } -- 1.6.0.6