python3 - 2to3 + miscell obvious tweaks
[sfa.git] / tests / client / testAggregate.py
1 from pprint import pprint
2
3 from sfa.util.client import *
4 from sfa.trust.credential import *
5
6 cred = Credential(filename = 'tmack.pl.sa.cred')
7 slicehrn = 'planetlab.us.pl.tmack'
8 print(cred.get_privileges().save_to_string())
9
10 r = GeniClient('https://128.112.139.120:12345', 'tmack.pkey', 'tmack.cert') 
11 a = GeniClient('https://128.112.139.120:12346', 'tmack.pkey', 'tmack.cert')
12
13 #pprint(r.list(cred, 'planetlab.us.princeton'))
14 pprint(a.get_policy(cred))
15
16 print("components at this aggregate")
17 components = a.list_components()
18 pprint(components)
19
20 print("resources being used by %(slicehrn)s" % locals())
21 tmack_components = a.list_resources(cred, slicehrn)
22 pprint(tmack_components)
23
24 #print "removing %(slicehrn)s from all nodes" % locals()
25 #a.DeleteSliver(cred, slicehrn)
26
27 print("adding %(slicehrn)s back to its original nodes" % locals())
28 a.list_resources(cred, slicehrn)
29 a.CreateSliver(cred, slicehrn, components)
30 a.list_resources(cred, slicehrn)
31
32