chore: remove unused file
This commit is contained in:
35
scripts/test_etcd_snapshots.py
Normal file
35
scripts/test_etcd_snapshots.py
Normal file
@@ -0,0 +1,35 @@
|
||||
import paramiko
|
||||
import sys
|
||||
import datetime
|
||||
|
||||
sys.stdout.reconfigure(encoding='utf-8')
|
||||
|
||||
timestamp = datetime.datetime.now().strftime("%Y%m%d_%H%M%S")
|
||||
|
||||
clusters = [
|
||||
("aerodrome", "140.44.4.11"),
|
||||
("spaceport", "140.44.4.41")
|
||||
]
|
||||
|
||||
for name, ip in clusters:
|
||||
print(f"[{name.upper()}] Connecting to {ip}...")
|
||||
ssh = paramiko.SSHClient()
|
||||
ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
|
||||
ssh.connect(ip, username='root', key_filename=r'C:\Users\Snarf\.ssh\id_ed25519_snarfnet', timeout=10)
|
||||
|
||||
cmd = f"k3s etcd-snapshot save --name pre-upgrade-{name}-{timestamp}"
|
||||
print(f"[{name.upper()}] Executing: {cmd}")
|
||||
stdin, stdout, stderr = ssh.exec_command(cmd)
|
||||
out = stdout.read().decode().strip()
|
||||
err = stderr.read().decode().strip()
|
||||
if out:
|
||||
print(f"[{name.upper()}] STDOUT: {out}")
|
||||
if err:
|
||||
print(f"[{name.upper()}] STDERR: {err}")
|
||||
|
||||
check_cmd = "k3s etcd-snapshot ls"
|
||||
stdin, stdout, stderr = ssh.exec_command(check_cmd)
|
||||
print(f"[{name.upper()}] Recent Snapshots:\n" + stdout.read().decode().strip())
|
||||
|
||||
ssh.close()
|
||||
print("-" * 50)
|
||||
Reference in New Issue
Block a user