[PATCH 2/2] Network spoke: add sanity check for hostname setting (#856456)

Chris Lumens clumens at redhat.com
Mon Dec 17 20:57:32 UTC 2012


>  class NetworkSpoke(NormalSpoke):
>      builderObjects = ["networkWindow", "liststore_wireless_network", "liststore_devices"]
> @@ -1062,6 +1064,19 @@ class NetworkSpoke(NormalSpoke):
>              update_hostname(self.data)
>              self.network_control_box.hostname = self.data.network.hostname
>  
> +    def on_back_clicked(self, button):
> +        hostname = self.network_control_box.hostname
> +        (valid, error) = sanityCheckHostname(hostname)
> +        if not valid:
> +            self.clear_info()
> +            msg = _("Hostname is not valid: %s" % error)

The substitution needs to be done outside of the translation marker,
like so:

    msg = _("Hostname is not valid: %s") % error

> @@ -1119,6 +1134,19 @@ class NetworkStandaloneSpoke(StandaloneSpoke):
>          StandaloneSpoke.refresh(self)
>          self.network_control_box.refresh()
>  
> +    def _on_continue_clicked(self, cb):
> +        hostname = self.network_control_box.hostname
> +        (valid, error) = sanityCheckHostname(hostname)
> +        if not valid:
> +            self.clear_info()
> +            msg = _("Hostname is not valid: %s" % error)

Same here.

- Chris


More information about the anaconda-patches mailing list