Skip to content

Commit

Permalink
Update Sandbox.py
Browse files Browse the repository at this point in the history
removed try/catch to debug exception
  • Loading branch information
kalsky committed May 5, 2017
1 parent 3194c5a commit 6eabbf1
Showing 1 changed file with 19 additions and 30 deletions.
49 changes: 19 additions & 30 deletions sandbox_scripts/QualiEnvironmentUtils/Sandbox.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,36 +19,25 @@ def __init__(self, reservation_id, logger):
Load the configuration from config files on the Blueprint's devices
:param str reservation_id: reservation id
"""
try:
self._logger = logger
""":type : logging.Logger"""
self.api_session = helpers.get_api_session()
self.id = reservation_id
self.context = helpers.get_reservation_context_details()
print vars(self.context)
self.owner = self.context.owner_user
self.environment_path = self.context.environment_path
self.Blueprint_name = self.context.environment_name
if self.Blueprint_name == '':
raise QualiError("Blueprint name empty (from env name)")

full_path = None
tp = self.api_session.GetActiveTopologyNames()

for value in tp.Topologies:
filename = basename(value)
if filename == self.Blueprint_name:
full_path = value
break

if full_path:
self.blueprint_details = self.api_session.GetTopologyDetails(full_path)
except AttributeError, e:
print e
except:
err = "Failed to initialize the Sandbox. Unexpected error:" + \
str(sys.exc_info()[0])
self.report_error(error_message=err)
#try:
self._logger = logger
""":type : logging.Logger"""
self.api_session = helpers.get_api_session()
self.id = reservation_id
self.context = helpers.get_reservation_context_details()
print vars(self.context)
self.owner = self.context.owner_user
self.environment_path = self.context.environment_path
self.Blueprint_name = self.context.environment_name
if self.Blueprint_name == '':
raise QualiError("Blueprint name empty (from env name)")

if self.environment_path:
self.blueprint_details = self.api_session.GetTopologyDetails(self.environment_path)
#except:
# err = "Failed to initialize the Sandbox. Unexpected error:" + \
# str(sys.exc_info()[0])
# self.report_error(error_message=err)

# ----------------------------------
# ----------------------------------
Expand Down

0 comments on commit 6eabbf1

Please sign in to comment.