def list_clouds(request): """Gets the available clouds. .. note:: Currently, this is only used by the cloud controller in js. """ user = user_from_request(request) return methods.list_clouds(user)
def list_clouds(self): clouds = methods.list_clouds(self.user) self.send('list_clouds', clouds) for key, task in (('list_machines', tasks.ListMachines()), ('list_images', tasks.ListImages()), ('list_sizes', tasks.ListSizes()), ('list_networks', tasks.ListNetworks()), ('list_locations', tasks.ListLocations()), ('list_projects', tasks.ListProjects()),): for cloud_id in self.user.clouds: if self.user.clouds[cloud_id].enabled: cached = task.smart_delay(self.user.email, cloud_id) if cached is not None: log.info("Emitting %s from cache", key) self.send(key, cached)
def list_clouds(self): clouds = methods.list_clouds(self.user) self.send('list_clouds', clouds) for key, task in ( ('list_machines', tasks.ListMachines()), ('list_images', tasks.ListImages()), ('list_sizes', tasks.ListSizes()), ('list_networks', tasks.ListNetworks()), ('list_locations', tasks.ListLocations()), ('list_projects', tasks.ListProjects()), ): for cloud_id in self.user.clouds: if self.user.clouds[cloud_id].enabled: cached = task.smart_delay(self.user.email, cloud_id) if cached is not None: log.info("Emitting %s from cache", key) self.send(key, cached)