Skip to content

Commit 75f725d

Browse files
committed
revert last patch, only remove separator_all to prevent to latest newline
1 parent fc3fb0d commit 75f725d

1 file changed

Lines changed: 4 additions & 9 deletions

File tree

checkvsphere/vcmd/vmtools.py

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -144,25 +144,20 @@ def run():
144144
check.add_message(Status.CRITICAL, f"{name} tools not running")
145145
logging.debug(f"{name} tools not running")
146146
else:
147-
vmname=name
148147
perf_data["VMware Tools running"] += 1
149148

150149
for key, value in perf_data.items():
151150
check.add_perfdata(label=key, value=value, uom="")
152151

153152
(code, message) = check.check_messages(separator="\n")
154-
155-
if (vmscnt > 1):
156-
message=f"{vmscnt} VMs checked for VMware Tools state, {len(vms) - vmscnt} VMs ignored"
157-
else:
158-
if (code == Status.OK):
159-
message=f"{vmname} tools running"
160-
161153
check.exit(
162154
code=code,
163-
message=message,
155+
message=f"{vmscnt} VMs checked for VMware Tools state, {len(vms) - vmscnt} VMs ignored"
156+
if code == Status.OK
157+
else message,
164158
)
165159

160+
166161
if __name__ == "__main__":
167162
try:
168163
run()

0 commit comments

Comments
 (0)