summaryrefslogtreecommitdiffstats
path: root/ipa-client
diff options
context:
space:
mode:
authorTomas Babej <tbabej@redhat.com>2014-05-29 10:18:21 +0200
committerPetr Viktorin <pviktori@redhat.com>2014-06-16 19:48:19 +0200
commit926f8647d2a676c1dd2e446633eb76cdf1a7bf0c (patch)
tree06c6519941bba3814a4e41d72580db8fd2814421 /ipa-client
parenta7c2327a366d2dfbbdde5362e957fad23e233105 (diff)
downloadfreeipa-926f8647d2a676c1dd2e446633eb76cdf1a7bf0c.tar.gz
freeipa-926f8647d2a676c1dd2e446633eb76cdf1a7bf0c.tar.xz
freeipa-926f8647d2a676c1dd2e446633eb76cdf1a7bf0c.zip
ipaplatform: Change platform dependant code in freeipa to use ipaplatform tasks
https://fedorahosted.org/freeipa/ticket/4052 Reviewed-By: Petr Viktorin <pviktori@redhat.com>
Diffstat (limited to 'ipa-client')
-rwxr-xr-xipa-client/ipa-install/ipa-client-automount7
-rwxr-xr-xipa-client/ipa-install/ipa-client-install12
-rw-r--r--ipa-client/ipaclient/ntpconf.py7
3 files changed, 14 insertions, 12 deletions
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)
diff --git a/ipa-client/ipaclient/ntpconf.py b/ipa-client/ipaclient/ntpconf.py
index 11d37091e..9a68016e5 100644
--- a/ipa-client/ipaclient/ntpconf.py
+++ b/ipa-client/ipaclient/ntpconf.py
@@ -21,6 +21,7 @@ from ipapython import ipautil
from ipapython import services as ipaservices
import shutil
import os
+from ipaplatform import tasks
ntp_conf = """# Permit time synchronization with our time source, but do not
# permit the source to query or modify the service on this system.
@@ -110,7 +111,7 @@ def config_ntp(server_fqdn, fstore = None, sysstore = None):
ns = ipautil.template_str(ntp_step_tickers, sub_dict)
__backup_config(path_step_tickers, fstore)
__write_config(path_step_tickers, ns)
- ipaservices.restore_context(path_step_tickers)
+ tasks.restore_context(path_step_tickers)
if sysstore:
module = 'ntp'
@@ -120,11 +121,11 @@ def config_ntp(server_fqdn, fstore = None, sysstore = None):
__backup_config(path_ntp_conf, fstore)
__write_config(path_ntp_conf, nc)
- ipaservices.restore_context(path_ntp_conf)
+ tasks.restore_context(path_ntp_conf)
__backup_config(path_ntp_sysconfig, fstore)
__write_config(path_ntp_sysconfig, ntp_sysconfig)
- ipaservices.restore_context(path_ntp_sysconfig)
+ tasks.restore_context(path_ntp_sysconfig)
# Set the ntpd to start on boot
ipaservices.knownservices.ntpd.enable()