mirror of https://github.com/jumpserver/jumpserver
睡觉去了
parent
1f15f13aac
commit
ab87420c9d
19
connect.py
19
connect.py
|
@ -164,6 +164,24 @@ def get_user_host(username):
|
||||||
return hosts
|
return hosts
|
||||||
|
|
||||||
|
|
||||||
|
def get_port(ip):
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
def get_ldap_pwd(username):
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
def connect_one(username, segment):
|
||||||
|
assets = Asset.objects.filter(ip__icontains=segment)
|
||||||
|
if len(assets) > 1:
|
||||||
|
for asset in assets:
|
||||||
|
print '%s -- %s' % (asset.ip, asset.comment)
|
||||||
|
elif len(assets) == 1:
|
||||||
|
asset = assets[0]
|
||||||
|
permission = asset.permission_set.all()
|
||||||
|
|
||||||
|
|
||||||
def print_prompt():
|
def print_prompt():
|
||||||
msg = """\033[1;32m### Welcome Use JumpServer To Login. ### \033[0m
|
msg = """\033[1;32m### Welcome Use JumpServer To Login. ### \033[0m
|
||||||
1) Type \033[32mIP ADDRESS\033[0m To Login.
|
1) Type \033[32mIP ADDRESS\033[0m To Login.
|
||||||
|
@ -230,6 +248,7 @@ if __name__ == '__main__':
|
||||||
try:
|
try:
|
||||||
option = raw_input("\033[1;32mOpt or IP>:\033[0m ")
|
option = raw_input("\033[1;32mOpt or IP>:\033[0m ")
|
||||||
except EOFError:
|
except EOFError:
|
||||||
|
print
|
||||||
continue
|
continue
|
||||||
if option in ['P', 'p']:
|
if option in ['P', 'p']:
|
||||||
print_user_host(login_name)
|
print_user_host(login_name)
|
||||||
|
|
Loading…
Reference in New Issue