logging
This commit is contained in:
@@ -565,47 +565,47 @@ class CertPusher:
|
||||
|
||||
def process_proxmox(self, section: str, hostname: str, port: int,
|
||||
username: str, ssh_key: str, source_cert_path: str) -> bool:
|
||||
"""Process Proxmox VE server specifically"""
|
||||
try:
|
||||
logger.info("Using Proxmox deployment method")
|
||||
|
||||
source_key_path = self.get_key_path(section, source_cert_path)
|
||||
|
||||
if not os.path.exists(source_key_path):
|
||||
logger.error(f"Private key not found: {source_key_path}")
|
||||
return False
|
||||
|
||||
# Load source certificate for comparison
|
||||
source_cert = self.cert_manager.get_cert_from_file(source_cert_path)
|
||||
|
||||
# Get check URL if available
|
||||
check_url = self.config.get(section, 'check_url', fallback=None)
|
||||
|
||||
# Check if we should verify before upload
|
||||
check_first = self.config.getboolean(section, 'check_before_upload', fallback=True)
|
||||
|
||||
proxmox = ProxmoxManager(hostname, port, username, ssh_key)
|
||||
|
||||
if not proxmox.connect():
|
||||
self.stats['failed'] += 1
|
||||
return False
|
||||
|
||||
# Upload with optional checking
|
||||
if not proxmox.upload_certificate(source_cert_path, source_key_path,
|
||||
check_first, source_cert, check_url):
|
||||
"""Process Proxmox VE server specifically"""
|
||||
try:
|
||||
logger.info("Using Proxmox deployment method")
|
||||
|
||||
source_key_path = self.get_key_path(section, source_cert_path)
|
||||
|
||||
if not os.path.exists(source_key_path):
|
||||
logger.error(f"Private key not found: {source_key_path}")
|
||||
return False
|
||||
|
||||
# Load source certificate for comparison
|
||||
source_cert = self.cert_manager.get_cert_from_file(source_cert_path)
|
||||
|
||||
# Get check URL if available
|
||||
check_url = self.config.get(section, 'check_url', fallback=None)
|
||||
|
||||
# Check if we should verify before upload
|
||||
check_first = self.config.getboolean(section, 'check_before_upload', fallback=True)
|
||||
|
||||
proxmox = ProxmoxManager(hostname, port, username, ssh_key)
|
||||
|
||||
if not proxmox.connect():
|
||||
self.stats['failed'] += 1
|
||||
return False
|
||||
|
||||
# Upload with optional checking
|
||||
if not proxmox.upload_certificate(source_cert_path, source_key_path,
|
||||
check_first, source_cert, check_url):
|
||||
proxmox.disconnect()
|
||||
self.stats['failed'] += 1
|
||||
return False
|
||||
|
||||
proxmox.disconnect()
|
||||
self.stats['uploaded'] += 1
|
||||
logger.info(f"✓ Proxmox processed successfully")
|
||||
return True
|
||||
|
||||
except Exception as e:
|
||||
logger.error(f"Proxmox processing failed: {e}")
|
||||
self.stats['failed'] += 1
|
||||
return False
|
||||
|
||||
proxmox.disconnect()
|
||||
self.stats['uploaded'] += 1
|
||||
logger.info(f"✓ Proxmox processed successfully")
|
||||
return True
|
||||
|
||||
except Exception as e:
|
||||
logger.error(f"Proxmox processing failed: {e}")
|
||||
self.stats['failed'] += 1
|
||||
return False
|
||||
|
||||
|
||||
def process_host(self, section: str) -> bool:
|
||||
|
||||
Reference in New Issue
Block a user