summaryrefslogtreecommitdiffstats
path: root/ipaserver
diff options
context:
space:
mode:
authorMartin Basti <mbasti@redhat.com>2015-03-23 13:00:49 +0100
committerPetr Vobornik <pvoborni@redhat.com>2015-04-14 19:25:47 +0200
commitd09706a8c8ed02506a9486f919df3d1c2a8e8087 (patch)
tree6eea2ab51176a2fa9c9d2268f5a48262a620692b /ipaserver
parentb605ccc94bef9a280aa500d57caa74d95e230b4b (diff)
downloadfreeipa-d09706a8c8ed02506a9486f919df3d1c2a8e8087.tar.gz
freeipa-d09706a8c8ed02506a9486f919df3d1c2a8e8087.tar.xz
freeipa-d09706a8c8ed02506a9486f919df3d1c2a8e8087.zip
Server Upgrade: restart DS using ipaplatfom service
Removes extra class DSRestart which do the same thing https://fedorahosted.org/freeipa/ticket/4904 Reviewed-By: David Kupka <dkupka@redhat.com>
Diffstat (limited to 'ipaserver')
-rw-r--r--ipaserver/install/ldapupdate.py8
-rw-r--r--ipaserver/install/plugins/baseupdate.py47
2 files changed, 4 insertions, 51 deletions
diff --git a/ipaserver/install/ldapupdate.py b/ipaserver/install/ldapupdate.py
index 6d1c589ec..1f30f4b21 100644
--- a/ipaserver/install/ldapupdate.py
+++ b/ipaserver/install/ldapupdate.py
@@ -36,11 +36,11 @@ import krbV
import ldap
from ipaserver.install import installutils
-from ipaserver.install.plugins.baseupdate import DSRestart
from ipapython import ipautil, ipaldap
from ipalib import errors
from ipalib import api, create_api
from ipaplatform.paths import paths
+from ipaplatform import services
from ipapython.dn import DN
from ipapython.ipa_log_manager import *
from ipapython.ipautil import wait_for_open_socket
@@ -883,7 +883,7 @@ class LDAPUpdate:
self.conn = None
def restart_ds(self):
- dsrestart = DSRestart()
-
- dsrestart.create_instance()
+ dirsrv = services.knownservices.dirsrv
+ self.log.info('Restarting directory server to apply updates')
+ dirsrv.restart()
wait_for_open_socket(self.socket_name)
diff --git a/ipaserver/install/plugins/baseupdate.py b/ipaserver/install/plugins/baseupdate.py
deleted file mode 100644
index d39d8ac89..000000000
--- a/ipaserver/install/plugins/baseupdate.py
+++ /dev/null
@@ -1,47 +0,0 @@
-# Authors:
-# Rob Crittenden <rcritten@redhat.com>
-#
-# Copyright (C) 2011 Red Hat
-# see file 'COPYING' for use and warranty information
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-
-from ipalib import api
-from ipalib import Object
-from ipaserver.install import service
-
-class DSRestart(service.Service):
- """
- Restart the 389-ds service.
- """
- def __init__(self):
- """
- This class is present to provide ldapupdate the means to
- restart 389-ds.
- """
- service.Service.__init__(self, "dirsrv")
-
- def start(self, instance_name="", capture_output=True, wait=True):
- """
- During upgrades the server is listening only on the socket so
- we don't want to wait on ports. The caller is responsible for
- waiting for the socket to be ready.
- """
- super(DSRestart, self).start(wait=False)
-
- def create_instance(self):
- self.step("stopping directory server", self.stop)
- self.step("starting directory server", self.start)
- self.start_creation(start_message="Restarting Directory server "
- "to apply updates", show_service_name=False)