Madhuvishy has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/344220 )

Change subject: nfs-exportd: Explicitly check if instance address is valid
......................................................................

nfs-exportd: Explicitly check if instance address is valid

Change-Id: I3d686ea7a4769714b51c937d24a2293565ac629d
---
M modules/labstore/files/nfs-exportd
1 file changed, 7 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/20/344220/1

diff --git a/modules/labstore/files/nfs-exportd 
b/modules/labstore/files/nfs-exportd
index 800573d..d1ff484 100755
--- a/modules/labstore/files/nfs-exportd
+++ b/modules/labstore/files/nfs-exportd
@@ -97,10 +97,13 @@
     try:
         for instance in client.servers.list():
             # Only provide internal IPs!
-            ips += [
-                str(ip['addr']) for ip in instance.addresses['public']
-                if ip['OS-EXT-IPS:type'] == 'fixed' and 
is_valid_ipv4(ip['addr'])
-            ]
+            if 'public' in instance.addresses:
+                ip = instance.addresses['public']
+                if ip['OS-EXT-IPS:type'] == 'fixed' and 
is_valid_ipv4(ip['addr']):
+                    ips.append(ip)
+            else:
+                logging.warn('Failed to get instance address for instance 
%s.%s',
+                             repr(instance), project)
     except keystoneauth1.exceptions.http.Unauthorized:
         logging.warn("Failed to get server list for project %s."
                      "  Maybe the project was deleted." % project)

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I3d686ea7a4769714b51c937d24a2293565ac629d
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Madhuvishy <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to