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

Commit cbdbf5d

Browse files
Christian StankowicChristian Stankowic
authored andcommitted
Release 0.3.6
Fixed various bugs: - fixed a bug where monitoring information were incorrect in the PDF reports - fixed a bug where debug information where printed in satprep_diff.py without explicitely enabling it - fixed a bug where child channels were not cloned correctly (see issue #50) Also, satprep_snapshot.py will now include patch information by default (omitting the -p parameter, see issue #51). Using -p will now exclude patch information!
1 parent 9e478d5 commit cbdbf5d

File tree

5 files changed

+18
-13
lines changed

5 files changed

+18
-13
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@
33
*.log
44
*.vlog
55
*.auth
6+
*.bak
67
TODO

default.tex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ \section*{}
7777
Backup services up and running & $\Box$ & %%BackupNo & %%BackupNoNotes \\
7878
Anti-virus services up and running & $\Box$ & %%AntivirNo & %%AntivirNoNotes \\
7979
Cluster test & $\Box$ & %%systemStandalone & %%hintsClusterTest \\
80-
Monitoring enabled & $\Box$ & $\Box$ & \\
80+
Monitoring enabled & %%monSchedYes & %%monSchedNo & %%monSchedNotes \\
8181
\hline
8282
\end{tabularx}
8383

satprep_diff.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -177,8 +177,9 @@ def main(options):
177177
f_log = open(options.verificationLog, 'r')
178178
else:
179179
f_log = open(options.verificationLog, 'w+')
180-
vlog = f_log.read()
181-
LOGGER.debug("vlog is:\n" + vlog)
180+
vlog = f_log.readlines()
181+
vlog = [x.strip('\n') for x in vlog]
182+
LOGGER.debug("vlog is:\n" + str(vlog))
182183

183184
#create delta
184185
delta = ''.join(x[2:] for x in diff if x.startswith('- '))
@@ -314,14 +315,16 @@ def main(options):
314315
#set system monitoring bit if specified and present in report
315316
if repcols["system_monitoring"] < 666 and line[repcols["system_monitoring"]] == "0":
316317
#no monitoring, add notes if available
318+
this_monYes = "$\Box$"
319+
this_monNo = "$\CheckedBox$"
317320
this_monSchedNo = "$\CheckedBox$"
318321
else:
319322
#set box/comment if downtime scheduled
320323
if repcols["system_monitoring_name"] < 666 and line[repcols["system_monitoring_name"]] != "":
321324
tempHost = line[repcols["system_monitoring_name"]]
322325
if "@" in tempHost: tempHost = tempHost[:tempHost.find("@")]
323326
else: tempHost = host
324-
if "MONOK;"+host in vlog:
327+
if str("MONOK;"+tempHost) in vlog:
325328
LOGGER.debug("MONOK;"+tempHost+" in vlog!")
326329
this_monYes = "$\CheckedBox$"
327330
this_monNo = "$\Box$"
@@ -397,7 +400,6 @@ def main(options):
397400

398401
#set reboot box if specified and present in report
399402
rebootErrata = [s for e in this_errata_reboot if e == "1"]
400-
print len(rebootErrata)
401403
if len(rebootErrata) == 0:
402404
this_NoReboot="$\CheckedBox$"
403405
this_RebootNotes="no reboot required"

satprep_patch_freeze.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,8 @@ def getChannels(client, key):
7070
childChannels = client.system.listSubscribedChildChannels(key, hostId[0]["id"])
7171
for channel in childChannels:
7272
cleanChild = channel["label"]
73-
if "." in cleanChild: cleanChild = cleanChild[:cleanChild.find(".")+1:]
73+
#if "." in cleanChild: cleanChild = cleanChild[:cleanChild.find(".")+1:]
74+
if "." in cleanChild: cleanChild = cleanChild[cleanChild.find(".")+1:]
7475
if cleanChild not in myChannels[cleanBase]:
7576
LOGGER.debug("Adding child-channel '{0}'".format(cleanChild))
7677
myChannels[cleanBase].append(cleanChild)
@@ -106,18 +107,19 @@ def cloneChannels(client, key, date, label, unfreeze=False):
106107
except:
107108
LOGGER.error("Unable to remove child-channel '{0}'!".format(options.targetLabel+"-"+options.targetDate+"."+child))
108109
#remove base-channel
109-
if options.dryrun: LOGGER.info("I'd like to remove cloned base-channel '{0}'".format(channel+"."+options.targetLabel+"-"+options.targetDate))
110+
#if options.dryrun: LOGGER.info("I'd like to remove cloned base-channel '{0}'".format(channel+"."+options.targetLabel+"-"+options.targetDate))
111+
if options.dryrun: LOGGER.info("I'd like to remove cloned base-channel '{0}'".format(options.targetLabel+"-"+options.targetDate+"."+channel))
110112
else:
111113
try:
112-
LOGGER.info("Deleting base-channel '{0}'".format(channel+"."+options.targetLabel+"-"+options.targetDate))
114+
LOGGER.info("Deleting base-channel '{0}'".format(options.targetLabel+"-"+options.targetDate+"."+channel))
113115
result = client.channel.software.delete(key, options.targetLabel+"-"+options.targetDate+"."+channel)
114116
except: LOGGER.error("Unable to remove base-channel '{0}'!".format(channel))
115117
return True
116118

117119
#clone channels
118120
for channel in myChannels:
119121
#clone base-channels
120-
myargs={"name" : channel+" clone from "+options.targetDate+" ("+options.targetLabel+")", "label" : options.targetLabel+"-"+options.targetDate+"."+channel, "summary" : "Software channel cloned by Satprep"}
122+
myargs={"name" : "Cloned " + channel + " from "+options.targetDate+" ("+options.targetLabel+")", "label" : options.targetLabel+"-"+options.targetDate+"."+channel, "summary" : "Software channel cloned by Satprep"}
121123
if options.dryrun:
122124
LOGGER.info("I'd like to clone base-channel '{0}' as '{1}'".format(channel, options.targetLabel+"-"+options.targetDate+"."+channel))
123125
else:
@@ -134,7 +136,7 @@ def cloneChannels(client, key, date, label, unfreeze=False):
134136

135137
#clone child-channels
136138
for child in myChannels[channel]:
137-
myargs={"name" : child+" clone from "+options.targetDate, "label" : options.targetLabel+"-"+options.targetDate+"."+child, "summary" : "Software channel cloned by Satprep", "parent_label": options.targetLabel+"-"+options.targetDate+"."+channel}
139+
myargs={"name" : "Cloned " + child + " from "+options.targetDate, "label" : options.targetLabel+"-"+options.targetDate+"."+child, "summary" : "Software channel cloned by Satprep", "parent_label": options.targetLabel+"-"+options.targetDate+"."+channel}
138140
if options.dryrun:
139141
LOGGER.info("I'd like to clone child-channel '{0}' as '{1}'".format(child, options.targetLabel+"-"+options.targetDate+"."+child))
140142
else:

satprep_snapshot.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,8 @@ def parse_options(args=None):
7575
snapOpts.add_option("-o", "--output", action="store", type="string", dest="output", default="foobar", metavar="FILE", help=("define CSV report filename. (default: " "errata-snapshot-report-RHNhostname-Ymd.csv)"))
7676
#-f / --field
7777
#snapOpts.add_option("-f", "--field", action="append", type="choice", dest="fields", choices=POSSIBLE_FIELDS, metavar="FIELDS", help="defines which fields should be integrated in the report (default: all available)")
78-
#-p / --include-patches
79-
snapOpts.add_option("-p", "--include-patches", action="store_true", default=False, dest="includePatches", help="defines whether package updates that are not part of an erratum shall be included (default: no)")
78+
#-p / --exclude-patches
79+
snapOpts.add_option("-p", "--exclude-patches", action="store_true", default=False, dest="excludePatches", help="defines whether package updates that are not part of an erratum shall be excluded (default: no)")
8080
#-l / --include-locked
8181
snapOpts.add_option("-l", "--include-locked", action="store_true", default=False, dest="includeLocked", help="also includes locked systems (default: no)")
8282

@@ -145,7 +145,7 @@ def process_system(client, key, writer, system):
145145
LOGGER.debug("Found host {0[name]} (SID {0[id]})".format(system))
146146
process_errata(client, key, writer, system)
147147

148-
if options.includePatches:
148+
if options.excludePatches == False:
149149
process_patches(client, key, writer, system)
150150

151151

0 commit comments

Comments
 (0)