[API] Disallow MnB messages if disabled

Change-Id: If912fcf573217afe65d1b330274db335d34d199a
This commit is contained in:
Marc Pilon 2013-12-18 13:18:39 -05:00
parent 0eb56f8c62
commit 76282bbcb4
2 changed files with 6 additions and 4 deletions

View File

@ -42,8 +42,8 @@ class UsageStats(object):
self.start_stats_sched()
def shutdown(self):
if self.billing_timer:
self.billing_timer.cancel()
if self.stats_timer:
self.stats_timer.cancel()
def gather_stats(self):
# Work out if it is our turn to run

View File

@ -31,8 +31,10 @@ LOG = logging.getLogger(__name__)
def update_mnb(event_type, lbid, tenant_id):
# Start a new thread
eventlet.spawn_n(client_job, event_type, lbid, tenant_id)
if cfg.CONF['admin_api'].billing_enable:
# Start a new thread
eventlet.spawn_n(client_job, event_type, lbid, tenant_id)
def client_job(event_type, lbid, tenant_id):