diff options
author | Tomas Babej <tbabej@redhat.com> | 2014-05-29 10:37:18 +0200 |
---|---|---|
committer | Petr Viktorin <pviktori@redhat.com> | 2014-06-16 19:48:19 +0200 |
commit | 49fcd42f8fd71b894a0953a37f10a6c326e16048 (patch) | |
tree | 0c1324c5a3183ce20e92af183ffefde92a77147a /ipa-client/ipaclient | |
parent | 926f8647d2a676c1dd2e446633eb76cdf1a7bf0c (diff) | |
download | freeipa-49fcd42f8fd71b894a0953a37f10a6c326e16048.tar.gz freeipa-49fcd42f8fd71b894a0953a37f10a6c326e16048.tar.xz freeipa-49fcd42f8fd71b894a0953a37f10a6c326e16048.zip |
ipaplatform: Change service code in freeipa to use ipaplatform services
https://fedorahosted.org/freeipa/ticket/4052
Reviewed-By: Petr Viktorin <pviktori@redhat.com>
Diffstat (limited to 'ipa-client/ipaclient')
-rw-r--r-- | ipa-client/ipaclient/ntpconf.py | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/ipa-client/ipaclient/ntpconf.py b/ipa-client/ipaclient/ntpconf.py index 9a68016e5..182c977d2 100644 --- a/ipa-client/ipaclient/ntpconf.py +++ b/ipa-client/ipaclient/ntpconf.py @@ -22,6 +22,7 @@ from ipapython import services as ipaservices import shutil import os from ipaplatform import tasks +from ipaplatform import services ntp_conf = """# Permit time synchronization with our time source, but do not # permit the source to query or modify the service on this system. @@ -115,7 +116,7 @@ def config_ntp(server_fqdn, fstore = None, sysstore = None): if sysstore: module = 'ntp' - sysstore.backup_state(module, "enabled", ipaservices.knownservices.ntpd.is_enabled()) + sysstore.backup_state(module, "enabled", services.knownservices.ntpd.is_enabled()) if config_step_tickers: sysstore.backup_state(module, "step-tickers", True) @@ -128,10 +129,10 @@ def config_ntp(server_fqdn, fstore = None, sysstore = None): tasks.restore_context(path_ntp_sysconfig) # Set the ntpd to start on boot - ipaservices.knownservices.ntpd.enable() + services.knownservices.ntpd.enable() # Restart ntpd - ipaservices.knownservices.ntpd.restart() + services.knownservices.ntpd.restart() def synconce_ntp(server_fqdn): @@ -174,11 +175,11 @@ def check_timedate_services(): https://fedorahosted.org/freeipa/ticket/2974 http://fedoraproject.org/wiki/Features/ChronyDefaultNTP """ - for service in ipaservices.timedate_services: + for service in services.timedate_services: if service == 'ntpd': continue # Make sure that the service is not enabled - service = ipaservices.service(service) + service = services.service(service) if service.is_enabled() or service.is_running(): raise NTPConflictingService(conflicting_service=service.service_name) @@ -187,10 +188,10 @@ def force_ntpd(statestore): Force ntpd configuration and disable and stop any other conflicting time&date service """ - for service in ipaservices.timedate_services: + for service in services.timedate_services: if service == 'ntpd': continue - service = ipaservices.service(service) + service = services.service(service) enabled = service.is_enabled() running = service.is_running() @@ -209,11 +210,11 @@ def restore_forced_ntpd(statestore): Restore from --force-ntpd installation and enable/start service that were disabled/stopped during installation """ - for service in ipaservices.timedate_services: + for service in services.timedate_services: if service == 'ntpd': continue if statestore.has_state(service): - service = ipaservices.service(service) + service = services.service(service) enabled = statestore.restore_state(service.service_name, 'enabled') running = statestore.restore_state(service.service_name, 'running') if enabled: |