Exemple #1
0
func LoadActionDefinition(actionName string) (*def.Action, []string, error) {
	logger.Infof("Reading action def file =>\t%v\n", actionName)
	act := strings.Split(actionName, "_")
	action := def.BlankAction()

	act, actionVars := cullCLIVariables(act)
	actionConf, dropped, err := readActionDefinition(act, make(map[string]string), 1)
	if err != nil {
		return action, actionVars, err
	}

	err = marshalActionDefinition(actionConf, action)
	if err != nil {
		return action, actionVars, err
	}

	if len(dropped) != 0 {
		fixSteps(action, dropped)
	}

	return action, actionVars, nil
}
Exemple #2
0
func MockAction(act string) (*def.Action, []string) {
	action := def.BlankAction()
	logger.Debugf("Mocking action =>\t\t%v\n", act)
	return action, []string{}
}
Exemple #3
0
func MockAction(act string) (*def.Action, []string) {
	action := def.BlankAction()
	log.WithField("file", act).Debug("Mocking action")
	return action, []string{}
}