Skip to content

Commit

Permalink
Logging
Browse files Browse the repository at this point in the history
  • Loading branch information
bskjon committed Oct 9, 2024
1 parent b8ee81d commit fc3ff3c
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions DynamicVirshService/DynamicVirshService.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from libvirt import virConnect, virDomain
from .virshClient import VirshClient, VirshVM, VMStates

logging.basicConfig(level=logging.INFO)
logging.basicConfig(level=logging.DEBUG)

class DynamicVirshService:
qemu_address: str
Expand Down Expand Up @@ -49,11 +49,13 @@ def __init__(self, configFile: str) -> None:
self.virshClient = VirshClient(self.qemu_address, self.__virsh_state_update)

def is_excluded(self, name: str) -> bool:
if (name.lower() in (excl.lower() for excl in self.qemu_excluded_vms)):
logging.info(f"VM {name} is excluded")
return True
else:
return False
for excludedName in self.qemu_excluded_vms:
if (excludedName.strip().lower() == name.strip().lower()):
logging.info(f"VM {name} is excluded")
return True
else:
logging.debug(f"VM: {name} does not match excluded: {excludedName}")
return False

def start(self) -> None:
if (self.mqtt_password is not None):
Expand Down

0 comments on commit fc3ff3c

Please sign in to comment.