Andrew Bogott has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/343447 )

Change subject: nfs-exportd: Properly collect IPs for volume exports.
......................................................................


nfs-exportd: Properly collect IPs for volume exports.

Also, exclude exports for projects with no instances associated.

Bug: T160818
Change-Id: I69936b8fce85a5ecc1862fdf1a252120480b0c78
---
M modules/labstore/files/nfs-exportd
1 file changed, 9 insertions(+), 5 deletions(-)

Approvals:
  Andrew Bogott: Looks good to me, approved
  Rush: Looks good to me, but someone else must approve
  jenkins-bot: Verified



diff --git a/modules/labstore/files/nfs-exportd 
b/modules/labstore/files/nfs-exportd
index 79b1edd..2c558f2 100755
--- a/modules/labstore/files/nfs-exportd
+++ b/modules/labstore/files/nfs-exportd
@@ -96,7 +96,7 @@
         # 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)
+            if ip['OS-EXT-IPS:type'] == 'fixed' and is_valid_ipv4(ip['addr'])
         ]
     return ips
 
@@ -117,10 +117,14 @@
                 continue
         else:
             continue
-        project = Project(name, config['gid'], get_instance_ips(name, 
observer_pass), mounts)
-        projects.append(project)
-        logging.debug('project %s has %s instances',
-                     name, len(project.instance_ips))
+        ips = get_instance_ips(name, observer_pass)
+        if ips:
+            project = Project(name, config['gid'], ips, mounts)
+            projects.append(project)
+            logging.debug('project %s has %s instances',
+                          name, len(project.instance_ips))
+        else:
+            logging.warning('project %s has no instances; skipping.', name)
 
     # Validate that there are no duplicate gids
     gids = [p.gid for p in projects]

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I69936b8fce85a5ecc1862fdf1a252120480b0c78
Gerrit-PatchSet: 3
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Andrew Bogott <[email protected]>
Gerrit-Reviewer: Andrew Bogott <[email protected]>
Gerrit-Reviewer: Giuseppe Lavagetto <[email protected]>
Gerrit-Reviewer: Rush <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

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

Reply via email to