1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-10-27 10:25:13 +03:00

lvmdbusd: Use UUID instead of name for VG rename

Use the UUID to specify the VG to rename instead of the name as this
approach works when we have duplicate VG names.
This commit is contained in:
Tony Asleson 2019-01-16 15:43:39 -06:00
parent f43b7bb461
commit 0d142f6514
2 changed files with 3 additions and 3 deletions

View File

@ -263,10 +263,10 @@ def lv_tag(lv_name, add, rm, tag_options):
return _tag('lvchange', lv_name, add, rm, tag_options)
def vg_rename(vg, new_name, rename_options):
def vg_rename(vg_uuid, new_name, rename_options):
cmd = ['vgrename']
cmd.extend(options_to_cli_args(rename_options))
cmd.extend([vg, new_name])
cmd.extend([vg_uuid, new_name])
return call(cmd)

View File

@ -177,7 +177,7 @@ class Vg(AutomatedProperties):
# Make sure we have a dbus object representing it
Vg.validate_dbus_object(uuid, vg_name)
rc, out, err = cmdhandler.vg_rename(
vg_name, new_name, rename_options)
uuid, new_name, rename_options)
Vg.handle_execute(rc, out, err)
return '/'