func/overlord

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



 func/overlord/groups.py |   13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

New commits:
commit 9f116eb6b726ce7e709ea06fe461334abb2c920d
Author: Seth Vidal <skvidal@xxxxxxxxxxxxxxxxx>
Date:   Wed Jul 28 12:44:56 2010 -0400

    wouldn't it be nice if groups worked in puppetminions too? I think so
    whoops

diff --git a/func/overlord/groups.py b/func/overlord/groups.py
index b957a63..2b9fd1a 100644
--- a/func/overlord/groups.py
+++ b/func/overlord/groups.py
@@ -23,6 +23,9 @@ class Groups(object):
         if 'get_hosts_for_spec' in kwargs:
             self.get_hosts_for_spec = kwargs['get_hosts_for_spec']
             del kwargs['get_hosts_for_spec']
+        else:
+            # fallback/legacy only - won't work for puppet or other minion types
+            self.get_hosts_for_spec = get_hosts_spec
             
         self.backend = choose_backend(**kwargs)
 
@@ -91,9 +94,9 @@ class Groups(object):
         @param exclude_string :Glob string to be excluded you can
                             add something like "www*" easy and fast
         """
-        hoststring = get_hosts_spec(hoststring)
+        hoststring = self.get_hosts_spec(hoststring)
         if exclude_string :
-            e_s = get_hosts_spec(exclude_string)
+            e_s = self.get_hosts_spec(exclude_string)
             hoststring = hoststring.difference(e_s)
 
         #add them to backend
@@ -202,7 +205,7 @@ class Groups(object):
             #we seek for @group:ww* thing here
             if group_glob.find(":")!=-1:
                 group_str,host_str = group_glob.split(":")
-                hosts = get_hosts_spec(host_str)
+                hosts = self.get_hosts_spec(host_str)
                 #print "The hosts are ",hosts
                 include_host=include_host.union(set(self.get_hosts(pattern=hosts,group=group_str,exact=True)))
             else:
@@ -285,9 +288,9 @@ class Groups(object):
     
     def remove_host_glob(self,group_name,host_str,exclude_string=None):
         copy_host_str = host_str
-        host_str = get_hosts_spec(host_str)
+        host_str = self.get_hosts_spec(host_str)
         if exclude_string:
-            e_s = get_hosts_spec(exclude_string)
+            e_s = self.get_hosts_spec(exclude_string)
             host_str = host_str.difference(e_s)
 
         #remove the list completely


_______________________________________________
Func-list mailing list
Func-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/func-list


[Index of Archives]     [Fedora Users]     [Linux Networking]     [Fedora Legacy List]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]

  Powered by Linux