summaryrefslogtreecommitdiffstats
path: root/src/lib/Bcfg2/Component.py
diff options
context:
space:
mode:
authorSol Jerome <sol.jerome@gmail.com>2012-07-08 16:24:06 -0500
committerSol Jerome <sol.jerome@gmail.com>2012-07-08 16:24:06 -0500
commit77f75b406d84cb799b03fd3977a3c9407af69a5b (patch)
treeb842f6b1090be2ea0dcc22793260c4660ebae1e5 /src/lib/Bcfg2/Component.py
parent95debe731f8621b4ada9218e9f8ab8fecadf163a (diff)
downloadbcfg2-77f75b406d84cb799b03fd3977a3c9407af69a5b.tar.gz
bcfg2-77f75b406d84cb799b03fd3977a3c9407af69a5b.tar.bz2
bcfg2-77f75b406d84cb799b03fd3977a3c9407af69a5b.zip
Add IPv6 support
Signed-off-by: Sol Jerome <sol.jerome@gmail.com>
Diffstat (limited to 'src/lib/Bcfg2/Component.py')
-rw-r--r--src/lib/Bcfg2/Component.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/lib/Bcfg2/Component.py b/src/lib/Bcfg2/Component.py
index eb9ea166a..b6cea3e22 100644
--- a/src/lib/Bcfg2/Component.py
+++ b/src/lib/Bcfg2/Component.py
@@ -6,6 +6,7 @@ import inspect
import logging
import os
import pydoc
+import socket
import sys
import time
import threading
@@ -59,12 +60,14 @@ def run_component(component_cls, listen_all, location, daemon, pidfile_name,
pidfile.close()
component = component_cls(cfile=cfile, **cls_kwargs)
- up = urlparse(location)
- port = tuple(up[1].split(':'))
- port = (port[0], int(port[1]))
+ hostname, port = urlparse(location)[1].split(':')
+ server_address = socket.getaddrinfo(hostname,
+ port,
+ socket.AF_UNSPEC,
+ socket.SOCK_STREAM)[0][4]
try:
server = XMLRPCServer(listen_all,
- port,
+ server_address,
keyfile=keyfile,
certfile=certfile,
register=register,