Exemple #1
0
def create_upload_requests(args=None):
    u"""Parâmetro: Lista de volumes. Ex: volume1|volume2|volume3
    Solicita o upload de volumes a fila do offsite"""
    if args is None:
        return

    try:
        volumes = args.split('|')
        volumes = filter(None, volumes)
        volumes = managers.get_volumes_abspath(volumes)
        manager = managers.RemoteManager()

        for volume in volumes:
            manager.create_upload_request(volume)

        manager.generate_database_dump_upload_request()

        queue_manager = queue_service.get_queue_service_manager()
        requests = manager.get_upload_requests()
        for request in requests:
            try:
                queue_manager.add_request(request.id)
            except xmlrpclib.Fault:
                pass

    except IndexError, error:
        # not args.
        pass
Exemple #2
0
def create_upload_requests(args=None):
    u"""Parâmetro: Lista de volumes. Ex: volume1|volume2|volume3
    Solicita o upload de volumes a fila do offsite"""
    if args is None:
        return 

    try:
        volumes = args.split('|')
        volumes = filter(None, volumes)
        volumes = managers.get_volumes_abspath( volumes )
        manager = managers.RemoteManager()

        for volume in volumes:
            manager.create_upload_request( volume )


        manager.generate_database_dump_upload_request()

        queue_manager = queue_service.get_queue_service_manager()
        requests = manager.get_upload_requests()
        for request in requests:
            try:
                queue_manager.add_request(request.id)
            except xmlrpclib.Fault:
                pass

    except IndexError, error:
        # not args.
        pass
Exemple #3
0
    def on_remove(cls, procedure):
        from nimbus.offsite import managers
        from nimbus.offsite import queue_service

        remote_manager = managers.RemoteManager()

        pool_name = procedure.pool_bacula_name()
        medias = Media.objects.filter(pool__name=pool_name).distinct()
        volumes = [m.volumename for m in medias]

        remote_manager.create_deletes_request(volumes)
        queue_service_manager = queue_service.get_queue_service_manager()
        queue_service_manager.run_delete_agent()
Exemple #4
0
    def on_remove(cls, procedure):
        from nimbus.offsite import managers
        from nimbus.offsite import queue_service

        remote_manager = managers.RemoteManager()

        pool_name = procedure.pool_bacula_name()
        medias = Media.objects.filter(pool__name=pool_name).distinct()
        volumes = [m.volumename for m in medias]

        remote_manager.create_deletes_request(volumes)
        queue_service_manager = queue_service.get_queue_service_manager()
        queue_service_manager.run_delete_agent()