summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarian Csontos <mcsontos@redhat.com>2017-06-02 08:19:04 +0200
committerMarian Csontos <mcsontos@redhat.com>2017-06-02 08:23:38 +0200
commitc8981f814fc841f8d4b39d629df08ae8a9d8cecf (patch)
tree7dc5c22da7e5cdcc1e1cb40b3f0a7cb637080c8f
parentc5d990d6f604d199798318e8cd5884a68e7776f3 (diff)
downloadlvm2-dev-mcsontos-bz1455471.tar.gz
dbusd: raise DeprecationWarningdev-mcsontos-bz1455471
Unfortunately, this will only litter lvmdbusd logs, instead of showing in application using it.
-rw-r--r--daemons/lvmdbusd/main.py2
-rw-r--r--daemons/lvmdbusd/vg.py12
2 files changed, 5 insertions, 9 deletions
diff --git a/daemons/lvmdbusd/main.py b/daemons/lvmdbusd/main.py
index d289c6261..e79c4f5e1 100644
--- a/daemons/lvmdbusd/main.py
+++ b/daemons/lvmdbusd/main.py
@@ -62,7 +62,6 @@ def check_bb_size(value):
"positive integers only ('%s' invalid)" % value)
return v
-
def main():
start = time.time()
# Add simple command line handling
@@ -109,6 +108,7 @@ def main():
# as the user may be specifying a different size. The default one in
# cmdhandler is for when we are running other code with a different main.
cfg.blackbox = LvmFlightRecorder(cfg.args.bb_size)
+ cfg.deprecation = dbus.exceptions.DBusException if cfg.args.strict else DeprecationWarning
if cfg.args.use_lvm_shell and not cfg.args.use_json:
log_error("You cannot specify --lvmshell and --nojson")
diff --git a/daemons/lvmdbusd/vg.py b/daemons/lvmdbusd/vg.py
index ad6512cd2..0d42849a6 100644
--- a/daemons/lvmdbusd/vg.py
+++ b/daemons/lvmdbusd/vg.py
@@ -238,14 +238,10 @@ class Vg(AutomatedProperties):
# If pv_object_paths is not empty, then get the device paths
if pv_object_paths and len(pv_object_paths) > 0:
if missing:
- if cfg.args.strict:
- # FIXME: Shall this call cbe directly from Reduce?
- raise dbus.exceptions.DBusException(
- VG_INTERFACE,
- 'Mixed missing and PVs usage!')
- else:
- # Passing an empty list to vg_reduce
- pass
+ # FIXME: Shall this call cbe directly from Reduce?
+ raise cfg.deprecation(
+ VG_INTERFACE,
+ 'Mixed missing and PVs usage!')
else:
for pv_op in pv_object_paths:
pv = cfg.om.get_object_by_path(pv_op)