diff options
author | luke <luke@980ebf18-57e1-0310-9a29-db15c13687c0> | 2006-01-03 03:08:48 +0000 |
---|---|---|
committer | luke <luke@980ebf18-57e1-0310-9a29-db15c13687c0> | 2006-01-03 03:08:48 +0000 |
commit | 592c24d08efcb19f46835bf5c4410dc677ea1b4f (patch) | |
tree | 478cf34add0c7720e2ef00ab7d1c30fa680bf1af | |
parent | f9f84bf90d60eef0504d2237fd336ce3c52598ab (diff) | |
download | puppet-592c24d08efcb19f46835bf5c4410dc677ea1b4f.tar.gz puppet-592c24d08efcb19f46835bf5c4410dc677ea1b4f.tar.xz puppet-592c24d08efcb19f46835bf5c4410dc677ea1b4f.zip |
adding some comments
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@761 980ebf18-57e1-0310-9a29-db15c13687c0
-rw-r--r-- | lib/puppet/type/nameservice/netinfo.rb | 7 | ||||
-rw-r--r-- | lib/puppet/type/nameservice/objectadd.rb | 2 | ||||
-rw-r--r-- | lib/puppet/type/nameservice/posix.rb | 12 |
3 files changed, 20 insertions, 1 deletions
diff --git a/lib/puppet/type/nameservice/netinfo.rb b/lib/puppet/type/nameservice/netinfo.rb index 006164879..e3e2bdece 100644 --- a/lib/puppet/type/nameservice/netinfo.rb +++ b/lib/puppet/type/nameservice/netinfo.rb @@ -12,6 +12,7 @@ module Puppet module NameService module NetInfo + # Verify that we've got all of the commands we need. def self.test system("which niutil > /dev/null 2>&1") @@ -32,6 +33,7 @@ module Puppet end end + # Does the object already exist? def self.exists?(obj) cmd = "nidump -r /%s/%s /" % [obj.class.netinfodir, obj.name] @@ -45,6 +47,7 @@ module Puppet end end + # Attempt to flush the database, but this doesn't seem to work at all. def self.flush output = %x{lookupd -flushcache 2>&1} @@ -54,10 +57,12 @@ module Puppet end class NetInfoState < POSIX::POSIXState + # Should we do all of the changes at once? def self.allatonce? false end + # Similar to posixmethod, what key do we use to get data? def self.netinfokey if defined? @netinfokey and @netinfokey return @netinfokey @@ -66,6 +71,7 @@ module Puppet end end + # Retrieve the data, yo. def retrieve NetInfo.flush dir = @parent.class.netinfodir @@ -102,6 +108,7 @@ module Puppet end end + # How to add an object. def addcmd creatorcmd("-create") end diff --git a/lib/puppet/type/nameservice/objectadd.rb b/lib/puppet/type/nameservice/objectadd.rb index f8fba4419..cc25c5f5f 100644 --- a/lib/puppet/type/nameservice/objectadd.rb +++ b/lib/puppet/type/nameservice/objectadd.rb @@ -2,6 +2,7 @@ require 'puppet' module Puppet class State + # The flag to use to add an object def self.objectaddflag if defined? @objectaddflag and @objectaddflag return @objectaddflag @@ -25,6 +26,7 @@ module Puppet end end + # Does the object already exist? def self.exists?(obj) if obj.getinfo return true diff --git a/lib/puppet/type/nameservice/posix.rb b/lib/puppet/type/nameservice/posix.rb index 1f7a427cd..41b069f9d 100644 --- a/lib/puppet/type/nameservice/posix.rb +++ b/lib/puppet/type/nameservice/posix.rb @@ -1,7 +1,8 @@ require 'puppet' module Puppet - class Type + class Type # :nodoc: + # The method that returns what we want from the POSIX struct def self.posixmethod if defined? @posixmethod and @posixmethod return @posixmethod @@ -21,6 +22,8 @@ module Puppet class << self attr_accessor :extender + # Can we autogenerate a value for this field? If a required field + # can be autogenerated then we don't require a value. def autogen? if defined? @autogen return @autogen @@ -29,6 +32,7 @@ module Puppet end end + # Is this field optional? def optional? if defined? @optional return @optional @@ -38,6 +42,8 @@ module Puppet end end + # The documentation for our module comes from the extending class, + # not directly from the object def self.doc if defined? @extender @extender.doc @@ -46,6 +52,7 @@ module Puppet end end + # Find the module to use to extend the current class def self.complete mod = "Puppet::State::%s" % self.to_s.sub(/.+::/,'') @@ -61,6 +68,7 @@ module Puppet self.extender = modklass end + # Return the method that we'll call on the POSIX struct. def self.posixmethod if defined? @extender if @extender.respond_to?(:posixmethod) @@ -95,6 +103,7 @@ module Puppet end end + # Sync the information. def sync event = nil # they're in sync some other way @@ -149,6 +158,7 @@ module Puppet end private + # This is only used when creating or destroying the object. def syncname cmd = nil event = nil |