Re: [Freeipa-devel] [PATCH 0538-0540] DNS locations: epilogue
On 28.06.2016 15:22, Petr Spacek wrote: On 27.6.2016 11:43, Martin Basti wrote: On 27.06.2016 10:56, Petr Spacek wrote: On 24.6.2016 12:25, Martin Basti wrote: On 23.06.2016 18:26, Petr Spacek wrote: On 23.6.2016 16:38, Martin Basti wrote: Patches attached. https://fedorahosted.org/freeipa/ticket/2008 freeipa-mbasti-0538-Revert-DNS-Locations-do-not-generate-location-record.patch From 28499422115cbfbb343033511319c7c8710e1ff5 Mon Sep 17 00:00:00 2001 From: Martin BastiDate: Tue, 21 Jun 2016 18:04:13 +0200 Subject: [PATCH 1/4] Revert "DNS Locations: do not generate location records for unused locations" This reverts commit bbf8227e3fd678d4bd6659a12055ba3dbe1c8230. After deeper investigation, we found out that empty locations are needed for clients, because clients may have cached records for longer time for that particular location. Only way how to remove location is to remove it using location-del https://fedorahosted.org/freeipa/ticket/2008 --- ipaserver/dns_data_management.py | 11 --- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/ipaserver/dns_data_management.py b/ipaserver/dns_data_management.py index a9e9c0a3856961b5494c8d3ca30ddb2e4aa5c523..eac2e7d1a5618ea92372bd81b7d12752791ef117 100644 --- a/ipaserver/dns_data_management.py +++ b/ipaserver/dns_data_management.py @@ -68,7 +68,6 @@ class IPASystemRecords(object): self.api_instance = api_instance self.domain_abs = DNSName(self.api_instance.env.domain).make_absolute() self.servers_data = {} -self.used_locations = set() self.__init_data() def reload_data(self): @@ -92,7 +91,6 @@ class IPASystemRecords(object): def __init_data(self): self.servers_data = {} -self.used_locations = set() servers_result = self.api_instance.Command.server_find( pkey_only=True)['result'] @@ -104,8 +102,6 @@ class IPASystemRecords(object): 'location': location, 'roles': roles, } -if location: -self.used_locations.add(location) def __add_srv_records( self, zone_obj, hostname, rname_port_map, @@ -353,12 +349,13 @@ class IPASystemRecords(object): pkey_only=True)['result'] servers = [s['cn'][0] for s in servers_result] -# generate only records for used location, records for unassigned -# locations are useless +locations_result = self.api_instance.Command.location_find()['result'] +locations = [l['idnsname'][0] for l in locations_result] + for server in servers: self._get_location_dns_records_for_server( zone_obj, server, -self.used_locations, roles=roles, +locations, roles=roles, include_master_role=include_master_role) return zone_obj -- 2.5.5 freeipa-mbasti-0539-DNS-Locations-hide-option-no-msdcs-in-adtrust-instal.patch From 37cae4f05cd3c0a2c4de037402938a5437dbc072 Mon Sep 17 00:00:00 2001 From: Martin Basti Date: Tue, 21 Jun 2016 18:17:55 +0200 Subject: [PATCH 2/4] DNS Locations: hide option --no-msdcs in adtrust-install Since DNS location mechanism is active, this option has no effect, because records are generate dynamically. https://fedorahosted.org/freeipa/ticket/2008 --- install/tools/ipa-adtrust-install| 10 +++--- ipaserver/install/adtrustinstance.py | 21 - 2 files changed, 15 insertions(+), 16 deletions(-) diff --git a/install/tools/ipa-adtrust-install b/install/tools/ipa-adtrust-install index 5babcdb7cb169e4a944acca55739064e0464d41e..5ba72a65d00ca683239a4ff3c5e7cfdc62c0bb6c 100755 --- a/install/tools/ipa-adtrust-install +++ b/install/tools/ipa-adtrust-install @@ -29,6 +29,8 @@ import ldap import six +from optparse import SUPPRESS_HELP + from ipaserver.install import adtrustinstance from ipaserver.install.installutils import ( read_password, @@ -54,9 +56,11 @@ def parse_options(): default=False, help="print debugging information") parser.add_option("--netbios-name", dest="netbios_name", help="NetBIOS name of the IPA domain") + +# no-msdcs has not effect, option is here just for backward compatibility parser.add_option("--no-msdcs", dest="no_msdcs", action="store_true", - default=False, help="Do not create DNS service records " \ - "for Windows in managed DNS server") + default=False, help=SUPPRESS_HELP) + parser.add_option("--rid-base", dest="rid_base", type=int, default=1000, help="Start value for mapping UIDs and GIDs to RIDs") parser.add_option("--secondary-rid-base",
Re: [Freeipa-devel] [PATCH 0538-0540] DNS locations: epilogue
On 27.6.2016 11:43, Martin Basti wrote: > > > On 27.06.2016 10:56, Petr Spacek wrote: >> On 24.6.2016 12:25, Martin Basti wrote: >>> >>> On 23.06.2016 18:26, Petr Spacek wrote: On 23.6.2016 16:38, Martin Basti wrote: > Patches attached. > > > https://fedorahosted.org/freeipa/ticket/2008 > > > freeipa-mbasti-0538-Revert-DNS-Locations-do-not-generate-location-record.patch > > > > From 28499422115cbfbb343033511319c7c8710e1ff5 Mon Sep 17 00:00:00 2001 > From: Martin Basti> Date: Tue, 21 Jun 2016 18:04:13 +0200 > Subject: [PATCH 1/4] Revert "DNS Locations: do not generate location > records >for unused locations" > > This reverts commit bbf8227e3fd678d4bd6659a12055ba3dbe1c8230. > > After deeper investigation, we found out that empty locations are needed > for clients, because clients may have cached records for longer time for > that particular location. Only way how to remove location is to remove > it using location-del > > https://fedorahosted.org/freeipa/ticket/2008 > --- >ipaserver/dns_data_management.py | 11 --- >1 file changed, 4 insertions(+), 7 deletions(-) > > diff --git a/ipaserver/dns_data_management.py > b/ipaserver/dns_data_management.py > index > a9e9c0a3856961b5494c8d3ca30ddb2e4aa5c523..eac2e7d1a5618ea92372bd81b7d12752791ef117 > > 100644 > --- a/ipaserver/dns_data_management.py > +++ b/ipaserver/dns_data_management.py > @@ -68,7 +68,6 @@ class IPASystemRecords(object): >self.api_instance = api_instance >self.domain_abs = > DNSName(self.api_instance.env.domain).make_absolute() >self.servers_data = {} > -self.used_locations = set() >self.__init_data() > def reload_data(self): > @@ -92,7 +91,6 @@ class IPASystemRecords(object): > def __init_data(self): >self.servers_data = {} > -self.used_locations = set() > servers_result = self.api_instance.Command.server_find( >pkey_only=True)['result'] > @@ -104,8 +102,6 @@ class IPASystemRecords(object): >'location': location, >'roles': roles, >} > -if location: > -self.used_locations.add(location) > def __add_srv_records( >self, zone_obj, hostname, rname_port_map, > @@ -353,12 +349,13 @@ class IPASystemRecords(object): >pkey_only=True)['result'] >servers = [s['cn'][0] for s in servers_result] >-# generate only records for used location, records for > unassigned > -# locations are useless > +locations_result = > self.api_instance.Command.location_find()['result'] > +locations = [l['idnsname'][0] for l in locations_result] > + >for server in servers: >self._get_location_dns_records_for_server( >zone_obj, server, > -self.used_locations, roles=roles, > +locations, roles=roles, >include_master_role=include_master_role) >return zone_obj >-- 2.5.5 > > > freeipa-mbasti-0539-DNS-Locations-hide-option-no-msdcs-in-adtrust-instal.patch > > > > From 37cae4f05cd3c0a2c4de037402938a5437dbc072 Mon Sep 17 00:00:00 2001 > From: Martin Basti > Date: Tue, 21 Jun 2016 18:17:55 +0200 > Subject: [PATCH 2/4] DNS Locations: hide option --no-msdcs in > adtrust-install > > Since DNS location mechanism is active, this option has no effect, > because records are generate dynamically. > > https://fedorahosted.org/freeipa/ticket/2008 > --- >install/tools/ipa-adtrust-install| 10 +++--- >ipaserver/install/adtrustinstance.py | 21 - >2 files changed, 15 insertions(+), 16 deletions(-) > > diff --git a/install/tools/ipa-adtrust-install > b/install/tools/ipa-adtrust-install > index > 5babcdb7cb169e4a944acca55739064e0464d41e..5ba72a65d00ca683239a4ff3c5e7cfdc62c0bb6c > > 100755 > --- a/install/tools/ipa-adtrust-install > +++ b/install/tools/ipa-adtrust-install > @@ -29,6 +29,8 @@ import ldap > import six >+from optparse import SUPPRESS_HELP > + >from ipaserver.install import adtrustinstance >from ipaserver.install.installutils import ( >read_password, > @@ -54,9 +56,11 @@ def parse_options(): > default=False, help="print debugging > information") >parser.add_option("--netbios-name", dest="netbios_name", > help="NetBIOS name of the IPA
Re: [Freeipa-devel] [PATCH 0538-0540] DNS locations: epilogue
On 27.06.2016 13:25, Petr Spacek wrote: On 27.6.2016 11:43, Martin Basti wrote: On 27.06.2016 10:56, Petr Spacek wrote: On 24.6.2016 12:25, Martin Basti wrote: On 23.06.2016 18:26, Petr Spacek wrote: On 23.6.2016 16:38, Martin Basti wrote: Patches attached. https://fedorahosted.org/freeipa/ticket/2008 freeipa-mbasti-0538-Revert-DNS-Locations-do-not-generate-location-record.patch From 28499422115cbfbb343033511319c7c8710e1ff5 Mon Sep 17 00:00:00 2001 From: Martin BastiDate: Tue, 21 Jun 2016 18:04:13 +0200 Subject: [PATCH 1/4] Revert "DNS Locations: do not generate location records for unused locations" This reverts commit bbf8227e3fd678d4bd6659a12055ba3dbe1c8230. After deeper investigation, we found out that empty locations are needed for clients, because clients may have cached records for longer time for that particular location. Only way how to remove location is to remove it using location-del https://fedorahosted.org/freeipa/ticket/2008 --- ipaserver/dns_data_management.py | 11 --- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/ipaserver/dns_data_management.py b/ipaserver/dns_data_management.py index a9e9c0a3856961b5494c8d3ca30ddb2e4aa5c523..eac2e7d1a5618ea92372bd81b7d12752791ef117 100644 --- a/ipaserver/dns_data_management.py +++ b/ipaserver/dns_data_management.py @@ -68,7 +68,6 @@ class IPASystemRecords(object): self.api_instance = api_instance self.domain_abs = DNSName(self.api_instance.env.domain).make_absolute() self.servers_data = {} -self.used_locations = set() self.__init_data() def reload_data(self): @@ -92,7 +91,6 @@ class IPASystemRecords(object): def __init_data(self): self.servers_data = {} -self.used_locations = set() servers_result = self.api_instance.Command.server_find( pkey_only=True)['result'] @@ -104,8 +102,6 @@ class IPASystemRecords(object): 'location': location, 'roles': roles, } -if location: -self.used_locations.add(location) def __add_srv_records( self, zone_obj, hostname, rname_port_map, @@ -353,12 +349,13 @@ class IPASystemRecords(object): pkey_only=True)['result'] servers = [s['cn'][0] for s in servers_result] -# generate only records for used location, records for unassigned -# locations are useless +locations_result = self.api_instance.Command.location_find()['result'] +locations = [l['idnsname'][0] for l in locations_result] + for server in servers: self._get_location_dns_records_for_server( zone_obj, server, -self.used_locations, roles=roles, +locations, roles=roles, include_master_role=include_master_role) return zone_obj -- 2.5.5 freeipa-mbasti-0539-DNS-Locations-hide-option-no-msdcs-in-adtrust-instal.patch From 37cae4f05cd3c0a2c4de037402938a5437dbc072 Mon Sep 17 00:00:00 2001 From: Martin Basti Date: Tue, 21 Jun 2016 18:17:55 +0200 Subject: [PATCH 2/4] DNS Locations: hide option --no-msdcs in adtrust-install Since DNS location mechanism is active, this option has no effect, because records are generate dynamically. https://fedorahosted.org/freeipa/ticket/2008 --- install/tools/ipa-adtrust-install| 10 +++--- ipaserver/install/adtrustinstance.py | 21 - 2 files changed, 15 insertions(+), 16 deletions(-) diff --git a/install/tools/ipa-adtrust-install b/install/tools/ipa-adtrust-install index 5babcdb7cb169e4a944acca55739064e0464d41e..5ba72a65d00ca683239a4ff3c5e7cfdc62c0bb6c 100755 --- a/install/tools/ipa-adtrust-install +++ b/install/tools/ipa-adtrust-install @@ -29,6 +29,8 @@ import ldap import six +from optparse import SUPPRESS_HELP + from ipaserver.install import adtrustinstance from ipaserver.install.installutils import ( read_password, @@ -54,9 +56,11 @@ def parse_options(): default=False, help="print debugging information") parser.add_option("--netbios-name", dest="netbios_name", help="NetBIOS name of the IPA domain") + +# no-msdcs has not effect, option is here just for backward compatibility parser.add_option("--no-msdcs", dest="no_msdcs", action="store_true", - default=False, help="Do not create DNS service records " \ - "for Windows in managed DNS server") + default=False, help=SUPPRESS_HELP) + parser.add_option("--rid-base", dest="rid_base", type=int, default=1000, help="Start value for mapping UIDs and GIDs to RIDs") parser.add_option("--secondary-rid-base",
Re: [Freeipa-devel] [PATCH 0538-0540] DNS locations: epilogue
On 27.6.2016 11:43, Martin Basti wrote: > > > On 27.06.2016 10:56, Petr Spacek wrote: >> On 24.6.2016 12:25, Martin Basti wrote: >>> >>> On 23.06.2016 18:26, Petr Spacek wrote: On 23.6.2016 16:38, Martin Basti wrote: > Patches attached. > > > https://fedorahosted.org/freeipa/ticket/2008 > > > freeipa-mbasti-0538-Revert-DNS-Locations-do-not-generate-location-record.patch > > > > From 28499422115cbfbb343033511319c7c8710e1ff5 Mon Sep 17 00:00:00 2001 > From: Martin Basti> Date: Tue, 21 Jun 2016 18:04:13 +0200 > Subject: [PATCH 1/4] Revert "DNS Locations: do not generate location > records >for unused locations" > > This reverts commit bbf8227e3fd678d4bd6659a12055ba3dbe1c8230. > > After deeper investigation, we found out that empty locations are needed > for clients, because clients may have cached records for longer time for > that particular location. Only way how to remove location is to remove > it using location-del > > https://fedorahosted.org/freeipa/ticket/2008 > --- >ipaserver/dns_data_management.py | 11 --- >1 file changed, 4 insertions(+), 7 deletions(-) > > diff --git a/ipaserver/dns_data_management.py > b/ipaserver/dns_data_management.py > index > a9e9c0a3856961b5494c8d3ca30ddb2e4aa5c523..eac2e7d1a5618ea92372bd81b7d12752791ef117 > > 100644 > --- a/ipaserver/dns_data_management.py > +++ b/ipaserver/dns_data_management.py > @@ -68,7 +68,6 @@ class IPASystemRecords(object): >self.api_instance = api_instance >self.domain_abs = > DNSName(self.api_instance.env.domain).make_absolute() >self.servers_data = {} > -self.used_locations = set() >self.__init_data() > def reload_data(self): > @@ -92,7 +91,6 @@ class IPASystemRecords(object): > def __init_data(self): >self.servers_data = {} > -self.used_locations = set() > servers_result = self.api_instance.Command.server_find( >pkey_only=True)['result'] > @@ -104,8 +102,6 @@ class IPASystemRecords(object): >'location': location, >'roles': roles, >} > -if location: > -self.used_locations.add(location) > def __add_srv_records( >self, zone_obj, hostname, rname_port_map, > @@ -353,12 +349,13 @@ class IPASystemRecords(object): >pkey_only=True)['result'] >servers = [s['cn'][0] for s in servers_result] >-# generate only records for used location, records for > unassigned > -# locations are useless > +locations_result = > self.api_instance.Command.location_find()['result'] > +locations = [l['idnsname'][0] for l in locations_result] > + >for server in servers: >self._get_location_dns_records_for_server( >zone_obj, server, > -self.used_locations, roles=roles, > +locations, roles=roles, >include_master_role=include_master_role) >return zone_obj >-- 2.5.5 > > > freeipa-mbasti-0539-DNS-Locations-hide-option-no-msdcs-in-adtrust-instal.patch > > > > From 37cae4f05cd3c0a2c4de037402938a5437dbc072 Mon Sep 17 00:00:00 2001 > From: Martin Basti > Date: Tue, 21 Jun 2016 18:17:55 +0200 > Subject: [PATCH 2/4] DNS Locations: hide option --no-msdcs in > adtrust-install > > Since DNS location mechanism is active, this option has no effect, > because records are generate dynamically. > > https://fedorahosted.org/freeipa/ticket/2008 > --- >install/tools/ipa-adtrust-install| 10 +++--- >ipaserver/install/adtrustinstance.py | 21 - >2 files changed, 15 insertions(+), 16 deletions(-) > > diff --git a/install/tools/ipa-adtrust-install > b/install/tools/ipa-adtrust-install > index > 5babcdb7cb169e4a944acca55739064e0464d41e..5ba72a65d00ca683239a4ff3c5e7cfdc62c0bb6c > > 100755 > --- a/install/tools/ipa-adtrust-install > +++ b/install/tools/ipa-adtrust-install > @@ -29,6 +29,8 @@ import ldap > import six >+from optparse import SUPPRESS_HELP > + >from ipaserver.install import adtrustinstance >from ipaserver.install.installutils import ( >read_password, > @@ -54,9 +56,11 @@ def parse_options(): > default=False, help="print debugging > information") >parser.add_option("--netbios-name", dest="netbios_name", > help="NetBIOS name of the IPA
Re: [Freeipa-devel] [PATCH 0538-0540] DNS locations: epilogue
On 27.06.2016 10:56, Petr Spacek wrote: On 24.6.2016 12:25, Martin Basti wrote: On 23.06.2016 18:26, Petr Spacek wrote: On 23.6.2016 16:38, Martin Basti wrote: Patches attached. https://fedorahosted.org/freeipa/ticket/2008 freeipa-mbasti-0538-Revert-DNS-Locations-do-not-generate-location-record.patch From 28499422115cbfbb343033511319c7c8710e1ff5 Mon Sep 17 00:00:00 2001 From: Martin BastiDate: Tue, 21 Jun 2016 18:04:13 +0200 Subject: [PATCH 1/4] Revert "DNS Locations: do not generate location records for unused locations" This reverts commit bbf8227e3fd678d4bd6659a12055ba3dbe1c8230. After deeper investigation, we found out that empty locations are needed for clients, because clients may have cached records for longer time for that particular location. Only way how to remove location is to remove it using location-del https://fedorahosted.org/freeipa/ticket/2008 --- ipaserver/dns_data_management.py | 11 --- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/ipaserver/dns_data_management.py b/ipaserver/dns_data_management.py index a9e9c0a3856961b5494c8d3ca30ddb2e4aa5c523..eac2e7d1a5618ea92372bd81b7d12752791ef117 100644 --- a/ipaserver/dns_data_management.py +++ b/ipaserver/dns_data_management.py @@ -68,7 +68,6 @@ class IPASystemRecords(object): self.api_instance = api_instance self.domain_abs = DNSName(self.api_instance.env.domain).make_absolute() self.servers_data = {} -self.used_locations = set() self.__init_data() def reload_data(self): @@ -92,7 +91,6 @@ class IPASystemRecords(object): def __init_data(self): self.servers_data = {} -self.used_locations = set() servers_result = self.api_instance.Command.server_find( pkey_only=True)['result'] @@ -104,8 +102,6 @@ class IPASystemRecords(object): 'location': location, 'roles': roles, } -if location: -self.used_locations.add(location) def __add_srv_records( self, zone_obj, hostname, rname_port_map, @@ -353,12 +349,13 @@ class IPASystemRecords(object): pkey_only=True)['result'] servers = [s['cn'][0] for s in servers_result] -# generate only records for used location, records for unassigned -# locations are useless +locations_result = self.api_instance.Command.location_find()['result'] +locations = [l['idnsname'][0] for l in locations_result] + for server in servers: self._get_location_dns_records_for_server( zone_obj, server, -self.used_locations, roles=roles, +locations, roles=roles, include_master_role=include_master_role) return zone_obj -- 2.5.5 freeipa-mbasti-0539-DNS-Locations-hide-option-no-msdcs-in-adtrust-instal.patch From 37cae4f05cd3c0a2c4de037402938a5437dbc072 Mon Sep 17 00:00:00 2001 From: Martin Basti Date: Tue, 21 Jun 2016 18:17:55 +0200 Subject: [PATCH 2/4] DNS Locations: hide option --no-msdcs in adtrust-install Since DNS location mechanism is active, this option has no effect, because records are generate dynamically. https://fedorahosted.org/freeipa/ticket/2008 --- install/tools/ipa-adtrust-install| 10 +++--- ipaserver/install/adtrustinstance.py | 21 - 2 files changed, 15 insertions(+), 16 deletions(-) diff --git a/install/tools/ipa-adtrust-install b/install/tools/ipa-adtrust-install index 5babcdb7cb169e4a944acca55739064e0464d41e..5ba72a65d00ca683239a4ff3c5e7cfdc62c0bb6c 100755 --- a/install/tools/ipa-adtrust-install +++ b/install/tools/ipa-adtrust-install @@ -29,6 +29,8 @@ import ldap import six +from optparse import SUPPRESS_HELP + from ipaserver.install import adtrustinstance from ipaserver.install.installutils import ( read_password, @@ -54,9 +56,11 @@ def parse_options(): default=False, help="print debugging information") parser.add_option("--netbios-name", dest="netbios_name", help="NetBIOS name of the IPA domain") + +# no-msdcs has not effect, option is here just for backward compatibility parser.add_option("--no-msdcs", dest="no_msdcs", action="store_true", - default=False, help="Do not create DNS service records " \ - "for Windows in managed DNS server") + default=False, help=SUPPRESS_HELP) + parser.add_option("--rid-base", dest="rid_base", type=int, default=1000, help="Start value for mapping UIDs and GIDs to RIDs") parser.add_option("--secondary-rid-base", dest="secondary_rid_base", @@ -390,7 +394,7 @@ def main(): smb.setup(api.env.host, api.env.realm, netbios_name,
Re: [Freeipa-devel] [PATCH 0538-0540] DNS locations: epilogue
On 24.6.2016 12:25, Martin Basti wrote: > > > On 23.06.2016 18:26, Petr Spacek wrote: >> On 23.6.2016 16:38, Martin Basti wrote: >>> Patches attached. >>> >>> >>> https://fedorahosted.org/freeipa/ticket/2008 >>> >>> >>> freeipa-mbasti-0538-Revert-DNS-Locations-do-not-generate-location-record.patch >>> >>> >>> From 28499422115cbfbb343033511319c7c8710e1ff5 Mon Sep 17 00:00:00 2001 >>> From: Martin Basti>>> Date: Tue, 21 Jun 2016 18:04:13 +0200 >>> Subject: [PATCH 1/4] Revert "DNS Locations: do not generate location records >>> for unused locations" >>> >>> This reverts commit bbf8227e3fd678d4bd6659a12055ba3dbe1c8230. >>> >>> After deeper investigation, we found out that empty locations are needed >>> for clients, because clients may have cached records for longer time for >>> that particular location. Only way how to remove location is to remove >>> it using location-del >>> >>> https://fedorahosted.org/freeipa/ticket/2008 >>> --- >>> ipaserver/dns_data_management.py | 11 --- >>> 1 file changed, 4 insertions(+), 7 deletions(-) >>> >>> diff --git a/ipaserver/dns_data_management.py >>> b/ipaserver/dns_data_management.py >>> index >>> a9e9c0a3856961b5494c8d3ca30ddb2e4aa5c523..eac2e7d1a5618ea92372bd81b7d12752791ef117 >>> 100644 >>> --- a/ipaserver/dns_data_management.py >>> +++ b/ipaserver/dns_data_management.py >>> @@ -68,7 +68,6 @@ class IPASystemRecords(object): >>> self.api_instance = api_instance >>> self.domain_abs = >>> DNSName(self.api_instance.env.domain).make_absolute() >>> self.servers_data = {} >>> -self.used_locations = set() >>> self.__init_data() >>> def reload_data(self): >>> @@ -92,7 +91,6 @@ class IPASystemRecords(object): >>> def __init_data(self): >>> self.servers_data = {} >>> -self.used_locations = set() >>> servers_result = self.api_instance.Command.server_find( >>> pkey_only=True)['result'] >>> @@ -104,8 +102,6 @@ class IPASystemRecords(object): >>> 'location': location, >>> 'roles': roles, >>> } >>> -if location: >>> -self.used_locations.add(location) >>> def __add_srv_records( >>> self, zone_obj, hostname, rname_port_map, >>> @@ -353,12 +349,13 @@ class IPASystemRecords(object): >>> pkey_only=True)['result'] >>> servers = [s['cn'][0] for s in servers_result] >>> -# generate only records for used location, records for unassigned >>> -# locations are useless >>> +locations_result = >>> self.api_instance.Command.location_find()['result'] >>> +locations = [l['idnsname'][0] for l in locations_result] >>> + >>> for server in servers: >>> self._get_location_dns_records_for_server( >>> zone_obj, server, >>> -self.used_locations, roles=roles, >>> +locations, roles=roles, >>> include_master_role=include_master_role) >>> return zone_obj >>> -- 2.5.5 >>> >>> >>> freeipa-mbasti-0539-DNS-Locations-hide-option-no-msdcs-in-adtrust-instal.patch >>> >>> >>> From 37cae4f05cd3c0a2c4de037402938a5437dbc072 Mon Sep 17 00:00:00 2001 >>> From: Martin Basti >>> Date: Tue, 21 Jun 2016 18:17:55 +0200 >>> Subject: [PATCH 2/4] DNS Locations: hide option --no-msdcs in >>> adtrust-install >>> >>> Since DNS location mechanism is active, this option has no effect, >>> because records are generate dynamically. >>> >>> https://fedorahosted.org/freeipa/ticket/2008 >>> --- >>> install/tools/ipa-adtrust-install| 10 +++--- >>> ipaserver/install/adtrustinstance.py | 21 - >>> 2 files changed, 15 insertions(+), 16 deletions(-) >>> >>> diff --git a/install/tools/ipa-adtrust-install >>> b/install/tools/ipa-adtrust-install >>> index >>> 5babcdb7cb169e4a944acca55739064e0464d41e..5ba72a65d00ca683239a4ff3c5e7cfdc62c0bb6c >>> 100755 >>> --- a/install/tools/ipa-adtrust-install >>> +++ b/install/tools/ipa-adtrust-install >>> @@ -29,6 +29,8 @@ import ldap >>> import six >>> +from optparse import SUPPRESS_HELP >>> + >>> from ipaserver.install import adtrustinstance >>> from ipaserver.install.installutils import ( >>> read_password, >>> @@ -54,9 +56,11 @@ def parse_options(): >>> default=False, help="print debugging information") >>> parser.add_option("--netbios-name", dest="netbios_name", >>> help="NetBIOS name of the IPA domain") >>> + >>> +# no-msdcs has not effect, option is here just for backward >>> compatibility >>> parser.add_option("--no-msdcs", dest="no_msdcs", action="store_true", >>> - default=False, help="Do not create DNS service >>> records " \ >>> - "for Windows in managed DNS >>> server") >>> +
Re: [Freeipa-devel] [PATCH 0538-0540] DNS locations: epilogue
On 23.06.2016 18:26, Petr Spacek wrote: On 23.6.2016 16:38, Martin Basti wrote: Patches attached. https://fedorahosted.org/freeipa/ticket/2008 freeipa-mbasti-0538-Revert-DNS-Locations-do-not-generate-location-record.patch From 28499422115cbfbb343033511319c7c8710e1ff5 Mon Sep 17 00:00:00 2001 From: Martin BastiDate: Tue, 21 Jun 2016 18:04:13 +0200 Subject: [PATCH 1/4] Revert "DNS Locations: do not generate location records for unused locations" This reverts commit bbf8227e3fd678d4bd6659a12055ba3dbe1c8230. After deeper investigation, we found out that empty locations are needed for clients, because clients may have cached records for longer time for that particular location. Only way how to remove location is to remove it using location-del https://fedorahosted.org/freeipa/ticket/2008 --- ipaserver/dns_data_management.py | 11 --- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/ipaserver/dns_data_management.py b/ipaserver/dns_data_management.py index a9e9c0a3856961b5494c8d3ca30ddb2e4aa5c523..eac2e7d1a5618ea92372bd81b7d12752791ef117 100644 --- a/ipaserver/dns_data_management.py +++ b/ipaserver/dns_data_management.py @@ -68,7 +68,6 @@ class IPASystemRecords(object): self.api_instance = api_instance self.domain_abs = DNSName(self.api_instance.env.domain).make_absolute() self.servers_data = {} -self.used_locations = set() self.__init_data() def reload_data(self): @@ -92,7 +91,6 @@ class IPASystemRecords(object): def __init_data(self): self.servers_data = {} -self.used_locations = set() servers_result = self.api_instance.Command.server_find( pkey_only=True)['result'] @@ -104,8 +102,6 @@ class IPASystemRecords(object): 'location': location, 'roles': roles, } -if location: -self.used_locations.add(location) def __add_srv_records( self, zone_obj, hostname, rname_port_map, @@ -353,12 +349,13 @@ class IPASystemRecords(object): pkey_only=True)['result'] servers = [s['cn'][0] for s in servers_result] -# generate only records for used location, records for unassigned -# locations are useless +locations_result = self.api_instance.Command.location_find()['result'] +locations = [l['idnsname'][0] for l in locations_result] + for server in servers: self._get_location_dns_records_for_server( zone_obj, server, -self.used_locations, roles=roles, +locations, roles=roles, include_master_role=include_master_role) return zone_obj -- 2.5.5 freeipa-mbasti-0539-DNS-Locations-hide-option-no-msdcs-in-adtrust-instal.patch From 37cae4f05cd3c0a2c4de037402938a5437dbc072 Mon Sep 17 00:00:00 2001 From: Martin Basti Date: Tue, 21 Jun 2016 18:17:55 +0200 Subject: [PATCH 2/4] DNS Locations: hide option --no-msdcs in adtrust-install Since DNS location mechanism is active, this option has no effect, because records are generate dynamically. https://fedorahosted.org/freeipa/ticket/2008 --- install/tools/ipa-adtrust-install| 10 +++--- ipaserver/install/adtrustinstance.py | 21 - 2 files changed, 15 insertions(+), 16 deletions(-) diff --git a/install/tools/ipa-adtrust-install b/install/tools/ipa-adtrust-install index 5babcdb7cb169e4a944acca55739064e0464d41e..5ba72a65d00ca683239a4ff3c5e7cfdc62c0bb6c 100755 --- a/install/tools/ipa-adtrust-install +++ b/install/tools/ipa-adtrust-install @@ -29,6 +29,8 @@ import ldap import six +from optparse import SUPPRESS_HELP + from ipaserver.install import adtrustinstance from ipaserver.install.installutils import ( read_password, @@ -54,9 +56,11 @@ def parse_options(): default=False, help="print debugging information") parser.add_option("--netbios-name", dest="netbios_name", help="NetBIOS name of the IPA domain") + +# no-msdcs has not effect, option is here just for backward compatibility parser.add_option("--no-msdcs", dest="no_msdcs", action="store_true", - default=False, help="Do not create DNS service records " \ - "for Windows in managed DNS server") + default=False, help=SUPPRESS_HELP) + parser.add_option("--rid-base", dest="rid_base", type=int, default=1000, help="Start value for mapping UIDs and GIDs to RIDs") parser.add_option("--secondary-rid-base", dest="secondary_rid_base", @@ -390,7 +394,7 @@ def main(): smb.setup(api.env.host, api.env.realm, netbios_name, reset_netbios_name, options.rid_base, options.secondary_rid_base, - options.no_msdcs,
Re: [Freeipa-devel] [PATCH 0538-0540] DNS locations: epilogue
On 23.6.2016 16:38, Martin Basti wrote: > Patches attached. > > > https://fedorahosted.org/freeipa/ticket/2008 > > > freeipa-mbasti-0538-Revert-DNS-Locations-do-not-generate-location-record.patch > > > From 28499422115cbfbb343033511319c7c8710e1ff5 Mon Sep 17 00:00:00 2001 > From: Martin Basti> Date: Tue, 21 Jun 2016 18:04:13 +0200 > Subject: [PATCH 1/4] Revert "DNS Locations: do not generate location records > for unused locations" > > This reverts commit bbf8227e3fd678d4bd6659a12055ba3dbe1c8230. > > After deeper investigation, we found out that empty locations are needed > for clients, because clients may have cached records for longer time for > that particular location. Only way how to remove location is to remove > it using location-del > > https://fedorahosted.org/freeipa/ticket/2008 > --- > ipaserver/dns_data_management.py | 11 --- > 1 file changed, 4 insertions(+), 7 deletions(-) > > diff --git a/ipaserver/dns_data_management.py > b/ipaserver/dns_data_management.py > index > a9e9c0a3856961b5494c8d3ca30ddb2e4aa5c523..eac2e7d1a5618ea92372bd81b7d12752791ef117 > 100644 > --- a/ipaserver/dns_data_management.py > +++ b/ipaserver/dns_data_management.py > @@ -68,7 +68,6 @@ class IPASystemRecords(object): > self.api_instance = api_instance > self.domain_abs = > DNSName(self.api_instance.env.domain).make_absolute() > self.servers_data = {} > -self.used_locations = set() > self.__init_data() > > def reload_data(self): > @@ -92,7 +91,6 @@ class IPASystemRecords(object): > > def __init_data(self): > self.servers_data = {} > -self.used_locations = set() > > servers_result = self.api_instance.Command.server_find( > pkey_only=True)['result'] > @@ -104,8 +102,6 @@ class IPASystemRecords(object): > 'location': location, > 'roles': roles, > } > -if location: > -self.used_locations.add(location) > > def __add_srv_records( > self, zone_obj, hostname, rname_port_map, > @@ -353,12 +349,13 @@ class IPASystemRecords(object): > pkey_only=True)['result'] > servers = [s['cn'][0] for s in servers_result] > > -# generate only records for used location, records for unassigned > -# locations are useless > +locations_result = > self.api_instance.Command.location_find()['result'] > +locations = [l['idnsname'][0] for l in locations_result] > + > for server in servers: > self._get_location_dns_records_for_server( > zone_obj, server, > -self.used_locations, roles=roles, > +locations, roles=roles, > include_master_role=include_master_role) > return zone_obj > > -- 2.5.5 > > > freeipa-mbasti-0539-DNS-Locations-hide-option-no-msdcs-in-adtrust-instal.patch > > > From 37cae4f05cd3c0a2c4de037402938a5437dbc072 Mon Sep 17 00:00:00 2001 > From: Martin Basti > Date: Tue, 21 Jun 2016 18:17:55 +0200 > Subject: [PATCH 2/4] DNS Locations: hide option --no-msdcs in adtrust-install > > Since DNS location mechanism is active, this option has no effect, > because records are generate dynamically. > > https://fedorahosted.org/freeipa/ticket/2008 > --- > install/tools/ipa-adtrust-install| 10 +++--- > ipaserver/install/adtrustinstance.py | 21 - > 2 files changed, 15 insertions(+), 16 deletions(-) > > diff --git a/install/tools/ipa-adtrust-install > b/install/tools/ipa-adtrust-install > index > 5babcdb7cb169e4a944acca55739064e0464d41e..5ba72a65d00ca683239a4ff3c5e7cfdc62c0bb6c > 100755 > --- a/install/tools/ipa-adtrust-install > +++ b/install/tools/ipa-adtrust-install > @@ -29,6 +29,8 @@ import ldap > > import six > > +from optparse import SUPPRESS_HELP > + > from ipaserver.install import adtrustinstance > from ipaserver.install.installutils import ( > read_password, > @@ -54,9 +56,11 @@ def parse_options(): >default=False, help="print debugging information") > parser.add_option("--netbios-name", dest="netbios_name", >help="NetBIOS name of the IPA domain") > + > +# no-msdcs has not effect, option is here just for backward compatibility > parser.add_option("--no-msdcs", dest="no_msdcs", action="store_true", > - default=False, help="Do not create DNS service records > " \ > - "for Windows in managed DNS > server") > + default=False, help=SUPPRESS_HELP) > + > parser.add_option("--rid-base", dest="rid_base", type=int, default=1000, >help="Start value for mapping UIDs and GIDs to RIDs") > parser.add_option("--secondary-rid-base", dest="secondary_rid_base", > @@ -390,7 +394,7 @@ def main(): > smb.setup(api.env.host,