summaryrefslogtreecommitdiffstats
path: root/lib/puppet
diff options
context:
space:
mode:
Diffstat (limited to 'lib/puppet')
-rw-r--r--lib/puppet/application/agent.rb4
-rw-r--r--lib/puppet/application/apply.rb28
-rw-r--r--lib/puppet/application/master.rb22
-rw-r--r--lib/puppet/application/parser.rb5
-rw-r--r--lib/puppet/defaults.rb4
-rw-r--r--lib/puppet/face/parser.rb17
-rw-r--r--lib/puppet/faces/help/action.erb3
-rw-r--r--lib/puppet/faces/help/face.erb7
-rw-r--r--lib/puppet/faces/help/global.erb20
-rw-r--r--lib/puppet/node/environment.rb1
-rw-r--r--lib/puppet/parser/grammar.ra6
-rw-r--r--lib/puppet/parser/parser.rb6
-rw-r--r--lib/puppet/parser/type_loader.rb2
-rw-r--r--lib/puppet/resource/type_collection.rb1
-rw-r--r--lib/puppet/util/rdoc.rb3
15 files changed, 79 insertions, 50 deletions
diff --git a/lib/puppet/application/agent.rb b/lib/puppet/application/agent.rb
index fc8616817..317a61436 100644
--- a/lib/puppet/application/agent.rb
+++ b/lib/puppet/application/agent.rb
@@ -429,10 +429,6 @@ Copyright (c) 2011 Puppet Labs, LLC Licensed under the Apache 2.0 License
Puppet.settings.use :main, :agent, :ssl
- # Always ignoreimport for agent. It really shouldn't even try to import,
- # but this is just a temporary band-aid.
- Puppet[:ignoreimport] = true
-
# We need to specify a ca location for all of the SSL-related i
# indirected classes to work; in fingerprint mode we just need
# access to the local files and we don't need a ca.
diff --git a/lib/puppet/application/apply.rb b/lib/puppet/application/apply.rb
index bf7b8a988..a63c2ddae 100644
--- a/lib/puppet/application/apply.rb
+++ b/lib/puppet/application/apply.rb
@@ -26,6 +26,16 @@ 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
+
+ option("--ignoreimport") do
+ puts "--ignoreimport has been removed. Please use 'puppet parser validate <manifest>'"
+ exit 1
+ end
+
def help
<<-HELP
@@ -125,8 +135,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 +161,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 f93894d99..924e671fb 100644
--- a/lib/puppet/application/master.rb
+++ b/lib/puppet/application/master.rb
@@ -25,6 +25,16 @@ 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
+
+ option("--ignoreimport") do
+ puts "--ignoreimport has been removed. Please use 'puppet parser validate <manifest>'"
+ exit 1
+ end
+
def help
<<-HELP
@@ -125,8 +135,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 +156,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/application/parser.rb b/lib/puppet/application/parser.rb
new file mode 100644
index 000000000..b6ec3c185
--- /dev/null
+++ b/lib/puppet/application/parser.rb
@@ -0,0 +1,5 @@
+require 'puppet/application/face_base'
+require 'puppet/face'
+
+class Puppet::Application::Parser < Puppet::Application::FaceBase
+end
diff --git a/lib/puppet/defaults.rb b/lib/puppet/defaults.rb
index 89f3e169d..47e625815 100644
--- a/lib/puppet/defaults.rb
+++ b/lib/puppet/defaults.rb
@@ -90,9 +90,6 @@ module Puppet
$LOAD_PATH << value
end
},
- :ignoreimport => [false, "A parameter that can be used in commit
- hooks, since it enables you to parse-check a single file rather
- than requiring that all files exist."],
:authconfig => [ "$confdir/namespaceauth.conf",
"The configuration file that defines the rights to the different
namespaces and methods. This can be used as a coarse-grained
@@ -418,7 +415,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/parser.rb b/lib/puppet/face/parser.rb
new file mode 100644
index 000000000..c44810b99
--- /dev/null
+++ b/lib/puppet/face/parser.rb
@@ -0,0 +1,17 @@
+require 'puppet/face'
+require 'puppet/parser'
+
+Puppet::Face.define(:parser, '0.0.1') do
+ action :validate do
+ when_invoked do |*args|
+ args.pop
+ files = args
+ files << Puppet[:manifest] if files.empty?
+ files.each do |file|
+ Puppet[:manifest] = file
+ Puppet::Node::Environment.new(Puppet[:environment]).known_resource_types.clear
+ end
+ nil
+ end
+ end
+end
diff --git a/lib/puppet/faces/help/action.erb b/lib/puppet/faces/help/action.erb
new file mode 100644
index 000000000..eaf131464
--- /dev/null
+++ b/lib/puppet/faces/help/action.erb
@@ -0,0 +1,3 @@
+Use: puppet <%= face.name %> [options] <%= action.name %> [options]
+
+Summary: <%= action.summary %>
diff --git a/lib/puppet/faces/help/face.erb b/lib/puppet/faces/help/face.erb
new file mode 100644
index 000000000..efe5fd809
--- /dev/null
+++ b/lib/puppet/faces/help/face.erb
@@ -0,0 +1,7 @@
+Use: puppet <%= face.name %> [options] <action> [options]
+
+Available actions:
+% face.actions.each do |actionname|
+% action = face.get_action(actionname)
+ <%= action.name.to_s.ljust(16) %> <%= action.summary %>
+% end
diff --git a/lib/puppet/faces/help/global.erb b/lib/puppet/faces/help/global.erb
new file mode 100644
index 000000000..e123367a2
--- /dev/null
+++ b/lib/puppet/faces/help/global.erb
@@ -0,0 +1,20 @@
+puppet <subcommand> [options] <action> [options]
+
+Available subcommands, from Puppet Faces:
+% Puppet::Faces.faces.sort.each do |name|
+% face = Puppet::Faces[name, :current]
+ <%= face.name.to_s.ljust(16) %> <%= face.summary %>
+% end
+
+% unless legacy_applications.empty? then # great victory when this is true!
+Available applications, soon to be ported to Faces:
+% legacy_applications.each do |appname|
+% summary = horribly_extract_summary_from appname
+ <%= appname.to_s.ljust(16) %> <%= summary %>
+% end
+% end
+
+See 'puppet help <subcommand> <action>' for help on a specific subcommand action.
+See 'puppet help <subcommand>' for help on a specific subcommand.
+See 'puppet man <subcommand>' for the full man page.
+Puppet v<%= Puppet::PUPPETVERSION %>
diff --git a/lib/puppet/node/environment.rb b/lib/puppet/node/environment.rb
index dc631979e..4589ea64c 100644
--- a/lib/puppet/node/environment.rb
+++ b/lib/puppet/node/environment.rb
@@ -150,7 +150,6 @@ class Puppet::Node::Environment
private
def perform_initial_import
- return empty_parse_result if Puppet.settings[:ignoreimport]
parser = Puppet::Parser::Parser.new(self)
if code = Puppet.settings.uninterpolated_value(:code, name.to_s) and code != ""
parser.string = code
diff --git a/lib/puppet/parser/grammar.ra b/lib/puppet/parser/grammar.ra
index 8339c51b7..d2bd06e94 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 300ddddd6..611398d14 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/lib/puppet/parser/type_loader.rb b/lib/puppet/parser/type_loader.rb
index 1fba73d0b..23fb78c0a 100644
--- a/lib/puppet/parser/type_loader.rb
+++ b/lib/puppet/parser/type_loader.rb
@@ -60,8 +60,6 @@ class Puppet::Parser::TypeLoader
# Import our files.
def import(file, current_file = nil)
- return if Puppet[:ignoreimport]
-
# use a path relative to the file doing the importing
if current_file
dir = current_file.sub(%r{[^/]+$},'').sub(/\/$/, '')
diff --git a/lib/puppet/resource/type_collection.rb b/lib/puppet/resource/type_collection.rb
index 9fe7cdd06..89b0a16ed 100644
--- a/lib/puppet/resource/type_collection.rb
+++ b/lib/puppet/resource/type_collection.rb
@@ -6,6 +6,7 @@ class Puppet::Resource::TypeCollection
@hostclasses.clear
@definitions.clear
@nodes.clear
+ @watched_files.clear
end
def initialize(env)
diff --git a/lib/puppet/util/rdoc.rb b/lib/puppet/util/rdoc.rb
index c00bc6f85..2a6dbdfa5 100644
--- a/lib/puppet/util/rdoc.rb
+++ b/lib/puppet/util/rdoc.rb
@@ -6,8 +6,6 @@ module Puppet::Util::RDoc
# launch a rdoc documenation process
# with the files/dir passed in +files+
def rdoc(outputdir, files, charset = nil)
- Puppet[:ignoreimport] = true
-
# then rdoc
require 'rdoc/rdoc'
require 'rdoc/options'
@@ -41,7 +39,6 @@ module Puppet::Util::RDoc
# launch a output to console manifest doc
def manifestdoc(files)
- Puppet[:ignoreimport] = true
files.select { |f| FileTest.file?(f) }.each do |f|
parser = Puppet::Parser::Parser.new(Puppet::Node::Environment.new(Puppet[:environment]))
parser.file = f