Exemplo n.º 1
0
def delete_queued_image(options, args):
    """
%(prog)s delete-queued-image <IMAGE_ID> [options]

Deletes an image from the cache
    """
    if len(args) == 1:
        image_id = args.pop()
    else:
        print("Please specify one and only ID of the image you wish to ")
        print("delete from the cache as the first argument")
        return FAILURE

    if (not options.force and
        not user_confirm("Delete queued image %(image_id)s?" %
                         {'image_id': image_id}, default=False)):
        return SUCCESS

    client = get_client(options)
    client.delete_queued_image(image_id)

    if options.verbose:
        print("Deleted queued image %(image_id)s" % {'image_id': image_id})

    return SUCCESS
Exemplo n.º 2
0
def delete_queued_image(options, args):
    """
%(prog)s delete-queued-image <IMAGE_ID> [options]

Deletes an image from the cache
    """
    if len(args) == 1:
        image_id = args.pop()
    else:
        print("Please specify one and only ID of the image you wish to ")
        print("delete from the cache as the first argument")
        return FAILURE

    if (not options.force and
        not user_confirm("Delete queued image %(image_id)s?" %
                         {'image_id': image_id}, default=False)):
        return SUCCESS

    client = get_client(options)
    client.delete_queued_image(image_id)

    if options.verbose:
        print("Deleted queued image %(image_id)s" % {'image_id': image_id})

    return SUCCESS
Exemplo n.º 3
0
def delete_queued_image(args):
    """%(prog)s delete-queued-image <IMAGE_ID> [options]

    Deletes an image from the cache.
    """
    image_id = args.command[1]
    if (not args.force and not user_confirm(
            "Delete queued image %(image_id)s?" % {'image_id': image_id},
            default=False)):
        return SUCCESS

    client = get_client(args)
    client.delete_queued_image(image_id)

    if args.verbose:
        print("Deleted queued image %(image_id)s" % {'image_id': image_id})

    return SUCCESS
Exemplo n.º 4
0
def delete_queued_image(options, args):
    """
%(prog)s delete-queued-image [options]

Deletes an image from the cache"""
    try:
        image_id = args.pop()
    except IndexError:
        print "Please specify the ID of the image you wish to delete "
        print "from the cache as the first argument"
        return FAILURE

    if (not options.force and
        not user_confirm("Delete queued image %s?" % (image_id,),
                         default=False)):
        return SUCCESS

    client = get_client(options)
    client.delete_queued_image(image_id)

    if options.verbose:
        print "Deleted queued image %(image_id)s" % locals()

    return SUCCESS
Exemplo n.º 5
0
def delete_queued_image(options, args):
    """
%(prog)s delete-queued-image [options]

Deletes an image from the cache"""
    try:
        image_id = args.pop()
    except IndexError:
        print "Please specify the ID of the image you wish to delete "
        print "from the cache as the first argument"
        return FAILURE

    if (not options.force
            and not user_confirm("Delete queued image %s?" % (image_id, ),
                                 default=False)):
        return SUCCESS

    client = get_client(options)
    client.delete_queued_image(image_id)

    if options.verbose:
        print "Deleted queued image %(image_id)s" % locals()

    return SUCCESS