summaryrefslogtreecommitdiffstats
path: root/lib/puppet
diff options
context:
space:
mode:
authorLuke Kanies <luke@madstop.com>2005-06-29 21:16:54 +0000
committerLuke Kanies <luke@madstop.com>2005-06-29 21:16:54 +0000
commit3441b82f84ff7dbc15e9a9d3c20da84a7eae8ce5 (patch)
tree2938f0ff110748a0ea61adafd84880b293902d07 /lib/puppet
parentf250d920627696bab766dffe6c8e6a8983298fc6 (diff)
downloadpuppet-3441b82f84ff7dbc15e9a9d3c20da84a7eae8ce5.tar.gz
puppet-3441b82f84ff7dbc15e9a9d3c20da84a7eae8ce5.tar.xz
puppet-3441b82f84ff7dbc15e9a9d3c20da84a7eae8ce5.zip
finishing rename of file class
git-svn-id: https://reductivelabs.com/svn/puppet/library/trunk@323 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'lib/puppet')
-rw-r--r--lib/puppet/type.rb2
-rw-r--r--lib/puppet/type/pfile.rb50
-rw-r--r--lib/puppet/type/pprocess.rb10
-rw-r--r--lib/puppet/type/symlink.rb8
4 files changed, 35 insertions, 35 deletions
diff --git a/lib/puppet/type.rb b/lib/puppet/type.rb
index 0eee5dbe0..2ec09dc81 100644
--- a/lib/puppet/type.rb
+++ b/lib/puppet/type.rb
@@ -875,7 +875,7 @@ end # Puppet::Type
end
require 'puppet/type/service'
-require 'puppet/type/file'
+require 'puppet/type/pfile'
require 'puppet/type/symlink'
require 'puppet/type/package'
require 'puppet/type/component'
diff --git a/lib/puppet/type/pfile.rb b/lib/puppet/type/pfile.rb
index 28ac59447..e8d459fe6 100644
--- a/lib/puppet/type/pfile.rb
+++ b/lib/puppet/type/pfile.rb
@@ -11,7 +11,7 @@ module Puppet
# because the objects must be defined for us to use them in our
# definition of the file object
class State
- class FileCreate < Puppet::State
+ class PFileCreate < Puppet::State
require 'etc'
attr_accessor :file
@name = :create
@@ -45,7 +45,7 @@ module Puppet
end
end
- class FileChecksum < Puppet::State
+ class PFileChecksum < Puppet::State
@name = :checksum
@event = :file_modified
@@ -122,7 +122,7 @@ module Puppet
end
end
- class FileUID < Puppet::State
+ class PFileUID < Puppet::State
require 'etc'
attr_accessor :file
@name = :owner
@@ -159,7 +159,7 @@ module Puppet
end
unless self.parent.stat
- Puppet.err "File '%s' does not exist; cannot chown" %
+ Puppet.err "PFile '%s' does not exist; cannot chown" %
self.parent[:path]
end
@@ -177,7 +177,7 @@ module Puppet
# this state should actually somehow turn into many states,
# one for each bit in the mode
# I think MetaStates are the answer, but I'm not quite sure
- class FileMode < Puppet::State
+ class PFileMode < Puppet::State
require 'etc'
@name = :mode
@@ -210,7 +210,7 @@ module Puppet
end
unless self.parent.stat
- Puppet.err "File '%s' does not exist; cannot chmod" %
+ Puppet.err "PFile '%s' does not exist; cannot chmod" %
self.parent[:path]
return
end
@@ -226,10 +226,10 @@ module Puppet
# not used until I can figure out how to solve the problem with
# metastates
- class FileSetUID < Puppet::State
+ class PFileSetUID < Puppet::State
require 'etc'
- @parent = Puppet::State::FileMode
+ @parent = Puppet::State::PFileMode
@name = :setuid
@event = :inode_changed
@@ -254,7 +254,7 @@ module Puppet
end
end
- class FileGroup < Puppet::State
+ class PFileGroup < Puppet::State
require 'etc'
@name = :group
@@ -307,7 +307,7 @@ module Puppet
end
unless self.parent.stat
- Puppet.err "File '%s' does not exist; cannot chgrp" %
+ Puppet.err "PFile '%s' does not exist; cannot chgrp" %
self.parent[:path]
return
end
@@ -324,16 +324,16 @@ module Puppet
end
end
class Type
- class File < Type
+ class PFile < Type
attr_reader :params
# class instance variable
@states = [
- Puppet::State::FileCreate,
- Puppet::State::FileUID,
- Puppet::State::FileGroup,
- Puppet::State::FileMode,
- Puppet::State::FileChecksum,
- Puppet::State::FileSetUID
+ Puppet::State::PFileCreate,
+ Puppet::State::PFileUID,
+ Puppet::State::PFileGroup,
+ Puppet::State::PFileMode,
+ Puppet::State::PFileChecksum,
+ Puppet::State::PFileSetUID
]
@parameters = [
@@ -347,7 +347,7 @@ module Puppet
# a wrapper method to make sure the file exists before doing anything
def retrieve
unless stat = self.stat(true)
- Puppet.debug "File %s does not exist" % self[:path]
+ Puppet.debug "PFile %s does not exist" % self[:path]
@states.each { |name,state|
state.is = -1
}
@@ -359,7 +359,7 @@ module Puppet
def stat(refresh = false)
if @stat.nil? or refresh == true
begin
- @stat = ::File.stat(self[:path])
+ @stat = File.stat(self[:path])
rescue => error
Puppet.debug "Failed to stat %s: %s" %
[self[:path],error]
@@ -404,7 +404,7 @@ module Puppet
Dir.foreach(self[:path]) { |file|
next if file =~ /^\.\.?/ # skip . and ..
- arghash[:path] = ::File.join(self[:path],file)
+ arghash[:path] = File.join(self[:path],file)
child = nil
# if the file already exists...
@@ -421,19 +421,19 @@ module Puppet
end
end
end
- end # Puppet::Type::File
+ end # Puppet::Type::PFile
end # Puppet::Type
- class FileSource
+ class PFileSource
attr_accessor :name
@sources = Hash.new(nil)
- def FileSource.[]=(name,sub)
+ def PFileSource.[]=(name,sub)
@sources[name] = sub
end
- def FileSource.[](name)
+ def PFileSource.[](name)
return @sources[name]
end
@@ -444,7 +444,7 @@ module Puppet
yield self
end
- FileSource[name] = self
+ PFileSource[name] = self
end
end
end
diff --git a/lib/puppet/type/pprocess.rb b/lib/puppet/type/pprocess.rb
index 5ee12a9e2..1b14fa07d 100644
--- a/lib/puppet/type/pprocess.rb
+++ b/lib/puppet/type/pprocess.rb
@@ -5,7 +5,7 @@
module Puppet
class State
- class ProcessRunning < State
+ class PProcessRunning < State
def retrieve
running = 0
regex = Regexp.new(@params[:pattern])
@@ -44,8 +44,8 @@ module Puppet
uid = Etc.getpwnam(@params[:user]).uid
end
Kernel.fork {
- Process.uid = uid
- Process.euid = uid
+ PProcess.uid = uid
+ PProcess.euid = uid
string = @params[:binary] + (@params[:arguments] || "")
Puppet::Message.new(
:level => :notice,
@@ -58,7 +58,7 @@ module Puppet
end
end
class Type
- class BProcess < Type
+ class PProcess < Type
attr_reader :stat, :path
@parameters = [:start, :stop, :user, :pattern, :binary, :arguments]
@name = :process
@@ -77,7 +77,7 @@ module Puppet
:pattern => :pattern
})
- end # Puppet::Type::BProcess
+ end # Puppet::Type::PProcess
end # Puppet::Type
end
diff --git a/lib/puppet/type/symlink.rb b/lib/puppet/type/symlink.rb
index b33e81dba..811f9aa2b 100644
--- a/lib/puppet/type/symlink.rb
+++ b/lib/puppet/type/symlink.rb
@@ -4,7 +4,7 @@
require 'etc'
require 'puppet/type/state'
-require 'puppet/type/file'
+require 'puppet/type/pfile'
module Puppet
# okay, how do we deal with parameters that don't have operations
@@ -91,9 +91,9 @@ module Puppet
attr_reader :stat, :path, :params
# class instance variable
@states = [
- Puppet::State::FileUID,
- Puppet::State::FileGroup,
- Puppet::State::FileMode,
+ Puppet::State::PFileUID,
+ Puppet::State::PFileGroup,
+ Puppet::State::PFileMode,
Puppet::State::SymlinkTarget
]