Let global modules add disco features for all hosts
authorWaqas Hussain <waqas20@gmail.com>
Wed, 4 Mar 2009 17:23:41 +0000 (22:23 +0500)
committerWaqas Hussain <waqas20@gmail.com>
Wed, 4 Mar 2009 17:23:41 +0000 (22:23 +0500)
core/modulemanager.lua

index 5bbff0add35355f0e9aeb4da0e2023e262414ea1..76ea0bc07df5460e7cca9e2ebbbfb58b197748e7 100644 (file)
@@ -300,6 +300,14 @@ addDiscoInfoHandler("*host", function(reply, to, from, node)
                                end
                        end
                end
+               for module, features in pairs(features_table:get("*") or NULL) do -- for each module
+                       for feature in pairs(features) do
+                               if not done[feature] then
+                                       reply:tag("feature", {var = feature}):up(); -- TODO cache
+                                       done[feature] = true;
+                               end
+                       end
+               end
                return next(done) ~= nil;
        end
 end);