Skip to content

Commit

Permalink
refactor: Change variable name for consistent typing (#4823)
Browse files Browse the repository at this point in the history
`line` gets reused in two different loops in cc_mounts,
causing mypy to think the later line has the same type as the
early line. Change `line` to `entry` to make mypy happy.
  • Loading branch information
TheRealFalcon committed Jan 31, 2024
1 parent 21b2b6e commit 31fff57
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions cloudinit/config/cc_mounts.py
Original file line number Diff line number Diff line change
Expand Up @@ -573,14 +573,14 @@ def handle(name: str, cfg: Config, cloud: Cloud, args: list) -> None:
needswap = False
need_mount_all = False
dirs = []
for line in actlist:
for entry in actlist:
# write 'comment' in the fs_mntops, entry, claiming this
line[3] = "%s,%s" % (line[3], MNT_COMMENT)
if line[2] == "swap":
entry[3] = "%s,%s" % (entry[3], MNT_COMMENT)
if entry[2] == "swap":
needswap = True
if line[1].startswith("/"):
dirs.append(line[1])
cc_lines.append("\t".join(line))
if entry[1].startswith("/"):
dirs.append(entry[1])
cc_lines.append("\t".join(entry))

mount_points = [
v["mountpoint"] for k, v in util.mounts().items() if "mountpoint" in v
Expand Down

0 comments on commit 31fff57

Please sign in to comment.