Skip to content

Commit

Permalink
nova-compute status is not being used by webui and there are cases
Browse files Browse the repository at this point in the history
where nova-compute doesn't exist - hence removing the check for
nova-compute from nodemgr

Change-Id: I604d22617fbaf6bd0c7c3234e59c6d4cc86c01fe
Closes-Bug: #1538514
  • Loading branch information
Raj Reddy committed Jan 28, 2016
1 parent 0022e08 commit f756d3c
Showing 1 changed file with 0 additions and 54 deletions.
54 changes: 0 additions & 54 deletions src/nodemgr/vrouter_nodemgr/vrouter_event_manager.py
Expand Up @@ -65,21 +65,6 @@ def __init__(self, rule_file, discovery_server,
self.supervisor_serverurl = "unix:///tmp/supervisord_vrouter.sock"
self.add_current_process()

os_nova_comp = VrouterProcessStat('openstack-nova-compute')
popen_cmd = "openstack-status | grep openstack-nova-compute" + \
" | cut -d ':' -f2"
(os_nova_comp_state, error_value) = \
Popen(popen_cmd, shell=True, stdout=PIPE).communicate()
os_nova_comp.process_state = os_nova_comp_state.strip()
if (os_nova_comp.process_state == 'active'):
os_nova_comp.process_state = 'PROCESS_STATE_RUNNING'
os_nova_comp.start_time = str(int(time.time() * 1000000))
os_nova_comp.start_count += 1
if (os_nova_comp.process_state == 'dead'):
os_nova_comp.process_state = 'PROCESS_STATE_FATAL'
sys.stderr.write('Openstack Nova Compute status:' +
os_nova_comp.process_state + "\n")
self.process_state_db['openstack-nova-compute'] = os_nova_comp
self.lb_stats = LoadbalancerStats()
# end __init__

Expand Down Expand Up @@ -116,10 +101,7 @@ def get_process_stat_object(self, pname):
return VrouterProcessStat(pname)

# overridden delete_process_handler -
# ignore delete in case of openstack-nova-compute
def delete_process_handler(self, deleted_process):
if deleted_process == 'openstack-nova-compute':
return
super(VrouterEventManager,
self).delete_process_handler(deleted_process)
# end delete_process_handler
Expand Down Expand Up @@ -151,42 +133,6 @@ def runforever(self, test=False):
self.event_process_communication(pdata)
# do periodic events
if headers['eventname'].startswith("TICK_60"):
os_nova_comp = self.process_state_db['openstack-nova-compute']
popen_cmd = "openstack-status | " + \
"grep openstack-nova-compute | cut -d ':' -f2"
(os_nova_comp_state, error_value) = \
Popen(popen_cmd, shell=True, stdout=PIPE).communicate()
if (os_nova_comp_state.strip() == 'active'):
os_nova_comp_state = 'PROCESS_STATE_RUNNING'
if (os_nova_comp_state.strip() == 'dead'):
os_nova_comp_state = 'PROCESS_STATE_FATAL'
if (os_nova_comp_state.strip() == 'inactive'):
os_nova_comp_state = 'PROCESS_STATE_STOPPED'
if (os_nova_comp.process_state != os_nova_comp_state):
os_nova_comp.process_state = os_nova_comp_state.strip()
msg = ('Openstack Nova Compute status changed to:' +
os_nova_comp.process_state)
self.msg_log(msg, level=SandeshLevel.SYS_DEBUG)
if (os_nova_comp.process_state == 'PROCESS_STATE_RUNNING'):
os_nova_comp.start_time = \
str(int(time.time() * 1000000))
os_nova_comp.start_count += 1
if (os_nova_comp.process_state == 'PROCESS_STATE_FATAL'):
os_nova_comp.exit_time = \
str(int(time.time() * 1000000))
os_nova_comp.exit_count += 1
if (os_nova_comp.process_state == 'PROCESS_STATE_STOPPED'):
os_nova_comp.stop_time = \
str(int(time.time() * 1000000))
os_nova_comp.stop_count += 1
self.process_state_db['openstack-nova-compute'] = \
os_nova_comp
self.send_process_state_db('vrouter_group')
else:
msg = ('Openstack Nova Compute status unchanged at:' +
os_nova_comp.process_state)
self.msg_log(msg, level=SandeshLevel.SYS_DEBUG)
self.process_state_db['openstack-nova-compute'] = os_nova_comp
prev_current_time = self.event_tick_60(prev_current_time)

# loadbalancer processing
Expand Down

0 comments on commit f756d3c

Please sign in to comment.