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:
d50cd58
)
renamed list_components to list_nodes. also renamed some variables
author
Tony Mack
<tmack@cs.princeton.edu>
Wed, 11 Feb 2009 18:57:15 +0000
(18:57 +0000)
committer
Tony Mack
<tmack@cs.princeton.edu>
Wed, 11 Feb 2009 18:57:15 +0000
(18:57 +0000)
geni/aggregate.py
patch
|
blob
|
history
diff --git
a/geni/aggregate.py
b/geni/aggregate.py
index
29948ec
..
c16c29b
100644
(file)
--- a/
geni/aggregate.py
+++ b/
geni/aggregate.py
@@
-229,14
+229,16
@@
class Aggregate(GeniServer):
self.policy.load()
self.policy.load()
- def get
Components(self, type
= 'rspec'):
+ def get
Nodes(self, format
= 'rspec'):
"""
Return a list of components at this aggregate.
"""
"""
Return a list of components at this aggregate.
"""
- valid_types = ['rspec', 'hrn', 'dns', 'ip']
- if type not in valid_types:
- raise Exception, "Invalid type specified, must be one of the following: %s" \
- % ", ".join(valid_types)
+ valid_formats = ['rspec', 'hrn', 'dns', 'ip']
+ if not format:
+ format = 'rspec'
+ if format not in valid_formats:
+ raise Exception, "Invalid format specified, must be one of the following: %s" \
+ % ", ".join(valid_formats)
# Reload components list
now = datetime.datetime.now()
# Reload components list
now = datetime.datetime.now()
@@
-245,7
+247,7
@@
class Aggregate(GeniServer):
self.refresh_components()
elif now < self.threshold and not self.nodes.keys():
self.load_components()
self.refresh_components()
elif now < self.threshold and not self.nodes.keys():
self.load_components()
- return self.nodes[
type
]
+ return self.nodes[
format
]
def getSlices(self, hrn):
"""
def getSlices(self, hrn):
"""
@@
-450,9
+452,9
@@
class Aggregate(GeniServer):
# XX fix rights, should be function name defined in
# privilege_table (from util/rights.py)
# XX fix rights, should be function name defined in
# privilege_table (from util/rights.py)
- def list_
components(self, cred
):
+ def list_
nodes(self, cred, format
):
self.decode_authentication(cred, 'listnodes')
self.decode_authentication(cred, 'listnodes')
- return self.get
Components(
)
+ return self.get
Nodes(format
)
def list_slices(self, cred, hrn):
self.decode_authentication(cred, 'listslices')
def list_slices(self, cred, hrn):
self.decode_authentication(cred, 'listslices')
@@
-494,7
+496,7
@@
class Aggregate(GeniServer):
GeniServer.register_functions(self)
# Aggregate interface methods
GeniServer.register_functions(self)
# Aggregate interface methods
- self.server.register_function(self.list_
component
s)
+ self.server.register_function(self.list_
node
s)
self.server.register_function(self.list_slices)
self.server.register_function(self.get_resources)
self.server.register_function(self.get_policy)
self.server.register_function(self.list_slices)
self.server.register_function(self.get_resources)
self.server.register_function(self.get_policy)