Age | Commit message (Collapse) | Author | Files | Lines |
|
expiry fix
This commit change the Puppet::Util::Libuser module to look for libuser.conf in its new /etc/puppet/provider/libuser.conf location. It also updates Puppet::Features::Libuser to only return true if the config file as well as the binaries are found.
Updated the useradd and groupadd specs to expect :execute when called from create to now have 2 parametes. A command and an options hash.
During my work on this feature I added an exipry getter since the builtin getter didn't retrieve the correct values. Before this patch was merged another commit came along that also set the proper getter. So I removed mine as it caused a conflict.
|
|
Puppet::Error now
|
|
identical to the existing providers
Performed exhaustive analysis of the differences between useradd/groupadd and luseradd/lgroupadd and coded around these differences to ensure that the useradd/groupadd providers behave identically with and without the forcelocal parameter being set. The only difference being a local account is always created and managed when forcelocal is set to true. The commands are very similar for the most part so there was not a huge need to diverge from the original code. In all but one of the cases that did arise the solution was to make a subsequent usermod or groupmod call after the luseradd/lgroupadd command. Since the usermod/groupmod commands will always act on local accounts first, this achieves the desired effect. The one case where a subsequent call would not suffice was the use of the allowdupe parameter. By default libuser will allow duplicate uid/gid where useradd/groupadd require an explicit -o. The work around was to manually do a local check for a duplicate if using the libuser library and not intending to allow duplicates. If a duplicate is found Puppet raises a DuplicateUID or DuplicateGID exception.
|
|
Puppet::Util::Libuser for better reuse of common code.
|
|
NSS database e.g. LDAP.
Some applications require local accounts and the useradd/groupadd commands currently used by the provider will not create a local account if they already exist remotely. The libuser commands luseradd/lgroupadd will allow a local name to duplicate a remote name. So these commands are used to force the local account creation. The libuser commands parse /etc/libuser.conf to determine which modules to use for creating users. Files must be the module used to get the desired local account managment. Because of this, it is necessary for Puppet to ship a libuser.conf file, which will only be used during a Puppet run, to ensure local account managment. The libuser.conf file used by the luseradd/lgroupadd commands can be overrideen by setting the environment variable LIBUSER_CONF. Which is what Puppet does to make sure its version of the configuration file is used
|
|
Without this patch Ruby 1.9 is still complaining loudly about trying to
parse the spec files. The previous attempt to clean up this problem in
edc3ddf works for Ruby 1.8 but not 1.9.
I'd prefer to remove the shebang lines entirely, but doing so will cause
encoding errors in Ruby 1.9. This patch strives for a happy middle
ground of convincing Ruby it is actually working with Ruby while not
confusing it to think it should exec() to rspec.
This patch is the result of the following command run against the source
tree:
find spec -type f -print0 | \
xargs -0 perl -pl -i -e 's,^\#\!\s?/(.*)rspec,\#! /usr/bin/env ruby,'
|
|
|
|
The groupadd and useradd spec will only work if groupadd / useradd are
the default provider for the group / user type.
Explicitly set the provider in the spec tests so they can e.g. also run
on MacOSX.
|
|
According to
http://nixdoc.net/man-pages/hp-ux/man1/groupadd.1m.html
http://docs.oracle.com/cd/E19963-01/html/821-1462/groupadd-1m.html
neither Solaris nor HP-UX support the -r switch to create system groups
so the groupadd provider should not claim to support system_groups on
these platforms.
|
|
It seams to be more reliable to work with real objects instead
|
|
Tests are now ordered by method, so if modifications have to be done
done in the provider code, it will be easier to track the according spec
tests that have to be changed.
|
|
Without this patch some spec files are using `ruby -S rspec` and others
are using `rspec`.
We should standardize on a single form of the interpreter used for spec
files.
`ruby -S rspec` is the best choice because it correctly informs editors
such as Vim with Syntastic that the file is a Ruby file rather than an
Rspec file.
|
|
* 2.6.x:
Updated CHANGELOG for 2.6.8rc1
(#2331) Remove darwinports pkg provider, replace with rewritten macports provider
Fixed #7082 - Added system support for groups
(#7018) Give more context on the service type's assumptions. Wording tweaks.
(#7018) explain internals better in service provider documentation
maint: Fix sqlite3 require to really be optional
maint: Fix sporadic sqlite error
(#6818) Stop from getting Rails 3 named_scope deprecation warning
(#6856) Copy dangling symlinks with 'links => manage' File resource.
Conflicts (Resolved manually):
lib/puppet/type/group.rb
spec/unit/indirector/facts/inventory_active_record_spec.rb
|
|
|
|
We now use a shebang of: #!/usr/bin/env rspec
This enables the direct execution of spec tests again, which was lost earlier
during the transition to more directly using the rspec2 runtime environment.
|
|
rspec2 automatically sets a bunch of load-path stuff we were by hand, so we
can just stop. As a side-effect we can now avoid a whole pile of stupid things
to try and include the spec_helper.rb file...
...and then we can stop protecting spec_helper from evaluating twice, since we
now require it with a consistent name. Yay.
Reviewed-By: Pieter van de Bruggen <pieter@puppetlabs.com>
|
|
Doing a require to a relative path can cause files to be required more
than once when they're required from different relative paths. If you
expand the path fully, this won't happen. Ruby 1.9 also requires that
you use expand_path when doing these requires.
Paired-with: Jesse Wolfe
|
|
Replaced 106806 occurances of ^( +)(.*$) with
The ruby community almost universally (i.e. everyone but Luke, Markus, and the other eleven people
who learned ruby in the 1900s) uses two-space indentation.
3 Examples:
The code:
end
# Tell getopt which arguments are valid
def test_get_getopt_args
element = Setting.new :name => "foo", :desc => "anything", :settings => Puppet::Util::Settings.new
assert_equal([["--foo", GetoptLong::REQUIRED_ARGUMENT]], element.getopt_args, "Did not produce appropriate getopt args")
becomes:
end
# Tell getopt which arguments are valid
def test_get_getopt_args
element = Setting.new :name => "foo", :desc => "anything", :settings => Puppet::Util::Settings.new
assert_equal([["--foo", GetoptLong::REQUIRED_ARGUMENT]], element.getopt_args, "Did not produce appropriate getopt args")
The code:
assert_equal(str, val)
assert_instance_of(Float, result)
end
# Now test it with a passed object
becomes:
assert_equal(str, val)
assert_instance_of(Float, result)
end
# Now test it with a passed object
The code:
end
assert_nothing_raised do
klass[:Yay] = "boo"
klass["Cool"] = :yayness
end
becomes:
end
assert_nothing_raised do
klass[:Yay] = "boo"
klass["Cool"] = :yayness
end
|
|
Part 2 re-did the change on the spec files, which it shouldn't have.
|
|
Some spec files like active_record.rb had names that would confuse the
load path and get loaded instead of the intended implentation when the
spec was run from the same directory as the file.
Author: Matt Robinson <matt@puppetlabs.com>
Date: Fri Jun 11 15:29:33 2010 -0700
|
|
Some spec files like active_record.rb had names that would confuse the
load path and get loaded instead of the intended implentation when the
spec was run from the same directory as the file.
Author: Matt Robinson <matt@puppetlabs.com>
Date: Fri Jun 11 15:29:33 2010 -0700
|