Ejemplo n.º 1
0
        protected static void FixAd(Pool pool, List <Host> hostsToAdConfigure, Func <Host, AdUserAndPassword> getAdCredentials)
        {
            if (hostsToAdConfigure.Count == 0)
            {
                return;
            }

            Host        poolMaster = Helpers.GetMaster(pool);
            AsyncAction action;

            bool success = true;

            do
            {
                success = true;
                AdUserAndPassword adUserAndPassword = getAdCredentials(poolMaster);

                try
                {
                    foreach (Host h in hostsToAdConfigure)
                    {
                        action = new EnableAdAction(h.Connection, poolMaster.external_auth_service_name,
                                                    adUserAndPassword.Username, adUserAndPassword.Password)
                        {
                            Host = h
                        };
                        action.RunExternal(null);
                    }
                }
                catch (EnableAdAction.CredentialsFailure)
                {
                    success = false;
                }
            } while (!success);
        }
Ejemplo n.º 2
0
        protected static void FixAd(Pool pool, List<Host> hostsToAdConfigure, Func<Host, AdUserAndPassword> getAdCredentials)
        {
            if (hostsToAdConfigure.Count == 0)
                return;

            Host poolMaster = Helpers.GetMaster(pool);
            AsyncAction action;

            bool success = true;
            do
            {
                success = true;
                AdUserAndPassword adUserAndPassword = getAdCredentials(poolMaster);

                try
                {
                    foreach (Host h in hostsToAdConfigure)
                    {
                        action = new EnableAdAction(Helpers.GetPoolOfOne(h.Connection), poolMaster.external_auth_service_name,adUserAndPassword.Username, adUserAndPassword.Password)
                                     {Host = h};
                        action.RunExternal(null);
                    }
                }
                catch (EnableAdAction.CredentialsFailure)
                {
                    success = false;
                }
            } while (!success);
        }