Skip to content

Commit

Permalink
Fix NameError: name 'logger' is not defined bug (sonic-net#82)
Browse files Browse the repository at this point in the history
Signed-off-by: Shu0T1an ChenG <[email protected]>
  • Loading branch information
Shuotian Cheng authored Aug 22, 2018
1 parent b180f44 commit b7d915e
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def _getPsuIndex(self, sub_id):
num_psus = self.psuutil.get_num_psus()
except Exception:
# Any unexpected exception or error, log it and keep running
logger.exception("PowerStatusHandler._getPsuIndex() caught an unexpected exception during get_num_psus()")
mibs.logger.exception("PowerStatusHandler._getPsuIndex() caught an unexpected exception during get_num_psus()")
return None

if psu_index < 1 or psu_index > num_psus:
Expand All @@ -73,7 +73,7 @@ def get_next(self, sub_id):
num_psus = self.psuutil.get_num_psus()
except Exception:
# Any unexpected exception or error, log it and keep running
logger.exception("PowerStatusHandler.get_next() caught an unexpected exception during get_num_psus()")
mibs.logger.exception("PowerStatusHandler.get_next() caught an unexpected exception during get_num_psus()")
return None


Expand All @@ -100,15 +100,15 @@ def getPsuStatus(self, sub_id):
psu_presence = self.psuutil.get_psu_presence(psu_index)
except Exception:
# Any unexpected exception or error, log it and keep running
logger.exception("PowerStatusHandler.getPsuStatus() caught an unexpected exception during get_psu_presence()")
mibs.logger.exception("PowerStatusHandler.getPsuStatus() caught an unexpected exception during get_psu_presence()")
return None

if psu_presence:
try:
psu_status = self.psuutil.get_psu_status(psu_index)
except Exception:
# Any unexpected exception or error, log it and keep running
logger.exception("PowerStatusHandler.getPsuStatus() caught an unexpected exception during get_psu_status()")
mibs.logger.exception("PowerStatusHandler.getPsuStatus() caught an unexpected exception during get_psu_status()")
return None

if psu_status:
Expand Down

0 comments on commit b7d915e

Please sign in to comment.