diff --git a/kube_hunter/console/auth/auth.py b/kube_hunter/console/auth/auth.py index d5c6c92..51938f7 100644 --- a/kube_hunter/console/auth/auth.py +++ b/kube_hunter/console/auth/auth.py @@ -2,8 +2,9 @@ import cmd2 class AuthSubConsole(cmd2.Cmd): def __init__(self, env): + super(AuthSubConsole, self).__init__() self.env = env - self.prompt = environment.get_prompt(sub_console="env/auth") + self.prompt = self.env.get_prompt(sub_console="env/auth") def do_set(self, auth_index): """Manages the auth database, Usage: @@ -21,15 +22,15 @@ class AuthSubConsole(cmd2.Cmd): print("ERROR: Auth index should be a integer") return - print(environment.current_auth.get_auth(auth_index).raw_token) + print(self.env.current_auth.get_auth(auth_index).raw_token) else: - print(environment.current_auth.get_table()) + print(self.env.current_auth.get_table()) def do_exit(self, arg): return True def postcmd(self, stop, line): - self.prompt = self.prompt.get_prompt(sub_console="env/auth") + self.prompt = self.env.get_prompt(sub_console="env/auth") if stop: return True diff --git a/kube_hunter/console/env/env.py b/kube_hunter/console/env/env.py index 10ae696..3739850 100644 --- a/kube_hunter/console/env/env.py +++ b/kube_hunter/console/env/env.py @@ -9,6 +9,7 @@ class EnvSubConsole(cmd2.Cmd): Includes: Auth database.. """ def __init__(self, env): + super(EnvSubConsole, self).__init__() self.env = env self.prompt = self.env.get_prompt(sub_command="env") diff --git a/kube_hunter/console/manager.py b/kube_hunter/console/manager.py index 84e1706..a29ae68 100644 --- a/kube_hunter/console/manager.py +++ b/kube_hunter/console/manager.py @@ -6,6 +6,7 @@ from kube_hunter.modules.discovery.hosts import RunningAsPodEvent class KubeHunterMainConsole(cmd2.Cmd): def __init__(self, env=None): + super(KubeHunterMainConsole, self).__init__() kube_hunter_logo = r""" __ __ __ __ /\ \ /\ \ /\ \ /\ \__