Example #1
0
    def get_running_processes(self):
        processes = {}
        ports = []
        passwords = []
        for port in self.busy_ports:
            conf_path = redis_service.get_redis_conf_path(port)

            if port == redis_service.__redis__['defaults']['port']:
                args = ('ps', '-G', 'redis', '-o', 'command', '--no-headers')
                out = system2(args, silent=True)[0].split('\n')
                try:
                    p = [x for x in out if x and __redis__['redis-server'] in x and __redis__['defaults']['redis.conf'] in x]
                except PopenError:
                    p = []
                if p:
                    conf_path = __redis__['defaults']['redis.conf']

            LOG.debug('Got config path %s for port %s' % (conf_path, port))
            redis_conf = redis_service.RedisConf(conf_path)
            password = redis_conf.requirepass
            processes[port] = password
            ports.append(port)
            passwords.append(password)
            LOG.debug('Redis config %s has password %s' % (conf_path, password))
        return dict(ports=ports, passwords=passwords)
Example #2
0
    def get_running_processes(self):
        processes = {}
        ports = []
        passwords = []
        for port in self.busy_ports:
            conf_path = redis_service.get_redis_conf_path(port)

            if port == redis_service.DEFAULT_PORT:
                args = ("ps", "-G", "redis", "-o", "command", "--no-headers")
                out = system2(args, silent=True)[0].split("\n")
                try:
                    p = [x for x in out if x and BIN_PATH in x and redis_service.DEFAULT_CONF_PATH in x]
                except PopenError:
                    p = []
                if p:
                    conf_path = redis_service.DEFAULT_CONF_PATH

            LOG.debug("Got config path %s for port %s" % (conf_path, port))
            redis_conf = redis_service.RedisConf(conf_path)
            password = redis_conf.requirepass
            processes[port] = password
            ports.append(port)
            passwords.append(password)
            LOG.debug("Redis config %s has password %s" % (conf_path, password))
        return dict(ports=ports, passwords=passwords)
Example #3
0
    def get_running_processes(self):
        processes = {}
        ports = []
        passwords = []
        for port in self.busy_ports:
            conf_path = redis_service.get_redis_conf_path(port)

            if port == redis_service.DEFAULT_PORT:
                args = ('ps', '-G', 'redis', '-o', 'command', '--no-headers')
                out = system2(args, silent=True)[0].split('\n')
                try:
                    p = [x for x in out if x and BIN_PATH in x and redis_service.DEFAULT_CONF_PATH in x]
                except PopenError:
                    p = []
                if p:
                    conf_path = redis_service.DEFAULT_CONF_PATH

            LOG.debug('Got config path %s for port %s' % (conf_path, port))
            redis_conf = redis_service.RedisConf(conf_path)
            password = redis_conf.requirepass
            processes[port] = password
            ports.append(port)
            passwords.append(password)
            LOG.debug('Redis config %s has password %s' % (conf_path, password))
        return dict(ports=ports, passwords=passwords)
Example #4
0
    def get_running_processes(self):
        processes = {}
        ports = []
        passwords = []
        for port in self.busy_ports:
            conf_path = redis_service.get_redis_conf_path(port)

            if port == redis_service.__redis__['defaults']['port']:
                args = ('ps', '-G', 'redis', '-o', 'command', '--no-headers')
                out = system2(args, silent=True)[0].split('\n')
                default_path = __redis__['defaults']['redis.conf']
                try:
                    p = [
                        x for x in out if x and __redis__['redis-server'] in x
                        and default_path in x
                    ]
                except PopenError:
                    p = []
                if p:
                    conf_path = __redis__['defaults']['redis.conf']

            LOG.debug('Got config path %s for port %s', conf_path, port)
            redis_conf = redis_service.RedisConf(conf_path)
            password = redis_conf.requirepass
            processes[port] = password
            ports.append(port)
            passwords.append(password)
            LOG.debug('Redis config %s has password %s', conf_path, password)
        return dict(ports=ports, passwords=passwords)
Example #5
0
    def _get_conf(self, port):
        conf_path = redis_service.get_redis_conf_path(port)

        if port == redis_service.__redis__['defaults']['port']:
            args = ('ps', '-G', 'redis', '-o', 'command', '--no-headers')
            out = system2(args, silent=True)[0].split('\n')
            default_path = __redis__['defaults']['redis.conf']
            try:
                p = [x for x in out if x and __redis__['redis-server'] in x and default_path in x]
            except PopenError:
                p = []
            if p:
                conf_path = __redis__['defaults']['redis.conf']

        LOG.debug('Got config path %s for port %s', conf_path, port)
        redis_conf = redis_service.RedisConf(conf_path)
        return redis_conf
Example #6
0
    def _get_conf(self, port):
        conf_path = redis_service.get_redis_conf_path(port)

        if port == redis_service.__redis__['defaults']['port']:
            args = ('ps', '-G', 'redis', '-o', 'command', '--no-headers')
            out = system2(args, silent=True)[0].split('\n')
            default_path = __redis__['defaults']['redis.conf']
            try:
                p = [
                    x for x in out if x and __redis__['redis-server'] in x
                    and default_path in x
                ]
            except PopenError:
                p = []
            if p:
                conf_path = __redis__['defaults']['redis.conf']

        LOG.debug('Got config path %s for port %s', conf_path, port)
        redis_conf = redis_service.RedisConf(conf_path)
        return redis_conf
Example #7
0
	def get_running_processes(self):
		processes = {}
		ports = []
		passwords = []
		for port in self.busy_ports:
			conf_path = redis_service.get_redis_conf_path(port)
			
			if port == redis_service.DEFAULT_PORT:
				args = ('ps', '-G', 'redis', '-o', 'command', '--no-headers')
				out = system2(args, silent=True)[0].split('\n')
				try:
					p = [x for x in out if x and BIN_PATH in x and redis_service.DEFAULT_CONF_PATH in x]
				except PopenError,e:
					p = []
				if p:
					conf_path = redis_service.DEFAULT_CONF_PATH
					
			LOG.debug('Got config path %s for port %s' % (conf_path, port))
			redis_conf = redis_service.RedisConf(conf_path)
			password = redis_conf.requirepass
			processes[port] = password
			ports.append(port)
			passwords.append(password)
			LOG.debug('Redis config %s has password %s' % (conf_path, password))
Example #8
0
	def __init__(self):
		cnf_path = redis.get_redis_conf_path()
		CnfController.__init__(self, BEHAVIOUR, cnf_path, 'redis', {'1':'yes', '0':'no'})
Example #9
0
 def __init__(self):
     cnf_path = redis.get_redis_conf_path()
     CnfController.__init__(self, BEHAVIOUR, cnf_path, 'redis', {'1':'yes', '0':'no'})