summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTony Asleson <tasleson@redhat.com>2019-01-16 15:43:39 -0600
committerTony Asleson <tasleson@redhat.com>2019-01-16 16:29:05 -0600
commit0d142f65141d591430ced6a7a7fcccb4d2198d28 (patch)
treeb5ad0c8b9943aeacb7ab22fcfed8233b93a67d7e
parentf43b7bb46159d00a4eba56df92ad5e572fa2038c (diff)
downloadlvm2-0d142f65141d591430ced6a7a7fcccb4d2198d28.tar.gz
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.
-rw-r--r--daemons/lvmdbusd/cmdhandler.py4
-rw-r--r--daemons/lvmdbusd/vg.py2
2 files changed, 3 insertions, 3 deletions
diff --git a/daemons/lvmdbusd/cmdhandler.py b/daemons/lvmdbusd/cmdhandler.py
index fde7f5e61..df854eb84 100644
--- a/daemons/lvmdbusd/cmdhandler.py
+++ b/daemons/lvmdbusd/cmdhandler.py
@@ -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)
diff --git a/daemons/lvmdbusd/vg.py b/daemons/lvmdbusd/vg.py
index 64ad0f01f..7011ff899 100644
--- a/daemons/lvmdbusd/vg.py
+++ b/daemons/lvmdbusd/vg.py
@@ -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 '/'