Age | Commit message (Collapse) | Author | Files | Lines |
|
ffrank/ticket/3.7.x/PUP-3357-purge-unnamed-ssh-keys
(PUP-3357) purge unnamed ssh keys
|
|
Just makes sure that the user type and ssh_authorized_keys provider
generate pseudo-names for keys following the same pattern.
|
|
When a pkg certificate is in it's last 30 days before expiration, the
pkg tools emit a warning message so you can get a new certificate for
some operations. The 'latest' method issues a 'pkg -Hn <package>' which
trips this warning message, but the message was unexpected and 'latest'
would raise, failing the catalog application.
This commit simply ignores such certificate expiration warnings.
While I was in there, I split a very compact line of code across a couple
lines and added some spaces, in the name of readability.
|
|
Previously, when checking if the `current` and `desired` triggers were
equivalent, we were silently deleting the `index` and `enabled` values from
the `current` trigger. If we later needed to delete the `current`
trigger, we would have lost its `index`, resulting in a call to
`Win32::TaskScheduler.delete_trigger(nil)` causing the error:
no implicit conversion from nil to integer
This commit ensure that we don't mutate the `current` or `desired` trigger.
|
|
Previously, the `#triggers` method on the scheduled task provider would
magically return single element or an array of multiple elements.
This commit changes the provider to always return an array, of possibly a
single element.
|
|
Previously, if a scheduled_task resource was created in the past, and
the desired value of the resource's trigger did not specify a
`start_date`, then puppet would think the resource was out of sync,
and attempt to delete the old trigger, and add the new one. This
process would repeat once per day, leading to spurious 'triggered
changed' messages, and reports.
This commit modifies the scheduled_task provider so that if the
desired value does not specify a `start_date`, then it will
effectively be ignored when comparing the current and desired
triggers.
|
|
The `enabled` and `index` trigger parameters are read-only, so they will be set
in the `current` trigger, but are not allowed in the `desired` trigger.
Previously, the `translate_hash_to_trigger` method performed validation based
on whether it was passed a `current` or `desired` trigger.
This commit moves the validation logic to the `validate_trigger` method, which
is only ever called with `desired` trigger values. It also allows the `index`
and `enabled` keys to be present in a trigger. This isn't an issue because they
are ignored for the purposes of determining if two triggers are the same.
The reason for this change, is because ultimately we don't want the
`translate_hash_to_trigger` method to mutate the `current` trigger, and this
commit makes it so that the `index` and `enabled` keys can be in the
`puppet_trigger` but will be ignored.
|
|
Previously, the windows service provider rescued exceptions of type
Win32::Service::Error. However, FFI-based versions of win32-service (v0.8.x)
no longer raise that type of error. Instead they raise SystemCallError.
So previously, if puppet failed to manage a service, e.g. service didn't
exist, puppet would try to rescue the exception specifying a class that
was not defined:
puppet resource service foo ensure=stopped
Error: /Service[foo]: Could not evaluate: uninitialized constant Win32::Service::Error
This regression was introduced as part of PUP-1283 when we migrated from
win32-service version 0.7.x to 0.8.x.
This commit modifies the various provider methods to more broadly rescue
StandardErrors and updates the spec tests to handle the negative cases.
Paired-with: Ethan J Brown <ethan@puppetlabs.com>
|
|
Before this patch, parsing /etc/shadow, when empty trailing fields were
present, they were discarded, and inturn a nil check was used to ensure that
the fields did not exist. However, this ran into trouble when a value was
appended to the end, causing all the empty fields to be returned as empty
strings instead, failing the nil checks.
This patch ensures that all empty fields are returned as empty strings, and
a check for empty string is used to check whether the field exists or not.
|
|
|
|
Also this patch splits out the long line in upstart_spec.rb to be
one line per service, so more diff-friendly.
|
|
When executing the list command to filter virtual packages (when
allow_virtual is false or nil), the yum package provider was not passing
down the install options to the list command. For users passing options
like --enablerepo, this prevents the packages from being discovered and
the list command fails.
The fix is to properly pass down the install options when executing the
list command.
|
|
fiddyspence/feature/2945/warning_on_windows_package_source
(PUP-398) Windows package provider source munging and test
|
|
Adding munge and slashreplace method to windows package provider
to ensure successful installation of packages. Validation in the
type validate() not possible because we haven't chosen a provider
at that point. Outputs debug as a means of notifying the user that
the source has been changed.
|
|
adrienthebo/fixup/master/pup-2871-install-uninstall-options-pacman
Fixup/master/pup 2871 install uninstall options pacman
|
|
These methods should not be called by any outside class; this commit
makes them private and removes the tests that invoke them directly.
|
|
In the same manner as 9137faf uninstall_options were being appended as a
nested array value; this commit changes the uninstall method to
concatentate options to the array.
|
|
Before this commit, install_options were passed as a nested array to
pacman/yaourt. This commit changes that to concatentate the values
with the argument vector.
|
|
|
|
|
|
|
|
Maint/master/update rspec
|
|
- Instead of trying to simulate a POSIX environment on the Windows for
the sake of tests against a provider that never runs on Windows,
exclude the tests when Puppet.features.posix? is not true.
- Given that these tests will no longer execute on Windows, the usage
of expand_path is no longer necessary, nor are any of the
Puppet.features.microsoft_windows? guards
|
|
The return type of Etc.getpwent (and friends) is available as
Etc::Passwd in ruby 1.9.3 and later. However that constant doesn't exist
in ruby 1.8.7. However the docs refer to the type as Struct::Passwd,
which turns out to be available on 1.8.7, 1.9.3, 2.0.0, and 2.1.0.
|
|
Iristyle/ticket/master/PUP-2919-remove-win32-taskscheduler-ruby2-pending-tests
(PUP-2919) Remove Windows / Ruby 2 pending specs
|
|
* pr/2742:
(PUP-2732) Test ignoring of user parameter
(maint) Use real resource for testing shell provider
(maint) Use parameter matchers in tests
(PUP-2732) Add tests for user validation
(PUP-2732) Use less restrictive exec user validation
Closes #2742
|
|
When the user parameter is specified, but it is the same as the current
user, there isn't any need to control the user when executing the
command. This adds a test in the posix provider for this shared
behavior. There don't appear to be many tests for how exec works at all.
|
|
The shell provider tests were creating an invalid configuration of
objects in order to test. The resource needs to be an instance of the
:exec type, not a Puppet::Resource.
|
|
This uses the mocha parameter matchers in the tests rather than a custom
with() block. This is a little shorter and should provide better error
messages when it fails.
|
|
Iristyle/ticket/master/PUP-2521-remove-windows-pr-gem
(PUP-2521) Remove windows-pr gem
|
|
- Previously removed in 76cde1ba547b6aed12e8de0b4ec3d7339789ce01 as
part of https://github.com/puppetlabs/puppet/pull/2846
- Win32-taskscheduler is Windows x64 / Ruby 2 compatible, and therefore
these tests can be re-enabled
|
|
* ticket/master/PUP-2881-update-win32-taskscheduler: (27 commits)
(doc) task_scheduler failure on enabled/index in manifest
(PUP-2881) Use COM UseInstance Helper for cleanup
(PUP-2881) Don't Release TaskScheduler in save
(PUP-2881) Refactor Task cleanup
(PUP-2881) Use COM interface pointer helper
(PUP-2881) Remove taskscheduler VERSION
(PUP-2881) Taskscheduler COM initialization
(PUP-2881) Remove taskscheduler S_OK constant
(PUP-2881) Remove msvcrt/buffer from taskscheduler
(PUP-2881) Refactor ITaskTrigger for FFI / COM
(PUP-2881) Refactor IPersistFile for FFI / COM
(PUP-2881) Remove CoTaskMemFree in windows/com.rb
(PUP-2881) Refactor ITask for FFI / COM
(PUP-2881) Setup Taskscheduler HRESULT constants
(PUP-2881) Refactor IEnumWorkItems for FFI / COM
(PUP-2881) Refactor ITaskScheduler for FFI / COM
(PUP-2881) Fix Unknownr UseInstance helper
(PUP-2881) Use Windows::Error for COM call fails
(PUP-2881) Add Windows COM code from Unknownr
(PUP-2881) Move COM FFI to file windows/com.rb
...
|
|
It's not possible to test
Puppet::Provider::NameService::DirectoryService without stubbing out a
huge amount of code, which is done by a different test. The removed test
behaved almost identically like the following test so we can remove this
without losing test coverage.
|
|
From RSpec:
DEPRECATION: `expect { }.not_to raise_error(SpecificErrorClass, message)` is deprecated. Use `expect { }.not_to raise_error` (with no args) instead.
This commit removes all args from `.to_not raise_error` expectations.
|
|
The taskscheduler provider tests don't pass on Windows and ruby 2,
because the underlying win32-taskscheduler gem does not work on x64.
This commit marks the tests as conditionally pending. The tests will be
re-enabled when PUP-2881 is implemented.
|
|
- Remove win32-taskscheduler from gemspec through project_data.yaml
- Update require statements where appropriate
- All specs verified
|
|
- Windows::Error no longer exists and the ERROR_FILE_NOT_FOUND
constant is part of the Puppet codebase now.
- Catch appropriate error in package specs
- Remove windows-pr, win32-api and windows-api from gemspec
|
|
(PUP-1177) make sure ssh_known_hosts is not created with mode 0600
|
|
Without this patch, a user unfamiliar with the pacman provider might write
attempt to add flags to install and uninstall, not knowing that they will fail.
This patch adds support for these two flags to ensure a more cohesive experience
across puppet.
|
|
- Somehow there were still some remaining constants referencing
Windows:: which is part of windows-pr gem. Most are already
defined locally as of the code being ported to FFI. Ensure that we
use our internal constant definitions rather than those from gem:
Puppet::Util::Windows::AccessControlEntry::CONTAINER_INHERIT_ACE
Puppet::Util::Windows::AccessControlEntry::OBJECT_INHERIT_ACE
Puppet::Util::Windows::AccessControlEntry::INHERIT_ONLY_ACE
Puppet::Util::Windows::File::STANDARD_RIGHTS_ALL
Puppet::Util::Windows::File::SPECIFIC_RIGHTS_ALL
Puppet::Util::Windows::File::FILE_ALL_ACCESS
Puppet::Util::Windows::File::FILE_GENERIC_READ
Puppet::Util::Windows::File::FILE_GENERIC_EXECUTE
- Add new constants to Puppet::Util::Windows::Error
ERROR_FILE_NOT_FOUND
ERROR_ACCESS_DENIED
|
|
- use .tgz as the package extension
- complete 'provider features' and sort lines
|
|
- SID methods can really standalone on their own, and
should for the sake of sanity / code maintenance. Adjust all
callsites (including specs) accordingly.
- Make SID methods into static module_functions since they're
already stateless
|
|
(PUP-2578) Adjustments for new OpenBSD service provider
|
|
- Ensure strict ordering of the result of #pkg_scripts_append
- Add test for #in_base?
- Ensure package scripts don't end up with empty flags
|
|
* pr/2734:
(PUP-2579) Improve regular expression for options of ssh_authorized_keys
Closes GH-2734
|
|
An option of an SSH key containing escaped double quotes were not correctly
parsed by the ssh_authorized_keys provider, because of an incomplete
regular expression. This commit improves the regular expression by ensuring
that the option is ended by an non-escaped double quote.
|
|
(PUP-1069) Implement feature :upgradeable for OpenBSD package provider.
|
|
The constructor for the :flat filetype accepts a second argument now.
This second argument must be taken into account when stubbing specific
invocations.
|
|
- FFI GetACP
- Remove requirement on gem windows-pr by removing 'windows/national'
- Moved require for windows/registry into windows platform specific
- Added module definition to satisfy MSI/Windows Package
|
|
|