Exemple #1
0
    def is_alive_ds(self, ds_ip, ds_port):
        key = ds_alive_key()
        item = '%s:%d' % (ds_ip, ds_port)
        lists = self.get(key)

        ret = False
        if item in lists:
            ret = True

        return ret
Exemple #2
0
    def is_alive_ds(self, ds_ip, ds_port):
        key = ds_alive_key()
        item = '%s:%d' % (ds_ip, ds_port)
        lists = self.get(key)

        ret = False
        if item in lists:
            ret = True

        return ret
Exemple #3
0
    def del_alive_ds(self, ds_ip, ds_port):
        key = ds_alive_key()
        item = '%s:%d' % (ds_ip, ds_port)
        lists = self.get(key)

        ret = True
        if item in lists:
            lists.remove(item)
            ret = self.set(key, lists)

        return ret
Exemple #4
0
    def del_alive_ds(self, ds_ip, ds_port):
        key = ds_alive_key()
        item = '%s:%d' % (ds_ip, ds_port)
        lists = self.get(key)

        ret = True
        if item in lists:
            lists.remove(item)
            ret = self.set(key, lists)

        return ret
Exemple #5
0
    def add_alive_ds(self, ds_ip, ds_port):
        key = ds_alive_key()
        item = '%s:%d' % (ds_ip, ds_port)
        lists = self.get(key)
        if not lists:
            lists = []

        ret = True
        if item not in lists:
            lists.append(item)
            ret = self.set(key, lists)

        return ret
Exemple #6
0
    def add_alive_ds(self, ds_ip, ds_port):
        key = ds_alive_key()
        item = '%s:%d' % (ds_ip, ds_port)
        lists = self.get(key)
        if not lists:
            lists = []

        ret = True
        if item not in lists:
            lists.append(item)
            ret = self.set(key, lists)

        return ret
Exemple #7
0
    def get_alive_ds(self):
        key = ds_alive_key()
        lists = self.get(key)

        return lists
Exemple #8
0
    def get_alive_ds(self):
        key = ds_alive_key()
        lists = self.get(key)

        return lists
Exemple #9
0
def test_ds_alive_key():
    key = ds_alive_key()
    eq_(key, 'ds_alive')