Andrew Bogott has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/311461

Change subject: Puppet Panel:  check for empty hiera before we start 
enumerating keys.
......................................................................

Puppet Panel:  check for empty hiera before we start enumerating keys.

Change-Id: I3d8f6709bfce442cf76903ab9e1b0fee4517933b
---
M modules/openstack/files/liberty/horizon/puppettab/puppet_config.py
1 file changed, 4 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/61/311461/1

diff --git a/modules/openstack/files/liberty/horizon/puppettab/puppet_config.py 
b/modules/openstack/files/liberty/horizon/puppettab/puppet_config.py
index deb078f..a43e814 100644
--- a/modules/openstack/files/liberty/horizon/puppettab/puppet_config.py
+++ b/modules/openstack/files/liberty/horizon/puppettab/puppet_config.py
@@ -100,9 +100,10 @@
 
         # Remove all related role args from hiera
         hiera_yaml = yaml.safe_load(self.hiera_raw)
-        for key in hiera_yaml.keys():
-            if key.startswith("%s::" % role.name):
-                del hiera_yaml[key]
+        if hiera_yaml:
+            for key in hiera_yaml.keys():
+                if key.startswith("%s::" % role.name):
+                    del hiera_yaml[key]
 
         self.set_role_list(roles)
         self.set_hiera(hiera_yaml)

-- 
To view, visit https://gerrit.wikimedia.org/r/311461
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I3d8f6709bfce442cf76903ab9e1b0fee4517933b
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Andrew Bogott <abog...@wikimedia.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to