- Timestamp:
- May 26, 2010 7:25:05 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VBoxShell/vboxshell.py
r29756 r29800 843 843 print "exec in guest needs at least program name" 844 844 return 845 user = " "845 user = "nike" 846 846 passwd = "" 847 847 tmo = 0 … … 1702 1702 if dvd.state != ctx['global'].constants.MediumState_Created: 1703 1703 dvd.refreshState() 1704 print " %s (%s)%s %s" %(colPath(ctx,dvd.location), dvd.format,optId(verbose, hdd.id),colSizeM(ctx,asSize(hdd.size, True)))1704 print " %s (%s)%s %s" %(colPath(ctx,dvd.location), dvd.format,optId(verbose,dvd.id),colSizeM(ctx,asSize(dvd.size, True))) 1705 1705 1706 1706 floppys = ctx['global'].getArray(ctx['vb'], 'floppyImages') … … 1709 1709 if floppy.state != ctx['global'].constants.MediumState_Created: 1710 1710 floppy.refreshState() 1711 print " %s (%s)%s %s" %(colPath(ctx,floppy.location), floppy.format,optId(verbose, hdd.id), colSizeM(ctx,asSize(hdd.size, True)))1711 print " %s (%s)%s %s" %(colPath(ctx,floppy.location), floppy.format,optId(verbose,floppy.id), colSizeM(ctx,asSize(floppy.size, True))) 1712 1712 1713 1713 return 0 … … 2407 2407 } 2408 2408 2409 if args[1] == 'help':2409 if len(args) < 2 or args[1] == 'help': 2410 2410 if len(args) > 2: 2411 2411 print natcommands[args[2]].__doc__ … … 2470 2470 (rc, r) = nicSwitchOnOff(adapter, 'traceEnabled', args) 2471 2471 if len(args) == 1 and rc == 0: 2472 r = '%s file:%s' % (r, adapter.traceFile) 2472 r = '%s file:%s' % (r, adapter.traceFile) 2473 2473 return (0, r) 2474 2474 elif len(args) == 3 and rc == 0: … … 2529 2529 ctx['global'].constants.NetworkAttachmentType_HostOnly: ('HostOnly', adapter.hostInterface), 2530 2530 #ctx['global'].constants.NetworkAttachmentType_VDE: ('VDE', adapter.VDENetwork) 2531 } 2531 } 2532 2532 import types 2533 2533 if type(adapter.attachmentType) != types.IntType: … … 2540 2540 nicAttachmentType = { 2541 2541 'Null': { 2542 'v': lambda: len(args) == 2, 2542 'v': lambda: len(args) == 2, 2543 2543 'p': lambda: 'do nothing', 2544 2544 'f': lambda: adapter.detach()}, 2545 2545 'NAT': { 2546 'v': lambda: len(args) == 2, 2546 'v': lambda: len(args) == 2, 2547 2547 'p': lambda: 'do nothing', 2548 2548 'f': lambda: adapter.attachToNAT()}, … … 2559 2559 'p': lambda: adapter.__setattr__('hostInterface', args[2]), 2560 2560 'f': lambda: adapter.attachToHostOnlyInterface()}, 2561 'VDE': { 2561 'VDE': { 2562 2562 'v': lambda: len(args) == 3, 2563 2563 'p': lambda: adapter.__setattr__('VDENetwork', args[2]), 2564 2564 'f': lambda: adapter.attachToVDE()} 2565 } 2565 } 2566 2566 if args[1] not in nicAttachmentType.keys(): 2567 2567 print '{0} not in acceptable values ({1})'.format(args[1], nicAttachmentType.keys()) 2568 2568 return (1, None) 2569 2569 if not nicAttachmentType[args[1]]['v'](): 2570 print nicAttachmentType.__doc__ 2570 print nicAttachmentType.__doc__ 2571 2571 return (1, None) 2572 2572 nicAttachmentType[args[1]]['p']() … … 2576 2576 def nicCmd(ctx, args): 2577 2577 ''' 2578 This command to manage network adapters 2578 This command to manage network adapters 2579 2579 usage: nic <vm> <nicnum> <cmd> <cmd-args> 2580 2580 where cmd : attachment, trace, linespeed, cable, enable, type … … 2589 2589 'type': nicTypeSubCmd 2590 2590 } 2591 if args[1] == 'help'\2592 or len(args) < 2\2591 if len(args) < 2 \ 2592 or args[1] == 'help' \ 2593 2593 or (len(args) > 2 and args[3] not in niccomand): 2594 2594 if len(args) == 3 \ 2595 2595 and args[2] in niccomand: 2596 print niccomand[args[2]].__doc__ 2596 print niccomand[args[2]].__doc__ 2597 2597 else: 2598 2598 print nicCmd.__doc__ … … 2603 2603 print 'please specify vm' 2604 2604 return 0 2605 2605 2606 2606 if len(args) < 3 \ 2607 2607 or not args[2].isdigit() \ … … 2611 2611 nicnum = int(args[2]) 2612 2612 cmdargs = args[3:] 2613 func = args[3] 2613 func = args[3] 2614 2614 session = None 2615 session = ctx['global'].openMachineSession(vm.id) 2615 session = ctx['global'].openMachineSession(vm.id) 2616 2616 vm = session.machine 2617 2617 adapter = vm.getNetworkAdapter(nicnum)
Note:
See TracChangeset
for help on using the changeset viewer.