def save_cpu_pools(self): cpu_pool_records = dict([ (cpu_pool_uuid, XendAPIStore.get(cpu_pool_uuid, XendCPUPool.getClass()).get_record()) for cpu_pool_uuid in XendCPUPool.get_all_managed() ]) self.state_store.save_state(XendCPUPool.getClass(), cpu_pool_records)
def _init_cpu_pools(self): # Initialise cpu_pools saved_cpu_pools = self.state_store.load_state(XendCPUPool.getClass()) if saved_cpu_pools: for cpu_pool_uuid, cpu_pool in saved_cpu_pools.items(): try: XendCPUPool.recreate(cpu_pool, cpu_pool_uuid) except CreateUnspecifiedAttributeError: log.warn("Error recreating %s %s", (XendCPUPool.getClass(), cpu_pool_uuid)) XendCPUPool.recreate_active_pools()
def save_cpu_pools(self): cpu_pool_records = dict([(cpu_pool_uuid, XendAPIStore.get( cpu_pool_uuid, XendCPUPool.getClass()).get_record()) for cpu_pool_uuid in XendCPUPool.get_all_managed()]) self.state_store.save_state(XendCPUPool.getClass(), cpu_pool_records)