Age | Commit message (Collapse) | Author | Files | Lines |
|
Previously, the logic for listing and requiring applications was in two
places, CommandLine and Application, respectively.
The CommandLine contained logic, basically duplicated from the
Autoloader, to walk a search path and generate a list unique
applications relative to 'puppet/application'.
The Application contained logic for requiring the application from
'puppet/application', duplicating the logic from CommandLine.
This commit moves the logic for listing available applications to the
Application class, which delegates to its autoloader. Note the
autoloader already takes gem and module paths into account, so no change
in functionality there.
This commit also deprecates the CommandLine available_subcomands
instance and class methods.
|
|
jeffmccune/fix/master/7316_load_faces_from_modulepath_try4"
This reverts commit bdda511d06ed6f89b58343e815585957a33db94e, reversing
changes made to 8f9699cee0d1028d538b0a26aa5bc885751b6d46.
Conflicts:
lib/puppet/settings/config_file.rb
|
|
into 3.x""
This reverts commit ef3fe695fd0be5ff2b5aeb563f34f62a0f503831.
|
|
Without this patch Ruby 1.9 is still complaining loudly about trying to
parse the spec files. The previous attempt to clean up this problem in
edc3ddf works for Ruby 1.8 but not 1.9.
I'd prefer to remove the shebang lines entirely, but doing so will cause
encoding errors in Ruby 1.9. This patch strives for a happy middle
ground of convincing Ruby it is actually working with Ruby while not
confusing it to think it should exec() to rspec.
This patch is the result of the following command run against the source
tree:
find spec -type f -print0 | \
xargs -0 perl -pl -i -e 's,^\#\!\s?/(.*)rspec,\#! /usr/bin/env ruby,'
|
|
This reverts commit b277bb3874ecd50e1cd6e600bf6d36e3240d5510, reversing
changes made to bdf193640701e9a107b1c6f6661499b31fdefb4d.
These changes are being backed out because they referenced a undefined
methods (`default_global_config_dir` and `default_global_var_dir`).
After fixing that locally, there was still a problem with `puppet help`
printing out a large number of warnings because it could not load face
code correctly.
I think we need to step back from this, re-evaluate what is happening,
and try a new approach.
|
|
This is a "revert-the-revert" commit.
This reverts commit 87ea7a8849f90a232f2bb683fb8a2ce1573a21db, reversing
changes made to 8dff14b9c5a3cdd99ede63dbcbb2dbe00b457926.
|
|
Revert the modulepath face loader change set for the following reason:
This change set is intended to load faces from the module path. It
works great... _if_ you explicitly set --confdir on the command line
like I do with my zsh puppet() function. If you don't, then it blows up
because the global for the confdir is set by defaults at a different
enough point in the code for us to overlook the issue.
If we invest in removing global state, specifically Puppet.settings, I
think we'll see a very quick return.
The confdir setting should be "available" for use at the same point,
regardless of where it comes from; defaults, puppet.conf, CLI, or
(hopefully) the environment.
This reverts commit 8b059a9a9e7c765d3050163ca59abeffe3e297b5, reversing
changes made to 7c3b620182602012b191a5b5ade7b1df5cbc8b19.
|
|
Without this patch Puppet does not search the modulepath lib
subdirectories for application subcommands. This is a problem because
face applications that aren't affected by #3947 should work.
This patch fixes the problem by searching through the modules along the
modulepath to find available subcommands in addition to those available
along the Ruby $LOAD_PATH and RubyGems $GEM_PATH.
Both legacy application files and modern face applications are loaded
from the modulepath with this patch.
This patch does _not_ add the module's `lib/` subdirectory to the
$LOAD_PATH, so issue #3947 will still affect face applications that
attempt to use `require` with library files inside the module.
|
|
* 2.7.x:
Use rspec 2.11 compatible block syntax
Conflicts:
spec/integration/faces/ca_spec.rb
spec/integration/network/server/mongrel_spec.rb
spec/unit/application_spec.rb
spec/unit/face/help_spec.rb
spec/unit/network/handler/fileserver_spec.rb
spec/unit/parser/functions/create_resources_spec.rb
spec/unit/provider/nameservice/directoryservice_spec.rb
spec/unit/type/file_spec.rb
spec/unit/type_spec.rb
|
|
In rspec 2.11, expectations on a block must take the form of expect...to or
lambda...should. Other combinations of those are no longer accepted. This
commit converts all mixed cases to use expect...to, as it seems to be the
preferred syntax now.
|
|
Without this patch applied the `puppet help` command displays nothing
but an exception when a 3rd party face throws an exception during the
loading process.
For example:
Error: Could not autoload puppet/face/node/classify: no such file to load -- fog
Error: Could not autoload puppet/face/node: Could not autoload puppet/face/node/classify: no such file to load -- fog
Error: Failed to load face node:
Error: Could not find version current of node
Error: Try 'puppet help help help' for usage
This is a problem because `puppet help` should be robust and provide helpful
information in all cases.
This patch fixes the problem by catching loading errors when building the list
of available face subcommands and their summaries. If an exception is caught,
it is handled by marking that face subcommand and presenting a message
indicating the face is unavailable in the help output.
This looks like:
Usage: puppet <subcommand> [options] <action> [options]
Available subcommands:
agent The puppet agent daemon
apply Apply Puppet manifests locally
ca Local Puppet Certificate Authority management.
catalog Compile, save, view, and convert catalogs.
cert Manage certificates and requests
certificate Provide access to the CA for certificate management.
certificate_request Manage certificate requests.
certificate_revocation_list Manage the list of revoked certificates.
config Interact with Puppet's configuration options.
describe Display help about resource types
device Manage remote network devices
doc Generate Puppet documentation and references
facts Retrieve and store facts.
file Retrieve and store files in a filebucket
filebucket Store and retrieve files in a filebucket
help Display Puppet help.
inspect Send an inspection report
instrumentation_data Manage instrumentation listener accumulated data.
instrumentation_listener Manage instrumentation listeners.
instrumentation_probe Manage instrumentation probes.
key Create, save, and remove certificate keys.
kick Remotely control puppet agent
man Display Puppet manual pages.
master The puppet master daemon
module Creates, installs and searches for modules on the Puppet Forge.
! node ! Subcommand unavailable due to error. Check error logs.
! node_aws ! Subcommand unavailable due to error. Check error logs.
! node_vmware ! Subcommand unavailable due to error. Check error logs.
parser Interact directly with the parser.
plugin Interact with the Puppet plugin system.
queue Queuing daemon for asynchronous storeconfigs
report Create, display, and submit reports.
resource The resource abstraction layer shell
resource_type View classes, defined resource types, and nodes from all manifests.
secret_agent Mimics puppet agent.
status View puppet server status.
See 'puppet help <subcommand> <action>' for help on a specific subcommand action.
See 'puppet help <subcommand>' for help on a specific subcommand.
Puppet v3.0.0
This patch also contains two squashed commits from Andy Parker
* Cleaned up help action by extracting methods
* Split apart things to stop mingling concerns
|
|
Without this patch some spec files are using `ruby -S rspec` and others
are using `rspec`.
We should standardize on a single form of the interpreter used for spec
files.
`ruby -S rspec` is the best choice because it correctly informs editors
such as Vim with Syntastic that the file is a Ruby file rather than an
Rspec file.
|
|
This commit does the following:
1. Fix the help face so that--in the case where there exists both an
App and a Face by the same name, and the App is not just a stub for the
Face--help gives preference to the App instead of the Face. The help
face (as a command line tool) is mostly going to be used to help
users navigate the other command line tools, so, e.g.,
"puppet help resource" should show help for the same tool that you
will get by running "puppet resource". This was not the case
prior to this commit.
2. Get rid of the separation between faces and applications in the
help screen... making this distinction seems more confusing than
helpful to the users, and exposes implementation details that
users should not need to be concerned with.
3. Change all class names for Applications to conform to the
convention of "foo_bar" file names mapping to "FooBar" class names.
|
|
Iterating over faces outside of a test causes problems because the run mode is
not set properly. Moving this inside of actual test cases allows the spec
helper to fake any necessary setup.
Changes due to Chris Price
|
|
A whole pile of spec files for faces were not pulling in the regular
spec_helper, or the puppet/face library before they used it. This worked fine
by coincidence when they ran together, but blew up if run separately.
Reviewed-By: Jesse Wolf <jesse@puppetlabs.com>
|
|
'remotes/lak/tickets/next/7118-summaries_for_all_faces' into 2.7.x
Fix conflicts due to version drift in:
lib/puppet/face/certificate.rb
lib/puppet/face/facts.rb
lib/puppet/face/node.rb
lib/puppet/face/secret_agent.rb
spec/lib/puppet/face/basetest.rb
spec/unit/face/help_spec.rb
Reviewed-By: Markus Roberts <markus@puppetlabs.com>
|
|
We had a pending test for this, but forgot to write it way back when we were
implementing the feature. Add it now.
Reviewed-By: Max Martin <max@puppetlabs.com>
|
|
We were generating the help output multiple times and testing it for multiple
properties; now we generate it once and test it multiple times. This makes
for less clear error reporting, but saving dozens of calls at ~ 1/3rd a second
each is worth it.
Paired-With: Max Martin <max@puppetlabs.com>
|
|
It's usually just a one-liner, but when I saw an
obvious opportunity for longer docs, I've added a
@longdocs variable that can be converted to longer
forms when ready.
Signed-off-by: Luke Kanies <luke@puppetlabs.com>
|
|
We now use a shebang of: #!/usr/bin/env rspec
This enables the direct execution of spec tests again, which was lost earlier
during the transition to more directly using the rspec2 runtime environment.
|
|
After some discussion we decided that most uses of the Puppet Face
infrastructure were about single faces on their own, not about the collection,
and so we were better referring to Puppet::Face[...] in code.
This implements that by translating names and references in the Ruby code to
the new, s-less, name.
|