import repository from arizona
[raven.git] / 2.0 / plush / start-storkplushd
1 #!/usr/bin/python
2
3 import os
4 import sys
5
6 def usage():
7    print "Usage: " + sys.argv[0] + " <planetlab username> <nest slice>"
8    sys.exit(1)
9
10
11 if len(sys.argv) != 3:
12    usage()
13
14 node_csv = ""
15 nest_slice = sys.argv[2]
16 planetlab_user = sys.argv[1]
17
18 try:
19    directory_file = open("directory.xml", "r")
20    line_csv = ""
21    for line in directory_file.readlines():
22       if line.find("<node hostname=") != -1:
23          host = line.split("\"")[1].split("@")[1].split(":")[0]
24          port = line.split("\"")[1].split("@")[1].split(":")[1]
25          node_csv = node_csv + nest_slice + "@" + host + ":" + port + ","
26
27    # strip the last ','
28    node_csv = node_csv.rstrip(',')
29    directory_file.close()
30
31 except:
32    print "Exception reading " + os.getcwd() + "/directory.xml occured.  Make sure directory.xml is in your CWD and is readable."
33    sys.exit(1)
34
35
36 os.system("rm -rf /tmp/plush")
37
38 os.system("/usr/local/stork/bin/storkplushd --push-interval=10 --check-interval=5 --plush-port=4000 --sync --nest-list=" + node_csv + " --planetlab-user=" + planetlab_user + " --metafile-path=/repository/packageinfo/metafile --plush-cwd=/usr/local/bin/plush --plush-command=/usr/local/bin/plush/plush --remote-path=/usr/local/stork/var/proxy/quake2.cs.arizona.edu_packageinfo_metafile --client-slices=arizona_demo --nest-metafile-url=http://localhost:6648/quake2.cs.arizona.edu/packageinfo/metafile --metafile-url=http://quake2.cs.arizona.edu/packageinfo/metafile --client-metafile-path=/usr/local/stork/var/packageinfo/quake2.cs.arizona.edu/packageinfo/metafile")