#982125 lvm2-dbusd: lvremove fails with ValueError (from `options_to_cli_args`)

Package:
libblockdev-lvm-dbus2
Source:
libblockdev
Description:
LVM DBus plugin for libblockdev
Submitter:
Johan Fleury
Date:
2022-07-04 02:00:05 UTC
Severity:
important
Tags:
#982125#5
Date:
2021-02-06 17:12:03 UTC
From:
To:
Dear Maintainer,

While working on targetd (ITP #968297), I figured removing an LV through lvm2-dbusd fails with (other operations like creating a new LV work as expected):

```
lvmdbusd[30995]: 30995:30999 - Exception returned to client:
lvmdbusd[30995]: Traceback (most recent call last):
lvmdbusd[30995]:   File "/usr/lib/python3/dist-packages/lvmdbusd/request.py", line 72, in run_cmd
lvmdbusd[30995]:     result = self.method(*self.arguments)
lvmdbusd[30995]:   File "/usr/lib/python3/dist-packages/lvmdbusd/lv.py", line 459, in _remove
lvmdbusd[30995]:     rc, out, err = cmdhandler.lv_remove(lv_name, remove_options)
lvmdbusd[30995]:   File "/usr/lib/python3/dist-packages/lvmdbusd/cmdhandler.py", line 391, in lv_remove
lvmdbusd[30995]:     cmd.extend(options_to_cli_args(remove_options))
lvmdbusd[30995]:   File "/usr/lib/python3/dist-packages/lvmdbusd/cmdhandler.py", line 214, in options_to_cli_args
lvmdbusd[30995]:     for k, v in list(dict(options).items()):
lvmdbusd[30995]: ValueError: dictionary update sequence element #0 has length 1; 2 is required
```

I’ve added a line before `cmdhandler.py:214` to print the content of `options` and it appears to contain:

```
dbus.Struct((dbus.Dictionary({dbus.String('--yes'): dbus.String('', variant_level=1)}, signature=dbus.Signature('sv'), variant_level=1),), signature=None)
```

I have no easy way to test this, but I don’t think it is fixed in newer versions present in testing/unstable as I didn’t found any change related to that part of the code in upstreams’s git history.

#982125#10
Date:
2021-02-06 20:15:43 UTC
From:
To:
I’ve made a MR on Salsa [3].

[1] https://github.com/storaged-project/libblockdev/issues/453
[2] https://github.com/storaged-project/libblockdev/pull/415
[3] https://salsa.debian.org/utopia-team/libblockdev/-/merge_requests/2