Skip to contentSkip to conversation

master - lvmdbusd: Remove sorting in db layer

PATCH tasleson 1 participant 1 message Jun 28, 2016

lore
Share & tools
lore

tasleson

author
#0 lore raw
Gitweb:        http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=4b337b20d47953e130edc8a456e9431eba58a778
Commit:        4b337b20d47953e130edc8a456e9431eba58a778
Parent:        e514284c65a7cffa24549a34612392731f6e06af
Author:        Tony Asleson <[email protected]>
AuthorDate:    Mon Jun 6 15:08:20 2016 -0500
Committer:     Tony Asleson <[email protected]>
CommitterDate: Tue Jun 28 12:09:28 2016 -0500

lvmdbusd: Remove sorting in db layer

When using the JSON this does not yield a totally sorted list as we don't have a complete set of LVs, so remove this sort.

---
 daemons/lvmdbusd/lvmdb.py |    8 +-------
 1 files changed, 1 insertions(+), 7 deletions(-)
daemons/lvmdbusd/lvmdb.py +1 -7
index 5ac90e3..f070bb6 100755
@@ -245,16 +245,10 @@ class DataStore(object):
 		# Each item item in the report is a collection of information pertaining
 		# to the vg
 		for r in _all['report']:
-			tmp_lv = []
 			# Get the lv data for this VG.
 			if 'lv' in r:
-				tmp_lv.extend(r['lv'])
-
-				# Sort them
-				sorted_tmp_lv = sorted(tmp_lv, key=lambda vk: vk['lv_name'])
-
 				# Add them to result set
-				for i in sorted_tmp_lv:
+				for i in r['lv']:
 					full_name = "%s/%s" % (i['vg_name'], i['lv_name'])
 					c_lv_full_lookup[full_name] = i['lv_uuid']
 					c_lvs[i['lv_uuid']] = i