Skip to content

Commit

Permalink
Add ha information in UVE for service monitor
Browse files Browse the repository at this point in the history
Change-Id: I7ea22f04dd439a1459156e1200ab3a21e7db2ea2
  • Loading branch information
rrugge committed Oct 3, 2014
1 parent e84b588 commit 08a992c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/config/svc-monitor/svc_monitor/instance_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -614,8 +614,14 @@ def create_service(self, st_obj, si_obj):
self.db.service_instance_insert(si_obj.get_fq_name_str(),
vm_db_entry)

if int(local_preference) == svc_info.get_standby_preference():
ha = ("standby: %s" % (local_preference))
else:
ha = ("active: %s" % (local_preference))

instances.append({'uuid': vm_obj.uuid,
'vr_name': vrouter_name})
'vr_name': vrouter_name,
'ha': ha})

# uve trace
self.logger.uve_svc_instance(si_obj.get_fq_name_str(),
Expand Down
2 changes: 2 additions & 0 deletions src/config/svc-monitor/svc_monitor/logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,8 @@ def uve_svc_instance(self, si_fq_name_str, status=None,
svc_uve_vm = UveSvcInstanceVMConfig(uuid=vm['uuid'])
if vm.has_key('vr_name'):
svc_uve_vm.vr_name = vm['vr_name']
if vm.has_key('ha'):
svc_uve_vm.ha = vm['ha']
svc_uve.vm_list.append(svc_uve_vm)
if status:
svc_uve.status = status
Expand Down
1 change: 1 addition & 0 deletions src/config/uve/service_instance.sandesh
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
struct UveSvcInstanceVMConfig {
1: string uuid
2: optional string vr_name;
3: optional string ha;
}

struct UveSvcInstanceConfig {
Expand Down

0 comments on commit 08a992c

Please sign in to comment.