From 01df40d490e0ac7bc7e5d9e95568156b83a9acda Mon Sep 17 00:00:00 2001
From: BaiJiangJie <32935519+BaiJiangJie@users.noreply.github.com>
Date: Mon, 18 Mar 2019 10:16:15 +0800
Subject: [PATCH] =?UTF-8?q?[Feature]=20=E4=BF=AE=E6=94=B9=E8=8E=B7?=
 =?UTF-8?q?=E5=8F=96=E7=B3=BB=E7=BB=9F=E7=94=A8=E6=88=B7=E8=AE=A4=E8=AF=81?=
 =?UTF-8?q?=E4=BF=A1=E6=81=AF=E7=9A=84API=E8=B0=83=E7=94=A8(=E8=8E=B7?=
 =?UTF-8?q?=E5=8F=96=E6=9F=90=E4=B8=AA=E7=B3=BB=E7=BB=9F=E7=94=A8=E6=88=B7?=
 =?UTF-8?q?=E5=AF=B9=E4=BA=8E=E6=9F=90=E4=B8=AA=E8=B5=84=E4=BA=A7=E7=9A=84?=
 =?UTF-8?q?=E8=AE=A4=E8=AF=81=E4=BF=A1=E6=81=AF)=20(#197)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 coco/connection.py | 6 +++---
 coco/proxy.py      | 2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/coco/connection.py b/coco/connection.py
index e1df9df..94c48b2 100644
--- a/coco/connection.py
+++ b/coco/connection.py
@@ -25,13 +25,13 @@ AUTO_LOGIN = 'auto'
 
 class SSHConnection:
     @staticmethod
-    def get_system_user_auth(system_user):
+    def get_system_user_auth(system_user, asset):
         """
         获取系统用户的认证信息,密码或秘钥
         :return: system user have full info
         """
         password, private_key = \
-            app_service.get_system_user_auth_info(system_user)
+            app_service.get_system_user_auth_info(system_user, asset)
         system_user.password = password
         system_user.private_key = private_key
 
@@ -42,7 +42,7 @@ class SSHConnection:
         error = ''
 
         if not system_user.password and not system_user.private_key:
-            self.get_system_user_auth(system_user)
+            self.get_system_user_auth(system_user, asset)
 
         if asset.domain:
             sock = self.get_proxy_sock_v2(asset)
diff --git a/coco/proxy.py b/coco/proxy.py
index 5d65322..4ed2377 100644
--- a/coco/proxy.py
+++ b/coco/proxy.py
@@ -34,7 +34,7 @@ class ProxyServer:
         :return: system user have full info
         """
         password, private_key = \
-            app_service.get_system_user_auth_info(self.system_user)
+            app_service.get_system_user_auth_info(self.system_user, self.asset)
         if self.system_user.login_mode == MANUAL_LOGIN \
                 or (not password and not private_key):
             prompt = "{}'s password: ".format(self.system_user.username)
-- 
2.18.0