diff options
| author | Markus Roberts <Markus@reality.com> | 2010-07-09 18:01:33 -0700 |
|---|---|---|
| committer | Markus Roberts <Markus@reality.com> | 2010-07-09 18:01:33 -0700 |
| commit | 77f8599f55be12bf5c7d69ac8f439d1fd756eafc (patch) | |
| tree | e8db2af5836d6fb4e3061531d570ffd24a087373 /lib/puppet/util | |
| parent | 3fbc1d57f07598de225ac805ff000733480c9ff8 (diff) | |
| download | puppet-77f8599f55be12bf5c7d69ac8f439d1fd756eafc.tar.gz puppet-77f8599f55be12bf5c7d69ac8f439d1fd756eafc.tar.xz puppet-77f8599f55be12bf5c7d69ac8f439d1fd756eafc.zip | |
Code smell: Win32 --> MS_windows
* Replaced 12 occurances of Win32 with Microsoft Windows
3 Examples:
The code:
# and all .rb files in lib/. This is disabled by default on Win32.
becomes:
# and all .rb files in lib/. This is disabled by default on Microsoft Windows.
The code:
# We can use Win32 functions
becomes:
# We can use Microsoft Windows functions
The code:
desc "Uses Win32 functionality to manage file's users and rights."
becomes:
desc "Uses Microsoft Windows functionality to manage file's users and rights."
* Replaced 10 occurances of :win32 with :microsoft_windows
3 Examples:
The code:
Puppet.features.add(:win32, :libs => ["sys/admin", "win32/process", "win32/dir"])
becomes:
Puppet.features.add(:microsoft_windows, :libs => ["sys/admin", "win32/process", "win32/dir"])
The code:
Puppet::Type.type(:file).provide :win32 do
becomes:
Puppet::Type.type(:file).provide :microsoft_windows do
The code:
confine :feature => :win32
becomes:
confine :feature => :microsoft_windows
* Replaced 13 occurances of win32\? with microsoft_windows?
3 Examples:
The code:
signals.update({:HUP => :restart, :USR1 => :reload, :USR2 => :reopen_logs }) unless Puppet.features.win32?
becomes:
signals.update({:HUP => :restart, :USR1 => :reload, :USR2 => :reopen_logs }) unless Puppet.features.microsoft_windows?
The code:
raise Puppet::Error,"Cannot determine basic system flavour" unless Puppet.features.posix? or Puppet.features.win32?
becomes:
raise Puppet::Error,"Cannot determine basic system flavour" unless Puppet.features.posix? or Puppet.features.microsoft_windows?
The code:
require 'sys/admin' if Puppet.features.win32?
becomes:
require 'sys/admin' if Puppet.features.microsoft_windows?
Diffstat (limited to 'lib/puppet/util')
| -rw-r--r-- | lib/puppet/util/run_mode.rb | 4 | ||||
| -rw-r--r-- | lib/puppet/util/suidmanager.rb | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/lib/puppet/util/run_mode.rb b/lib/puppet/util/run_mode.rb index fe9e07c85..bf745743f 100644 --- a/lib/puppet/util/run_mode.rb +++ b/lib/puppet/util/run_mode.rb @@ -27,14 +27,14 @@ module Puppet def conf_dir which_dir( - (Puppet.features.win32? ? File.join(Dir::WINDOWS, "puppet", "etc") : "/etc/puppet"), + (Puppet.features.microsoft_windows? ? File.join(Dir::WINDOWS, "puppet", "etc") : "/etc/puppet"), "~/.puppet" ) end def var_dir which_dir( - (Puppet.features.win32? ? File.join(Dir::WINDOWS, "puppet", "var") : "/var/lib/puppet"), + (Puppet.features.microsoft_windows? ? File.join(Dir::WINDOWS, "puppet", "var") : "/var/lib/puppet"), "~/.puppet/var" ) end diff --git a/lib/puppet/util/suidmanager.rb b/lib/puppet/util/suidmanager.rb index f8dbca79e..777c36411 100644 --- a/lib/puppet/util/suidmanager.rb +++ b/lib/puppet/util/suidmanager.rb @@ -50,7 +50,7 @@ module Puppet::Util::SUIDManager # Runs block setting uid and gid if provided then restoring original ids def asuser(new_uid=nil, new_gid=nil) - return yield if Puppet.features.win32? or !root? + return yield if Puppet.features.microsoft_windows? or !root? # We set both because some programs like to drop privs, i.e. bash. old_uid, old_gid = self.uid, self.gid |
