Changeset 35569 in vbox for trunk/src/VBox/Frontends/VBoxShell/vboxshell.py
- Timestamp:
- Jan 14, 2011 2:28:53 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VBoxShell/vboxshell.py
r35342 r35569 2173 2173 loc = args[2] 2174 2174 try: 2175 hdd = vb.find HardDisk(loc)2175 hdd = vb.findMedium(loc, ctx['global'].constants.DeviceType_HardDisk) 2176 2176 except: 2177 2177 print "no HDD with path %s registered" %(loc) … … 2195 2195 2196 2196 def detachMedium(ctx,mid,medium): 2197 cmdClosedVm(ctx, mach , detachVmDevice, [medium.id])2197 cmdClosedVm(ctx, machById(ctx, mid), detachVmDevice, [medium]) 2198 2198 2199 2199 def detachHddCmd(ctx,args): … … 2208 2208 loc = args[2] 2209 2209 try: 2210 hdd = vb.find HardDisk(loc)2210 hdd = vb.findMedium(loc, ctx['global'].constants.DeviceType_HardDisk) 2211 2211 except: 2212 2212 print "no HDD with path %s registered" %(loc) 2213 2213 return 0 2214 2214 2215 detachMedium(ctx, mach.id,hdd)2215 detachMedium(ctx, mach.id, hdd) 2216 2216 return 0 2217 2217 … … 2228 2228 vmunreg = 0 2229 2229 try: 2230 hdd = vb.find HardDisk(loc)2230 hdd = vb.findMedium(loc, ctx['global'].constants.DeviceType_HardDisk) 2231 2231 except: 2232 2232 print "no HDD with path %s registered" %(loc) … … 2238 2238 for m in machs: 2239 2239 print "Trying to detach from %s" %(m) 2240 detachMedium(ctx, m,hdd)2240 detachMedium(ctx, m, hdd) 2241 2241 except Exception, e: 2242 2242 print 'failed: ',e … … 2253 2253 loc = args[1] 2254 2254 try: 2255 hdd = vb.find HardDisk(loc)2255 hdd = vb.findMedium(loc, ctx['global'].constants.DeviceType_HardDisk) 2256 2256 except: 2257 2257 print "no HDD with path %s registered" %(loc) … … 2282 2282 loc = args[1] 2283 2283 try: 2284 dvd = vb.find DVDImage(loc)2284 dvd = vb.findMedium(loc, ) 2285 2285 except: 2286 2286 print "no DVD with path %s registered" %(loc) … … 2300 2300 loc = args[1] 2301 2301 try: 2302 dvd = vb.find DVDImage(loc)2302 dvd = vb.findMedium(loc, ctx['global'].constants.DeviceType_DVD) 2303 2303 except: 2304 2304 print "no DVD with path %s registered" %(loc) … … 2323 2323 loc = args[2] 2324 2324 try: 2325 dvd = vb.find DVDImage(loc)2325 dvd = vb.findMedium(loc, ctx['global'].constants.DeviceType_DVD) 2326 2326 except: 2327 2327 print "no DVD with path %s registered" %(loc) … … 2332 2332 else: 2333 2333 [ctr, port, slot] = findDevOfType(ctx, mach, ctx['global'].constants.DeviceType_DVD) 2334 cmdClosedVm(ctx, mach, lambda ctx,mach,args: mach.attachDevice(ctr, port, slot, ctx['global'].constants.DeviceType_DVD, dvd.id))2334 cmdClosedVm(ctx, mach, lambda ctx,mach,args: mach.attachDevice(ctr, port, slot, ctx['global'].constants.DeviceType_DVD, dvd)) 2335 2335 return 0 2336 2336 … … 2346 2346 loc = args[2] 2347 2347 try: 2348 dvd = vb.find DVDImage(loc)2348 dvd = vb.findMedium(loc, ctx['global'].constants.DeviceType_DVD) 2349 2349 except: 2350 2350 print "no DVD with path %s registered" %(loc) 2351 2351 return 0 2352 2352 2353 detachMedium(ctx, mach.id,dvd)2353 detachMedium(ctx, mach.id, dvd) 2354 2354 return 0 2355 2355 … … 2365 2365 loc = args[2] 2366 2366 try: 2367 dvd = vb.find DVDImage(loc)2367 dvd = vb.findMedium(loc, ctx['global'].constants.DeviceType_DVD) 2368 2368 except: 2369 2369 print "no DVD with path %s registered" %(loc) … … 2377 2377 [ctr, port, slot] = findDevOfType(ctx, mach, ctx['global'].constants.DeviceType_DVD) 2378 2378 2379 cmdExistingVm(ctx, mach, 'mountiso', [ctr, port, slot, dvd .id, True])2379 cmdExistingVm(ctx, mach, 'mountiso', [ctr, port, slot, dvd, True]) 2380 2380 2381 2381 return 0 … … 2391 2391 vb = ctx['vb'] 2392 2392 2393 if len(args) > 2:2393 if len(args) > 3: 2394 2394 ctr = args[2] 2395 2395 (port,slot) = args[3].split(":") … … 2398 2398 [ctr, port, slot] = findDevOfType(ctx, mach, ctx['global'].constants.DeviceType_DVD) 2399 2399 2400 cmdExistingVm(ctx, mach, 'mountiso', [ctr, port, slot, "", True])2400 cmdExistingVm(ctx, mach, 'mountiso', [ctr, port, slot, None, True]) 2401 2401 2402 2402 return 0
Note:
See TracChangeset
for help on using the changeset viewer.