mirror of
https://github.com/aquasecurity/kube-hunter.git
synced 2026-08-23 22:26:23 +00:00
fixed bug in init of cmd classes
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Vendored
+1
@@ -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")
|
||||
|
||||
|
||||
@@ -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"""
|
||||
__ __ __ __
|
||||
/\ \ /\ \ /\ \ /\ \__
|
||||
|
||||
Reference in New Issue
Block a user