get rid of the "ctdb setflags" command since
authorRonnie Sahlberg <ronniesahlberg@gmail.com>
Thu, 7 Oct 2010 05:18:27 +0000 (16:18 +1100)
committerRonnie Sahlberg <ronniesahlberg@gmail.com>
Thu, 7 Oct 2010 05:19:24 +0000 (16:19 +1100)
1, we dont need it
2, it uses the ugly "modify flags" control that should die

tools/ctdb.c

index ff2e7e9826f141bd71fb9a8a5f8075164258b5c9..8d422552aca693a2b4242b1dd70238b6cd192ef9 100644 (file)
@@ -4461,50 +4461,6 @@ static int control_wipedb(struct ctdb_context *ctdb, int argc,
        return 0;
 }
 
-/*
- * set flags of a node in the nodemap
- */
-static int control_setflags(struct ctdb_context *ctdb, int argc, const char **argv)
-{
-       int ret;
-       int32_t status;
-       int node;
-       int flags;
-       TDB_DATA data;
-       struct ctdb_node_flag_change c;
-
-       if (argc != 2) {
-               usage();
-               return -1;
-       }
-
-       if (sscanf(argv[0], "%d", &node) != 1) {
-               DEBUG(DEBUG_ERR, ("Badly formed node\n"));
-               usage();
-               return -1;
-       }
-       if (sscanf(argv[1], "0x%x", &flags) != 1) {
-               DEBUG(DEBUG_ERR, ("Badly formed flags\n"));
-               usage();
-               return -1;
-       }
-
-       c.pnn       = node;
-       c.old_flags = 0;
-       c.new_flags = flags;
-
-       data.dsize = sizeof(c);
-       data.dptr = (unsigned char *)&c;
-
-       ret = ctdb_control(ctdb, options.pnn, 0, CTDB_CONTROL_MODIFY_FLAGS, 0, 
-                          data, NULL, NULL, &status, NULL, NULL);
-       if (ret != 0 || status != 0) {
-               DEBUG(DEBUG_ERR,("Failed to modify flags\n"));
-               return -1;
-       }
-       return 0;
-}
-
 /*
   dump memory usage
  */
@@ -4803,7 +4759,6 @@ static const struct {
        { "dumpdbbackup",    control_dumpdbbackup,      false,  true,  "dump database backup from a file.", "<file>"},
        { "wipedb",           control_wipedb,        false,     false, "wipe the contents of a database.", "<dbname>"},
        { "recmaster",        control_recmaster,        false,  false, "show the pnn for the recovery master."},
-       { "setflags",        control_setflags,          false,  false, "set flags for a node in the nodemap.", "<node> <flags>"},
        { "scriptstatus",    control_scriptstatus,  false,      false, "show the status of the monitoring scripts (or all scripts)", "[all]"},
        { "enablescript",     control_enablescript,  false,     false, "enable an eventscript", "<script>"},
        { "disablescript",    control_disablescript,  false,    false, "disable an eventscript", "<script>"},