static ClRcT clCompAppHealthCheck(ClEoSchedFeedBackT* schFeedback) { /* * Add code for application specific health check below. The * defaults indicate EO is healthy and polling interval is * unaltered. */ /* * ---BEGIN_APPLICATION_CODE--- */ ClRcT rc = CL_OK; /* If you want to attach to gdb */ if (clDbgNoKillComponents) schFeedback->freq = CL_EO_DONT_POLL; else { schFeedback->freq = CL_EO_DEFAULT_POLL; schFeedback->status = CL_CPM_EO_ALIVE; /* GAS TODO: get the return value out of this call */ clRunPython("eoApp.HealthCheck()"); return rc; } /* * ---END_APPLICATION_CODE--- */ return CL_OK; }
static void clPyGlueCsiRemove( const SaNameT *compName, const SaNameT *csiName, SaAmfCSIFlagsT csiFlags) { char s[1024]; snprintf(s,1024,"eoApp.RemoveWorkAssignment('%s',%s)\n", csiName->value, (csiFlags & CL_AMS_CSI_FLAG_TARGET_ALL) ? "True":"False"); clRunPython(s); }
void clPyGlueTerminate() { clRunPython("eoApp.Stop()"); clOsalCondBroadcast (&event); clOsalMutexLock(&pyMutex); quit=1; PyEval_AcquireThread(thrdState); Py_Finalize(); clOsalMutexUnlock(&pyMutex); }
void clPyGlueStart(int block) { ClRcT rc; clRunPython("eoApp.Start()"); if (block) { ClTimerTimeOutT forever={0}; rc = clOsalMutexLock(&pyMutex); CL_ASSERT(rc==CL_OK); clOsalCondWait (&event,&pyMutex,forever); } }
static void clPyGlueCsiSet( const SaNameT *compName, SaAmfHAStateT haState, SaAmfCSIDescriptorT* csiDescriptor) { #define BSZ 2048 char s[BSZ]; int curlen = 0; int ok = 1; switch ( haState ) { case CL_AMS_HA_STATE_ACTIVE: { curlen += snprintf (s+curlen,BSZ-curlen, "eoApp.ActivateWorkAssignment("); break; } case CL_AMS_HA_STATE_STANDBY: { curlen += snprintf (s+curlen,BSZ-curlen, "eoApp.StandbyWorkAssignment("); break; } case CL_AMS_HA_STATE_QUIESCED: { curlen += snprintf (s+curlen,BSZ-curlen, "eoApp.AbortWorkAssignment("); break; } case CL_AMS_HA_STATE_QUIESCING: { curlen += snprintf (s+curlen,BSZ-curlen, "eoApp.QuiesceWorkAssignment("); break; } default: { ok = 0; // Its NOT ok break; } } if (ok) { curlen += clCreateCsiPython(s+curlen, BSZ-curlen, compName, csiDescriptor, haState); curlen += snprintf (s+curlen,BSZ-curlen, ")\n"); clprintf (CL_LOG_SEV_INFO, "%s",s); clRunPython(s); #if 0 if (strlen(csiDescriptor->csiName.value)) { /* Just for debugging use */ curlen = snprintf(s,BSZ,"%s = ", csiDescriptor->csiName.value); curlen += clCreateCsiPython(s+curlen, BSZ-curlen, compName, csiDescriptor, haState); clprintf (CL_LOG_SEV_INFO, "%s",s); clRunPython(s); } #endif } }
ClRcT clPyGlueHealthCheck() { /* GAS TODO: get the return value out of this call */ clRunPython("eoApp.HealthCheck()"); return CL_OK; }