summaryrefslogtreecommitdiff
path: root/lib/chef/provider/group
Commit message (Collapse)AuthorAgeFilesLines
* Cookstyle fixes for our resourcesTim Smith2020-02-261-5/+2
| | | | | | | | | | | I ran cookstyle against the resources and fixes a few minor issues: - Remove the now default guard interpreter from a powershell_script - Use our rdoc like header format everywhere - Remove some duplicate copyrights - Simplify a few platform case statements Signed-off-by: Tim Smith <tsmith@chef.io>
* Style/StringLiteralsInInterpolationLamont Granquist2019-07-055-10/+10
| | | | | | since we use double quotes, be consistent everywhere. Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* fix Layout/EmptyLineAfterGuardClauseLamont Granquist2019-07-024-0/+7
| | | | | | | i like this one, gives visual priority to returns or raises that are buried in the middle of things. Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* This hits the ones that are most frequently required.lcg/require-idempotencyLamont Granquist2019-05-201-1/+1
| | | | | | | | | Stops the kernel from scanning through all the activated gems every time in order to resolve names into pathnames. See rubygems/rubygems#2762 Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* Convert require to require_relativeLamont Granquist2019-05-086-7/+7
| | | | | | | This gives a speed boost since rubygems does not have to scan through every gem in the gemset in order to find the file. Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* Update the functional spec and provider behavior to matchJoshua Justice2019-02-071-8/+2
| | | | Signed-off-by: Joshua Justice <jjustice6@bloomberg.net>
* Alter how set_members works in the new solaris group providerJoshua Justice2019-02-061-8/+2
| | | | Signed-off-by: Joshua Justice <jjustice6@bloomberg.net>
* Add comment to provides lineJoshua Justice2019-01-251-0/+2
| | | | Signed-off-by: Joshua Justice <jjustice6@bloomberg.net>
* Update copyright yearTim Smith2019-01-251-1/+1
| | | | | Co-Authored-By: jjustice6 <jjustice6@bloomberg.net> Signed-off-by: Joshua Justice <jjustice6@bloomberg.net>
* Chefstyle nitpicksJoshua Justice2019-01-251-2/+1
| | | | Signed-off-by: Joshua Justice <jjustice6@bloomberg.net>
* Use provider specificity to maintain old behavior and remove reference to ↵Joshua Justice2019-01-251-2/+0
| | | | | | "solaris". Signed-off-by: Joshua Justice <jjustice6@bloomberg.net>
* Fix up headers and remove references to old versions of solarisJoshua Justice2019-01-251-1/+1
| | | | Signed-off-by: Joshua Justice <jjustice6@bloomberg.net>
* Change the provides lines to reflect the new setup.Joshua Justice2019-01-252-2/+2
| | | | Signed-off-by: Joshua Justice <jjustice6@bloomberg.net>
* Start modifying the files.Joshua Justice2019-01-251-32/+15
| | | | Signed-off-by: Joshua Justice <jjustice6@bloomberg.net>
* Starting point: copy usermod and usermod specJoshua Justice2019-01-251-0/+90
| | | | Signed-off-by: Joshua Justice <jjustice6@bloomberg.net>
* Remove support for unsupported opensuse < 42 from group providerTim Smith2019-01-243-6/+4
| | | | | | | | We had a few places where we checked for legacy opensuse platforms. Chef 15 doesn't support this platform and you won't be able to find binaries via omnitruck. We might as well yank out a bit of provider logic. Also for some reason usermod has logic in a method for suse, but the provider didn't support that. Signed-off-by: Tim Smith <tsmith@chef.io>
* Remove hpux support from group's usermod providerTim Smith2019-01-231-1/+1
| | | | | | We removed hpux support from other parts of ohai / chef. This appears to be the last of it. Signed-off-by: Tim Smith <tsmith@chef.io>
* Added support for setting the comment/description on a group in Windows. ↵Kapil Chouhan2018-12-131-0/+1
| | | | | | This is only for the Windows group. Signed-off-by: Kapil Chouhan <kapil.chouhan@msystechnologies.com>
* Unification of shell_out APIsLamont Granquist2018-06-158-27/+27
| | | | | | | converts all usage to just shell_out() from the numerous helper utilities that we've had previously. Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* mechanical conversion of most debug log statements to traceThom May2018-03-266-18/+18
| | | | Signed-off-by: Thom May <thom@chef.io>
* Fix dscl group provider gid_used? (#6703)Sean Karlage2018-01-081-2/+6
| | | | | | | | | | Use dscl search verb in gid_used? `dscl` has a search verb which makes checking whether a gid is currently used much easier than parsing string output of listing all gids. Signed-off-by: Sean Karlage <skarlage@fb.com>
* fixes for rubocop 0.49.1 engineLamont Granquist2017-06-202-2/+2
| | | | Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* Merge pull request #5679 from chef/lcg/fix-group-dsclLamont Granquist2016-12-221-11/+11
|\ | | | | fix dscl group provider func breakage from #5673
| * fix dscl group provider func breakageLamont Granquist2016-12-221-11/+11
| | | | | | | | | | | | | | | | | | | | i didn't fully grok the way the dscl providers were written and only half fixed the group dscl provider, but later did a better job fixing the user one. fixes the breakage caught in the dscl group func tests. Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* | properly only call set_options onceLamont Granquist2016-12-221-1/+1
| | | | | | | | Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* | fix aix breakage from d5517ce1e766c096dde16e5c8a10732ee346c5dcLamont Granquist2016-12-221-1/+4
|/ | | | Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* cleanup of group providerlcg/group-provider-cleanupLamont Granquist2016-12-219-182/+162
| | | | | | | | - consistent use of shell_out_compact! - remove more uses of run_command - some other code cleanup Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* fix unnecessary quoting of argslcg/deprecate-run-commandLamont Granquist2016-12-201-1/+1
| | | | Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* fix groupadd specs and modernizeLamont Granquist2016-12-201-28/+25
| | | | Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* remove run_command from groupaddLamont Granquist2016-12-201-3/+3
| | | | Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* Use `all?` instead of `any?` to check for SUSE usersTom Duffield2016-10-211-1/+1
| | | | | | Using `all?` will return `false` when the array is empty. Signed-off-by: Tom Duffield <tom@chef.io>
* Raise error if suse group manager adds non-existent userCOOL-597/address-suse-test-failuresTom Duffield2016-10-201-4/+23
| | | | | | | | | | The expected behavior of chef, as defined by our tests, is that if a user specified in a group resource does not exist than chef should raise an error. On suse, we use groupmod which will not raise an error if you attempt to add a non-existent user to a group. This change adds in a simple check that will raise an error if the specified does not exist. Signed-off-by: Tom Duffield <tom@chef.io>
* Solaris doesn't support -r for users or group.Noah Kantrowitz2016-09-191-1/+2
| | | | Signed-off-by: Noah Kantrowitz <noah@coderanger.net>
* Fix specify members of group on suse/openbsd/solaris2/hpuxTim Smith2016-07-301-1/+1
| | | | | | | | Action is an array. We need to check to see if create is in the action array instead of checking to see if it's ";create" which it never will be. Signed-off-by: Tim Smith <tsmith@chef.io>
* Update specssalam/group-fixSalim Alam2016-04-071-1/+1
|
* Don't fail when removing non-existing group memberSalim Alam2016-04-071-6/+19
|
* remove unnecessary whitespaceMarkus Winter2016-03-151-2/+2
|
* fix for https://github.com/chef/chef/issues/4689Markus Winter2016-03-121-4/+6
| | | | rework the set_members method so duplicates are avoided
* deal with 0.37.2 renamed copsLamont Granquist2016-02-181-1/+1
| | | | | | | | | | | | | | | 252 Style/TrailingCommaInLiteral 84 Style/TrailingCommaInArguments 15 Style/SpaceAroundKeyword -- 351 Total We already dealt with SpaceAroundKeyword under its old name SpaceBeforeModifierKeyword, it looks like it got stricter about spaces after keywords. TrailingComma also got split, and it looks like the TrailingCommaInArguments behavior is new?
* autofixing auto-inserted delimiterslcg/chefstyle-batchLamont Granquist2016-02-091-1/+1
|
* auto fixing some rubocopsLamont Granquist2016-02-091-1/+1
| | | | | | | | | Style/NegatedWhile Style/ParenthesesAroundCondition Style/WhileUntilDo Style/WordArray Performance/ReverseEach Style/ColonMethodCall
* autofixing whitespace copsLamont Granquist2016-02-055-9/+9
| | | | | | | | | | | | | | | | | | | | | | 4174 Style/SpaceInsideHashLiteralBraces 1860 Style/SpaceAroundOperators 1336 Style/SpaceInsideBlockBraces 1292 Style/AlignHash 997 Style/SpaceAfterComma 860 Style/SpaceAroundEqualsInParameterDefault 310 Style/EmptyLines 294 Style/IndentationConsistency 267 Style/TrailingWhitespace 238 Style/ExtraSpacing 212 Style/SpaceBeforeBlockBraces 166 Style/MultilineOperationIndentation 144 Style/TrailingBlankLines 120 Style/EmptyLineBetweenDefs 101 Style/IndentationWidth 82 Style/SpaceAroundBlockParameters 40 Style/EmptyLinesAroundMethodBody 29 Style/EmptyLinesAroundAccessModifier 1 Style/RescueEnsureAlignment
* Update all auth email address from opscode.com and getchef.com to chef.io.Noah Kantrowitz2016-02-024-4/+4
| | | Generated via git ls-files | xargs perl -pi -e "s/(Author.*?<[^@]+@)(?:opscode\\.com|getchef\\.com)(>)/\\1chef.io\\2/gi"
* Replace all Opscode copyrights with Chef Software.Noah Kantrowitz2016-02-027-7/+7
| | | Created via git ls-files | xargs perl -pi -e "s/(Copyright.*?), Opscode(,)? Inc(\.)?/\\1, Chef Software Inc./gi"
* Copyright year update for 2016 and massive cleanup.Noah Kantrowitz2016-02-029-9/+9
| | | Generated via git ls-files | xargs perl -pi -e "s/[Cc]opyright (?:\([Cc]\) )?((?\!$(date +%Y))\\d{4})(-\\d{4})?([, ][ \d]+)*(,|(?= ))/Copyright \\1-$(date +%Y),/g"
* Autofixing Style/PercentLiteralDelimeterslcg/percentliteraldelimetersLamont Granquist2016-01-181-1/+1
| | | | | | See chef/chefstyle#11 for analysis and discussion. We select '{}' since audit of our source code shows that is the most common, and that used to be the dominant learning paradigm (e.g. in ruby 1.9 pickaxe book.
* Use double quotes by defaultThom May2016-01-149-19/+19
| | | | | | | This is an entirely mechanically generated (chefstyle -a) change, to go along with chef/chefstyle#5 . We should pick something and use it consistently, and my opinion is that double quotes are the appropriate thing.
* chefstyle: fix Lint/StringConversionInInterpolationLamont Granquist2016-01-123-9/+9
| | | | useless use of `"#{foo.to_s}"`
* Don't modify members of new_resource in pw group implmentationjdm/freebsd-pw-fixJay Mundrawala2015-08-171-1/+1
| | | | | | | | | | | | | | | | This was causing the ``` Chef::Resource::Group group modify action when there is a group behaves like correct group management when the users exist when append is not set when group already contains some users should remove all existing users and only add the new users to the group ``` spec to fail. The test passes an array which gets modified which breaks the test.
* Create tests for all previous provider_mappingsjk/one_map_to_rule_them_allJohn Keiser2015-06-022-1/+2
|