[Pkg-puppet-devel] [SCM] Puppet packaging for Debian branch, experimental, updated. debian/2.6.8-1-844-g7ec39d5

Nick Lewis nick at puppetlabs.com
Tue May 10 08:14:06 UTC 2011


The following commit has been merged in the experimental branch:
commit fc36e8de8cdf32ae13b9241f9a9eef4c2727056e
Author: Nick Lewis <nick at puppetlabs.com>
Date:   Wed Apr 13 14:25:41 2011 -0700

    (#6928) Remove --parseonly
    
    This has been removed in favor of 'puppet parser validate <manifest>'.
    
    Paired-With: Jesse Wolfe

diff --git a/lib/puppet/application/apply.rb b/lib/puppet/application/apply.rb
index bf7b8a9..5779e79 100644
--- a/lib/puppet/application/apply.rb
+++ b/lib/puppet/application/apply.rb
@@ -26,6 +26,11 @@ class Puppet::Application::Apply < Puppet::Application
     end
   end
 
+  option("--parseonly") do
+    puts "--parseonly has been removed. Please use 'puppet parser validate <manifest>'"
+    exit 1
+  end
+
   def help
     <<-HELP
 
@@ -125,8 +130,6 @@ Copyright (c) 2011 Puppet Labs, LLC Licensed under the Apache 2.0 License
   def run_command
     if options[:catalog]
       apply
-    elsif Puppet[:parseonly]
-      parseonly
     else
       main
     end
@@ -153,22 +156,6 @@ Copyright (c) 2011 Puppet Labs, LLC Licensed under the Apache 2.0 License
     configurer.run :catalog => catalog
   end
 
-  def parseonly
-    # Set our code or file to use.
-    if options[:code] or command_line.args.length == 0
-      Puppet[:code] = options[:code] || STDIN.read
-    else
-      Puppet[:manifest] = command_line.args.shift
-    end
-    begin
-      Puppet::Node::Environment.new(Puppet[:environment]).known_resource_types
-    rescue => detail
-      Puppet.err detail
-      exit 1
-    end
-    exit 0
-  end
-
   def main
     # Set our code or file to use.
     if options[:code] or command_line.args.length == 0
diff --git a/lib/puppet/application/master.rb b/lib/puppet/application/master.rb
index f93894d..a90829a 100644
--- a/lib/puppet/application/master.rb
+++ b/lib/puppet/application/master.rb
@@ -25,6 +25,11 @@ class Puppet::Application::Master < Puppet::Application
     end
   end
 
+  option("--parseonly") do
+    puts "--parseonly has been removed. Please use 'puppet parser validate <manifest>'"
+    exit 1
+  end
+
   def help
     <<-HELP
 
@@ -125,8 +130,6 @@ Copyright (c) 2011 Puppet Labs, LLC Licensed under the Apache 2.0 License
   def run_command
     if options[:node]
       compile
-    elsif Puppet[:parseonly]
-      parseonly
     else
       main
     end
@@ -148,16 +151,6 @@ Copyright (c) 2011 Puppet Labs, LLC Licensed under the Apache 2.0 License
     exit(0)
   end
 
-  def parseonly
-    begin
-      Puppet::Node::Environment.new(Puppet[:environment]).known_resource_types
-    rescue => detail
-      Puppet.err detail
-      exit 1
-    end
-    exit(0)
-  end
-
   def main
     require 'etc'
     require 'puppet/file_serving/content'
diff --git a/lib/puppet/defaults.rb b/lib/puppet/defaults.rb
index 89f3e16..680762b 100644
--- a/lib/puppet/defaults.rb
+++ b/lib/puppet/defaults.rb
@@ -418,7 +418,6 @@ module Puppet
       :desc => "Where the puppet master web server logs."
     },
     :masterport => [8140, "Which port puppet master listens on."],
-    :parseonly => [false, "Just check the syntax of the manifests."],
     :node_name => ["cert", "How the puppetmaster determines the client's identity
       and sets the 'hostname', 'fqdn' and 'domain' facts for use in the manifest,
       in particular for determining which 'node' statement applies to the client.
diff --git a/lib/puppet/face/help/action.erb b/lib/puppet/faces/help/action.erb
similarity index 100%
copy from lib/puppet/face/help/action.erb
copy to lib/puppet/faces/help/action.erb
diff --git a/lib/puppet/face/help/face.erb b/lib/puppet/faces/help/face.erb
similarity index 100%
copy from lib/puppet/face/help/face.erb
copy to lib/puppet/faces/help/face.erb
diff --git a/lib/puppet/face/help/global.erb b/lib/puppet/faces/help/global.erb
similarity index 89%
copy from lib/puppet/face/help/global.erb
copy to lib/puppet/faces/help/global.erb
index f4c761b..e123367 100644
--- a/lib/puppet/face/help/global.erb
+++ b/lib/puppet/faces/help/global.erb
@@ -1,8 +1,8 @@
 puppet <subcommand> [options] <action> [options]
 
 Available subcommands, from Puppet Faces:
-% Puppet::Face.faces.sort.each do |name|
-%   face = Puppet::Face[name, :current]
+% Puppet::Faces.faces.sort.each do |name|
+%   face = Puppet::Faces[name, :current]
   <%= face.name.to_s.ljust(16) %>  <%= face.summary %>
 % end
 
diff --git a/lib/puppet/parser/grammar.ra b/lib/puppet/parser/grammar.ra
index 8339c51..d2bd06e 100644
--- a/lib/puppet/parser/grammar.ra
+++ b/lib/puppet/parser/grammar.ra
@@ -156,7 +156,7 @@ resourceoverride:     resourceref LBRACE anyparams endcomma RBRACE {
 virtualresource:  at resource {
   type = val[0]
 
-  if (type == :exported and ! Puppet[:storeconfigs]) and ! Puppet[:parseonly]
+  if (type == :exported and ! Puppet[:storeconfigs])
     Puppet.warning addcontext("You cannot collect without storeconfigs being set")
   end
 
@@ -188,7 +188,7 @@ collection:     classref collectrhand LBRACE anyparams endcomma RBRACE {
   else
     args[:form] = val[1]
   end
-  if args[:form] == :exported and ! Puppet[:storeconfigs] and ! Puppet[:parseonly]
+  if args[:form] == :exported and ! Puppet[:storeconfigs]
     Puppet.warning addcontext("You cannot collect exported resources without storeconfigs being set; the collection will be ignored")
   end
   args[:override] = val[3]
@@ -208,7 +208,7 @@ collection:     classref collectrhand LBRACE anyparams endcomma RBRACE {
   else
     args[:form] = val[1]
   end
-  if args[:form] == :exported and ! Puppet[:storeconfigs] and ! Puppet[:parseonly]
+  if args[:form] == :exported and ! Puppet[:storeconfigs]
     Puppet.warning addcontext("You cannot collect exported resources without storeconfigs being set; the collection will be ignored")
   end
   result = ast AST::Collection, args
diff --git a/lib/puppet/parser/parser.rb b/lib/puppet/parser/parser.rb
index 300dddd..611398d 100644
--- a/lib/puppet/parser/parser.rb
+++ b/lib/puppet/parser/parser.rb
@@ -1366,7 +1366,7 @@ module_eval(<<'.,.,', 'grammar.ra', 156)
   def _reduce_50(val, _values, result)
       type = val[0]
 
-  if (type == :exported and ! Puppet[:storeconfigs]) and ! Puppet[:parseonly]
+  if (type == :exported and ! Puppet[:storeconfigs])
     Puppet.warning addcontext("You cannot collect without storeconfigs being set")
   end
 
@@ -1411,7 +1411,7 @@ module_eval(<<'.,.,', 'grammar.ra', 178)
   else
     args[:form] = val[1]
   end
-  if args[:form] == :exported and ! Puppet[:storeconfigs] and ! Puppet[:parseonly]
+  if args[:form] == :exported and ! Puppet[:storeconfigs]
     Puppet.warning addcontext("You cannot collect exported resources without storeconfigs being set; the collection will be ignored")
   end
   args[:override] = val[3]
@@ -1436,7 +1436,7 @@ module_eval(<<'.,.,', 'grammar.ra', 197)
   else
     args[:form] = val[1]
   end
-  if args[:form] == :exported and ! Puppet[:storeconfigs] and ! Puppet[:parseonly]
+  if args[:form] == :exported and ! Puppet[:storeconfigs]
     Puppet.warning addcontext("You cannot collect exported resources without storeconfigs being set; the collection will be ignored")
   end
   result = ast AST::Collection, args
diff --git a/man/man5/puppet.conf.5 b/man/man5/puppet.conf.5
index f6c9926..930cec5 100644
--- a/man/man5/puppet.conf.5
+++ b/man/man5/puppet.conf.5
@@ -1,8 +1,8 @@
 .\" generated with Ronn/v0.7.3
 .\" http://github.com/rtomayko/ronn/tree/0.7.3
 .
-.TH "PUPPETCONF" "5" "February 2011" "Puppet Labs, LLC" "Puppet manual"
-\fBThis page is autogenerated; any changes will get overwritten\fR \fI(last generated on Thu Feb 17 09:56:34 \-0800 2011)\fR
+.TH "PUPPETCONF" "5" "April 2011" "Puppet Labs, LLC" "Puppet manual"
+\fBThis page is autogenerated; any changes will get overwritten\fR \fI(last generated on Wed Apr 13 14:24:43 \-0700 2011)\fR
 .
 .SH "Specifying Configuration Parameters"
 .
@@ -117,7 +117,7 @@ Puppet can also create user and group accounts for itself (one \fBpuppet\fR grou
 .
 .nf
 
-$ puppet agent \-\-mkusers
+$ puppet master \-\-mkusers
 .
 .fi
 .
@@ -132,6 +132,14 @@ Sending the \fBSIGUSR1\fR signal to an instance of \fBpuppet agent\fR will cause
 .SH "Configuration Parameter Reference"
 Below is a list of all documented parameters\. Not all of them are valid with all Puppet executables, but the executables will ignore any inappropriate values\.
 .
+.SS "allow_duplicate_certs"
+Whether to allow a new certificate request to overwrite an existing certificate\.
+.
+.IP "\(bu" 4
+\fIDefault\fR: false
+.
+.IP "" 0
+.
 .SS "archive_file_server"
 During an inspect run, the file bucket server to archive files to if archive_files is set\.
 .
@@ -340,7 +348,7 @@ Whether certificate revocation should be supported by downloading a Certificate
 The name to use when handling certificates\. Defaults to the fully qualified domain name\.
 .
 .IP "\(bu" 4
-\fIDefault\fR: magpie\.puppetlabs\.lan
+\fIDefault\fR: nick\-lewiss\-macbook\-pro\.local
 .
 .IP "" 0
 .
@@ -522,6 +530,14 @@ Which arguments to pass to the diff command when printing differences between fi
 .
 .IP "" 0
 .
+.SS "document_all"
+Document all resources
+.
+.IP "\(bu" 4
+\fIDefault\fR: false
+.
+.IP "" 0
+.
 .SS "downcasefacts"
 Whether facts should be made all lowercase when sent to the server\.
 .
@@ -1067,14 +1083,6 @@ Run the configuration once, rather than as a long\-running daemon\. This is usef
 .
 .IP "" 0
 .
-.SS "parseonly"
-Just check the syntax of the manifests\.
-.
-.IP "\(bu" 4
-\fIDefault\fR: false
-.
-.IP "" 0
-.
 .SS "passfile"
 Where puppet agent stores the password for its private key\. Generally unused\.
 .
@@ -1261,7 +1269,7 @@ The directory in which to store reports received from the client\. Each client g
 The \'from\' email address for the reports\.
 .
 .IP "\(bu" 4
-\fIDefault\fR: report at magpie\.puppetlabs\.lan
+\fIDefault\fR: report at Nick\-Lewiss\-MacBook\-Pro\.local
 .
 .IP "" 0
 .
@@ -1313,6 +1321,14 @@ The configuration file that defines the rights to the different rest indirection
 .
 .IP "" 0
 .
+.SS "route_file"
+The YAML file containing indirector route configuration\.
+.
+.IP "\(bu" 4
+\fIDefault\fR: $confdir/routes\.yaml
+.
+.IP "" 0
+.
 .SS "rrddir"
 The directory where RRD database files are stored\. Directories for each reporting host will be created under this directory\.
 .
@@ -1589,4 +1605,4 @@ Boolean; whether to use the zlib library
 .IP "" 0
 .
 .P
-\fIThis page autogenerated on Thu Feb 17 09:56:34 \-0800 2011\fR
+\fIThis page autogenerated on Wed Apr 13 14:24:43 \-0700 2011\fR
diff --git a/spec/unit/application/apply_spec.rb b/spec/unit/application/apply_spec.rb
index 66c658e..dca2a41 100755
--- a/spec/unit/application/apply_spec.rb
+++ b/spec/unit/application/apply_spec.rb
@@ -122,14 +122,6 @@ describe Puppet::Application::Apply do
 
   describe "when executing" do
 
-    it "should dispatch to parseonly if parseonly is set" do
-      @apply.stubs(:options).returns({})
-      Puppet.stubs(:[]).with(:parseonly).returns(true)
-
-      @apply.expects(:parseonly)
-      @apply.run_command
-    end
-
     it "should dispatch to 'apply' if it was called with 'apply'" do
       @apply.options[:catalog] = "foo"
 
@@ -137,48 +129,13 @@ describe Puppet::Application::Apply do
       @apply.run_command
     end
 
-    it "should dispatch to main if parseonly is not set" do
+    it "should dispatch to main otherwise" do
       @apply.stubs(:options).returns({})
-      Puppet.stubs(:[]).with(:parseonly).returns(false)
 
       @apply.expects(:main)
       @apply.run_command
     end
 
-    describe "the parseonly command" do
-      before :each do
-        @environment = Puppet::Node::Environment.new("env")
-        Puppet.stubs(:[]).with(:environment).returns(@environment)
-        Puppet.stubs(:[]).with(:manifest).returns("site.pp")
-        Puppet.stubs(:err)
-        @apply.stubs(:exit)
-        @apply.options.stubs(:[]).with(:code).returns "some code"
-      end
-
-      it "should use the environment to parse the file" do
-        @environment.stubs(:perform_initial_import)
-        @apply.parseonly
-      end
-
-      it "should exit with exit code 0 if no error" do
-        @apply.expects(:exit).with(0)
-        @apply.parseonly
-      end
-
-      it "should exit with exit code 1 if error" do
-        @environment.stubs(:perform_initial_import).raises(Puppet::ParseError)
-        @apply.expects(:exit).with(1)
-        @apply.parseonly
-      end
-
-      it "should exit with exit code 1 if error, even if --noop is set" do
-        Puppet[:noop] = true
-        @environment.stubs(:perform_initial_import).raises(Puppet::ParseError)
-        @apply.expects(:exit).with(1)
-        @apply.parseonly
-      end
-    end
-
     describe "the main command" do
       before :each do
         Puppet.stubs(:[])
diff --git a/spec/unit/application/master_spec.rb b/spec/unit/application/master_spec.rb
index 890f8ee..ea5d3f5 100755
--- a/spec/unit/application/master_spec.rb
+++ b/spec/unit/application/master_spec.rb
@@ -34,10 +34,6 @@ describe Puppet::Application::Master do
     @master.should respond_to(:main)
   end
 
-  it "should declare a parseonly command" do
-    @master.should respond_to(:parseonly)
-  end
-
   it "should declare a compile command" do
     @master.should respond_to(:compile)
   end
@@ -232,55 +228,19 @@ describe Puppet::Application::Master do
       @master.preinit
     end
 
-    it "should dispatch to parseonly if parseonly is set" do
-      Puppet.stubs(:[]).with(:parseonly).returns(true)
-      @master.options[:node] = nil
-
-      @master.expects(:parseonly)
-      @master.run_command
-    end
-
     it "should dispatch to compile if called with --compile" do
       @master.options[:node] = "foo"
       @master.expects(:compile)
       @master.run_command
     end
 
-    it "should dispatch to main if parseonly is not set" do
-      Puppet.stubs(:[]).with(:parseonly).returns(false)
+    it "should dispatch to main otherwise" do
       @master.options[:node] = nil
 
       @master.expects(:main)
       @master.run_command
     end
 
-
-    describe "the parseonly command" do
-      before :each do
-        @environment = Puppet::Node::Environment.new("env")
-        Puppet.stubs(:[]).with(:environment).returns(@environment)
-        Puppet.stubs(:[]).with(:manifest).returns("site.pp")
-        Puppet.stubs(:err)
-        @master.stubs(:exit)
-      end
-
-      it "should use a Puppet Resource Type Collection to parse the file" do
-        @environment.expects(:perform_initial_import)
-        @master.parseonly
-      end
-
-      it "should exit with exit code 0 if no error" do
-        @master.expects(:exit).with(0)
-        @master.parseonly
-      end
-
-      it "should exit with exit code 1 if error" do
-        @environment.stubs(:perform_initial_import).raises(Puppet::ParseError)
-        @master.expects(:exit).with(1)
-        @master.parseonly
-      end
-    end
-
     describe "the compile command" do
       before do
         Puppet.stubs(:[]).with(:environment)
diff --git a/test/language/parser.rb b/test/language/parser.rb
index 36a9c47..f7e636a 100755
--- a/test/language/parser.rb
+++ b/test/language/parser.rb
@@ -14,7 +14,6 @@ class TestParser < Test::Unit::TestCase
   include PuppetTest::Support::Utils
   def setup
     super
-    Puppet[:parseonly] = true
     #@lexer = Puppet::Parser::Lexer.new
   end
 

-- 
Puppet packaging for Debian



More information about the Pkg-puppet-devel mailing list