[node-patches] Change in ovirt-node[master]: setup: move nic identify to details and and replace with pin...
jboggs at redhat.com
jboggs at redhat.com
Sun Oct 7 04:23:20 UTC 2012
Joey Boggs has uploaded a new change for review.
Change subject: setup: move nic identify to details and and replace with ping test on network page
......................................................................
setup: move nic identify to details and and replace with ping test on network page
Change-Id: If7748f68acf4217b7d4d88559523d058e388ae9c
Signed-off-by: Joey Boggs <jboggs at redhat.com>
---
M scripts/ovirt-config-setup.py
1 file changed, 27 insertions(+), 2 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/ovirt-node refs/changes/89/8389/1
diff --git a/scripts/ovirt-config-setup.py b/scripts/ovirt-config-setup.py
index a06b495..4e9e141 100755
--- a/scripts/ovirt-config-setup.py
+++ b/scripts/ovirt-config-setup.py
@@ -42,6 +42,7 @@
CANCEL_BUTTON = "Cancel"
APPLY_BUTTON = "Apply"
IDENTIFY_BUTTON = "Identify NIC"
+PING_BUTTON = "Ping Test"
LOCK_BUTTON = "Lock"
RESTART_BUTTON = "Restart"
POWER_OFF_BUTTON = "Power Off"
@@ -130,6 +131,7 @@
self.net_apply_config = 0
self._plugins_enabled = False
self._plugins_pagenum = 0
+ self._ping_test = False
def _set_title(self):
@@ -1881,6 +1883,9 @@
buttons = []
plugin_page = False
if self.__current_page == NETWORK_PAGE:
+ buttons.append(["Ping Test",
+ PING_BUTTON])
+ if self.__current_page == NETWORK_DETAILS_PAGE:
buttons.append(["Flash Lights to Identify",
IDENTIFY_BUTTON])
if self.__current_page != STATUS_PAGE \
@@ -1942,6 +1947,20 @@
if pressed == IDENTIFY_BUTTON:
system_closefds("ethtool -p " + self.nic_lb.current() +
" 10")
+ elif pressed == PING_BUTTON:
+ self._ping_test = True
+ ping_window = EntryWindow(self.screen, 'Network Ping Test', 'Enter Host to Ping', ['Host:'])
+ res = ping_window[1]
+ host = res[0]
+ if len(host) > 0:
+ cmd = "ping -c 3 %s" % host
+ gridform = GridForm(self.screen, "", 1, 1)
+ gridform.add(Label("Performing Ping Test"), 0, 0)
+ gridform.draw()
+ self.screen.refresh()
+ proc = passthrough(cmd, log_func=logger.debug)
+ ButtonChoiceWindow(self.screen, "Ping Test Results",
+ proc.stdout, buttons=["OK"], width = 60)
elif pressed == APPLY_BUTTON or pressed == UNLOCK_BUTTON:
errors = []
self.process_config()
@@ -2005,8 +2024,12 @@
if self.is_same_network_config(
self.original_system_network_config,
current_network_config):
- self.__current_page = (
- NETWORK_DETAILS_PAGE)
+ if self._ping_test:
+ self._ping_test = False
+ self.__current_page = (NETWORK_PAGE)
+ else:
+ self.__current_page = (
+ NETWORK_DETAILS_PAGE)
else:
warn = None
self._create_warn_screen()
@@ -2033,6 +2056,8 @@
elif self.__current_page == NETWORK_DETAILS_PAGE:
if pressed == BACK_BUTTON:
self.__current_page = NETWORK_PAGE
+ elif pressed == IDENTIFY_BUTTON:
+ self.__current_page = NETWORK_DETAILS_PAGE
elif self.net_apply_config == 1:
self.__current_page = NETWORK_PAGE
elif self.__nic_config_failed == 1:
--
To view, visit http://gerrit.ovirt.org/8389
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: If7748f68acf4217b7d4d88559523d058e388ae9c
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