Diff
Not logged in

Differences From Artifact [aaa1316acd]:

To Artifact [efb0c40873]:


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/usr/bin/python
from ConfigParser import ConfigParser
from argparse import ArgumentParser
import fcntl
import socket,select
import errno
import re
import os,sys,time
VERSION=0.1
def find_vm(name):
    search_path=[os.environ['HOME']+"/VWs",
        config.get("directories","SharedVMs"),
        config.get("directories","AutostartVMs")]
    for dirname in search_path:
        if not os.access(dirname,os.X_OK):
            continue








|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/usr/bin/python
from ConfigParser import ConfigParser
from argparse import ArgumentParser
import fcntl
import socket,select
import errno
import re
import os,sys,time
VERSION=0.2
def find_vm(name):
    search_path=[os.environ['HOME']+"/VWs",
        config.get("directories","SharedVMs"),
        config.get("directories","AutostartVMs")]
    for dirname in search_path:
        if not os.access(dirname,os.X_OK):
            continue
255
256
257
258
259
260
261

262
263
264
265
266
267
268
                line.find("media=disk")>-1):
                m=re.search("file=([^,\s]*)",line)
                if m:
                    result.append(m.group(1))
    return result

def cmd_snapshot(options):

    if not options.stopped:
        print >>sys.stderr,"Cannot make snapshot of running VW"
        return 1
    drives=get_drives(options.dir)
    os.chdir(options.dir)
    newnames={}
    for i in drives:







>







255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
                line.find("media=disk")>-1):
                m=re.search("file=([^,\s]*)",line)
                if m:
                    result.append(m.group(1))
    return result

def cmd_snapshot(options):
    import os.path
    if not options.stopped:
        print >>sys.stderr,"Cannot make snapshot of running VW"
        return 1
    drives=get_drives(options.dir)
    os.chdir(options.dir)
    newnames={}
    for i in drives: