Beispiel #1
0
def mount_notify_save(mount_id):
    from .models import Mount

    logger.info(
        "Notifying save to mount with id {0}"
        .format(mount_id)
    )

    mount = Mount.objects.get(pk=mount_id)

    sck = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)

    sck.connect(LS_SOCKET_BASE_MOUNT_PATH.format(mount.pk))

    sck.send(LSTN_CMD_NOTIFY_SAVE.encode(encoding='utf_8'))
    sck.send(LSTN_CMD_EXIT.encode(encoding="utf_8"))

    sck.close()

    logger.info(
        "Notified save to mount with id {0}"
        .format(mount_id)
    )
    return
Beispiel #2
0
 def to_representation(self, name):
     return LS_SOCKET_BASE_MOUNT_PATH.format(name)