From 4b456dd01eaa9966eaa93445dc175d36cab56be0 Mon Sep 17 00:00:00 2001 From: Andris Raugulis Date: Thu, 6 Oct 2016 15:18:39 +0300 Subject: [PATCH] Return level name, not level itself (make consistent with setter). --- ssh-audit.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ssh-audit.py b/ssh-audit.py index 0ae8111..785a1ce 100755 --- a/ssh-audit.py +++ b/ssh-audit.py @@ -100,7 +100,9 @@ class Output(object): @property def minlevel(self): - return self.__minlevel + if self.__minlevel < len(self.LEVELS): + return self.LEVELS[self.__minlevel] + return 'unknown' @minlevel.setter def minlevel(self, name): @@ -122,7 +124,7 @@ class Output(object): def __getattr__(self, name): if name == 'head' and self.batch: return lambda x: None - if not self.getlevel(name) >= self.minlevel: + if not self.getlevel(name) >= self.__minlevel: return lambda x: None if self.colors and os.name == 'posix' and name in self.COLORS: color = u'\033[0;{0}m'.format(self.COLORS[name])