Skip to content

Commit

Permalink
Fixes after compile and test
Browse files Browse the repository at this point in the history
Signed-off-by: 1000TurquoisePogs <sgrady@rocketsoftware.com>
  • Loading branch information
1000TurquoisePogs committed Jul 5, 2024
1 parent 13ebdcd commit 847a675
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1578,15 +1578,21 @@ static int get_component_list(char *buf, size_t buf_size,ConfigManager *configmg
bool checkHaSection = false;

Json *haInstancesJson = NULL;
getStatus = cfgGetAny(configmgr, ZOWE_CONFIG_NAME, &haInstancesJson, 1, "haInstances");
int getStatus = cfgGetAnyC(configmgr, ZOWE_CONFIG_NAME, &haInstancesJson, 1, "haInstances");
if (!getStatus) {
if ((!strcmp(zl_context.ha_instance_id, "__ha_instance_id__")) || (!strcmp(zl_context.ha_instance_id, "{{ha_instance_id}}"))) {
int rc = 0;
int rsn = 0;
char *resolvedName = resolveSymbol("&SYSNAME", &rc, &rsn);
if (!rc) {
//ha instance name is always lowercase if derived from sysname automatically.
int nameLength = strlen(resolvedName);
for(int i = 0; i < nameLength; i++){
resolvedName[i] = tolower(resolvedName[i]);
}

// Resolves ha instance id for downstream as well.
zl_context.ha_instance_id = resolvedName;
snprintf(zl_context.ha_instance_id, 8+1, "%s", resolvedName);
checkHaSection = true;
} else {
ERROR("Could not resolve SYSNAME for HA instance lookup, rc=0x%x, rsn=0x%x\n", rc, rsn);
Expand All @@ -1601,7 +1607,7 @@ static int get_component_list(char *buf, size_t buf_size,ConfigManager *configmg
if (jsonIsObject(result)) {
JsonObject *resultObj = jsonAsObject(result);
JsonProperty *prop = resultObj->firstProperty;
int getStatus = cfgGetStringC(configmgr, ZOWE_CONFIG_NAME, &runtimeDirectory, 2, "zowe", "runtimeDirectory");
getStatus = cfgGetStringC(configmgr, ZOWE_CONFIG_NAME, &runtimeDirectory, 2, "zowe", "runtimeDirectory");
if (getStatus) {
getStatus = cfgGetStringC(configmgr, ZOWE_CONFIG_NAME, &extensionDirectory, 2, "zowe", "extensionDirectory");
if (getStatus) {
Expand All @@ -1616,7 +1622,7 @@ static int get_component_list(char *buf, size_t buf_size,ConfigManager *configmg
enabled = false;
// check if component is enabled
if (checkHaSection) {
getStatus = cfgGetBooleanC(configmgr, ZOWE_CONFIG_NAME, &enabled, 4, "haInstances", haInstName, "components", prop->key, "enabled");
getStatus = cfgGetBooleanC(configmgr, ZOWE_CONFIG_NAME, &enabled, 5, "haInstances", zl_context.ha_instance_id, "components", prop->key, "enabled");
if (getStatus) {
getStatus = cfgGetBooleanC(configmgr, ZOWE_CONFIG_NAME, &enabled,3, "components", prop->key, "enabled");
}
Expand Down

0 comments on commit 847a675

Please sign in to comment.