summaryrefslogtreecommitdiffstats
path: root/ipaserver/install/installutils.py
diff options
context:
space:
mode:
authorJr Aquino <jr.aquino@citrix.com>2011-09-08 12:07:26 -0700
committerRob Crittenden <rcritten@redhat.com>2011-09-12 16:28:27 -0400
commit8b3336ef55fa569e4f08307bf939a9698ce70645 (patch)
tree9463b195502b37434fca56d5c3091a9391bade84 /ipaserver/install/installutils.py
parenta40d4d4d643cb3a4846f21857e611a76f5037ce8 (diff)
downloadfreeipa-8b3336ef55fa569e4f08307bf939a9698ce70645.tar.gz
freeipa-8b3336ef55fa569e4f08307bf939a9698ce70645.tar.xz
freeipa-8b3336ef55fa569e4f08307bf939a9698ce70645.zip
Move Managed Entries into their own container in the replicated space.
Repoint cn=Managed Entries,cn=plugins,cn=config in common_setup Create: cn=Managed Entries,cn=etc,$SUFFIX Create: cn=Definitions,cn=Managed Entries,cn=etc,$SUFFIX Create: cn=Templates,cn=Managed Entries,cn=etc,$SUFFIX Create method for dynamically migrating any and all custom Managed Entries from the cn=config space into the new container. Separate the connection creation during update so that a restart can be performed to initialize changes before performing a delete. Add wait_for_open_socket() method in installutils https://fedorahosted.org/freeipa/ticket/1708
Diffstat (limited to 'ipaserver/install/installutils.py')
-rw-r--r--ipaserver/install/installutils.py21
1 files changed, 21 insertions, 0 deletions
diff --git a/ipaserver/install/installutils.py b/ipaserver/install/installutils.py
index fd978e713..57601d7af 100644
--- a/ipaserver/install/installutils.py
+++ b/ipaserver/install/installutils.py
@@ -441,6 +441,27 @@ def wait_for_open_ports(host, ports, timeout=0):
else:
raise e
+def wait_for_open_socket(socket_name, timeout=0):
+ """
+ Wait until the specified socket on the local host is open. Timeout
+ in seconds may be specified to limit the wait.
+ """
+ op_timeout = time.time() + timeout
+
+ while True:
+ try:
+ s = socket.socket(socket.AF_UNIX)
+ s.connect(socket_name)
+ s.close()
+ break;
+ except socket.error, e:
+ if e.errno == 111: # 111: Connection refused
+ if timeout and time.time() > op_timeout: # timeout exceeded
+ raise e
+ time.sleep(1)
+ else:
+ raise e
+
def resolve_host(host_name):
try:
addrinfos = socket.getaddrinfo(host_name, None,