Ejemplo n.º 1
0
        public object Process(dynamic args)
        {
            Monit.GetInstance().StopServices();

            dynamic spec;
            if (args.GetType().Name == "JObject")
                spec = args;
            else
                spec = args[0];

            Plan plan = new Plan(spec);
            foreach (Job job in plan.Jobs)
            {
                job.PrepareForInstall();
            }
            foreach (Package package in plan.Packages)
            {
                package.PrepareForInstall();
            }

            return new object();
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Processes the apply message using args.
        /// </summary>
        /// <param name="args">The args.</param>
        /// <returns></returns>
        public object Process(dynamic args)
        {
            Logger.Info("Processing apply message");

            if (args.Count < 1)
                throw new ArgumentException("not enough arguments");

            if (args.GetType().Name == "JObject")
                newSpec = args;
            else
                newSpec = args[0];

            CheckNetworkSettings();

            Logger.Info("Retrieving old plan");
            oldPlan = new Plan(Config.State.ToHash());

            Logger.Info("Retrieving new plan");
            newPlan = new Plan(newSpec);

            dynamic newState = ApplyPlan();

            return newState;
        }