VirtualBox

Ignore:
Timestamp:
Jul 25, 2012 9:22:54 AM (12 years ago)
Author:
vboxsync
Message:

vboxshell.py: update to current API state (hopefully)

File:
1 edited

Legend:

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

    r40402 r42380  
    11#!/usr/bin/python
    22#
    3 # Copyright (C) 2009-2011 Oracle Corporation
     3# Copyright (C) 2009-2012 Oracle Corporation
    44#
    55# This file is part of VirtualBox Open Source Edition (OSE), as
     
    219219    mgr = ctx['mgr']
    220220    vb = ctx['vb']
    221     mach = vb.createMachine("", name, kind, "", False)
     221    mach = vb.createMachine("", name, [], kind, "", False)
    222222    mach.saveSettings()
    223223    print "created machine with UUID",mach.id
     
    21682168   setParentId = False
    21692169   parentId = ""
    2170    hdd = vb.openMedium(loc, ctx['global'].constants.DeviceType_HardDisk, ctx['global'].constants.AccessMode_ReadWrite)
     2170   hdd = vb.openMedium(loc, ctx['global'].constants.DeviceType_HardDisk, ctx['global'].constants.AccessMode_ReadWrite, false)
    21712171   print "registered HDD as %s" %(hdd.id)
    21722172   return 0
     
    21872187   loc = args[2]
    21882188   try:
    2189       hdd = vb.findMedium(loc, ctx['global'].constants.DeviceType_HardDisk)
     2189      hdd = vb.openMedium(loc, ctx['global'].constants.DeviceType_HardDisk, ctx['global'].constants.AccessMode_ReadWrite, false)
    21902190   except:
    21912191      print "no HDD with path %s registered" %(loc)
     
    22222222   loc = args[2]
    22232223   try:
    2224       hdd = vb.findMedium(loc, ctx['global'].constants.DeviceType_HardDisk)
     2224      hdd = vb.openMedium(loc, ctx['global'].constants.DeviceType_HardDisk, ctx['global'].constants.AccessMode_ReadWrite, false)
    22252225   except:
    22262226      print "no HDD with path %s registered" %(loc)
     
    22422242      vmunreg = 0
    22432243   try:
    2244       hdd = vb.findMedium(loc, ctx['global'].constants.DeviceType_HardDisk)
     2244      hdd = vb.openMedium(loc, ctx['global'].constants.DeviceType_HardDisk, ctx['global'].constants.AccessMode_ReadWrite, false)
    22452245   except:
    22462246      print "no HDD with path %s registered" %(loc)
     
    22672267   loc = args[1]
    22682268   try:
    2269       hdd = vb.findMedium(loc, ctx['global'].constants.DeviceType_HardDisk)
     2269      hdd = vb.openMedium(loc, ctx['global'].constants.DeviceType_HardDisk, ctx['global'].constants.AccessMode_ReadWrite, false)
    22702270   except:
    22712271      print "no HDD with path %s registered" %(loc)
     
    22832283   vb = ctx['vb']
    22842284   loc = args[1]
    2285    iso = vb.openMedium(loc, ctx['global'].constants.DeviceType_DVD, ctx['global'].constants.AccessMode_ReadOnly)
     2285   iso = vb.openMedium(loc, ctx['global'].constants.DeviceType_DVD, ctx['global'].constants.AccessMode_ReadOnly, false)
    22862286   print "registered ISO as %s" %(iso.id)
    22872287   return 0
     
    22952295   loc = args[1]
    22962296   try:
    2297       dvd = vb.findMedium(loc, ctx['global'].constants.DeviceType_DVD)
     2297      dvd = vb.openMedium(loc, ctx['global'].constants.DeviceType_DVD, ctx['global'].constants.AccessMode_ReadOnly, false)
    22982298   except:
    22992299      print "no DVD with path %s registered" %(loc)
     
    23132313   loc = args[1]
    23142314   try:
    2315       dvd = vb.findMedium(loc, ctx['global'].constants.DeviceType_DVD)
     2315      dvd = vb.openMedium(loc, ctx['global'].constants.DeviceType_DVD, ctx['global'].constants.AccessMode_ReadOnly, false)
    23162316   except:
    23172317      print "no DVD with path %s registered" %(loc)
     
    23362336   loc = args[2]
    23372337   try:
    2338       dvd = vb.findMedium(loc, ctx['global'].constants.DeviceType_DVD)
     2338      dvd = vb.openMedium(loc, ctx['global'].constants.DeviceType_DVD, ctx['global'].constants.AccessMode_ReadOnly, false)
    23392339   except:
    23402340      print "no DVD with path %s registered" %(loc)
     
    23592359   loc = args[2]
    23602360   try:
    2361       dvd = vb.findMedium(loc, ctx['global'].constants.DeviceType_DVD)
     2361      dvd = vb.openMedium(loc, ctx['global'].constants.DeviceType_DVD, ctx['global'].constants.AccessMode_ReadOnly, false)
    23622362   except:
    23632363      print "no DVD with path %s registered" %(loc)
     
    23782378   loc = args[2]
    23792379   try:
    2380       dvd = vb.findMedium(loc, ctx['global'].constants.DeviceType_DVD)
     2380      dvd = vb.openMedium(loc, ctx['global'].constants.DeviceType_DVD, ctx['global'].constants.AccessMode_ReadOnly, false)
    23812381   except:
    23822382      print "no DVD with path %s registered" %(loc)
Note: See TracChangeset for help on using the changeset viewer.

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