IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 32668 for trunk/ippTools/src


Ignore:
Timestamp:
Nov 14, 2011, 5:09:22 PM (14 years ago)
Author:
bills
Message:

add new magicDSRun.state failed_revert_ud. Update clearstatefaults to automatically
figure out new state if one is not supplied.

Location:
trunk/ippTools/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippTools/src/magicdstool.c

    r32479 r32668  
    5353
    5454static bool setmagicDSRunState(pxConfig *config, psS64 magic_id, psString extraSetString, psMetadata *where, const char *state);
     55static bool validDSRunState(const char *state);
    5556
    5657# define MODECASE(caseName, func) \
     
    12121213
    12131214    psMetadata *where = psMetadataAlloc();
    1214     // new state (required
    1215     PXOPT_LOOKUP_STR(new_state, config->args, "-set_state", true, false);
     1215    // new state
     1216    PXOPT_LOOKUP_STR(new_state, config->args, "-set_state", false, false);
    12161217    // old state (required)
    12171218    PXOPT_LOOKUP_STR(state, config->args, "-state", true, false);
     
    12371238        if (!strcmp(state, "failed_revert")) {
    12381239            new_state = "new";
     1240        } else if (!strcmp(state, "failed_revert_ud")) {
     1241            new_state = "update";
    12391242        } else if (!strcmp(state, "failed_cleanup")) {
    12401243            new_state = "goto_cleaned";
     
    12431246            return false;
    12441247        }
     1248    } else {
     1249        if (!validDSRunState(new_state)) {
     1250            psError(PS_ERR_UNKNOWN, true, "unexpected value for new state: %s", new_state);
     1251            return false;
     1252        }
    12451253    }
    12461254    if (!p_psDBRunQueryF(config->dbh, query, new_state)) {
    1247         psError(PS_ERR_UNKNOWN, false, "failed to revert");
     1255        psError(PS_ERR_UNKNOWN, false, "failed to clear state faults");
    12481256        psFree(query);
    12491257        return false;
     
    14031411          (strcmp(state, "wait") == 0) ||
    14041412          (strcmp(state, "failed_revert") == 0) ||
     1413          (strcmp(state, "failed_revert_ud") == 0) ||
    14051414          (strcmp(state, "error_cleaned") == 0) ||
    14061415          (strcmp(state, "restored") == 0) ||
  • trunk/ippTools/src/magicdstoolConfig.c

    r32479 r32668  
    163163    // -clearstatefaults
    164164    psMetadata *clearstatefaultsArgs = psMetadataAlloc();
    165     psMetadataAddStr(clearstatefaultsArgs, PS_LIST_TAIL, "-set_state", 0, "new value for state (required)", NULL);
     165    psMetadataAddStr(clearstatefaultsArgs, PS_LIST_TAIL, "-set_state", 0, "new value for state", NULL);
    166166    psMetadataAddStr(clearstatefaultsArgs, PS_LIST_TAIL, "-state", 0, "search by state (required)", NULL);
    167167    psMetadataAddS64(clearstatefaultsArgs, PS_LIST_TAIL, "-magic_ds_id", 0, "search by magictool de-streak ID", 0);
Note: See TracChangeset for help on using the changeset viewer.