Skip to content

Instantly share code, notes, and snippets.

@Lothiraldan
Created July 19, 2011 22:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Lothiraldan/1093851 to your computer and use it in GitHub Desktop.
Save Lothiraldan/1093851 to your computer and use it in GitHub Desktop.
PYTI Minimal
from pyti.vmanager.diskhandler import *
from pyti.vmanager.vms import *
import time
import sys
from os import getcwd
from os.path import join
hd_location = join(getcwd(), sys.argv[1])
config={'name':'PYTI','memory':'123','hd_location':hd_location}
a=VirtualMachine('PYTI',"vbox:///session",config=config)
a.start(replace=True)
while a.domain.isActive():
time.sleep(2)
d=DiskOperations(hd_location)
d.mount()
d.download('/opt/pyti/out/log', 'out/log')
d.download('/opt/pyti/out/error.log', 'out/error.log')
d.close_connection()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment