Skip to content

Commit

Permalink
Swap 'blacklist' for 'denylist' (#81)
Browse files Browse the repository at this point in the history
Summary:
In the spirit of inclusivity and non-discrimination, this PR will swap-out the use of `blacklist` for the more acceptable word `denylist`.

This PR would close-out Issue #80 on this repo (and [an issue with our of our Chef cookbooks](uber/client-platform-engineering#40) which works atop `chefctl`).

Pull Request resolved: #81

Reviewed By: nikitakoshikov

Differential Revision: D22528913

Pulled By: davide125

fbshipit-source-id: 1976b5cb560e0834b359efb0f25344c04d53402b
  • Loading branch information
Austin Culter authored and facebook-github-bot committed Jul 14, 2020
1 parent 214e6a7 commit 8a8f7e6
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions chefctl/src/chefctl.rb
Original file line number Diff line number Diff line change
Expand Up @@ -451,14 +451,14 @@ def shell_output(command)

# Returns a list of processes whos commands match the given command.
# `command` should be a Regexp or String.
# `blacklist` should be an Array of Regexp.
# If blacklist is provided, commands that match any of the entries are
# `exclude` should be an Array of Regexp.
# If exclude is provided, commands that match any of the entries are
# not included in the output.
# Returns an Array of Hashes with keys: `:pid`, `:command`, `:nsid`
def list_processes(command, blacklist = nil, parents = false,
def list_processes(command, exclude = nil, parents = false,
same_nsid = true)
check_nsid = same_nsid
blacklist ||= []
exclude ||= []
procs = []

# `ps` on older platforms (notably centos6 and osx) don't have a pidns
Expand Down Expand Up @@ -496,8 +496,8 @@ def list_processes(command, blacklist = nil, parents = false,
procs.select! { |p| command =~ p[:command] }
end

# don't want stuff in the blacklist
blacklist.each do |b|
# don't want stuff to exclude
exclude.each do |b|
procs.reject! { |p| b =~ p[:command] }
end

Expand Down

0 comments on commit 8a8f7e6

Please sign in to comment.