mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
Server Upgrade: respect --test option in plugins
Several plugins do the LDAP data modification directly. In test mode these plugis should not be executed. https://fedorahosted.org/freeipa/ticket/3448 Reviewed-By: David Kupka <dkupka@redhat.com>
This commit is contained in:
parent
a42fcfc18b
commit
c95c4849ae
@ -60,6 +60,10 @@ class update_dnszones(PostUpdate):
|
||||
order=MIDDLE
|
||||
|
||||
def execute(self, **options):
|
||||
if not options.get('live_run'):
|
||||
self.log.info("Test mode: skipping 'update_dnszones'")
|
||||
return False, False, ()
|
||||
|
||||
ldap = self.obj.backend
|
||||
if not dns_container_exists(ldap):
|
||||
return (False, False, [])
|
||||
@ -159,6 +163,11 @@ class update_master_to_dnsforwardzones(PostUpdate):
|
||||
backup_path = u'%s%s' % (backup_dir, backup_filename)
|
||||
|
||||
def execute(self, **options):
|
||||
if not options.get('live_run'):
|
||||
self.log.info("Test mode: skipping "
|
||||
"'update_master_to_dnsforwardzones'")
|
||||
return False, False, ()
|
||||
|
||||
ldap = self.obj.backend
|
||||
# check LDAP if forwardzones already uses new semantics
|
||||
dns_container_dn = DN(api.env.container_dns, api.env.basedn)
|
||||
|
@ -38,6 +38,10 @@ class update_replica_attribute_lists(PreUpdate):
|
||||
order = MIDDLE
|
||||
|
||||
def execute(self, **options):
|
||||
if not options.get('live_run'):
|
||||
self.log.info("Test mode: skipping "
|
||||
"'update_replica_attribute_lists'")
|
||||
return False, False, ()
|
||||
# We need an IPAdmin connection to the backend
|
||||
self.log.debug("Start replication agreement exclude list update task")
|
||||
conn = ipaldap.IPAdmin(api.env.host, ldapi=True, realm=api.env.realm)
|
||||
|
@ -33,6 +33,9 @@ class update_idrange_type(PostUpdate):
|
||||
order = MIDDLE
|
||||
|
||||
def execute(self, **options):
|
||||
if not options.get('live_run'):
|
||||
self.log.info("Test mode: skipping 'update_idrange_type'")
|
||||
return False, False, ()
|
||||
ldap = self.obj.backend
|
||||
|
||||
base_dn = DN(api.env.container_ranges, api.env.basedn)
|
||||
@ -121,6 +124,10 @@ class update_idrange_baserid(PostUpdate):
|
||||
order = LAST
|
||||
|
||||
def execute(self, **options):
|
||||
if not options.get('live_run'):
|
||||
self.log.info("Test mode: skipping 'update_idrange_baserid'")
|
||||
return False, False, ()
|
||||
|
||||
ldap = self.obj.backend
|
||||
|
||||
base_dn = DN(api.env.container_ranges, api.env.basedn)
|
||||
|
@ -402,6 +402,10 @@ class update_managed_permissions(PostUpdate):
|
||||
|
||||
|
||||
def execute(self, **options):
|
||||
if not options.get('live_run'):
|
||||
self.log.info("Test mode: skipping 'update_managed_permissions'")
|
||||
return False, False, ()
|
||||
|
||||
ldap = self.api.Backend[ldap2]
|
||||
|
||||
anonymous_read_aci = self.get_anonymous_read_aci(ldap)
|
||||
|
@ -31,6 +31,10 @@ class update_pacs(PostUpdate):
|
||||
order = MIDDLE
|
||||
|
||||
def execute(self, **options):
|
||||
if not options.get('live_run'):
|
||||
self.log.info("Test mode: skipping 'update_pacs'")
|
||||
return False, False, ()
|
||||
|
||||
ldap = self.obj.backend
|
||||
|
||||
try:
|
||||
|
@ -28,6 +28,9 @@ class update_referint(PreUpdate):
|
||||
('cn', 'plugins'), ('cn', 'config'))
|
||||
|
||||
def execute(self, **options):
|
||||
if not options.get('live_run'):
|
||||
self.log.info("Test mode: skipping 'update_referint'")
|
||||
return False, False, ()
|
||||
|
||||
root_logger.debug("Upgrading referential integrity plugin configuration")
|
||||
ldap = self.obj.backend
|
||||
|
@ -33,6 +33,10 @@ class update_service_principalalias(PostUpdate):
|
||||
order = MIDDLE
|
||||
|
||||
def execute(self, **options):
|
||||
if not options.get('live_run'):
|
||||
self.log.info("Test mode: skipping 'update_service_principalalias'")
|
||||
return False, False, ()
|
||||
|
||||
ldap = self.obj.backend
|
||||
|
||||
base_dn = DN(api.env.container_service, api.env.basedn)
|
||||
|
Loading…
Reference in New Issue
Block a user