This check is already performed in `arg_validators.py`.
By the way, this check is only valid when the user passes a VG/LV with
the `<vg>/<lv>` format.
Signed-off-by: Guillaume Abrioux <gabrioux@ibm.com>
(cherry picked from commit
8d477959d62c172ef34f67c7284e908454044540)
if args is not None:
self.args = args
- try:
- vgname, lvname = self.args.data.split('/')
- lv = api.get_single_lv(filters={'lv_name': lvname,
- 'vg_name': vgname})
- except ValueError:
- lv = None
-
- if lv is not None:
- if api.is_ceph_device(lv):
- logger.info("device {} is already used".format(self.args.data))
- raise RuntimeError("skipping {}, it is already prepared".format(
- self.args.data))
try:
self.prepare()
except Exception: