Merge "[API] Disallow MnB messages if disabled"

This commit is contained in:
Jenkins 2013-12-18 18:24:07 +00:00 committed by Gerrit Code Review
commit 07c05f229a
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):