17 lines
727 B
Python
17 lines
727 B
Python
#!/usr/bin/env python3
|
|
# -*- coding: utf-8 -*-
|
|
"""Spusti PoC prilohy->SeaweedFS v python-runner kontejneru (blokujici)."""
|
|
import sys, paramiko
|
|
limit = sys.argv[1] if len(sys.argv) > 1 else "50"
|
|
extra = " ".join(sys.argv[2:]) if len(sys.argv) > 2 else "--write-back"
|
|
c = paramiko.SSHClient()
|
|
c.set_missing_host_key_policy(paramiko.AutoAddPolicy())
|
|
c.connect("192.168.1.76", username="root", password="7309208104", timeout=10)
|
|
cmd = ("docker exec -e PYTHONIOENCODING=utf-8 python-runner "
|
|
"python -u /scripts/MailStore/mailstore_attachments_poc.py "
|
|
f"vladimir.buzalka@buzalka.cz --limit {limit} {extra}")
|
|
i, o, e = c.exec_command(cmd)
|
|
sys.stdout.buffer.write(o.read())
|
|
sys.stdout.buffer.write(e.read())
|
|
c.close()
|