wcp-library 1.1.3__tar.gz → 1.1.4__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {wcp_library-1.1.3 → wcp_library-1.1.4}/PKG-INFO +1 -1
- {wcp_library-1.1.3 → wcp_library-1.1.4}/pyproject.toml +1 -1
- {wcp_library-1.1.3 → wcp_library-1.1.4}/wcp_library/ftp/sftp.py +10 -6
- {wcp_library-1.1.3 → wcp_library-1.1.4}/README.md +0 -0
- {wcp_library-1.1.3 → wcp_library-1.1.4}/wcp_library/__init__.py +0 -0
- {wcp_library-1.1.3 → wcp_library-1.1.4}/wcp_library/async_credentials/__init__.py +0 -0
- {wcp_library-1.1.3 → wcp_library-1.1.4}/wcp_library/async_credentials/api.py +0 -0
- {wcp_library-1.1.3 → wcp_library-1.1.4}/wcp_library/async_credentials/oracle.py +0 -0
- {wcp_library-1.1.3 → wcp_library-1.1.4}/wcp_library/async_credentials/postgres.py +0 -0
- {wcp_library-1.1.3 → wcp_library-1.1.4}/wcp_library/async_sql/__init__.py +0 -0
- {wcp_library-1.1.3 → wcp_library-1.1.4}/wcp_library/async_sql/oracle.py +0 -0
- {wcp_library-1.1.3 → wcp_library-1.1.4}/wcp_library/async_sql/postgres.py +0 -0
- {wcp_library-1.1.3 → wcp_library-1.1.4}/wcp_library/credentials/__init__.py +0 -0
- {wcp_library-1.1.3 → wcp_library-1.1.4}/wcp_library/credentials/ftp.py +0 -0
- {wcp_library-1.1.3 → wcp_library-1.1.4}/wcp_library/credentials/oracle.py +0 -0
- {wcp_library-1.1.3 → wcp_library-1.1.4}/wcp_library/credentials/postgres.py +0 -0
- {wcp_library-1.1.3 → wcp_library-1.1.4}/wcp_library/emailing.py +0 -0
- {wcp_library-1.1.3 → wcp_library-1.1.4}/wcp_library/ftp/__init__.py +0 -0
- {wcp_library-1.1.3 → wcp_library-1.1.4}/wcp_library/ftp/ftp.py +0 -0
- {wcp_library-1.1.3 → wcp_library-1.1.4}/wcp_library/informatica.py +0 -0
- {wcp_library-1.1.3 → wcp_library-1.1.4}/wcp_library/logging.py +0 -0
- {wcp_library-1.1.3 → wcp_library-1.1.4}/wcp_library/sql/__init__.py +0 -0
- {wcp_library-1.1.3 → wcp_library-1.1.4}/wcp_library/sql/oracle.py +0 -0
- {wcp_library-1.1.3 → wcp_library-1.1.4}/wcp_library/sql/postgres.py +0 -0
@@ -10,17 +10,21 @@ logger = logging.getLogger(__name__)
|
|
10
10
|
|
11
11
|
|
12
12
|
class SFTP:
|
13
|
-
def __init__(self, host: str, port: int=
|
14
|
-
self.host: str = host
|
15
|
-
self.port: int = port
|
16
|
-
self._username: Optional[str] = None
|
17
|
-
self._password: Optional[str] = None
|
13
|
+
def __init__(self, host: Optional[str]=None, port: Optional[int]=21, password_vault_dict: Optional[dict]=None):
|
14
|
+
self.host: str = host if not password_vault_dict else password_vault_dict['Host']
|
15
|
+
self.port: int = port if not password_vault_dict else password_vault_dict['Port']
|
16
|
+
self._username: Optional[str] = None if not password_vault_dict else password_vault_dict['UserName']
|
17
|
+
self._password: Optional[str] = None if not password_vault_dict else password_vault_dict['Password']
|
18
18
|
|
19
19
|
self.ssh = paramiko.SSHClient()
|
20
20
|
# AutoAddPolicy automatically adds the hostname and new host key to the local HostKeys object
|
21
21
|
self.ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
|
22
22
|
|
23
|
-
self.
|
23
|
+
if not (self._username and self._password):
|
24
|
+
self.sftp_connection: Optional[paramiko.SFTP] = None
|
25
|
+
else:
|
26
|
+
self.ssh.connect(self.host, self.port, self._username, self._password)
|
27
|
+
self.sftp_connection = self.ssh.open_sftp()
|
24
28
|
|
25
29
|
def login(self, username: str, password: str) -> None:
|
26
30
|
"""
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|