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:
6e1b513
)
(no commit message)
author
Andy Bavier
<acb@cs.princeton.edu>
Tue, 16 Feb 2010 17:59:37 +0000
(17:59 +0000)
committer
Andy Bavier
<acb@cs.princeton.edu>
Tue, 16 Feb 2010 17:59:37 +0000
(17:59 +0000)
sfa/managers/slice_manager_pl.py
patch
|
blob
|
history
diff --git
a/sfa/managers/slice_manager_pl.py
b/sfa/managers/slice_manager_pl.py
index
80d98f1
..
4a6fdf0
100644
(file)
--- a/
sfa/managers/slice_manager_pl.py
+++ b/
sfa/managers/slice_manager_pl.py
@@
-190,23
+190,26
@@
def get_rspec(api, xrn=None, origin_hrn=None):
try:
# get the rspec from the aggregate
agg_rspec = aggs[agg].get_resources(cred, xrn, origin_hrn)
try:
# get the rspec from the aggregate
agg_rspec = aggs[agg].get_resources(cred, xrn, origin_hrn)
-
- tree = etree.parse(StringIO(agg_rspec))
- root = tree.getroot()
- if root.get("type") in ["Planetlab", "VINI"]:
- # Validate the aggregate's RSpec?
-
- if rspec == None:
- rspec = root
- else:
- for network in root.iterfind("./network"):
- rspec.append(deepcopy(network))
except:
# XX print out to some error log
print >> log, "Error getting resources at aggregate %s" % agg
traceback.print_exc(log)
print >> log, "%s" % (traceback.format_exc())
except:
# XX print out to some error log
print >> log, "Error getting resources at aggregate %s" % agg
traceback.print_exc(log)
print >> log, "%s" % (traceback.format_exc())
+
+ try:
+ tree = etree.parse(StringIO(agg_rspec))
+ except etree.XMLSyntaxError:
+ message = agg + ": " + str(sys.exc_info()[1])
+ raise InvalidRSpec(message)
+
+ root = tree.getroot()
+ if root.get("type") in ["Planetlab", "VINI"]:
+ if rspec == None:
+ rspec = root
+ else:
+ for network in root.iterfind("./network"):
+ rspec.append(deepcopy(network))
return etree.tostring(rspec, xml_declaration=True, pretty_print=True)
return etree.tostring(rspec, xml_declaration=True, pretty_print=True)