def development_ports(): """Augment the configuration with branch-local port numbers.""" settings.STATSD_SERVERS = get_local_server('statsd') settings.aws.S3_PORT = settings.aws.KEYSTONE_PORT = get_local_port('s4') settings.aws.S3_PROXY_HOST = settings.aws.KEYSTONE_PROXY_HOST = 'localhost' proxy_port = get_local_port('storage-proxy') settings.aws.S3_PROXY_PORT = settings.aws.KEYSTONE_PROXY_PORT = proxy_port
def development_ports(config): """Augment the configuration with branch-local port numbers.""" config.statsd.servers = localendpoints.get_local_server('statsd') config.aws_s3.port = localendpoints.get_local_port('s4') config.aws_s3.proxy_host = 'localhost' config.aws_s3.proxy_port = localendpoints.get_local_port('storage-proxy') config.keystone.port = localendpoints.get_local_port('s4') config.keystone.proxy_host = 'localhost' config.keystone.proxy_port = localendpoints.get_local_port('storage-proxy')
def is_running(proc_name, pidfile, service, timeout=1): """Check if we have a postgres instance running.""" if not check_process(proc_name, pidfile): return False try: port = get_local_port(service) s = socket.create_connection(("127.0.0.1", port), timeout) except (IOError, socket.error): return False else: s.close() return True
import time import platform from utilities.utils import get_tmpdir import utilities.localendpoints as local TMP_DIR = get_tmpdir() statsd_log = os.path.join(TMP_DIR, "statsd.log") # allocate and register port statsd_port, = local.allocate_ports(1) local.register_local_port("statsd", statsd_port) # wait for graphite to be done carbon_port = local.get_local_port("carbon_pickle_receiver") s = socket.socket() for i in range(30): try: s.connect(("localhost", carbon_port)) break except socket.error: time.sleep(2) else: print "Carbon isn't up" sys.exit(1) s.close() twistd = "/usr/bin/twistd" cmdline = [twistd, "--reactor=epoll", "--logfile=%s" % statsd_log,
import socket import time import platform from utilities.utils import get_tmpdir import utilities.localendpoints as local TMP_DIR = get_tmpdir() statsd_log = os.path.join(TMP_DIR, "statsd.log") # allocate and register port statsd_port, = local.allocate_ports(1) local.register_local_port("statsd", statsd_port) # wait for graphite to be done carbon_port = local.get_local_port("carbon_pickle_receiver") s = socket.socket() for i in range(30): try: s.connect(("localhost", carbon_port)) break except socket.error: time.sleep(2) else: print "Carbon isn't up" sys.exit(1) s.close() twistd = "/usr/bin/twistd" cmdline = [