summaryrefslogtreecommitdiffstats
path: root/ipaserver/install/plugins/dns.py
diff options
context:
space:
mode:
authorMartin Basti <mbasti@redhat.com>2015-03-17 17:56:34 +0100
committerPetr Vobornik <pvoborni@redhat.com>2015-04-14 19:25:47 +0200
commitcc19b5a76a37d1fb87deb45d9cbfc71472a99fa4 (patch)
tree1dbecc1e9cb5b4bf972996fc45a2738f9942863d /ipaserver/install/plugins/dns.py
parentb4ca5c57d230c80ecc4f8eaaa01d8e7a36bcb3b4 (diff)
downloadfreeipa-cc19b5a76a37d1fb87deb45d9cbfc71472a99fa4.tar.gz
freeipa-cc19b5a76a37d1fb87deb45d9cbfc71472a99fa4.tar.xz
freeipa-cc19b5a76a37d1fb87deb45d9cbfc71472a99fa4.zip
Server Upgrade: Apply plugin updates immediately
Preparation to moving plugins executin into update files. * remove apply_now flag * plugins will return only (restart, modifications) https://fedorahosted.org/freeipa/ticket/4904 Reviewed-By: David Kupka <dkupka@redhat.com>
Diffstat (limited to 'ipaserver/install/plugins/dns.py')
-rw-r--r--ipaserver/install/plugins/dns.py30
1 files changed, 15 insertions, 15 deletions
diff --git a/ipaserver/install/plugins/dns.py b/ipaserver/install/plugins/dns.py
index f562978bc..082c066d0 100644
--- a/ipaserver/install/plugins/dns.py
+++ b/ipaserver/install/plugins/dns.py
@@ -62,13 +62,13 @@ class update_dnszones(PostUpdate):
def execute(self, **options):
ldap = self.obj.backend
if not dns_container_exists(ldap):
- return (False, False, [])
+ return False, []
try:
zones = api.Command.dnszone_find(all=True)['result']
except errors.NotFound:
self.log.info('No DNS zone to update found')
- return (False, False, [])
+ return False, []
for zone in zones:
update = {}
@@ -90,7 +90,7 @@ class update_dnszones(PostUpdate):
api.Command.dnszone_mod(zone[u'idnsname'][0].make_absolute(),
**update)
- return (False, False, [])
+ return False, []
api.register(update_dnszones)
@@ -109,7 +109,7 @@ class update_dns_limits(PostUpdate):
ldap = self.obj.backend
if not dns_container_exists(ldap):
- return (False, False, [])
+ return False, []
dns_principal = 'DNS/%s@%s' % (self.env.host, self.env.realm)
dns_service_dn = DN(('krbprincipalname', dns_principal),
@@ -121,12 +121,12 @@ class update_dns_limits(PostUpdate):
except errors.NotFound:
# this host may not have DNS service set
root_logger.debug("DNS: service %s not found, no need to update limits" % dns_service_dn)
- return (False, False, [])
+ return False, []
if all(entry.get(limit.lower(), [None])[0] == self.limit_value for limit in self.limit_attributes):
root_logger.debug("DNS: limits for service %s already set" % dns_service_dn)
# service is already updated
- return (False, False, [])
+ return False, []
limit_updates = []
@@ -137,7 +137,7 @@ class update_dns_limits(PostUpdate):
root_logger.debug("DNS: limits for service %s will be updated" % dns_service_dn)
- return (False, True, [dnsupdate])
+ return False, [dnsupdate]
api.register(update_dns_limits)
@@ -166,7 +166,7 @@ class update_master_to_dnsforwardzones(PostUpdate):
container_entry = ldap.get_entry(dns_container_dn)
except errors.NotFound:
# DNS container not found, nothing to upgrade
- return (False, False, [])
+ return False, []
for config_option in container_entry.get("ipaConfigString", []):
matched = re.match("^DNSVersion\s+(?P<version>\d+)$",
@@ -174,7 +174,7 @@ class update_master_to_dnsforwardzones(PostUpdate):
if matched and int(matched.group("version")) >= 1:
# forwardzones already uses new semantics,
# no upgrade is required
- return (False, False, [])
+ return False, []
self.log.info('Updating forward zones')
# update the DNSVersion, following upgrade can be executed only once
@@ -193,7 +193,7 @@ class update_master_to_dnsforwardzones(PostUpdate):
else:
if fwzones:
# fwzones exist, do not execute upgrade again
- return (False, False, [])
+ return False, []
zones = []
try:
@@ -206,7 +206,7 @@ class update_master_to_dnsforwardzones(PostUpdate):
if not zones:
self.log.info('No DNS zone to update found')
- return (False, False, [])
+ return False, []
zones_to_transform = []
@@ -271,7 +271,7 @@ class update_master_to_dnsforwardzones(PostUpdate):
self.log.error('Unable to backup zone %s' %
zone['idnsname'][0])
self.log.error(traceback.format_exc())
- return (False, False, [])
+ return False, []
for privilege_dn in privileges_to_ldif:
try:
@@ -281,13 +281,13 @@ class update_master_to_dnsforwardzones(PostUpdate):
self.log.error('Unable to backup privilege %s' %
privilege_dn)
self.log.error(traceback.format_exc())
- return (False, False, [])
+ return False, []
f.close()
except Exception:
self.log.error('Unable to create backup file')
self.log.error(traceback.format_exc())
- return (False, False, [])
+ return False, []
# update
for zone in zones_to_transform:
@@ -352,6 +352,6 @@ class update_master_to_dnsforwardzones(PostUpdate):
self.log.info('Zone %s was sucessfully transformed to forward zone',
zone['idnsname'][0])
- return (False, False, [])
+ return False, []
api.register(update_master_to_dnsforwardzones)