VirtualBox

Changeset 29052 in vbox for trunk/src/VBox


Ignore:
Timestamp:
May 5, 2010 2:59:23 AM (15 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
61101
Message:

VBoxShell: replaces with None in tuples returned with nat's commannds.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VBoxShell/vboxshell.py

    r29051 r29052  
    22082208                    print 'Invalid alias mode: ' + args[a]
    22092209                    print natAlias.__doc__
    2210                     return (1, '')
     2210                    return (1, None)
    22112211                nat.aliasMode = int(nat.aliasMode) | alias[args[a]];
    2212     return (0, '')
     2212    return (0, None)
    22132213
    22142214def natSettings(ctx, mach, nicnum, nat, args):
     
    22312231        if args[1] < 16000:
    22322232            print 'invalid mtu value ({0} no in range [65 - 16000])'.format(args[1])
    2233             return (1, '')
     2233            return (1, None)
    22342234        for i in range(2, len(args)):
    22352235            if not args[i].isdigit() or int(args[i]) < 8 or int(args[i]) > 1024:
    22362236                print 'invalid {0} parameter ({1} not in range [8-1024])'.format(i, args[i])
    2237                 return (1,'')
     2237                return (1, None)
    22382238        a = [args[1]]
    22392239        if len(args) < 6:
     
    22442244        #print a
    22452245        nat.setNetworkSettings(int(a[0]), int(a[1]), int(a[2]), int(a[3]), int(a[4]))
    2246     return (0,'')
     2246    return (0, None)
    22472247
    22482248def natDns(ctx, mach, nicnum, nat, args):
     
    22612261        nat.dnsProxy =  'proxy' in args
    22622262        nat.dnsUseHostResolver =  'usehostresolver' in args
    2263     return (0, '')
     2263    return (0, None)
    22642264
    22652265def natTftp(ctx, mach, nicnum, nat, args):
     
    22952295            print 'invalid args:', args
    22962296            print natTftp.__doc__
    2297             return (1,'')
     2297            return (1, None)
    22982298        if cmd == 'prefix': nat.tftpPrefix = args[2]
    22992299        elif cmd == 'bootfile': nat.tftpBootFile = args[2]
     
    23012301        else:
    23022302            print "invalid cmd:", cmd
    2303             return (1, '')
    2304     return (0,'')
     2303            return (1, None)
     2304    return (0, None)
    23052305
    23062306def natPortForwarding(ctx, mach, nicnum, nat, args):
     
    23452345            print 'invalid port-forwarding or args of sub command ', args[1]
    23462346            print natPortForwarding.__doc__
    2347             return (1, '')
     2347            return (1, None)
    23482348
    23492349        a = pfcmd[args[1]]['func']()
    2350     return (0,'')
     2350    return (0, None)
    23512351
    23522352def natNetwork(ctx, mach, nicnum, nat, args):
     
    23642364        if addr.count('.') > 3 or int(mask) < 0 or int(mask) > 32:
    23652365            print 'Invalid arguments'
    2366             return (1,'')
     2366            return (1, None)
    23672367        nat.network = args[1]
    2368     return (0, '')
     2368    return (0, None)
    23692369def natCmd(ctx, args):
    23702370    """This command is entry point to NAT settins management
     
    24222422            mach.saveSettings()
    24232423        session.close()
    2424     else:
     2424    elif report is not None:
    24252425        for r in report:
    24262426            msg ='{0} nic{1} {2}: {3}'.format(mach.name, nicnum, func, r)
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette