Fallback vfc-lcm sftp download file 13/18713/1
authorying.yunlong <ying.yunlong@zte.com.cn>
Fri, 13 Oct 2017 06:30:35 +0000 (14:30 +0800)
committerying.yunlong <ying.yunlong@zte.com.cn>
Fri, 13 Oct 2017 06:30:35 +0000 (14:30 +0800)
Change-Id: I980c0ae29c202ecd7e992d7bdbbad77445edc3f2
Issue-ID: VFC-533
Signed-off-by: ying.yunlong <ying.yunlong@zte.com.cn>
lcm/pub/utils/toscaparser/basemodel.py

index e635966..b80b275 100644 (file)
@@ -21,6 +21,7 @@ import re
 import shutil
 import urllib
 
+import paramiko
 from toscaparser.functions import GetInput
 from toscaparser.tosca_template import ToscaTemplate
 
@@ -120,16 +121,16 @@ class BaseInfoModel(object):
         return localFileName
 
     def sftp_get(self, userName, userPwd, hostIp, hostPort, remoteFileName, localFileName):
-        return
-        t = None
-        try:
-            t = paramiko.Transport(hostIp, int(hostPort))
-            t.connect(username=userName, password=userPwd)
-            sftp = paramiko.SFTPClient.from_transport(t)
-            sftp.get(remoteFileName, localFileName)
-        finally:
-            if t is not None:
-                t.close()
+        return
+        t = None
+        try:
+            t = paramiko.Transport(hostIp, int(hostPort))
+            t.connect(username=userName, password=userPwd)
+            sftp = paramiko.SFTPClient.from_transport(t)
+            sftp.get(remoteFileName, localFileName)
+        finally:
+            if t is not None:
+                t.close()
 
     def ftp_get(self, userName, userPwd, hostIp, hostPort, remoteFileName, localFileName):
         f = None