[Freeipa-devel] [PATCH 0073] Remove support for IPA deployments with no persistent search

Tomas Babej tbabej at redhat.com
Thu Jul 11 15:10:58 UTC 2013


On Thursday 11 of July 2013 16:10:33 Ana Krivokapic wrote:
> On 07/11/2013 11:20 AM, Tomas Babej wrote:
> >          boolean_var = {}
> > -        for var in ('persistent_search', 'serial_autoincrement'):
> > +        for var in ('serial_autoincrement'):
> This won't work - a one element tuple needs a comma at the end:
> ('serial_autoincrement', )
> >              boolean_var[var] = "yes" if getattr(self, var, False) else "no"
> >  
> >          self.sub_dict = dict(FQDN=self.fqdn,
> > @@ -607,9 +604,8 @@ class BindInstance(service.Service):
> >                               SUFFIX=self.suffix,
> >                               OPTIONAL_NTP=optional_ntp,
> >                               ZONEMGR=self.zonemgr,
> > -                             ZONE_REFRESH=self.zone_refresh,
> >                               IPA_CA_RECORD=ipa_ca,
> > -                             PERSISTENT_SEARCH=boolean_var['persistent_search'],
> > +                             PERSISTENT_SEARCH="yes",
> >                               SERIAL_AUTOINCREMENT=boolean_var['serial_autoincrement'],)
> 
> But anyway, I think this piece of code is unnecessarily complicated, I don't see
> a need for the 'boolean_var' dict here. I would suggest replacing it with
> something like:
> 
> serial_autoincrement = "yes" if self.serial_autoincrement else "no"
> 
> and then pass serial_autoincrement to self.sub_dict = dict(...)
> 
> 

Attached patch refactored the relevant part of the code.

Tomas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/freeipa-devel/attachments/20130711/60cdc02b/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: freeipa-tbabej-0073-3-Remove-support-for-IPA-deployments-with-no-persisten.patch
Type: text/x-patch
Size: 12947 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/freeipa-devel/attachments/20130711/60cdc02b/attachment.bin>


More information about the Freeipa-devel mailing list