Ejemplo n.º 1
0
    def list_from_all_tenants(self):
        hostList = []
        from tenant import Tenant

        obj = Tenant(self.__ipAddr, self.__port)

        tenants = obj.tenant_list()
        uris = []

        for tenant in tenants:
            uris.append(tenant["id"])

        defaultTenantId = obj.tenant_getid()
        uris.append(defaultTenantId)

        for uri in uris:
            if hostList.__len__() == 0:
                hostList = self.list_by_tenant(uri)
            else:
                tempList = self.list_by_tenant(uri)
                for tempHost in tempList:
                    hostList.append(tempHost)

        return hostList