print_detail("Invalid action requested (%s)\n" % options.action) else: print_detail("No action specified\n") parser.print_help() abort("") backend_proxy = PdiskBackendProxyFactory.createBackendProxy(ch) # Execute requested action status = 0 if options.action == 'check': print_detail("Checking LUN existence...", 1) lun = LUN(args[0], proxy=backend_proxy) status = lun.check() elif options.action == 'create': print_detail("Creating LUN...", 1) lun = LUN(args[0], size=args[1], proxy=backend_proxy) status = lun.create() elif options.action == 'delete': print_detail("Deleting LUN...", 1) lun = LUN(args[0], proxy=backend_proxy) status = lun.delete() elif options.action == 'getturl': print_detail("Returning Transport URL...", 1) lun = LUN(args[0], proxy=backend_proxy) turl = lun.getTurl() # If an error occured, it has already been signaled. # If it succeeds, rebasedLUN should always be defined... if turl:
print_detail("Invalid action requested (%s)\n" % options.action) else: print_detail("No action specified\n") parser.print_help() abort("") backend_proxy = PdiskBackendProxyFactory.createBackendProxy(ch) # Execute requested action status = 0 if options.action == 'check': print_detail("Checking LUN existence...", 1) lun = LUN(args[0], proxy=backend_proxy) status = lun.check() elif options.action == 'create': print_detail("Creating LUN...", 1) lun = LUN(args[0], size=args[1], proxy=backend_proxy) status = lun.create() elif options.action == 'delete': print_detail("Deleting LUN...", 1) lun = LUN(args[0], proxy=backend_proxy) status = lun.delete() elif options.action == 'getturl' : print_detail("Returning Transport URL...", 1) lun = LUN(args[0], proxy=backend_proxy) turl = lun.getTurl() # If an error occured, it has already been signaled. # If it succeeds, rebasedLUN should always be defined... if turl: