Skip to content

Commit

Permalink
comments
Browse files Browse the repository at this point in the history
  • Loading branch information
holmanb committed Dec 5, 2023
1 parent 50428a3 commit bb601ea
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions cloudinit/config/cc_growpart.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
from contextlib import suppress
from pathlib import Path
from textwrap import dedent
from typing import Tuple
from typing import Optional, Tuple

from cloudinit import subp, temp_utils, util
from cloudinit.cloud import Cloud
Expand Down Expand Up @@ -283,7 +283,7 @@ def resize(self, diskdev, partnum, partdev):
return (before, get_size(partdev))


def get_size(filename):
def get_size(filename) -> Optional[int]:
fd = None
try:
fd = os.open(filename, os.O_RDONLY)
Expand Down Expand Up @@ -584,12 +584,12 @@ def resize_devices(resizer, devices):
"no change necessary (%s, %s)" % (disk, ptnum),
)
)
elif new is None:
elif new is None or old is None:
info.append(
(
devent,
RESIZE.CHANGED,
"changed (%s, %s) from %s, new size is unknown"
"changed (%s, %s) size, new size is unknown"
% (disk, ptnum, old),
)
)
Expand Down

0 comments on commit bb601ea

Please sign in to comment.