]> andersk Git - moira.git/commitdiff
Care about CUPS-CLUSTER entries in serverhosts table as well.
authorzacheiss <zacheiss>
Mon, 16 Nov 2009 22:54:36 +0000 (22:54 +0000)
committerzacheiss <zacheiss>
Mon, 16 Nov 2009 22:54:36 +0000 (22:54 +0000)
gen/cups-cluster.pc
gen/cups-print.pc

index 2b87dd79f9530a8e4d7753c4b936dd82bbd0b4c0..b0d1c030929da65eff492965dbcf533809a626d4 100644 (file)
@@ -235,7 +235,7 @@ void do_host(char *host)
     FROM printers pr, machine m, serverhosts sh
     WHERE pr.rm = m.mach_id 
     AND (pr.type = 'CLUSTER' or pr.type = 'DORM') AND m.name <> :spoolhost AND
-    m.mach_id = sh.mach_id AND sh.service = 'CUPS-PRINT' AND 
+    m.mach_id = sh.mach_id AND (sh.service = 'CUPS-PRINT' OR sh.service = 'CUPS-CLUSTER') AND 
     sh.enable = 1 AND m.mach_id = sh.mach_id;
 
   EXEC SQL OPEN csr_remote_printers;
@@ -375,7 +375,7 @@ void do_host(char *host)
     WHERE pr.rm = m.mach_id 
     AND m.mach_id = sh.mach_id AND sh.enable = 1 
     AND (pr.type = 'DORM' or pr.type = 'CLUSTER')
-    AND (sh.service = 'CUPS-PRINT' OR sh.service = 'PRINT');
+    AND (sh.service = 'CUPS-PRINT' OR sh.service = 'PRINT' OR sh.service = 'CUPS-CLUSTER');
   EXEC SQL OPEN csr_duplexqs;
   while (1)
     {
@@ -584,7 +584,7 @@ void do_host(char *host)
     SELECT UNIQUE rp, ka, ac, lpc_acl
     FROM printers
     WHERE (ac != 0 OR lpc_acl != 0) AND rm in (SELECT m.mach_id FROM machine m, serverhosts sh
-    WHERE m.mach_id = sh.mach_id AND sh.service = 'CUPS-PRINT' AND sh.enable = 1);
+    WHERE m.mach_id = sh.mach_id AND (sh.service = 'CUPS-PRINT' OR sh.service = 'CUPS-CLUSTER') AND sh.enable = 1);
   EXEC SQL OPEN csr_lpc;
   while (1)
     {
index 48c153e868bff4ec1ae1ba00ac55293ef606c68e..a768a8f80362ea80ce98a8bc8e551e4e7e12b537 100644 (file)
@@ -74,7 +74,8 @@ int main(int argc, char **argv)
 
   EXEC SQL DECLARE csr_hosts CURSOR FOR
     SELECT m.name FROM machine m, serverhosts sh
-    WHERE m.mach_id = sh.mach_id AND sh.service = 'CUPS-PRINT' AND sh.enable = 1;
+    WHERE m.mach_id = sh.mach_id AND (sh.service = 'CUPS-PRINT' OR sh.service = 'CUPS-CLUSTER')
+    AND sh.enable = 1;
   EXEC SQL OPEN csr_hosts;
   while (1)
     {
@@ -235,8 +236,8 @@ void do_host(char *host)
     FROM printers pr, machine m, serverhosts sh
     WHERE pr.rm = m.mach_id 
     AND pr.type != 'ALIAS' AND m.name <> :spoolhost AND
-    m.mach_id = sh.mach_id AND sh.service = 'CUPS-PRINT' AND 
-    sh.enable = 1 AND m.mach_id = sh.mach_id;
+    m.mach_id = sh.mach_id AND (sh.service = 'CUPS-PRINT' OR sh.service = 'CUPS-CLUSTER')
+    AND sh.enable = 1 AND m.mach_id = sh.mach_id;
 
   EXEC SQL OPEN csr_remote_printers;
   while (1)
@@ -374,7 +375,7 @@ void do_host(char *host)
     FROM printers pr, machine m, serverhosts sh
     WHERE pr.rm = m.mach_id 
     AND m.mach_id = sh.mach_id AND sh.enable = 1 
-    AND (sh.service = 'CUPS-PRINT' OR sh.service = 'PRINT');
+    AND (sh.service = 'CUPS-PRINT' OR sh.service = 'PRINT' OR sh.service = 'CUPS-CLUSTER');
   EXEC SQL OPEN csr_duplexqs;
   while (1)
     {
@@ -583,7 +584,8 @@ void do_host(char *host)
     SELECT UNIQUE rp, ka, ac, lpc_acl
     FROM printers
     WHERE (ac != 0 OR lpc_acl != 0) AND rm in (SELECT m.mach_id FROM machine m, serverhosts sh
-    WHERE m.mach_id = sh.mach_id AND sh.service = 'CUPS-PRINT' AND sh.enable = 1);
+    WHERE m.mach_id = sh.mach_id AND (sh.service = 'CUPS-PRINT' OR sh.service = 'CUPS-CLUSTER')
+    AND sh.enable = 1);
   EXEC SQL OPEN csr_lpc;
   while (1)
     {
This page took 0.053578 seconds and 5 git commands to generate.