Skip to content

Commit

Permalink
Merge "Traceback during update of local preference" into R2.20
Browse files Browse the repository at this point in the history
  • Loading branch information
Zuul authored and opencontrail-ci-admin committed Jun 10, 2015
2 parents 8c3cb71 + e295985 commit 807f384
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
3 changes: 3 additions & 0 deletions src/config/svc-monitor/svc_monitor/instance_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -473,6 +473,9 @@ def _associate_vrouter(self, si, vm):
def _update_local_preference(self, si, del_vm):
if si.ha_mode != 'active-standby':
return
st = ServiceTemplateSM.get(si.service_template)
if not st:
return

if si.local_preference[del_vm.index] == \
svc_info.get_standby_preference():
Expand Down
18 changes: 10 additions & 8 deletions src/config/svc-monitor/svc_monitor/svc_monitor.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,12 @@ def config_log(self, msg, level):

def _vnc_subscribe_callback(self, oper_info):
self._db_resync_done.wait()
try:
self._vnc_subscribe_actions(oper_info)
except Exception:
cgitb_error_log(self)

def _vnc_subscribe_actions(self, oper_info):
try:
msg = "Notification Message: %s" % (pformat(oper_info))
self.config_log(msg, level=SandeshLevel.SYS_DEBUG)
Expand Down Expand Up @@ -237,11 +243,8 @@ def _vnc_subscribe_callback(self, oper_info):
obj_type, obj_id))
return


except Exception:
string_buf = cStringIO.StringIO()
cgitb.Hook(file=string_buf, format="text").handle(sys.exc_info())
self.config_log(string_buf.getvalue(), level=SandeshLevel.SYS_ERR)
cgitb_error_log(self)

for sas_id in dependency_tracker.resources.get('service_appliance_set', []):
sas_obj = ServiceApplianceSetSM.get(sas_id)
Expand Down Expand Up @@ -791,10 +794,9 @@ def launch_timer(monitor):
cgitb_error_log(monitor)

def cgitb_error_log(monitor):
tmp_file = cStringIO.StringIO()
cgitb.Hook(format="text", file=tmp_file).handle(sys.exc_info())
monitor._svc_err_logger.error("%s" % tmp_file.getvalue())
tmp_file.close()
string_buf = cStringIO.StringIO()
cgitb.Hook(file=string_buf, format="text").handle(sys.exc_info())
monitor.config_log(string_buf.getvalue(), level=SandeshLevel.SYS_ERR)

def parse_args(args_str):
'''
Expand Down

0 comments on commit 807f384

Please sign in to comment.