import repository from arizona
[raven.git] / demo / gec11 / scripts / change_plc_passwords.py
1 #!/usr/bin/python
2
3 #           [option, long option,    variable,     action,        data,     default,                            metavar, description]
4 """arizonaconfig\r
5    options=[]\r
6    includes=[]\r
7 """
8
9 import os, sys, time, shutil
10 import glob
11
12 import arizonaconfig
13 import planetlabAPI
14 import planetlabCall
15
16 def main():
17    arizonaconfig.init_options("change_plc_passwords.py")
18    planetlabAPI.PlanetLablogin()
19
20    for i in range(1, 32):
21        email = "guest" + str(i) + "@geni.net";
22        print "changing:", email
23        planetlabAPI.doplccall("UpdatePerson", email, {"password": "gec11tutorial"})
24
25 #   persons = planetlabAPI.doplccall("GetPersons", email);
26 #   person = persons[0]
27 #
28 #   print person
29 #
30 #   if person["email"] != email:
31 #      print "uh oh"
32 #      sys.exit(-1)
33 #
34 #   print "deleting id", person["person_id"]
35 #
36 #   planetlabAPI.doplccall("DeletePerson", person["person_id"])
37
38    print "done."
39
40 if __name__ == "__main__":
41    main()