Skip to content
This repository was archived by the owner on Oct 3, 2020. It is now read-only.

Commit 2160626

Browse files
committed
Fixed issue #25
Monitoring and virtualization host definitions are now included in snapshot reports
1 parent 1ded72f commit 2160626

File tree

1 file changed

+18
-2
lines changed

1 file changed

+18
-2
lines changed

satprep_snapshot.py

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -252,9 +252,17 @@ def process_errata(client, key, writer, system):
252252
valueSet.append(0)
253253
elif column == "system_virt_vmname":
254254
temp = client.system.getCustomValues(key, system["id"])
255+
temp_vmname=""
255256
if (temp and "SYSTEM_VIRT_VMNAME" in temp
256257
and temp["SYSTEM_VIRT_VMNAME"] != ""):
257-
valueSet.append(temp["SYSTEM_VIRT_VMNAME"])
258+
temp_vmname=temp["SYSTEM_VIRT_VMNAME"]
259+
#also add custom host and password if given
260+
if (temp and "SYSTEM_VIRT_HOST" in temp
261+
and temp["SYSTEM_VIRT_HOST"] != "" and
262+
"SYSTEM_VIRT_HOST_AUTH" in temp and
263+
temp["SYSTEM_VIRT_HOST_AUTH"] != ""):
264+
temp_vmname = temp_vmname + "@" + temp["SYSTEM_VIRT_HOST"] + ":" + temp["SYSTEM_VIRT_HOST_AUTH"]
265+
valueSet.append(temp_vmname)
258266
else:
259267
valueSet.append("")
260268
elif column == "system_monitoring":
@@ -272,9 +280,17 @@ def process_errata(client, key, writer, system):
272280
valueSet.append("")
273281
elif column == "system_monitoring_name":
274282
temp = client.system.getCustomValues(key, system["id"])
283+
temp_monname = ""
275284
if (temp and "SYSTEM_MONITORING_NAME" in temp
276285
and temp["SYSTEM_MONITORING_NAME"] != ""):
277-
valueSet.append(temp["SYSTEM_MONITORING_NAME"])
286+
temp_monname=temp["SYSTEM_MONITORING_NAME"]
287+
#also add custom host and password if given
288+
if (temp and "SYSTEM_MONITORING_HOST" in temp
289+
and temp["SYSTEM_MONITORING_HOST"] != "" and
290+
"SYSTEM_MONITORING_HOST_AUTH" in temp and
291+
temp["SYSTEM_MONITORING_HOST_AUTH"] != ""):
292+
temp_vmname = temp_vmname + "@" + temp["SYSTEM_MONITORING_HOST"] + ":" + temp["SYSTEM_MONITORING_HOST_AUTH"]
293+
valueSet.append(temp_monname)
278294
else:
279295
valueSet.append("")
280296
elif column == "system_backup":

0 commit comments

Comments
 (0)