[PATCH] Disable pylint errors on NetworkData in the new network_test.py.

Anne Mulhern amulhern at redhat.com
Mon May 19 15:01:18 UTC 2014





----- Original Message -----
> From: "Martin Kolman" <mkolman at redhat.com>
> To: "anaconda patch review" <anaconda-patches at lists.fedorahosted.org>
> Sent: Monday, May 19, 2014 10:31:11 AM
> Subject: Re: [PATCH] Disable pylint errors on NetworkData in the new	network_test.py.
> 
> On Mon, 2014-05-19 at 10:26 -0400, Chris Lumens wrote:
> > For whatever reason, pylint cannot figure out that AnacondaKSHandler does
> > in fact have a NetworkData member.  We are disabling this error message
> > in pyanaconda/network.py, so we need to do the same here.
> > ---
> >  tests/pyanaconda_tests/network_test.py | 5 +++++
> >  1 file changed, 5 insertions(+)
> > 
> > diff --git a/tests/pyanaconda_tests/network_test.py
> > b/tests/pyanaconda_tests/network_test.py
> > index f464c2b..7822a1f 100644
> > --- a/tests/pyanaconda_tests/network_test.py
> > +++ b/tests/pyanaconda_tests/network_test.py
> > @@ -164,6 +164,7 @@ class NetworkKSDataTests(unittest.TestCase):
> >          ksdata = self.ksdata_mock
> >  
> >          # network --hostname oldhostname
> > +        # pylint: disable=no-member
> >          nd = handler.NetworkData(hostname="oldhostname", bootProto="")
> >          ksdata.network.network = [nd]
> >          network.update_hostname_data(ksdata, "newhostname")
> > @@ -177,6 +178,7 @@ class NetworkKSDataTests(unittest.TestCase):
> >          self.assertEqual(ksdata.network.network[0].hostname,
> >          "newhostname")
> >  
> >          # network --bootproto dhcp --onboot no --device em1 --hostname
> >          oldhostname
> > +        # pylint: disable=no-member
> >          nd = handler.NetworkData(bootProto="dhcp", onboot="no",
> >          device="em1", hostname="oldhostname")
> >          ksdata.network.network = [nd]
> >          network.update_hostname_data(ksdata, "newhostname")
> > @@ -185,6 +187,7 @@ class NetworkKSDataTests(unittest.TestCase):
> >          self.assertEqual(len(ksdata.network.network), 1)
> >  
> >          # network --bootproto dhcp --onboot no --device em1
> > +        # pylint: disable=no-member
> >          nd = handler.NetworkData(bootProto="dhcp", onboot="no",
> >          device="em1")
> >          ksdata.network.network = [nd]
> >          network.update_hostname_data(ksdata, "newhostname")
> > @@ -195,7 +198,9 @@ class NetworkKSDataTests(unittest.TestCase):
> >  
> >          # network --bootproto dhcp --onboot no --device em1
> >          # network --hostname oldhostname
> > +        # pylint: disable=no-member
> >          nd1 = handler.NetworkData(bootProto="dhcp", onboot="no",
> >          device="em1")
> > +        # pylint: disable=no-member
> >          nd2 = handler.NetworkData(hostname="oldhostname", bootProto="")
> >          ksdata.network.network = [nd1, nd2]
> >          network.update_hostname_data(ksdata, "newhostname")
> ACK!
> 
> _______________________________________________
> anaconda-patches mailing list
> anaconda-patches at lists.fedorahosted.org
> https://lists.fedorahosted.org/mailman/listinfo/anaconda-patches
> 

Recall that the pragma disables no-member for all lines below it, not just the one immediately below it.

- mulhern


More information about the anaconda-patches mailing list