def queue_image(options, args): """%(prog)s queue-image <IMAGE_ID> [options] Queues an image for caching """ if len(args) == 1: image_id = args.pop() else: print("Please specify one and only ID of the image you wish to ") print("queue from the cache as the first argument") return FAILURE if (not options.force and not user_confirm("Queue image %(image_id)s for caching?" % {'image_id': image_id}, default=False)): return SUCCESS client = get_client(options) client.queue_image_for_caching(image_id) if options.verbose: print("Queued image %(image_id)s for caching" % {'image_id': image_id}) return SUCCESS
def queue_image(options, args): """%(prog)s queue-image <IMAGE_ID> [options] Queues an image for caching """ if len(args) == 1: image_id = args.pop() else: print("Please specify one and only ID of the image you wish to ") print("queue from the cache as the first argument") return FAILURE if (not options.force and not user_confirm("Queue image %(image_id)s for caching?" % {'image_id': image_id}, default=False)): return SUCCESS client = get_client(options) client.queue_image_for_caching(image_id) if options.verbose: print("Queued image %(image_id)s for caching" % {'image_id': image_id}) return SUCCESS
def queue_image(args): """%(prog)s queue-image <IMAGE_ID> [options] Queues an image for caching. """ image_id = args.command[1] if (not args.force and not user_confirm( "Queue image %(image_id)s for caching?" % {'image_id': image_id}, default=False)): return SUCCESS client = get_client(args) client.queue_image_for_caching(image_id) if args.verbose: print("Queued image %(image_id)s for caching" % {'image_id': image_id}) return SUCCESS
def queue_image(options, args): """ %(prog)s queue-image <IMAGE_ID> [options] Queues an image for caching""" try: image_id = args.pop() except IndexError: print "Please specify the ID of the image you wish to queue " print "from the cache as the first argument" return FAILURE if (not options.force and not user_confirm("Queue image %s for caching?" % (image_id,), default=False)): return SUCCESS client = get_client(options) client.queue_image_for_caching(image_id) if options.verbose: print "Queued image %(image_id)s for caching" % locals() return SUCCESS
def queue_image(options, args): """ %(prog)s queue-image <IMAGE_ID> [options] Queues an image for caching""" try: image_id = args.pop() except IndexError: print "Please specify the ID of the image you wish to queue " print "from the cache as the first argument" return FAILURE if (not options.force and not user_confirm("Queue image %s for caching?" % (image_id, ), default=False)): return SUCCESS client = get_client(options) client.queue_image_for_caching(image_id) if options.verbose: print "Queued image %(image_id)s for caching" % locals() return SUCCESS