From 926f8647d2a676c1dd2e446633eb76cdf1a7bf0c Mon Sep 17 00:00:00 2001 From: Tomas Babej Date: Thu, 29 May 2014 10:18:21 +0200 Subject: ipaplatform: Change platform dependant code in freeipa to use ipaplatform tasks https://fedorahosted.org/freeipa/ticket/4052 Reviewed-By: Petr Viktorin --- ipa-client/ipa-install/ipa-client-automount | 7 ++++--- ipa-client/ipa-install/ipa-client-install | 12 ++++++------ 2 files changed, 10 insertions(+), 9 deletions(-) (limited to 'ipa-client/ipa-install') diff --git a/ipa-client/ipa-install/ipa-client-automount b/ipa-client/ipa-install/ipa-client-automount index 43b8a1a0f..0841952cb 100755 --- a/ipa-client/ipa-install/ipa-client-automount +++ b/ipa-client/ipa-install/ipa-client-automount @@ -38,6 +38,7 @@ from ipaclient import ipachangeconf from ipapython.ipa_log_manager import * from ipapython.dn import DN from ipapython import services as ipaservices +from ipaplatform import tasks AUTOFS_CONF = '/etc/sysconfig/autofs' NSSWITCH_CONF = '/etc/nsswitch.conf' @@ -220,7 +221,7 @@ def configure_autofs(fstore, statestore, autodiscover, server, options): ipautil.backup_config_and_replace_variables(fstore, AUTOFS_CONF, replacevars=replacevars) - ipaservices.restore_context(AUTOFS_CONF) + tasks.restore_context(AUTOFS_CONF) statestore.backup_state('autofs', 'sssd', False) print "Configured %s" % AUTOFS_CONF @@ -313,7 +314,7 @@ def configure_nfs(fstore, statestore): } ipautil.backup_config_and_replace_variables(fstore, NFS_CONF, replacevars=replacevars) - ipaservices.restore_context(NFS_CONF) + tasks.restore_context(NFS_CONF) print "Configured %s" % NFS_CONF @@ -322,7 +323,7 @@ def configure_nfs(fstore, statestore): } ipautil.backup_config_and_replace_variables(fstore, IDMAPD_CONF, replacevars=replacevars) - ipaservices.restore_context(IDMAPD_CONF) + tasks.restore_context(IDMAPD_CONF) print "Configured %s" % IDMAPD_CONF diff --git a/ipa-client/ipa-install/ipa-client-install b/ipa-client/ipa-install/ipa-client-install index de3d08775..3a5c127b8 100755 --- a/ipa-client/ipa-install/ipa-client-install +++ b/ipa-client/ipa-install/ipa-client-install @@ -41,6 +41,7 @@ try: from ipapython.ipautil import ( run, user_input, CalledProcessError, file_exists, dir_exists, realm_to_suffix) + from ipaplatform.tasks import tasks from ipapython import ipautil, sysrestore, version, certmonger, ipaldap from ipapython import kernel_keyring from ipapython.config import IPAOptionParser @@ -50,7 +51,6 @@ try: from ipapython.dn import DN from ipapython.ssh import SSHPublicKey from ipalib.rpc import delete_persistent_client_session_data - from ipaplatform.tasks import tasks except ImportError: print >> sys.stderr, """\ @@ -648,7 +648,7 @@ def uninstall(options, env): if fstore.has_files(): root_logger.info("Restoring client configuration files") - ipaservices.restore_network_configuration(fstore, statestore) + tasks.restore_network_configuration(fstore, statestore) fstore.restore_all_files() ipautil.restore_hostname(statestore) @@ -740,7 +740,7 @@ def uninstall(options, env): 'as it can cause subsequent installation to fail.') # Remove the CA cert from the systemwide certificate store - ipaservices.remove_ca_cert_from_systemwide_ca_store(CACERT) + tasks.remove_ca_cert_from_systemwide_ca_store(CACERT) # Remove the CA cert try: @@ -2319,7 +2319,7 @@ def install(options, env, fstore, statestore): # configure /etc/sysconfig/network to contain the hostname we set. # skip this step when run by ipa-server-install as it always configures # hostname if different from system hostname - ipaservices.backup_and_replace_hostname(fstore, statestore, options.hostname) + tasks.backup_and_replace_hostname(fstore, statestore, options.hostname) if not options.on_master: # Attempt to sync time with IPA server. @@ -2540,7 +2540,7 @@ def install(options, env, fstore, statestore): root_logger.info("Configured /etc/sssd/sssd.conf") # Add the CA to the platform-dependant systemwide CA store - ipaservices.insert_ca_cert_into_systemwide_ca_store(CACERT) + tasks.insert_ca_cert_into_systemwide_ca_store(CACERT) # Add the CA to the default NSS database and trust it try: @@ -2803,7 +2803,7 @@ def main(): if not os.getegid() == 0: sys.exit("\nYou must be root to run ipa-client-install.\n") - ipaservices.check_selinux_status() + tasks.check_selinux_status() logging_setup(options) root_logger.debug( '%s was invoked with options: %s', sys.argv[0], safe_options) -- cgit