mirror of
https://github.com/FAUSheppy/athq-vm-management
synced 2025-12-06 05:41:35 +01:00
fix: ensure consistent ordering
This commit is contained in:
@@ -4,7 +4,7 @@ environment = jinja2.Environment(loader=jinja2.FileSystemLoader(searchpath="./te
|
|||||||
def createMasterHostConfig(vmList):
|
def createMasterHostConfig(vmList):
|
||||||
template = environment.get_template("icinga_host.conf.j2")
|
template = environment.get_template("icinga_host.conf.j2")
|
||||||
with open("ansible/files/icinga_master_hosts.conf", "w") as f:
|
with open("ansible/files/icinga_master_hosts.conf", "w") as f:
|
||||||
for vmo in set(vmList):
|
for vmo in sorted(list(set(vmList))):
|
||||||
|
|
||||||
if not vmo.check:
|
if not vmo.check:
|
||||||
continue
|
continue
|
||||||
|
|||||||
4
vm.py
4
vm.py
@@ -47,6 +47,10 @@ class VM:
|
|||||||
def __eq__(self, other):
|
def __eq__(self, other):
|
||||||
return self.hostname == other.hostname
|
return self.hostname == other.hostname
|
||||||
|
|
||||||
|
def __gt__(self, other):
|
||||||
|
if self.hostname != other.hostname:
|
||||||
|
return self.hostname > other.hostname
|
||||||
|
return len(str(self.__dict__)) > len(str(other.__dict__))
|
||||||
|
|
||||||
def dumpStreamComponents(self):
|
def dumpStreamComponents(self):
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user