From 849677b052d7392512a76d0afeae84981929fb8b Mon Sep 17 00:00:00 2001 From: Jimmy McCrory Date: Wed, 12 Jul 2017 11:55:42 -0700 Subject: [PATCH] Sort key-value pairs in backend dictionaries The items within each cinder backend section is currently templated as an unsorted dictionary. Sort them to avoid unnecessary config changes and service restarts. Change-Id: I48a0bd5dc294ec5bc142537c6e74d57a25fda5e4 --- templates/cinder.conf.j2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/cinder.conf.j2 b/templates/cinder.conf.j2 index ee51731c..cba061b5 100644 --- a/templates/cinder.conf.j2 +++ b/templates/cinder.conf.j2 @@ -95,7 +95,7 @@ enabled_backends={% for backend in cinder_backends|dictsort %}{{ backend.0 }}{% # All given backend(s) {% for backend_section in cinder_backends|dictsort %} [{{ backend_section.0 }}] -{% for key, value in backend_section.1.items() if key not in ['extra_volume_types', 'shares'] %} +{% for key, value in (backend_section.1 | dictsort) if key not in ['extra_volume_types', 'shares'] %} {{ key }}={{ value }} {% endfor %}