Skip to content

Commit 077b802

Browse files
authored
Merge pull request #41 from schubergphilis/fix/improve-long-hostnames
Improve display of long hostnames
2 parents db5db65 + e44ccdc commit 077b802

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

cloudstackops/cloudstacksql.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ def getHAWorkerData(self, hypervisorName):
7878
return 1
7979

8080
if len(hypervisorName) > 0:
81-
hypervisorNameWhere = " AND host.name = '" + hypervisorName + "'"
81+
hypervisorNameWhere = " AND host.name LIKE '" + hypervisorName + "%'"
8282
else:
8383
hypervisorNameWhere = ""
8484

listHAWorkers.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,9 @@ def handleArguments(argv):
158158
continue
159159
counter = counter + 1
160160
displayname = (vmname[:28] + '..') if len(vmname) >= 31 else vmname
161-
mgtname = mgtname.split(".")[0]
161+
if mgtname is not None:
162+
mgtname = mgtname.split(".")[0]
163+
hvname = hypervisor.split(".")[0]
162164
t.add_row([
163165
domain,
164166
displayname,
@@ -167,7 +169,7 @@ def handleArguments(argv):
167169
created,
168170
taken,
169171
step,
170-
hypervisor,
172+
hvname,
171173
mgtname
172174
])
173175

0 commit comments

Comments
 (0)