summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Pittman <daniel@puppetlabs.com>2011-06-01 11:28:39 -0700
committerDaniel Pittman <daniel@puppetlabs.com>2011-06-01 11:28:39 -0700
commit0370011a95d90ce0ff6ee7277d96021b3f3c8744 (patch)
treef410cdd81b63f51b3faae2a1fdfcd4aae09b3e84
parentdb25a02490efcafab6822d8e83a36df35a4afc01 (diff)
parenta23cfd869f90ae4456dded6e5a1c82719b128f01 (diff)
downloadpuppet-0370011a95d90ce0ff6ee7277d96021b3f3c8744.tar.gz
puppet-0370011a95d90ce0ff6ee7277d96021b3f3c8744.tar.xz
puppet-0370011a95d90ce0ff6ee7277d96021b3f3c8744.zip
Merge branch 'refactor/2.7rc/7717-deprecate-puppet-apply-by-magic' into 2.7rc
-rw-r--r--lib/puppet/util/command_line.rb38
1 files changed, 33 insertions, 5 deletions
diff --git a/lib/puppet/util/command_line.rb b/lib/puppet/util/command_line.rb
index 8190f8ac1..372aa5122 100644
--- a/lib/puppet/util/command_line.rb
+++ b/lib/puppet/util/command_line.rb
@@ -93,16 +93,44 @@ module Puppet
if zero == 'puppet'
case argv.first
- when nil; [ stdin.tty? ? nil : "apply", argv] # ttys get usage info
- when "--help", "-h"; [nil, argv] # help should give you usage, not the help for `puppet apply`
- when /^-|\.pp$|\.rb$/; ["apply", argv]
- else [ argv.first, argv[1..-1] ]
+ when nil then
+ if stdin.tty? then
+ [nil, argv] # ttys get usage info
+ else
+ # Killed for 2.7.0 --daniel 2011-06-01
+ Puppet.deprecation_warning <<EOM
+Implicit invocation of 'puppet apply' by redirection into 'puppet' is deprecated,
+and will be removed in the 2.8 series. Please invoke 'puppet apply' directly
+in the future.
+EOM
+ ["apply", argv]
+ end
+ when "--help", "-h" then
+ # help should give you usage, not the help for `puppet apply`
+ [nil, argv]
+ when /^-|\.pp$|\.rb$/ then
+ # Killed for 2.7.0 --daniel 2011-06-01
+ Puppet.deprecation_warning <<EOM
+Implicit invocation of 'puppet apply' by passing files (or flags) directly
+to 'puppet' is deprecated, and will be removed in the 2.8 series. Please
+invoke 'puppet apply' directly in the future.
+EOM
+ ["apply", argv]
+ else
+ [argv.first, argv[1..-1]]
end
else
- [ zero, argv ]
+ [zero, argv]
end
end
end
end
end
+
+# REVISIT: Without this, we can't use the full Puppet suite inside the code,
+# but we can't include it before we get this far through defining things as
+# this code is the product of incestuous union with the global code; global
+# code at load scope depends on methods we define, while we only depend on
+# them at runtime scope. --daniel 2011-06-01
+require 'puppet'