Update AppImage

This commit is contained in:
MacRimi
2025-10-28 23:18:32 +01:00
parent f606e131a7
commit 813c6aab13
2 changed files with 31 additions and 4 deletions

View File

@@ -165,6 +165,26 @@ def parse_lxc_hardware_config(vmid, node):
return hardware_info
def get_lxc_ip_from_lxc_info(vmid):
"""Get LXC IP address using lxc-info command (for DHCP containers)"""
try:
result = subprocess.run(
['lxc-info', '-n', str(vmid), '-iH'],
capture_output=True,
text=True,
timeout=5
)
if result.returncode == 0:
ip = result.stdout.strip()
# Return IP only if it's valid (not empty)
if ip and ip != '':
return ip
return None
except Exception:
# Silently fail if lxc-info is not available or fails
return None
# Helper function to format bytes into human-readable string
def format_bytes(size_in_bytes):
"""Converts bytes to a human-readable string (KB, MB, GB, TB)."""