+ def on_instantiate_done(fut):
+ # If the do_instantiate fails, then publish NSR with failed result
+ e = fut.exception()
+ if e is not None:
+ import traceback
+ print(traceback.format_exception(None, e, e.__traceback__), file=sys.stderr, flush=True)
+ self._log.error("NSR instantiation failed for NSR id %s: %s", msg.id, str(e))
+ failed_nsr = self._nsm.nsrs[msg.id]
+ self._loop.create_task(failed_nsr.instantiation_failed(failed_reason=str(e)))
+
+