From ab87420c9d2bc4248d6f76535e9516fc628f2e5c Mon Sep 17 00:00:00 2001 From: ibuler Date: Wed, 24 Dec 2014 23:40:52 +0800 Subject: [PATCH] =?UTF-8?q?=E7=9D=A1=E8=A7=89=E5=8E=BB=E4=BA=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- connect.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/connect.py b/connect.py index b3bc119c8..213b40d8e 100644 --- a/connect.py +++ b/connect.py @@ -164,6 +164,24 @@ def get_user_host(username): 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(): msg = """\033[1;32m### Welcome Use JumpServer To Login. ### \033[0m 1) Type \033[32mIP ADDRESS\033[0m To Login. @@ -230,6 +248,7 @@ if __name__ == '__main__': try: option = raw_input("\033[1;32mOpt or IP>:\033[0m ") except EOFError: + print continue if option in ['P', 'p']: print_user_host(login_name)