All of lore.kernel.org
 help / color / mirror / Atom feed
* main - lvmdbusd: Don't setup search key unless needed
@ 2021-06-16 17:19 Tony Asleson
  0 siblings, 0 replies; only message in thread
From: Tony Asleson @ 2021-06-16 17:19 UTC (permalink / raw)
  To: lvm-devel

Gitweb:        https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=e8f3a63000e692b00070b337e475fd4a38e1f1c9
Commit:        e8f3a63000e692b00070b337e475fd4a38e1f1c9
Parent:        27abb03a0d5fb8342741c306b0ce187f41f8e3c1
Author:        Tony Asleson <tasleson@redhat.com>
AuthorDate:    Thu Jun 10 13:26:15 2021 -0500
Committer:     Tony Asleson <tasleson@redhat.com>
CommitterDate: Wed Jun 16 12:19:02 2021 -0500

lvmdbusd: Don't setup search key unless needed

self.lvm_id is a property which actually executes some code which doesn't
need to be executed everytime.
---
 daemons/lvmdbusd/automatedproperties.py | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/daemons/lvmdbusd/automatedproperties.py b/daemons/lvmdbusd/automatedproperties.py
index b5919484d..d9f2c5e9f 100644
--- a/daemons/lvmdbusd/automatedproperties.py
+++ b/daemons/lvmdbusd/automatedproperties.py
@@ -157,14 +157,15 @@ class AutomatedProperties(dbus.service.Object):
 		if not self._ap_search_method:
 			return 0
 
-		search = self.lvm_id
-		if search_key:
-			search = search_key
-
 		# Either we have the new object state or we need to go fetch it
 		if object_state:
 			new_state = object_state
 		else:
+			if search_key:
+				search = search_key
+			else:
+				search = self.lvm_id
+
 			new_state = self._ap_search_method([search])[0]
 			assert isinstance(new_state, State)
 



^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2021-06-16 17:19 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-06-16 17:19 main - lvmdbusd: Don't setup search key unless needed Tony Asleson

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.