Skip to content

Commit

Permalink
Pass logger to nova client
Browse files Browse the repository at this point in the history
Pass logger to nova client class to log exceptions.

Change-Id: I02d842bd8c27909f8588ef6e030c23b3b5d951bd
  • Loading branch information
rrugge committed Dec 9, 2014
1 parent 589b43d commit 14881da
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions src/config/svc-monitor/svc_monitor/nova_client.py
Expand Up @@ -3,8 +3,9 @@
from novaclient import exceptions as nc_exc

class ServiceMonitorNovaClient(object):
def __init__(self, args):
def __init__(self, args, logger):
self._args = args
self.logger = logger
self._nova = {}

def _novaclient_get(self, proj_name, reauthenticate=False):
Expand All @@ -22,7 +23,7 @@ def _novaclient_get(self, proj_name, reauthenticate=False):
region_name=self._args.region_name, service_type='compute',
auth_url=auth_url, insecure=self._args.auth_insecure)
return self._nova[proj_name]

def _novaclient_exec(self, resource, oper, proj_name, **kwargs):
n_client = self._novaclient_get(proj_name)
try:
Expand Down
2 changes: 1 addition & 1 deletion src/config/svc-monitor/svc_monitor/svc_monitor.py
Expand Up @@ -236,7 +236,7 @@ def post_init(self, vnc_lib, args=None):

self._nova_client = importutils.import_object(
'svc_monitor.nova_client.ServiceMonitorNovaClient',
self._args)
self._args, self.logger)

# load vrouter scheduler
self.vrouter_scheduler = importutils.import_object(
Expand Down

0 comments on commit 14881da

Please sign in to comment.