]>
git.proxmox.com Git - ceph.git/blob - ceph/src/ceph-volume/plugin/zfs/ceph_volume_zfs/devices/zfs/inventory.py
3 from textwrap
import dedent
5 # import ceph_volume.process
7 from ceph_volume_zfs
.util
.disk
import Disks
9 class Inventory(object):
11 help = 'Generate a list of available devices'
13 def __init__(self
, argv
):
16 def format_report(self
, inventory
):
17 if self
.args
.format
== 'json':
18 print(json
.dumps(inventory
.json_report()))
19 elif self
.args
.format
== 'json-pretty':
20 print(json
.dumps(inventory
.json_report(), indent
=4, sort_keys
=True))
22 print(inventory
.pretty_report())
25 sub_command_help
= dedent("""
26 Generate an inventory of available devices
28 parser
= argparse
.ArgumentParser(
29 prog
='ceph-volume zfs inventory',
30 description
=sub_command_help
,
36 help=('Report on specific disk'),
40 choices
=['plain', 'json', 'json-pretty'],
45 self
.args
= parser
.parse_args(self
.argv
)
47 self
.format_report(Disks(self
.args
.path
))
49 self
.format_report(Disks())