git://git.onelab.eu
/
sfa.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
f584a23
)
fix more bugs
author
Tony Mack
<tmack@cs.princeton.edu>
Thu, 26 Mar 2009 17:10:36 +0000
(17:10 +0000)
committer
Tony Mack
<tmack@cs.princeton.edu>
Thu, 26 Mar 2009 17:10:36 +0000
(17:10 +0000)
geni/aggregate.py
patch
|
blob
|
history
diff --git
a/geni/aggregate.py
b/geni/aggregate.py
index
8f20d99
..
d0dd58f
100644
(file)
--- a/
geni/aggregate.py
+++ b/
geni/aggregate.py
@@
-301,10
+301,11
@@
class Aggregate(GeniServer):
# create the plc dict
networks = [{'nodes': nodes,
# create the plc dict
networks = [{'nodes': nodes,
- 'links': linkspecs,
'name': self.hrn,
'start_time': start_time,
'name': self.hrn,
'start_time': start_time,
- 'duration': duration}]
+ 'duration': duration}]
+ if type in ['aggregate']:
+ networks[0]['links'] = linkspecs
resources = {'networks': networks, 'start_time': start_time, 'duration': duration}
# convert the plc dict to an rspec dict
resources = {'networks': networks, 'start_time': start_time, 'duration': duration}
# convert the plc dict to an rspec dict
@@
-366,9
+367,9
@@
class Aggregate(GeniServer):
slicename = hrn_to_pl_slicename(slice_hrn)
slices = self.shell.GetSlices(self.auth, [slicename], ['node_ids'])
if not slices:
slicename = hrn_to_pl_slicename(slice_hrn)
slices = self.shell.GetSlices(self.auth, [slicename], ['node_ids'])
if not slices:
- # if site doesnt exist add it
parts = slicename.split("_")
login_base = parts[0]
parts = slicename.split("_")
login_base = parts[0]
+ # if site doesnt exist add it
sites = self.shell.GetSites(self.auth, [login_base])
if not sites:
authority = get_authority(slice_hrn)
sites = self.shell.GetSites(self.auth, [login_base])
if not sites:
authority = get_authority(slice_hrn)
@@
-393,20
+394,20
@@
class Aggregate(GeniServer):
person_records = self.registry.resolve(self.credential, researcher)
for record in person_records:
if record.get_type() in ['user']:
person_records = self.registry.resolve(self.credential, researcher)
for record in person_records:
if record.get_type() in ['user']:
- person_record =
person_records[0]
+ person_record =
record
if not person_record:
pass
if not person_record:
pass
- person_dict = person_record.as_dict()['pl
c
_info']
+ person_dict = person_record.as_dict()['pl_info']
persons = self.shell.GetPersons(self.auth, [person_dict['email']], ['person_id', 'key_ids'])
# Create the person record
if not persons:
self.shell.AddPerson(self.auth, person_dict)
persons = self.shell.GetPersons(self.auth, [person_dict['email']], ['person_id', 'key_ids'])
# Create the person record
if not persons:
self.shell.AddPerson(self.auth, person_dict)
- self.shell.AddPersonToSlice(self.auth, person_dict['email'],
login_bas
e)
+ self.shell.AddPersonToSlice(self.auth, person_dict['email'],
slicenam
e)
# Add this person's public keys
for personkey in person_dict['keys']:
# Add this person's public keys
for personkey in person_dict['keys']:
- key = {'type': 'ssh', 'key': personkey}
- self.shellAddPersonKey(self.auth, person_dict['email'], key)
+ key = {'
key_
type': 'ssh', 'key': personkey}
+ self.shell
.
AddPersonKey(self.auth, person_dict['email'], key)
# find out where this slice is currently running
nodelist = self.shell.GetNodes(self.auth, slice['node_ids'], ['hostname'])
# find out where this slice is currently running
nodelist = self.shell.GetNodes(self.auth, slice['node_ids'], ['hostname'])