예제 #1
0
def list_backends(request):
    """Gets the available backends.

    .. note:: Currently, this is only used by the backend controller in js.

    """

    user = user_from_request(request)
    return methods.list_backends(user)
예제 #2
0
def list_backends(request):
    """Gets the available backends.

    .. note:: Currently, this is only used by the backend controller in js.

    """

    user = user_from_request(request)
    return methods.list_backends(user)
예제 #3
0
파일: sockio.py 프로젝트: dz0ny/mist.io
def list_backends_from_socket(namespace):
    user = namespace.user
    backends = methods.list_backends(user)
    namespace.emit('list_backends', backends)
    for key, task in (('list_machines', tasks.ListMachines()),
                      ('list_images', tasks.ListImages()), ('list_sizes',
                                                            tasks.ListSizes()),
                      ('list_locations', tasks.ListLocations())):
        for backend_id in user.backends:
            if user.backends[backend_id].enabled:
                cached = task.smart_delay(user.email, backend_id)
                if cached is not None:
                    namespace.emit(key, cached)
예제 #4
0
파일: sockio.py 프로젝트: ShamailXD/mist.io
def list_backends_from_socket(namespace):
    user = namespace.user
    backends = methods.list_backends(user)
    namespace.emit('list_backends', backends)
    for key, task in (('list_machines', tasks.ListMachines()),
                      ('list_images', tasks.ListImages()),
                      ('list_sizes', tasks.ListSizes()),
                      ('list_locations', tasks.ListLocations())):
        for backend_id in user.backends:
            if user.backends[backend_id].enabled:
                cached = task.smart_delay(user.email, backend_id)
                if cached is not None:
                    namespace.emit(key, cached)
예제 #5
0
파일: sock.py 프로젝트: Gazzonyx/mist.io
 def list_backends(self):
     backends = methods.list_backends(self.user)
     self.send('list_backends', backends)
     for key, task in (('list_machines', tasks.ListMachines()),
                       ('list_images', tasks.ListImages()),
                       ('list_sizes', tasks.ListSizes()),
                       ('list_networks', tasks.ListNetworks()),
                       ('list_locations', tasks.ListLocations()),):
         for backend_id in self.user.backends:
             if self.user.backends[backend_id].enabled:
                 cached = task.smart_delay(self.user.email, backend_id)
                 if cached is not None:
                     log.info("Emitting %s from cache", key)
                     self.send(key, cached)
예제 #6
0
 def list_backends(self):
     backends = methods.list_backends(self.user)
     self.send('list_backends', backends)
     for key, task in (('list_machines', tasks.ListMachines()),
                       ('list_images', tasks.ListImages()),
                       ('list_sizes', tasks.ListSizes()),
                       ('list_networks', tasks.ListNetworks()),
                       ('list_locations', tasks.ListLocations()),):
         for backend_id in self.user.backends:
             if self.user.backends[backend_id].enabled:
                 cached = task.smart_delay(self.user.email, backend_id)
                 if cached is not None:
                     log.info("Emitting %s from cache", key)
                     self.send(key, cached)