def get_list_servers(self):
        """[summary]

        Returns:
            [dict] -- [description]
        """

        keys = self.get_list_server_keys()
        list_bdds = []
        list_bams = []
        list_vmhosts = []
        for key in keys:
            if key.split('|')[0] == ServerType.BDDS:
                bdds = Bdds()
                bdds.set_from_memcache(
                    key, self.client.get(key).decode())
                list_bdds.append(bdds)
            elif key.split('|')[0] == ServerType.BAM:
                bam = Bam()
                bam.set_from_memcache(
                    key, self.client.get(key).decode())
                list_bams.append(bam)
            elif key.split('|')[0] == ServerType.VM_HOST:
                vm_host = VMHost()
                vm_host.set_from_memcache(
                    key, self.client.get(key).decode())
                list_vmhosts.append(vm_host)
        return list_bdds, list_bams, list_vmhosts
Пример #2
0
 def test_set_from_memcache(self):
     """
     :param:
     :return:
     """
     call_class = Bdds("1", "2", "3", "4")
     key = "key|bam_ip|bam_id"
     value = "name|192.168.88.54|udf"
     call_class.set_from_memcache(key, value)