[PATCH master] Network spoke: use correct state value to display device status.

Vratislav Podzimek vpodzime at redhat.com
Wed Jan 9 16:54:17 UTC 2013


On Wed, 2013-01-09 at 14:27 +0100, Radek Vykydal wrote:
> Use state returned by signal, not current state.
> Prevents "Status unknown (missing)" in
> NM_DEVICE_STATE_SECONDARIES state.
> ---
>  pyanaconda/ui/gui/spokes/network.py | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/pyanaconda/ui/gui/spokes/network.py b/pyanaconda/ui/gui/spokes/network.py
> index 01459c3..e8f2b94 100644
> --- a/pyanaconda/ui/gui/spokes/network.py
> +++ b/pyanaconda/ui/gui/spokes/network.py
> @@ -88,10 +88,9 @@ DEVICES_COLUMN_TITLE  = 2
>  DEVICES_COLUMN_OBJECT = 3
>  
> 
> -def localized_string_of_device_state(device):
> +def localized_string_of_device_state(device, state):
>      str = _("Status unknown (missing)")
>  
> -    state = device.get_state()
>      if state == NetworkManager.DeviceState.UNKNOWN:
>          str = _("Status unknown")
>      elif state == NetworkManager.DeviceState.UNMANAGED:
> @@ -787,7 +786,7 @@ class NetworkControlBox(object):
>          if state is None:
>              state = device.get_state()
>          self.builder.get_object("label_%s_status" % dev_type_str).set_label(
> -            localized_string_of_device_state(device))
> +            localized_string_of_device_state(device, state))
>  
>          switch = self.builder.get_object("device_%s_off_switch" % dev_type_str)
>          if dev_type_str == "wired":
Looks good to me.

-- 
Vratislav Podzimek

Anaconda Rider | Red Hat, Inc. | Brno - Czech Republic



More information about the anaconda-patches mailing list