-
Notifications
You must be signed in to change notification settings - Fork 193
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(maint) Update documentation and style for puppet-lint & Rubocop
Additionally, this commit adds the Vox Beaker gem back. It was removed when updating PDK.
- Loading branch information
Showing
45 changed files
with
983 additions
and
985 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,61 +1,59 @@ | ||
# frozen_string_literal: true | ||
|
||
# Puppet Agent task helper | ||
module PuppetAgent | ||
module RbTaskHelper | ||
private | ||
|
||
def error_result(error_type, error_message) | ||
{ | ||
'_error' => { | ||
'msg' => error_message, | ||
'kind' => error_type, | ||
'details' => {}, | ||
}, | ||
} | ||
end | ||
|
||
def puppet_bin_present? | ||
File.exist?(puppet_bin) | ||
end | ||
|
||
# Returns the path to the Puppet agent executable | ||
def puppet_bin | ||
@puppet_bin ||= if Puppet.features.microsoft_windows? | ||
puppet_bin_windows | ||
else | ||
'/opt/puppetlabs/bin/puppet' | ||
end | ||
end | ||
|
||
# Returns the path to the Puppet agent executable on Windows | ||
def puppet_bin_windows | ||
require 'win32/registry' | ||
|
||
install_dir = begin | ||
Win32::Registry::HKEY_LOCAL_MACHINE.open('SOFTWARE\Puppet Labs\Puppet') do |reg| | ||
# Rescue missing key | ||
dir = begin | ||
reg['RememberedInstallDir64'] | ||
rescue StandardError | ||
'' | ||
end | ||
# Both keys may exist, make sure the dir exists | ||
break dir if File.exist?(dir) | ||
|
||
# Rescue missing key | ||
begin | ||
reg['RememberedInstallDir'] | ||
rescue StandardError | ||
'' | ||
end | ||
module PuppetAgent::RbTaskHelper | ||
private | ||
|
||
def error_result(error_type, error_message) | ||
{ | ||
'_error' => { | ||
'msg' => error_message, | ||
'kind' => error_type, | ||
'details' => {}, | ||
}, | ||
} | ||
end | ||
|
||
def puppet_bin_present? | ||
File.exist?(puppet_bin) | ||
end | ||
|
||
# Returns the path to the Puppet agent executable | ||
def puppet_bin | ||
@puppet_bin ||= if Puppet.features.microsoft_windows? | ||
puppet_bin_windows | ||
else | ||
'/opt/puppetlabs/bin/puppet' | ||
end | ||
end | ||
|
||
# Returns the path to the Puppet agent executable on Windows | ||
def puppet_bin_windows | ||
require 'win32/registry' | ||
|
||
install_dir = begin | ||
Win32::Registry::HKEY_LOCAL_MACHINE.open('SOFTWARE\Puppet Labs\Puppet') do |reg| | ||
# Rescue missing key | ||
dir = begin | ||
reg['RememberedInstallDir64'] | ||
rescue StandardError | ||
'' | ||
end | ||
# Both keys may exist, make sure the dir exists | ||
break dir if File.exist?(dir) | ||
|
||
# Rescue missing key | ||
begin | ||
reg['RememberedInstallDir'] | ||
rescue StandardError | ||
'' | ||
end | ||
rescue Win32::Registry::Error | ||
# Rescue missing registry path | ||
'' | ||
end | ||
rescue Win32::Registry::Error | ||
# Rescue missing registry path | ||
'' | ||
end | ||
|
||
File.join(install_dir, 'bin', 'puppet.bat') | ||
end | ||
File.join(install_dir, 'bin', 'puppet.bat') | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
lib/puppet/provider/puppet_agent_end_run/puppet_agent_end_run.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
lib/puppet/provider/puppet_agent_upgrade_error/puppet_agent_upgrade_error.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.