From 58dfe053446862fc34d8ac88f4ecc127d77e25ea Mon Sep 17 00:00:00 2001 From: Cole Robinson Date: Tue, 11 Jun 2019 08:51:44 -0400 Subject: [PATCH] virtManager: Remove some unnecessary generatename collidelist usage The libvirt callbacks will handle this for us already --- virtManager/create.py | 3 +-- virtManager/snapshots.py | 4 +--- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/virtManager/create.py b/virtManager/create.py index 5436bcda..63738329 100644 --- a/virtManager/create.py +++ b/virtManager/create.py @@ -1497,8 +1497,7 @@ class vmmCreate(vmmGObjectUI): return virtinst.generatename.generate_name(basename, self.conn.get_backend().lookupByName, start_num=force_num and 1 or 2, force_num=force_num, - sep=not force_num and "-" or "", - collidelist=[vm.get_name() for vm in self.conn.list_vms()]) + sep=not force_num and "-" or "") def _validate_install_page(self): diff --git a/virtManager/snapshots.py b/virtManager/snapshots.py index 0a4451a4..df1881ef 100644 --- a/virtManager/snapshots.py +++ b/virtManager/snapshots.py @@ -117,12 +117,10 @@ class vmmSnapshotNew(vmmGObjectUI): self.widget("snapshot-new-description").set_buffer(buf) def _reset_state(self): - collidelist = [s.get_xmlobj().name for s in self.vm.list_snapshots()] basename = "snapshot" cb = self.vm.get_backend().snapshotLookupByName default_name = generatename.generate_name( - basename, cb, sep="", start_num=1, force_num=True, - collidelist=collidelist) + basename, cb, sep="", start_num=1, force_num=True) self.widget("snapshot-new-name").set_text(default_name) self.widget("snapshot-new-name").emit("changed")