cv report ssh port and local path added, cv manager report name variable added

Signed-off-by: shivamcandela <shivam.thakur@candelatech.com>
This commit is contained in:
shivamcandela
2021-05-31 23:27:38 +05:30
parent eb79a0f3e6
commit 3c76df8d41
3 changed files with 12 additions and 5 deletions

View File

@@ -3,12 +3,15 @@ from scp import SCPClient
class lanforge_reports:
def pull_reports(self,hostname="localhost", username="lanforge", password="lanforge", report_location="/home/lanforge/html-reports/"):
def pull_reports(self, hostname="localhost", port=22, username="lanforge", password="lanforge",
report_location="/home/lanforge/html-reports/",
local_path="../../../reports/"):
ssh = paramiko.SSHClient()
ssh.load_system_host_keys()
ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
ssh.connect(hostname=hostname, username=username, password=password, allow_agent=False, look_for_keys=False)
ssh.connect(hostname=hostname, username=username, password=password, port=port)
with SCPClient(ssh.get_transport()) as scp:
scp.get(report_location,recursive=True)
scp.get(remote_path=report_location, local_path=local_path, recursive=True)
scp.close()