bug-cfengine
[Top][All Lists]
Advanced

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

Tidy Run-time Classes Bug


From: Robert Shaw
Subject: Tidy Run-time Classes Bug
Date: Mon, 16 Apr 2001 10:34:55 -0700

Mark,

We are using cfengine 1.6.3 and we noticed that when you declare
run-time classes on the tidy action, it doesn't work correctly. It
always runs all tidy actions (except for home pattern ones, it handles
those correctly).

I looked in the code, and I found and fixed the problem. Attached is the
patch to correct this, as well as the test-case I used that shows the
problem (without the patch) and is fixed after the patch has been
applied.

Please incorporate into the next release.

Thanks,
-Robert
Index: src/do.c
===================================================================
RCS file: /home/cadphx/cvsroot/gnu/cfengine/src/do.c,v
retrieving revision 1.3
diff -u -r1.3 do.c
--- src/do.c    2001/02/22 20:48:37     1.3
+++ src/do.c    2001/04/16 17:25:01
@@ -974,6 +974,11 @@
 
    for (tlp = tp->tidylist; tlp != NULL; tlp=tlp->next)
       {
+      if (IsExcluded(tlp->classes))
+         {
+         continue;
+         }
+
       Verbose("Directory %s\n",tp->path);
       strcpy(VBUFF,tp->path);
       AddSlash(VBUFF);
@@ -993,16 +998,15 @@
               }
             }
          }
-      }
 
-   basename[0] = '\0';
+      basename[0] = '\0';
 
-   ExpandWildCardsAndDo(tp->path,basename,TidyWrapper,tp);
-   
-   DeleteTidyList(tp->tidylist);
-   tp->tidylist = NULL;
-   }
+      ExpandWildCardsAndDo(tp->path,basename,TidyWrapper,tp);
 
+      DeleteTidyList(tp->tidylist);
+      tp->tidylist = NULL;
+      }
+   }
 
 Debug2("End PATHTIDY:\n");
 
control:
        domain = ( mydomain.com )

        homepattern = ( home )
        mountpattern = ( /tmp )

        actionsequence = ( 
                tidy.Fred
                tidy.Barney
                tidy.Rest
        )

tidy:

        Rest::
                /rest1/tidy pattern=nuke age=0

        Fred::
                /fred/tidy1 pattern=nuke1 age=0
                home/fred   pattern=nuke2 age=0
                /fred/tidy2 pattern=nuke3 age=0

        Rest::
                /rest2/tidy pattern=nuke age=0

        Barney::
                /barney/tidy1 pattern=nukeA age=0
                home/barney   pattern=nukeB age=0
                /barney/tidy2 pattern=nukeC age=0

        Rest::
                /rest3/tidy pattern=nuke age=0

reply via email to

[Prev in Thread] Current Thread [Next in Thread]