From 72cb4816253b4cdbdfe49af16e70dc25b9f8cd45 Mon Sep 17 00:00:00 2001 From: Thierry Parmentelat Date: Wed, 6 Jul 2011 17:02:37 +0200 Subject: [PATCH] catch exception in _CreateSliver that otherwise gets discarded still need to fix _get_server_version that's an unknown symbol --- sfa/managers/slice_manager_pl.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sfa/managers/slice_manager_pl.py b/sfa/managers/slice_manager_pl.py index 4ac41a43..0ed8f48e 100644 --- a/sfa/managers/slice_manager_pl.py +++ b/sfa/managers/slice_manager_pl.py @@ -155,12 +155,13 @@ def ListResources(api, creds, options, call_id): def CreateSliver(api, xrn, creds, rspec_str, users, call_id): def _CreateSliver(server, xrn, credential, rspec, users, call_id): + try: # Need to call GetVersion at an aggregate to determine the supported # rspec type/format beofre calling CreateSliver at an Aggregate. server_version = _get_server_version(api, server) if 'sfa' not in aggregate_version and 'geni_api' in aggregate_version: # sfa aggregtes support both sfa and pg rspecs, no need to convert - # if aggregate supports sfa rspecs. othewise convert to pg rspec + # if aggregate supports sfa rspecs. otherwise convert to pg rspec rspec = RSpecConverter.to_pg_rspec(rspec) args = [xrn, credential, rspec, users] if _call_id_supported(api, server): @@ -169,6 +170,8 @@ def CreateSliver(api, xrn, creds, rspec_str, users, call_id): return server.CreateSliver(*args) except Exception, e: api.logger.warn("CreateSliver failed at %s: %s" %(server.url, str(e))) + except: + logger.log_exc('Something wrong in _CreateSliver') if Callids().already_handled(call_id): return "" # Validate the RSpec against PlanetLab's schema --disabled for now -- 2.43.0