Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions acceptance/lib/puppet/acceptance/windows_utils.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ module WindowsUtils
def profile_base(agent)
ruby = Puppet::Acceptance::CommandUtils.ruby_command(agent)
getbasedir = <<'END'
require 'puppet/util/windows/monkey_patches/dir'
puts Dir::PROFILE.match(/(.*)\\\\[^\\\\]*/)[1]
puts ENV['USERPROFILE'].match(/(.*)\\\\[^\\\\]*/)[1]
END
on(agent, "#{ruby} -e \"#{getbasedir}\"").stdout.chomp
end
Expand Down
5 changes: 1 addition & 4 deletions ext/windows/service/daemon.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,13 @@
# monkey patches ruby Process to add .create method
require 'puppet/util/windows/monkey_patches/process'

# monkey patch Dir to add constants
require 'puppet/util/windows/monkey_patches/dir'

class WindowsDaemon < Puppet::Util::Windows::Daemon
CREATE_NEW_CONSOLE = 0x00000010

@run_thread = nil
@LOG_TO_FILE = false
@loglevel = 0
LOG_FILE = File.expand_path(File.join(Dir::COMMON_APPDATA, 'PuppetLabs', 'puppet', 'var', 'log', 'windows.log'))
LOG_FILE = File.expand_path(File.join(ENV['ALLUSERSPROFILE'], 'PuppetLabs', 'puppet', 'var', 'log', 'windows.log'))
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the service is configured to run under a domain service account, would COMMON_APPDATA be different than ALLUSERSPROFILE? I assume not, but wanted to check

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I set up a domain controller and client, set the puppet service to run as a domain account and confirmed that COMMON_APPDATA and ALLUSERSPROFILE are the same.

LEVELS = [:debug, :info, :notice, :warning, :err, :alert, :emerg, :crit]
LEVELS.each do |level|
define_method("log_#{level}") do |msg|
Expand Down
7 changes: 0 additions & 7 deletions lib/puppet/util/rdoc.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,6 @@ def rdoc(outputdir, files, charset = nil)

options << "--force-update"
options += [ "--charset", charset] if charset
# Rdoc root default is Dir.pwd, but the win32-dir gem monkey patches Dir.pwd
# replacing Ruby's normal / with \. When RDoc generates relative paths it
# uses relative_path_from that will generate errors when the slashes don't
# properly match. This is a workaround for that issue.
if Puppet::Util::Platform.windows? && RDoc::VERSION !~ /^[0-3]\./
options += [ "--root", Dir.pwd.tr('\\', '/')]
end
options += files

# launch the documentation process
Expand Down
2 changes: 1 addition & 1 deletion lib/puppet/util/run_mode.rb
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ def log_dir
private

def windows_common_base(*extra)
[Dir::COMMON_APPDATA, "PuppetLabs"] + extra
[ENV['ALLUSERSPROFILE'], "PuppetLabs"] + extra
end
end
end
Expand Down
1 change: 0 additions & 1 deletion lib/puppet/util/windows.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ class EventLog; end
require 'puppet/util/windows/registry'
require 'puppet/util/windows/eventlog'
require 'puppet/util/windows/service'
require 'puppet/util/windows/monkey_patches/dir'
require 'puppet/util/windows/monkey_patches/process'
end
end
Loading