Fixed unhandled --ignoreschedules in puppet kick
Use method execute instead of transport.command
Fix spaces
Explicit use of the device given the block
Extract connection and disconnection behaviours
Remove unused verbose parameter, add debug in the transport
Disable debug log in the transport
Cast fqdn as string for gsub
(#18440) Don't make class methods private

Previously, the launchd service provider `enabled?` instance method was
calling the `launchd_overrides` private class method, which is not
allowed. This issue wasn't noticed, because the spec test was overly
stubbing the provider.

This commit makes the class methods public to avoid these sorts of
problems in the future.
Merge pull request #1383 from Aethylred/fix/master/string_miscast_settings.rb

Cast fqdn as string for gsub
(#11675) Remove duplicate flag on useradd

The check in the useradd provider caused puppet to add the expiry flag
twice when adding a user.

The addproperties method does already add the expiry flag to the
argument list. The default flag (dash and first letter of the property)
does also match what useradd expects, so everything just works "out of
the box".

The old method does also caused puppet to pass "-e EXPIRY" as ONE
argument instead of two. Kind of surprising that useradd actually does
not complain about that.
maint: Add specs for password min age/max age
maint: Improve test coverage for nameservice provider

The nameservice provider lacks a spec file so I tried to cover the most
important methods.

The changes to the nameservice provider itself do not imply any functional
changes or changes in behaviour and are just there to make writing specs
easier.
(#11675) Add value munging for nameservice provider

The nameservice provider defines a helper method `options` to specify
the flag for a property that will be used when creating the appropiate
useradd/usermod commandline. This commit now adds the options `munge` and
`umunge` to define methods that will automtically transformed the
property value when building the useradd/usermod command or when
retrieving the current value.

This munging is realized at a provider level so a unified value can be
used at a resource type level to represent different values at a
provider level.

One future use case could be the expiry property. We can define a value
of :absent at a resource type level to represent "account should not
expire" and represent it as '00-00-0000' in the pw provider and as ' '
in the useradd provider.
(#11675) Implement expiry in user provider

The useradd and pw provider claim to support expiry of user accounts.
And while they seem to be able to *set* the expiry, they don't seem to
implement any way to *get* the current value.

While this is still true for the pw provider (I am not familiar with
AIX) it should now work correctly with the useradd provider.

The expiry property uses munging at a provider level to convert
correctly to and from :absent (useraccount should not expire).
(#11675) Refactor useradd provider

The useradd provider is a subclass of the nameservice provider and all
the property retrieval and property installation is handled in the
nameservice class.

This works for most properties but does not work for properties that can
be installed with usermod but cannot be retrieved with Etc.getpwnam. The
useradd provider defines special getter methods for these properties
(password_max_age, password_min_age, password, expiry). Because all of
these more or less look exactly the same we can remove duplicate code.
Merge branch 'stschulte-ticket/master/11675_implement_expiry_retrieve'

* stschulte-ticket/master/11675_implement_expiry_retrieve:
  (#11675) Refactor useradd provider
  (#11675) Implement expiry in user provider
  (#11675) Add value munging for nameservice provider
  maint: Improve test coverage for nameservice provider
  maint: Add specs for password min age/max age
  (#11675) Remove duplicate flag on useradd
Revert "Merge branch 'stschulte-ticket/master/11675_implement_expiry_retrieve'"

This reverts commit ef7e01a0ae238969b29c97c263a1d37be3f05d5d, reversing
changes made to fe573ff61ffd0f04150a8aff20b126285d26b18e.

I'm reverting this commit because the spec tests are not passing on Ruby
1.8.7.  The following error is being raised in CI http://goo.gl/ruC4e

Failures:

  1) Puppet::Type::User::ProviderUseradd#addcmd should return an array with full command
     Failure/Error: provider.addcmd.must == ['/usr/sbin/useradd', '-G', 'somegroup', '-e', '2012-08-18', '-o', '-m', '-r', 'myuser']
       expected: ["/usr/sbin/useradd", "-G", "somegroup", "-e", "2012-08-18", "-o", "-m", "-r", "myuser"]
            got: ["/usr/sbin/useradd", "-e", "2012-08-18", "-G", "somegroup", "-o", "-m", "-r", "myuser"] (using ==)
     # /home/jenkins/.rvm/gems/ruby-1.8.7-p358@noFeatures/gems/rspec-expectations-2.9.1/lib/rspec/expectations/fail_with.rb:33:in `fail_with'
     # /home/jenkins/.rvm/gems/ruby-1.8.7-p358@noFeatures/gems/rspec-expectations-2.9.1/lib/rspec/matchers/operator_matcher.rb:47:in `fail_with_message'
     # /home/jenkins/.rvm/gems/ruby-1.8.7-p358@noFeatures/gems/rspec-expectations-2.9.1/lib/rspec/matchers/operator_matcher.rb:69:in `__delegate_operator'
     # /home/jenkins/.rvm/gems/ruby-1.8.7-p358@noFeatures/gems/rspec-expectations-2.9.1/lib/rspec/matchers/operator_matcher.rb:59:in `eval_match'
     # /home/jenkins/.rvm/gems/ruby-1.8.7-p358@noFeatures/gems/rspec-expectations-2.9.1/lib/rspec/matchers/operator_matcher.rb:28:in `=='
     # /mnt/workspace/Puppet Specs (master)/gemset/@noFeatures/ruby/ruby-1.8.7/rvm/#rvm/spec/unit/provider/user/useradd_spec.rb:234
     # /home/jenkins/.rvm/gems/ruby-1.8.7-p358@noFeatures/gems/rspec-core-2.9.0/lib/rspec/core/example.rb:80:in `instance_eval'
     # /home/jenkins/.rvm/gems/ruby-1.8.7-p358@noFeatures/gems/rspec-core-2.9.0/lib/rspec/core/example.rb:80:in `run'
     # /home/jenkins/.rvm/gems/ruby-1.8.7-p358@noFeatures/gems/rspec-core-2.9.0/lib/rspec/core/example.rb:173:in `with_around_hooks'
     # /home/jenkins/.rvm/gems/ruby-1.8.7-p358@noFeatures/gems/rspec-core-2.9.0/lib/rspec/core/example.rb:77:in `run'
     # /home/jenkins/.rvm/gems/ruby-1.8.7-p358@noFeatures/gems/rspec-core-2.9.0/lib/rspec/core/example_group.rb:355:in `run_examples'
     # /home/jenkins/.rvm/gems/ruby-1.8.7-p358@noFeatures/gems/rspec-core-2.9.0/lib/rspec/core/example_group.rb:351:in `map'
     # /home/jenkins/.rvm/gems/ruby-1.8.7-p358@noFeatures/gems/rspec-core-2.9.0/lib/rspec/core/example_group.rb:351:in `run_examples'
     # /home/jenkins/.rvm/gems/ruby-1.8.7-p358@noFeatures/gems/rspec-core-2.9.0/lib/rspec/core/example_group.rb:337:in `run'
     # /home/jenkins/.rvm/gems/ruby-1.8.7-p358@noFeatures/gems/rspec-core-2.9.0/lib/rspec/core/example_group.rb:338:in `run'
     # /home/jenkins/.rvm/gems/ruby-1.8.7-p358@noFeatures/gems/rspec-core-2.9.0/lib/rspec/core/example_group.rb:338:in `map'
     # /home/jenkins/.rvm/gems/ruby-1.8.7-p358@noFeatures/gems/rspec-core-2.9.0/lib/rspec/core/example_group.rb:338:in `run'
     # /home/jenkins/.rvm/gems/ruby-1.8.7-p358@noFeatures/gems/rspec-core-2.9.0/lib/rspec/core/command_line.rb:28:in `run'
     # /home/jenkins/.rvm/gems/ruby-1.8.7-p358@noFeatures/gems/rspec-core-2.9.0/lib/rspec/core/command_line.rb:28:in `map'
     # /home/jenkins/.rvm/gems/ruby-1.8.7-p358@noFeatures/gems/rspec-core-2.9.0/lib/rspec/core/command_line.rb:28:in `run'
     # /home/jenkins/.rvm/gems/ruby-1.8.7-p358@noFeatures/gems/rspec-core-2.9.0/lib/rspec/core/reporter.rb:34:in `report'
     # /home/jenkins/.rvm/gems/ruby-1.8.7-p358@noFeatures/gems/rspec-core-2.9.0/lib/rspec/core/command_line.rb:25:in `run'
     # /home/jenkins/.rvm/gems/ruby-1.8.7-p358@noFeatures/gems/rspec-core-2.9.0/lib/rspec/core/runner.rb:69:in `run'
     # /home/jenkins/.rvm/gems/ruby-1.8.7-p358@noFeatures/gems/rspec-core-2.9.0/lib/rspec/core/runner.rb:10:in `autorun'
     # /home/jenkins/.rvm/gems/ruby-1.8.7-p358@noFeatures/bin/rspec:19

  2) Puppet::Type::User::ProviderUseradd#addcmd should pass -e " " on solaris if the expiry has to be removed
     Failure/Error: provider.addcmd.must == ['/usr/sbin/useradd', '-G', 'somegroup', '-e', ' ', '-o', '-m', '-r', 'myuser']
       expected: ["/usr/sbin/useradd", "-G", "somegroup", "-e", " ", "-o", "-m", "-r", "myuser"]
            got: ["/usr/sbin/useradd", "-e", " ", "-G", "somegroup", "-o", "-m", "-r", "myuser"] (using ==)
     # /home/jenkins/.rvm/gems/ruby-1.8.7-p358@noFeatures/gems/rspec-expectations-2.9.1/lib/rspec/expectations/fail_with.rb:33:in `fail_with'
     # /home/jenkins/.rvm/gems/ruby-1.8.7-p358@noFeatures/gems/rspec-expectations-2.9.1/lib/rspec/matchers/operator_matcher.rb:47:in `fail_with_message'
     # /home/jenkins/.rvm/gems/ruby-1.8.7-p358@noFeatures/gems/rspec-expectations-2.9.1/lib/rspec/matchers/operator_matcher.rb:69:in `__delegate_operator'
     # /home/jenkins/.rvm/gems/ruby-1.8.7-p358@noFeatures/gems/rspec-expectations-2.9.1/lib/rspec/matchers/operator_matcher.rb:59:in `eval_match'
     # /home/jenkins/.rvm/gems/ruby-1.8.7-p358@noFeatures/gems/rspec-expectations-2.9.1/lib/rspec/matchers/operator_matcher.rb:28:in `=='
     # /mnt/workspace/Puppet Specs (master)/gemset/@noFeatures/ruby/ruby-1.8.7/rvm/#rvm/spec/unit/provider/user/useradd_spec.rb:247
     # /home/jenkins/.rvm/gems/ruby-1.8.7-p358@noFeatures/gems/rspec-core-2.9.0/lib/rspec/core/example.rb:80:in `instance_eval'
     # /home/jenkins/.rvm/gems/ruby-1.8.7-p358@noFeatures/gems/rspec-core-2.9.0/lib/rspec/core/example.rb:80:in `run'
     # /home/jenkins/.rvm/gems/ruby-1.8.7-p358@noFeatures/gems/rspec-core-2.9.0/lib/rspec/core/example.rb:173:in `with_around_hooks'
     # /home/jenkins/.rvm/gems/ruby-1.8.7-p358@noFeatures/gems/rspec-core-2.9.0/lib/rspec/core/example.rb:77:in `run'
     # /home/jenkins/.rvm/gems/ruby-1.8.7-p358@noFeatures/gems/rspec-core-2.9.0/lib/rspec/core/example_group.rb:355:in `run_examples'
     # /home/jenkins/.rvm/gems/ruby-1.8.7-p358@noFeatures/gems/rspec-core-2.9.0/lib/rspec/core/example_group.rb:351:in `map'
     # /home/jenkins/.rvm/gems/ruby-1.8.7-p358@noFeatures/gems/rspec-core-2.9.0/lib/rspec/core/example_group.rb:351:in `run_examples'
     # /home/jenkins/.rvm/gems/ruby-1.8.7-p358@noFeatures/gems/rspec-core-2.9.0/lib/rspec/core/example_group.rb:337:in `run'
     # /home/jenkins/.rvm/gems/ruby-1.8.7-p358@noFeatures/gems/rspec-core-2.9.0/lib/rspec/core/example_group.rb:338:in `run'
     # /home/jenkins/.rvm/gems/ruby-1.8.7-p358@noFeatures/gems/rspec-core-2.9.0/lib/rspec/core/example_group.rb:338:in `map'
     # /home/jenkins/.rvm/gems/ruby-1.8.7-p358@noFeatures/gems/rspec-core-2.9.0/lib/rspec/core/example_group.rb:338:in `run'
     # /home/jenkins/.rvm/gems/ruby-1.8.7-p358@noFeatures/gems/rspec-core-2.9.0/lib/rspec/core/command_line.rb:28:in `run'
     # /home/jenkins/.rvm/gems/ruby-1.8.7-p358@noFeatures/gems/rspec-core-2.9.0/lib/rspec/core/command_line.rb:28:in `map'
     # /home/jenkins/.rvm/gems/ruby-1.8.7-p358@noFeatures/gems/rspec-core-2.9.0/lib/rspec/core/command_line.rb:28:in `run'
     # /home/jenkins/.rvm/gems/ruby-1.8.7-p358@noFeatures/gems/rspec-core-2.9.0/lib/rspec/core/reporter.rb:34:in `report'
     # /home/jenkins/.rvm/gems/ruby-1.8.7-p358@noFeatures/gems/rspec-core-2.9.0/lib/rspec/core/command_line.rb:25:in `run'
     # /home/jenkins/.rvm/gems/ruby-1.8.7-p358@noFeatures/gems/rspec-core-2.9.0/lib/rspec/core/runner.rb:69:in `run'
     # /home/jenkins/.rvm/gems/ruby-1.8.7-p358@noFeatures/gems/rspec-core-2.9.0/lib/rspec/core/runner.rb:10:in `autorun'
     # /home/jenkins/.rvm/gems/ruby-1.8.7-p358@noFeatures/bin/rspec:19

  3) Puppet::Type::User::ProviderUseradd#addcmd should pass -e "" on other systems if the expiry has to be removed
     Failure/Error: provider.addcmd.must == ['/usr/sbin/useradd', '-G', 'somegroup', '-e', '', '-o', '-m', '-r', 'myuser']
       expected: ["/usr/sbin/useradd", "-G", "somegroup", "-e", "", "-o", "-m", "-r", "myuser"]
            got: ["/usr/sbin/useradd", "-e", "", "-G", "somegroup", "-o", "-m", "-r", "myuser"] (using ==)
     # /home/jenkins/.rvm/gems/ruby-1.8.7-p358@noFeatures/gems/rspec-expectations-2.9.1/lib/rspec/expectations/fail_with.rb:33:in `fail_with'
     # /home/jenkins/.rvm/gems/ruby-1.8.7-p358@noFeatures/gems/rspec-expectations-2.9.1/lib/rspec/matchers/operator_matcher.rb:47:in `fail_with_message'
     # /home/jenkins/.rvm/gems/ruby-1.8.7-p358@noFeatures/gems/rspec-expectations-2.9.1/lib/rspec/matchers/operator_matcher.rb:69:in `__delegate_operator'
     # /home/jenkins/.rvm/gems/ruby-1.8.7-p358@noFeatures/gems/rspec-expectations-2.9.1/lib/rspec/matchers/operator_matcher.rb:59:in `eval_match'
     # /home/jenkins/.rvm/gems/ruby-1.8.7-p358@noFeatures/gems/rspec-expectations-2.9.1/lib/rspec/matchers/operator_matcher.rb:28:in `=='
     # /mnt/workspace/Puppet Specs (master)/gemset/@noFeatures/ruby/ruby-1.8.7/rvm/#rvm/spec/unit/provider/user/useradd_spec.rb:255
     # /home/jenkins/.rvm/gems/ruby-1.8.7-p358@noFeatures/gems/rspec-core-2.9.0/lib/rspec/core/example.rb:80:in `instance_eval'
     # /home/jenkins/.rvm/gems/ruby-1.8.7-p358@noFeatures/gems/rspec-core-2.9.0/lib/rspec/core/example.rb:80:in `run'
     # /home/jenkins/.rvm/gems/ruby-1.8.7-p358@noFeatures/gems/rspec-core-2.9.0/lib/rspec/core/example.rb:173:in `with_around_hooks'
     # /home/jenkins/.rvm/gems/ruby-1.8.7-p358@noFeatures/gems/rspec-core-2.9.0/lib/rspec/core/example.rb:77:in `run'
     # /home/jenkins/.rvm/gems/ruby-1.8.7-p358@noFeatures/gems/rspec-core-2.9.0/lib/rspec/core/example_group.rb:355:in `run_examples'
     # /home/jenkins/.rvm/gems/ruby-1.8.7-p358@noFeatures/gems/rspec-core-2.9.0/lib/rspec/core/example_group.rb:351:in `map'
     # /home/jenkins/.rvm/gems/ruby-1.8.7-p358@noFeatures/gems/rspec-core-2.9.0/lib/rspec/core/example_group.rb:351:in `run_examples'
     # /home/jenkins/.rvm/gems/ruby-1.8.7-p358@noFeatures/gems/rspec-core-2.9.0/lib/rspec/core/example_group.rb:337:in `run'
     # /home/jenkins/.rvm/gems/ruby-1.8.7-p358@noFeatures/gems/rspec-core-2.9.0/lib/rspec/core/example_group.rb:338:in `run'
     # /home/jenkins/.rvm/gems/ruby-1.8.7-p358@noFeatures/gems/rspec-core-2.9.0/lib/rspec/core/example_group.rb:338:in `map'
     # /home/jenkins/.rvm/gems/ruby-1.8.7-p358@noFeatures/gems/rspec-core-2.9.0/lib/rspec/core/example_group.rb:338:in `run'
     # /home/jenkins/.rvm/gems/ruby-1.8.7-p358@noFeatures/gems/rspec-core-2.9.0/lib/rspec/core/command_line.rb:28:in `run'
     # /home/jenkins/.rvm/gems/ruby-1.8.7-p358@noFeatures/gems/rspec-core-2.9.0/lib/rspec/core/command_line.rb:28:in `map'
     # /home/jenkins/.rvm/gems/ruby-1.8.7-p358@noFeatures/gems/rspec-core-2.9.0/lib/rspec/core/command_line.rb:28:in `run'
     # /home/jenkins/.rvm/gems/ruby-1.8.7-p358@noFeatures/gems/rspec-core-2.9.0/lib/rspec/core/reporter.rb:34:in `report'
     # /home/jenkins/.rvm/gems/ruby-1.8.7-p358@noFeatures/gems/rspec-core-2.9.0/lib/rspec/core/command_line.rb:25:in `run'
     # /home/jenkins/.rvm/gems/ruby-1.8.7-p358@noFeatures/gems/rspec-core-2.9.0/lib/rspec/core/runner.rb:69:in `run'
     # /home/jenkins/.rvm/gems/ruby-1.8.7-p358@noFeatures/gems/rspec-core-2.9.0/lib/rspec/core/runner.rb:10:in `autorun'
     # /home/jenkins/.rvm/gems/ruby-1.8.7-p358@noFeatures/bin/rspec:19
Revert "Revert "Merge branch 'stschulte-ticket/master/11675_implement_expiry_retrieve'""

This reverts commit 3f96ecdc6dec2bb724cb60a36970f6199757e42a.

The original commit series around issue 11675 have been reverted because
they caused test failures and the policy is to revert such commits.

Restore the commit series to be able to fix the failing tests.
(#11675) Fix test failures in ruby 1.8.7

The spec tests for the Puppet::Type.addcmd method failed on ruby 1.8.7.

The addcmd method builds a commandline to execute `useradd` with
appropiate command line arguments. To build the commandline
`add_properties` gets called which in turn calls
`Puppet::Type.validproperties`. The order in which properties are returned
can be considered undefinied so the whole `useradd` commandline can include
arguments in random order. While the randomness does not make a difference for
the useradd executable it causes spec failures on some systems.

Sort the properties when building the useradd commandline. This way the
result is consistent across all ruby versions and easier to test.