ipa_certupdate: avoid classmethod and staticmethod

Because classmethod and staticmethod are just fancy ways of calling
plain old functions, turn the classmethods and staticmethods of
CertUpdate into plain old functions.

This improves readability by making it clear that the behaviour of
the routines cannot depend on instance or class variables.

Part of: https://pagure.io/freeipa/issue/6577

Reviewed-By: Rob Crittenden <rcritten@redhat.com>
This commit is contained in:
Fraser Tweedale
2017-12-01 12:27:26 +11:00
committed by Christian Heimes
parent 97942a7c7a
commit 39fdc2d250
2 changed files with 131 additions and 133 deletions

View File

@@ -27,7 +27,7 @@ import tempfile
from ipalib.install.kinit import kinit_keytab
from ipapython import ipautil
from ipaclient.install.ipa_certupdate import CertUpdate
from ipaclient.install import ipa_certupdate
from ipaserver.install import installutils
from ipaserver.install.installutils import create_replica_config
from ipaserver.install.installutils import check_creds, ReplicaConfig
@@ -178,7 +178,7 @@ def install_replica(safe_options, options, filename):
# Run ipa-certupdate to ensure we have the CA cert. This is
# necessary if the admin has just promoted the topology from
# CA-less to CA-ful, and ipa-certupdate has not been run yet.
CertUpdate.run_with_args(api)
ipa_certupdate.run_with_args(api)
# CertUpdate restarts DS causing broken pipe on the original
# connection, so reconnect the backend.
@@ -257,7 +257,7 @@ def install_master(safe_options, options):
# Run ipa-certupdate to add the new CA certificate to
# certificate databases on this server.
logger.info("Updating certificate databases.")
CertUpdate.run_with_args(api)
ipa_certupdate.run_with_args(api)
def install(safe_options, options, filename):
options.promote = False