The branch, master has been updated
       via  c1deb87 ctdb-tools-ctdb: scriptstatus should not count disabled 
scripts
      from  f1d4b27 Remove obsolete README.packaging4.

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit c1deb87fb78b84a551ad8dc1004247d8a836f9bc
Author: Martin Schwenke <mar...@meltin.net>
Date:   Tue May 6 11:08:57 2014 +1000

    ctdb-tools-ctdb: scriptstatus should not count disabled scripts
    
    script_status->num_scripts is used as the count in this message:
    
      "%d scripts were executed last %s cycle\n"
    
    However, script_status->num_scripts includes disabled scripts, which
    are never actually executed.
    
    Instead, count the number of scripts that aren't disabled and make the
    message print that.
    
    Signed-off-by: Martin Schwenke <mar...@meltin.net>
    Reviewed-by: Amitay Isaacs <ami...@gmail.com>
    
    Autobuild-User(master): Amitay Isaacs <ami...@samba.org>
    Autobuild-Date(master): Wed May 28 02:27:48 CEST 2014 on sn-devel-104

-----------------------------------------------------------------------

Summary of changes:
 ctdb/tools/ctdb.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)


Changeset truncated at 500 lines:

diff --git a/ctdb/tools/ctdb.c b/ctdb/tools/ctdb.c
index 624c61c..8033fcb 100644
--- a/ctdb/tools/ctdb.c
+++ b/ctdb/tools/ctdb.c
@@ -1377,8 +1377,14 @@ static int control_one_scriptstatus(struct ctdb_context 
*ctdb,
        }
 
        if (!options.machinereadable) {
+               int num_run = 0;
+               for (i=0; i<script_status->num_scripts; i++) {
+                       if (script_status->scripts[i].status != -ENOEXEC) {
+                               num_run++;
+                       }
+               }
                printf("%d scripts were executed last %s cycle\n",
-                      script_status->num_scripts,
+                      num_run,
                       ctdb_eventscript_call_names[type]);
        }
        for (i=0; i<script_status->num_scripts; i++) {


-- 
Samba Shared Repository

Reply via email to