You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Default policy user count is reduced twice for the same set of users.
On line 53 the unsafe users are removed from the users being sprayed. Then on line 59 the the fine grained policy users are subtracted from the user count. This results in the default policy user count being reduced twice for the same users.
var removedUnsafe = Users.RemoveAll(x => x.UserState != UserState.SAFE_TO_SPRAY);
var fineGrainedPoliciesUserCount = Policies
.Where(x => x.IsFineGrained)
.Sum(y => y.AppliesToUsers.Count());
var defaultPolicyUserCount = Users.Count() - fineGrainedPoliciesUserCount;
var removedExcluded = Users.RemoveAll(x => excluded.Contains(x.Username, StringComparer.OrdinalIgnoreCase));
_logger.Log($"Default Policy: {defaultPolicyUserCount} total user(s)");
_logger.Log($"Fine Grained Policies: {fineGrainedPoliciesUserCount} total user(s)");
_logger.Log($"Removed {removedUnsafe} unsafe user(s)");
_logger.Log($"Removed {removedExcluded} excluded user(s)");
_logger.Log($"Preparing to spray {Users.Count} user(s)");
A simple fix is to move the removedUnsafe line below where the defaultPolicyUserCount is being set.
The text was updated successfully, but these errors were encountered:
Default policy user count is reduced twice for the same set of users.
On line 53 the unsafe users are removed from the users being sprayed. Then on line 59 the the fine grained policy users are subtracted from the user count. This results in the default policy user count being reduced twice for the same users.
A simple fix is to move the removedUnsafe line below where the defaultPolicyUserCount is being set.
The text was updated successfully, but these errors were encountered: