[pykickstart][PATCH] Add --remove-service option for the firewall command (#957809)

Martin Kolman mkolman at redhat.com
Mon Oct 7 09:42:49 UTC 2013


On Fri, 2013-10-04 at 13:43 -0700, Brian C. Lane wrote:
> On Fri, Oct 04, 2013 at 06:07:04PM +0200, Martin Kolman wrote:
> > The --remove-service option makes it possible to remove services
> > that were enabled on the firewall.
> > 
> > Signed-off-by: Martin Kolman <mkolman at redhat.com>
> > ---
> >  pykickstart/commands/firewall.py | 42 ++++++++++++++++++++++++++++++++++++++++
> >  pykickstart/handlers/control.py  |  2 +-
> >  tests/commands/firewall.py       | 10 ++++++++++
> >  3 files changed, 53 insertions(+), 1 deletion(-)
> > 
> > diff --git a/pykickstart/commands/firewall.py b/pykickstart/commands/firewall.py
> > index 664bea6..1384d63 100644
> > --- a/pykickstart/commands/firewall.py
> > +++ b/pykickstart/commands/firewall.py
> > @@ -191,3 +191,45 @@ class F14_Firewall(F10_Firewall):
> >          op = F10_Firewall._getParser(self)
> >          op.remove_option("--telnet")
> >          return op
> > +
> > +class F20_Firewall(F14_Firewall):
> > +    removedKeywords = F14_Firewall.removedKeywords
> > +    removedAttrs = F14_Firewall.removedAttrs
> > +
> 
> 
> You also need an updated __init__ that sets the empty value for
> self.remove_services (see the F10_Firewall class).
Oh, right, thanks !
> 
> > +        # remove service
> > +        if "--remove-service" in self.optionList:
> > +            self.assert_parse("firewall --remove-service=mdns")  # remove only
> > +            # service & remove service at once
> > +            self.assert_parse("firewall --service=ssh --remove-service=mdns")
> > +            # with alternative service notation
> > +            self.assert_parse("firewall --ssh --smtp --ftp --remove-service=mdns")
> > +            # multiple remove & remove ssh
> > +            self.assert_parse("firewall --service=mdns --remove-service=dhcpv6-client --remove-service=ssh")
> > +
> 
> These are missing the result string, which is just the original with \n
> on the end.
OK, fixing both locally.
> 
> _______________________________________________
> anaconda-patches mailing list
> anaconda-patches at lists.fedorahosted.org
> https://lists.fedorahosted.org/mailman/listinfo/anaconda-patches




More information about the anaconda-patches mailing list