Skip to content

Commit b460a1a

Browse files
committed
ceph-volume: add type annotations to devices.lvm.main
This commit adds the Python type annotations to `devices.lvm.main`. Signed-off-by: Guillaume Abrioux <[email protected]>
1 parent aa26a5a commit b460a1a

File tree

1 file changed

+8
-5
lines changed
  • src/ceph-volume/ceph_volume/devices/lvm

1 file changed

+8
-5
lines changed

src/ceph-volume/ceph_volume/devices/lvm/main.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,10 @@
1010
from . import zap
1111
from . import batch
1212
from . import migrate
13+
from typing import List, Optional
1314

1415

15-
class LVM(object):
16+
class LVM:
1617

1718
help = 'Use LVM and LVM-based technologies to deploy OSDs'
1819

@@ -36,19 +37,21 @@ class LVM(object):
3637
'new-db': migrate.NewDB,
3738
}
3839

39-
def __init__(self, argv):
40+
def __init__(self, argv: Optional[List[str]]) -> None:
4041
self.argv = argv
4142

42-
def print_help(self, sub_help):
43+
def print_help(self, sub_help: str) -> str:
4344
return self._help.format(sub_help=sub_help)
4445

45-
def main(self):
46+
def main(self) -> None:
4647
terminal.dispatch(self.mapper, self.argv)
4748
parser = argparse.ArgumentParser(
4849
prog='ceph-volume lvm',
4950
formatter_class=argparse.RawDescriptionHelpFormatter,
5051
description=self.print_help(terminal.subhelp(self.mapper)),
5152
)
53+
if self.argv is None:
54+
self.argv = []
5255
parser.parse_args(self.argv)
5356
if len(self.argv) <= 1:
54-
return parser.print_help()
57+
parser.print_help()

0 commit comments

Comments
 (0)