get ssh creds from .env

This commit is contained in:
ahmadbilalkhalid 2019-08-13 09:28:55 +05:00
parent 945b34d76c
commit 3db47346bd
1 changed files with 4 additions and 3 deletions

View File

@ -17,6 +17,7 @@ import sshtunnel
import errno import errno
from dataclasses import dataclass from dataclasses import dataclass
from decouple import config
from typing import Union from typing import Union
from functools import wraps from functools import wraps
from string import Template from string import Template
@ -236,9 +237,9 @@ def transfer_vm(request_event):
if vm: if vm:
tunnel = sshtunnel.SSHTunnelForwarder( tunnel = sshtunnel.SSHTunnelForwarder(
(_host, 22), (_host, 22),
ssh_username="meow", ssh_username=config("ssh_username"),
ssh_pkey="~/.ssh/id_rsa", ssh_pkey=config("ssh_pkey"),
ssh_private_key_password="***REMOVED***", ssh_private_key_password=config("ssh_private_key_password"),
remote_bind_address=('127.0.0.1', _port), remote_bind_address=('127.0.0.1', _port),
) )
try: try: