diff options
author | Daniel Pittman <daniel@puppetlabs.com> | 2011-06-01 11:04:18 -0700 |
---|---|---|
committer | Daniel Pittman <daniel@puppetlabs.com> | 2011-06-01 11:25:44 -0700 |
commit | a23cfd869f90ae4456dded6e5a1c82719b128f01 (patch) | |
tree | f410cdd81b63f51b3faae2a1fdfcd4aae09b3e84 /lib/puppet/util/command_line.rb | |
parent | 3f47b0cce4436aa638e0b914ff8ab1c9fbf67552 (diff) | |
download | puppet-a23cfd869f90ae4456dded6e5a1c82719b128f01.tar.gz puppet-a23cfd869f90ae4456dded6e5a1c82719b128f01.tar.xz puppet-a23cfd869f90ae4456dded6e5a1c82719b128f01.zip |
(#7177) Deprecate implicit 'puppet apply' for 2.7.0
Back in prehistory (eg: 0.25 era), 'puppet' was the name for the agent, and
could be used directly to apply a manifest as well as to communicate with the
puppet master process.
During the 2.6 series we moved to a single binary, but continued to support
older scripts by detecting invocations that looked like the traditional
scripting uses and implicitly turning those into a call to 'puppet apply'.
Now, with the 2.7.0 release, we are moving to deprecate that behaviour. We
still do the same detection, and still run the old manifests, but we now
emit a deprecation warning directing people to use 'puppet apply' directly.
We intend to remove the behaviour entirely in the 2.8 release, which also
paves the way to nicer handling of the command line.
Reviewed-By: Randall Hansen <randall@puppetlabs.com>
Reviewed-By: Nick Fagerlund <nick.fagerlund@puppetlabs.com>
Diffstat (limited to 'lib/puppet/util/command_line.rb')
-rw-r--r-- | lib/puppet/util/command_line.rb | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/lib/puppet/util/command_line.rb b/lib/puppet/util/command_line.rb index c475dacc4..372aa5122 100644 --- a/lib/puppet/util/command_line.rb +++ b/lib/puppet/util/command_line.rb @@ -94,12 +94,27 @@ module Puppet if zero == 'puppet' case argv.first when nil then - # ttys get usage info - [stdin.tty? ? nil : "apply", argv] + 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]] @@ -112,3 +127,10 @@ module Puppet 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' |