How to use the pylxd.managers.BaseManager function in pylxd

To help you get started, we’ve selected a few pylxd examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github lxc / pylxd / pylxd / managers.py View on Github external
def __init__(self, *args, **kwargs):
        manager_for = self.manager_for
        module = '.'.join(manager_for.split('.')[0:-1])
        obj = manager_for.split('.')[-1]
        target_module = importlib.import_module(module)
        target = getattr(target_module, obj)

        methods = inspect.getmembers(target, predicate=inspect.ismethod)
        for name, method in methods:
            func = functools.partial(method, *args, **kwargs)
            setattr(self, name, func)
        return super(BaseManager, self).__init__()
github lxc / pylxd / pylxd / managers.py View on Github external
def __init__(self, *args, **kwargs):
        manager_for = self.manager_for
        module = '.'.join(manager_for.split('.')[0:-1])
        obj = manager_for.split('.')[-1]
        target_module = importlib.import_module(module)
        target = getattr(target_module, obj)

        methods = inspect.getmembers(target, predicate=inspect.ismethod)
        for name, method in methods:
            func = functools.partial(method, *args, **kwargs)
            setattr(self, name, func)
        return super(BaseManager, self).__init__()


class CertificateManager(BaseManager):
    manager_for = 'pylxd.models.Certificate'


class ContainerManager(BaseManager):
    manager_for = 'pylxd.models.Container'


class ImageManager(BaseManager):
    manager_for = 'pylxd.models.Image'


class NetworkManager(BaseManager):
    manager_for = 'pylxd.models.Network'


class OperationManager(BaseManager):
github lxc / pylxd / pylxd / managers.py View on Github external
manager_for = 'pylxd.models.Network'


class OperationManager(BaseManager):
    manager_for = 'pylxd.models.Operation'


class ProfileManager(BaseManager):
    manager_for = 'pylxd.models.Profile'


class SnapshotManager(BaseManager):
    manager_for = 'pylxd.models.Snapshot'


class StoragePoolManager(BaseManager):
    manager_for = 'pylxd.models.StoragePool'


class ClusterMemberManager(BaseManager):
    manager_for = 'pylxd.models.ClusterMember'


class ClusterManager(BaseManager):

    manager_for = 'pylxd.models.Cluster'

    def __init__(self, client, *args, **kwargs):
        super(ClusterManager, self).__init__(client, *args, **kwargs)
        self._client = client
        self.members = ClusterMemberManager(client)
github lxc / pylxd / pylxd / managers.py View on Github external
manager_for = 'pylxd.models.Image'


class NetworkManager(BaseManager):
    manager_for = 'pylxd.models.Network'


class OperationManager(BaseManager):
    manager_for = 'pylxd.models.Operation'


class ProfileManager(BaseManager):
    manager_for = 'pylxd.models.Profile'


class SnapshotManager(BaseManager):
    manager_for = 'pylxd.models.Snapshot'


class StoragePoolManager(BaseManager):
    manager_for = 'pylxd.models.StoragePool'


class ClusterMemberManager(BaseManager):
    manager_for = 'pylxd.models.ClusterMember'


class ClusterManager(BaseManager):

    manager_for = 'pylxd.models.Cluster'

    def __init__(self, client, *args, **kwargs):
github lxc / pylxd / pylxd / managers.py View on Github external
methods = inspect.getmembers(target, predicate=inspect.ismethod)
        for name, method in methods:
            func = functools.partial(method, *args, **kwargs)
            setattr(self, name, func)
        return super(BaseManager, self).__init__()


class CertificateManager(BaseManager):
    manager_for = 'pylxd.models.Certificate'


class ContainerManager(BaseManager):
    manager_for = 'pylxd.models.Container'


class ImageManager(BaseManager):
    manager_for = 'pylxd.models.Image'


class NetworkManager(BaseManager):
    manager_for = 'pylxd.models.Network'


class OperationManager(BaseManager):
    manager_for = 'pylxd.models.Operation'


class ProfileManager(BaseManager):
    manager_for = 'pylxd.models.Profile'


class SnapshotManager(BaseManager):
github lxc / pylxd / pylxd / managers.py View on Github external
manager_for = 'pylxd.models.Certificate'


class ContainerManager(BaseManager):
    manager_for = 'pylxd.models.Container'


class ImageManager(BaseManager):
    manager_for = 'pylxd.models.Image'


class NetworkManager(BaseManager):
    manager_for = 'pylxd.models.Network'


class OperationManager(BaseManager):
    manager_for = 'pylxd.models.Operation'


class ProfileManager(BaseManager):
    manager_for = 'pylxd.models.Profile'


class SnapshotManager(BaseManager):
    manager_for = 'pylxd.models.Snapshot'


class StoragePoolManager(BaseManager):
    manager_for = 'pylxd.models.StoragePool'


class ClusterMemberManager(BaseManager):
github lxc / pylxd / pylxd / managers.py View on Github external
manager_for = 'pylxd.models.Container'


class ImageManager(BaseManager):
    manager_for = 'pylxd.models.Image'


class NetworkManager(BaseManager):
    manager_for = 'pylxd.models.Network'


class OperationManager(BaseManager):
    manager_for = 'pylxd.models.Operation'


class ProfileManager(BaseManager):
    manager_for = 'pylxd.models.Profile'


class SnapshotManager(BaseManager):
    manager_for = 'pylxd.models.Snapshot'


class StoragePoolManager(BaseManager):
    manager_for = 'pylxd.models.StoragePool'


class ClusterMemberManager(BaseManager):
    manager_for = 'pylxd.models.ClusterMember'


class ClusterManager(BaseManager):
github lxc / pylxd / pylxd / managers.py View on Github external
manager_for = 'pylxd.models.Profile'


class SnapshotManager(BaseManager):
    manager_for = 'pylxd.models.Snapshot'


class StoragePoolManager(BaseManager):
    manager_for = 'pylxd.models.StoragePool'


class ClusterMemberManager(BaseManager):
    manager_for = 'pylxd.models.ClusterMember'


class ClusterManager(BaseManager):

    manager_for = 'pylxd.models.Cluster'

    def __init__(self, client, *args, **kwargs):
        super(ClusterManager, self).__init__(client, *args, **kwargs)
        self._client = client
        self.members = ClusterMemberManager(client)


@contextmanager
def web_socket_manager(manager):
    try:
        yield manager
    finally:
        manager.stop()
github lxc / pylxd / pylxd / managers.py View on Github external
return super(BaseManager, self).__init__()


class CertificateManager(BaseManager):
    manager_for = 'pylxd.models.Certificate'


class ContainerManager(BaseManager):
    manager_for = 'pylxd.models.Container'


class ImageManager(BaseManager):
    manager_for = 'pylxd.models.Image'


class NetworkManager(BaseManager):
    manager_for = 'pylxd.models.Network'


class OperationManager(BaseManager):
    manager_for = 'pylxd.models.Operation'


class ProfileManager(BaseManager):
    manager_for = 'pylxd.models.Profile'


class SnapshotManager(BaseManager):
    manager_for = 'pylxd.models.Snapshot'


class StoragePoolManager(BaseManager):
github lxc / pylxd / pylxd / managers.py View on Github external
manager_for = 'pylxd.models.Operation'


class ProfileManager(BaseManager):
    manager_for = 'pylxd.models.Profile'


class SnapshotManager(BaseManager):
    manager_for = 'pylxd.models.Snapshot'


class StoragePoolManager(BaseManager):
    manager_for = 'pylxd.models.StoragePool'


class ClusterMemberManager(BaseManager):
    manager_for = 'pylxd.models.ClusterMember'


class ClusterManager(BaseManager):

    manager_for = 'pylxd.models.Cluster'

    def __init__(self, client, *args, **kwargs):
        super(ClusterManager, self).__init__(client, *args, **kwargs)
        self._client = client
        self.members = ClusterMemberManager(client)


@contextmanager
def web_socket_manager(manager):
    try: