Changeset 44588 in vbox for trunk/src/VBox/Main/webservice/samples/python/clienttest.py
- Timestamp:
- Feb 7, 2013 2:28:14 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/webservice/samples/python/clienttest.py
-
Property svn:eol-style
changed from
native
toLF
-
Property svn:executable
set to
*
r40400 r44588 38 38 39 39 from vboxapi import VirtualBoxManager 40 # This is a VirtualBox COM/XPCOM API client, no data needed. 40 41 wrapper = VirtualBoxManager(None, None) 41 42 … … 51 52 52 53 # Enumerate all defined machines 53 for mach in vbox.machines:54 for mach in wrapper.getArray(vbox, 'machines'): 54 55 55 56 try: 57 # Be prepared for failures - the VM can be inaccessible 58 vmname = '<inaccessible>' 59 try: 60 vmname = mach.name 61 except Exception, e: 62 None 63 vmid = ''; 64 try: 65 vmid = mach.id 66 except Exception, e: 67 None 56 68 57 # Print some basic information 58 print "Machine name: %s [%s]" %(mach.name,mach.id) 69 # Print some basic VM information even if there were errors 70 print "Machine name: %s [%s]" %(vmname,vmid) 71 if vmname == '<inaccessible>' or vmid == '': 72 continue 73 74 # Print some basic VM information 59 75 print " State: %s" %(enumToString(vboxConstants, "MachineState", mach.state)) 60 76 print " Session state: %s" %(enumToString(vboxConstants, "SessionState", mach.sessionState)) -
Property svn:eol-style
changed from
Note:
See TracChangeset
for help on using the changeset viewer.