coren has uploaded a new change for review.

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

Change subject: Make manage-nfs-volumes handle broken instances
......................................................................

Make manage-nfs-volumes handle broken instances

Or, more precisely, let them skip over instances which
have not gotten an aRecord because they are broken.

Change-Id: I284eeb74fc31baba7d7fb1be76cb677755554d4f
---
M modules/ldap/files/scripts/manage-nfs-volumes-daemon
1 file changed, 13 insertions(+), 12 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/46/114146/1

diff --git a/modules/ldap/files/scripts/manage-nfs-volumes-daemon 
b/modules/ldap/files/scripts/manage-nfs-volumes-daemon
index 16a4bb9..52195bd 100755
--- a/modules/ldap/files/scripts/manage-nfs-volumes-daemon
+++ b/modules/ldap/files/scripts/manage-nfs-volumes-daemon
@@ -273,18 +273,19 @@
         project_hosts = {}
         if hostdata:
             for host in hostdata:
-                host_ip = host[1]["aRecord"][0]
-                puppet_vars = host[1]["puppetvar"]
-                for puppet_var in puppet_vars:
-                    var_arr = puppet_var.split('=')
-                    if len(var_arr) == 2 and var_arr[0] == "instanceproject":
-                        project = var_arr[1]
-                        if project in project_hosts:
-                            project_hosts[project].append(host_ip)
-                        else:
-                            project_hosts[project] = [host_ip]
-                        # No need to go any further, we aren't reading other 
variables
-                        break
+                if "aRecord" in host[1]
+                    host_ip = host[1]["aRecord"][0]
+                    puppet_vars = host[1]["puppetvar"]
+                    for puppet_var in puppet_vars:
+                        var_arr = puppet_var.split('=')
+                        if len(var_arr) == 2 and var_arr[0] == 
"instanceproject":
+                            project = var_arr[1]
+                            if project in project_hosts:
+                                project_hosts[project].append(host_ip)
+                            else:
+                                project_hosts[project] = [host_ip]
+                            # No need to go any further, we aren't reading 
other variables
+                            break
         return project_hosts
 
     # returns an array containing zero, one, or both of 'project', 'volume'

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I284eeb74fc31baba7d7fb1be76cb677755554d4f
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: coren <mpellet...@wikimedia.org>

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

Reply via email to