Skip to content

Commit 43a9c80

Browse files
committed
tree: address latest pylint issues
Looks like a new pylint release brought some new warnings. Fix or explicitly ignore those.
1 parent 11bf3bf commit 43a9c80

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed

src/cmd-buildextend-live

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,8 @@ def generate_iso():
229229
raise Exception("Live image generation requires `metal` image")
230230
img_metal = os.path.join(builddir, img_metal_obj['path'])
231231
img_metal_checksum = img_metal_obj['sha256']
232+
img_metal4k = None
233+
img_metal4k_checksum = None
232234
img_metal4k_obj = buildmeta.get_artifact_meta("metal4k", unmerged=True)["images"].get("metal4k")
233235
if not img_metal4k_obj:
234236
if not args.fast:
@@ -319,6 +321,8 @@ def generate_iso():
319321
'--description', pretty_name, '--checksum', img_metal_checksum,
320322
'--output', '/var/tmp/coreos-installer-output'] + fast_arg)
321323
if img_metal4k_obj:
324+
assert img_metal4k
325+
assert img_metal4k_checksum
322326
tmp_osmet4k = os.path.join(tmpinitrd_rootfs, img_metal4k_obj['path'] + '.osmet')
323327
print('Generating osmet file for 4k metal image')
324328
runcmd(['/usr/lib/coreos-assembler/runvm-coreos-installer',
@@ -695,7 +699,7 @@ boot
695699
# Write out the igninfo.json file. This is used by coreos-installer to know
696700
# how to embed the Ignition config.
697701
with open(os.path.join(tmpisocoreos, igninfo_file), 'w') as fh:
698-
json.dump(igninfo_json, fh, indent=2, sort_keys=True)
702+
json.dump(igninfo_json, fh, indent=2, sort_keys=True) # pylint: disable=E0601
699703
fh.write('\n')
700704

701705
# Define inputs and outputs

src/cmd-compress

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ def compress_one_builddir(builddir):
121121
elif args.compressor == 'zstd':
122122
runcmd(['zstd', '-10', '-c', f'-T{t}', filepath], stdout=f)
123123
else:
124-
runcmd(['gzip', f'-{gzip_level}', '-c', filepath], stdout=f)
124+
runcmd(['gzip', f'-{gzip_level}', '-c', filepath], stdout=f) # pylint: disable=E0606
125125
file_with_ext = file + ext
126126
filepath_with_ext = filepath + ext
127127
compressed_size = os.path.getsize(tmpfile)

src/cmd-koji-upload

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -169,10 +169,9 @@ class Build(_Build):
169169
ftype = (os.path.splitext(base)[1]).replace(".", "")
170170
ctype = f"{ftype}.{x}"
171171
if ctype not in KOJI_CG_TYPES and ftype in KOJI_CG_TYPES:
172-
if x == "gz":
173-
compressor = gzip
174-
elif x == "xz":
172+
if x != "gz":
175173
raise Exception("not supported yet")
174+
compressor = gzip
176175

177176
new_path = os.path.join(self._tmpdir, base)
178177
try:

0 commit comments

Comments
 (0)