Пример #1
0
        public bool PreCondition(DelayedEvent delayedEvent)
        {
            var commandResult = ModuleTools.ExecuteCommand(preConditionCommand, delayedEvent, this, settings, ModuleBase.PREFIX_PRECONDITION);

            if (commandResult.Error != null)
            {
                Util.LogError(commandResult.Error);
                return(false);
            }
            Util.WriteLog(string.Format("ExitCode {0}, expected {1}", commandResult.ExitCode, preConditionExpectedExitCode));
            return(commandResult.ExitCode == preConditionExpectedExitCode);
        }
Пример #2
0
        public void Execute(DelayedEvent delayedEvent)
        {
            var commandResult = ModuleTools.ExecuteCommand(command, delayedEvent, this, settings, ModuleBase.PREFIX_MODULE);

            if (commandResult.Error != null)
            {
                throw commandResult.Error;
            }
            if (commandResult.ExitCode != expectedExitCode)
            {
                Util.WriteLog(string.Format("Command {0} did not exit correctly, exit code {1} (expected {2}).",
                                            command, commandResult.ExitCode, expectedExitCode));
                foreach (var line in commandResult.Lines)
                {
                    Util.WriteLog(line);
                }
            }
        }