[PATCH] Cleanup some pylint failures in the network module

Radek Vykydal rvykydal at redhat.com
Mon Sep 23 13:29:31 UTC 2013


ACK, one note below.

On 09/20/2013 11:13 PM, Brian C. Lane wrote:
> From: "Brian C. Lane" <bcl at redhat.com>
>
> ---
>   pyanaconda/network.py | 8 ++++----
>   1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/pyanaconda/network.py b/pyanaconda/network.py
> index dcb6ee0..f2f28a9 100644
> --- a/pyanaconda/network.py
> +++ b/pyanaconda/network.py
> @@ -226,18 +226,18 @@ class IfcfgFile(SimpleConfigFile):
>           SimpleConfigFile.__init__(self, always_quote=True, filename=filename)
>           self._dirty = False
>   
> -    def read(self):
> +    def read(self, filename=None):
>           self.reset()
>           ifcfglog.debug("IfcfFile.read %s", self.filename)
>           SimpleConfigFile.read(self)
>           self._dirty = False
>   
> -    def write(self, filename=None):
> +    def write(self, filename=None, use_tmp=False):
>           if self._dirty or filename:
>               # ifcfg-rh is using inotify IN_CLOSE_WRITE event so we don't use
>               # temporary file for new configuration
>               ifcfglog.debug("IfcfgFile.write %s:\n%s", self.filename, self.__str__())
> -            SimpleConfigFile.write(self, filename, use_tmp=False)
> +            SimpleConfigFile.write(self, filename, use_tmp=use_tmp)
>               self._dirty = False
>   
>       def set(self, *args):
> @@ -582,7 +582,6 @@ def ifcfg_to_ksdata(ifcfg, devname):
>   def hostname_ksdata(hostname):
>       from pyanaconda.kickstart import AnacondaKSHandler
>       handler = AnacondaKSHandler()
> -    kwargs = {}
>       # pylint: disable-msg=E1101
>       return handler.NetworkData(hostname=hostname, bootProto="")
>   
> @@ -1047,6 +1046,7 @@ def status_message():
>               slaves = {}
>               ssids = {}
>               nonslaves = []
> +            devname = ""
>   
>               # first find slaves and wireless aps
>               for devname in active_devs:

I'd prefer the way below, but I'm going to change this part anyway
due to bz #1010519 and thanks to new NM 'Slaves' propertyso ack.

diff --git a/pyanaconda/network.py b/pyanaconda/network.py
index dcb6ee0..7c74a94 100644
--- a/pyanaconda/network.py
+++ b/pyanaconda/network.py
@@ -1062,6 +1062,7 @@ def status_message():
                      ssids[devname] = nm.nm_device_active_ssid(devname) 
or ""

              if len(nonslaves) == 1:
+                devname = nonslaves[0]
                  if nm.nm_device_type_is_ethernet(devname):
                      msg = _("Wired (%(interface_name)s) connected") \
                            % {"interface_name": devname}





More information about the anaconda-patches mailing list