]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/ceph-volume/ceph_volume/inventory/main.py
Import ceph 15.2.8
[ceph.git] / ceph / src / ceph-volume / ceph_volume / inventory / main.py
index 470be274f52ebb2d30048ecfaecaa78230ca97df..aa70e92f19d5c949af903952aacfefb8690bcee0 100644 (file)
@@ -31,17 +31,32 @@ class Inventory(object):
             default='plain',
             help='Output format',
         )
+        parser.add_argument(
+            '--filter-for-batch',
+            action='store_true',
+            help=('Filter devices unsuitable to pass to an OSD service spec, '
+                  'no effect when <path> is passed'),
+            default=False,
+        )
+        parser.add_argument(
+            '--with-lsm',
+            action='store_true',
+            help=('Attempt to retrieve additional health and metadata through '
+                  'libstoragemgmt'),
+            default=False,
+        )
         self.args = parser.parse_args(self.argv)
         if self.args.path:
-            self.format_report(Device(self.args.path))
+            self.format_report(Device(self.args.path, with_lsm=self.args.with_lsm))
         else:
-            self.format_report(Devices())
+            self.format_report(Devices(filter_for_batch=self.args.filter_for_batch,
+                                       with_lsm=self.args.with_lsm))
 
     def get_report(self):
         if self.args.path:
-            return Device(self.args.path).json_report()
+            return Device(self.args.path, with_lsm=self.args.with_lsm).json_report()
         else:
-            return Devices().json_report()
+            return Devices(filter_for_batch=self.args.filter_for_batch, with_lsm=self.args.with_lsm).json_report()
 
     def format_report(self, inventory):
         if self.args.format == 'json':