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); }
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); }