summaryrefslogtreecommitdiffstats
path: root/lib/puppet/application
Commit message (Collapse)AuthorAgeFilesLines
* Fixed #5684 - Move to Apache 2.0 licenseJames Turnbull2011-04-1111-23/+11
| | | | | | | | | | | | | | For details of why we're moving please see: https://groups.google.com/d/topic/puppet-users/NuspYhMpE5o/discussion Removed explicit GPL licenses where appropriate Replaced selected GPL licenses with Apache 2.0 Replaced LICENSE with Apache 2.0 Updated README
* Fixing 'puppet faces' applicationLuke Kanies2011-04-091-16/+9
| | | | | | | | | | | It only had one available method, and the errors incorrectly specified what it was. This just defaults to listing all the time, and I've updated the docs to be correct, too. Signed-off-by: Luke Kanies <luke@puppetlabs.com> Reviewed-by: Daniel Pittman <daniel@puppetlabs.com>
* Merge puppet-interfaces into puppet.Daniel Pittman2011-04-0716-0/+334
|\ | | | | | | | | This joins the two repositories, including full history, into a single run, as well as landing the interfaces work on the next branch ready for release.
| * (#7012) Update references in code to use face(s)Daniel Pittman2011-04-075-28/+28
| | | | | | | | | | The codebase is now using the new name, faces, uniformly to reference the objects contained. All tests pass.
| * (#7012) global rename of strings to faces.Daniel Pittman2011-04-072-0/+0
| | | | | | | | | | | | | | | | This just changes filenames and directories; files are exact copies rather than having additional modifications to make clearer each step of this process. This does leave a currently broken build. :/
| * (#6972) Handle ca-location in the certificate string.Daniel Pittman2011-04-061-12/+3
| | | | | | | | | | | | | | | | | | | | | | | | This ports the existing certificate location configuration to be a string option, and then uses that to change the configuration. This will leak state between calls, which is somewhat unavoidable, but should at least get the basic stuff right for the CLI. We eventually need the CA string to be supported by a stateless internal CA implementation that allows us to do the right thing overall. Reviewed-By: Dan Bode <dan@puppetlabs.com>
| * (#6972) Recognize puppet global options in pre-parse.Daniel Pittman2011-04-061-1/+21
| | | | | | | | | | | | | | | | | | | | This extends the CLI pre-parse phase to identify both string *and* global options out of the Puppet settings/defaults system. This makes the regular CLI support for setting Puppet configuration globals work as expected. This moves us along the line of supporting these options more fully. Reviewed-By: Dan Bode <dan@puppetlabs.com>
| * (#6949) Fix passing positional arguments to actions.Daniel Pittman2011-04-041-6/+8
| | | | | | | | | | | | | | | | We had a logic failure that didn't pass positional arguments at all, but which our testing didn't verify. This entirely broke things. Now fixed, and a test added to ensure we don't bug out further... Reviewed-By: Pieter van de Bruggen <pieter@puppetlabs.com>
| * (#6749) Handle options with inline arguments.Daniel Pittman2011-04-041-1/+5
| | | | | | | | | | | | | | We didn't correctly handle '--foo=bar' as having supplied an argument during the pre-parse phase. Now we have a test for it, and a fix in the code. Reviewed-By: Nick Lewis <nick@puppetlabs.com>
| * (#6749) Extract the action from the arguments cleanly.Daniel Pittman2011-04-041-2/+6
| | | | | | | | | | | | | | | | | | This adds a test to verify that we are correctly removing the action name from the set of arguments passed to the string action, then cleans up the previous code so we don't need to mutilate the command line arguments: we can just extract it from the resultant set of information. Reviewed-By: Nick Lewis <nick@puppetlabs.com>
| * (#6749) Fix optional vs mandatory argument handling.Daniel Pittman2011-04-041-6/+5
| | | | | | | | | | | | | | | | | | | | optparse will treat '--foo --bar' as "foo with the argument --bar" when foo takes a mandatory argument. We need to emulate that behaviour in our pre-parse of the command line. Incidentally, fix up a bug in boolean options, and improve our testing. Reviewed-By: Nick Lewis <nick@puppetlabs.com>
| * (#6749) Polish the CLI option pre-parse implementationDaniel Pittman2011-04-041-11/+7
| | | | | | | | | | | | | | | | | | | | This improves handling of the pre-parse of the command line to be non-destructive, which cuts down the volume of garbage generated in the process. It also improves testing to verify that we get the darn thing right... Reviewed-By: Pieter van de Bruggen <pieter@puppetlabs.com>
| * (#6749) Start porting existing strings to the options API.Daniel Pittman2011-04-042-3/+3
| | | | | | | | | | | | | | | | This provides a solid test of the new code, by migrating the existing strings to match. This also gives us a chance to determine any weak points in the code as written. Reviewed-By: Pieter van de Bruggen <pieter@puppetlabs.com>
| * (#6749) code and test cleanup of Application/StringBase.Daniel Pittman2011-04-041-12/+0
| | | | | | | | | | | | | | This removes dead code now we have terminus in the base string, and disables some tests on StringBase app until they can be rewritten. Reviewed-By: Pieter van de Bruggen <pieter@puppetlabs.com>
| * (#6749) Remove "save does not work" language from strings.Daniel Pittman2011-04-041-1/+1
| | | | | | | | | | | | | | Now we are pushing into production we can eliminate this language, which was a legacy from the prototype that is no longer relevant globally. Reviewed-By: Pieter van de Bruggen <pieter@puppetlabs.com>
| * (#6749) string cli base: implement preinit CLI parsingDaniel Pittman2011-04-041-41/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | In order to identify the full set of options we need to know the action that is being invoked; that actually requires a pre-processing step to identify that out of the global options. Notably, our spec is that options can be to the right of their declaration point, but not to the left: that means that we can now extract the full set of options, and interact with the standard Puppet option handling code, resulting in at least vaguely saner behaviour... Reviewed-By: Pieter van de Bruggen <pieter@puppetlabs.com>
| * (#6749) implementing option handling in CLI string wrapperDaniel Pittman2011-04-042-14/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The purpose of this is to adapt the generic option support in our strings to the command line; we adapt the generic option information to optparse, and establish our environment early in the process to ensure that we can play nice with Puppet::Application for the moment. In the process we ensure that we detect, and report, conflicts in option naming across the board. Additionally, when an option is declared with multiple aliases, we insist that either all, or none, of them take an argument. To support this we support introspecting options having an optional argument, as well as documentation and all. Reviewed-By: Pieter van de Bruggen <pieter@puppetlabs.com>
| * (#6758) Pass options as an argument to string actions.Daniel Pittman2011-04-021-8/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Earlier in their implementation the String prototype would set global state on a String object to reflect options set on the command line. As we move strings away from a CLI-only prototype, this becomes troublesome because we can easily have, for example, HTTP access to a string, which means load balancers can really make this confusing. It also encourages global state pollution, where one invocation can adversely influence another. A better approach is that we pass options to the string action invocation directly; this makes the interaction stateless. Changes required to your code to adapt to the new world: - action(:foo) do |some, args| + action(:foo) do |some, args, options={}| if options[:whatever] then Reviewed-By: Pieter van de Bruggen <pieter@puppetlabs.com>
| * (#6770) Change versioning; adopt :current over :latest.Pieter van de Bruggen2011-03-281-2/+2
| | | | | | | | | | | | | | | | | | | | | | As per discussion with Luke, versions of an interface are first looked up by requiring 'puppet/interface/{name}', and secondarily looked up by requiring '{name}@{version}/puppet/interface/{name}' if the first failed. A version of `:current` can be used to represent the version living in 'puppet/interface/{name}'. Paired-With: Nick Lewis
| * MAINT: the API is officially named "string" as of this moment.Daniel Pittman2011-03-285-32/+32
| | | | | | | | | | | | | | Now that we have settled on the final public name for the API, "Puppet::String", mass-rename and mass-edit all the files to follow. Reviewed-By: Randall Hansen <randall@puppetlabs.com>
| * (#6770) Add support for version :latest.Pieter van de Bruggen2011-03-251-3/+3
| | | | | | | | | | | | | | | | | | Specifying a version of `:latest` will find the most recent version of the named interface installed in your RUBYLIB, and attempt to load that. This is unlikely to provide a stable dependency in the future, so should be used sparingly, acknowledging the dangers. Reviewed-By: Daniel Pittman
| * Merge branch 'tickets/master/6770'Pieter van de Bruggen2011-03-233-6/+7
| |\ | | | | | | | | | | | | | | | | | | Conflicts: lib/puppet/interface/certificate.rb spec/unit/application/interface_base_spec.rb spec/unit/interface/interface_collection_spec.rb
| | * (#6770) Rename Puppet::Interface::interface method.Pieter van de Bruggen2011-03-233-4/+4
| | | | | | | | | | | | | | | | | | | | | Puppet::Interface::interface is now Puppet::Interface::define, also aliased to Puppet::Interface::[] for convenience. Paired-With: Nick Lewis
| | * (#6770) Changing versioning to semver.Pieter van de Bruggen2011-03-233-5/+5
| | | | | | | | | | | | | | | | | | More information about the versioning scheme can be found at http://semver.org. Paired-With: Nick Lewis
| | * (#6770) Add basic versioning for interfaces.Pieter van de Bruggen2011-03-233-6/+7
| | | | | | | | | | | | Reviewed-By: Nick Lewis
| * | Added list action.Richard Crowley2011-03-231-0/+15
| | | | | | | | | | | | The common tasks of checking the --ca-location argument and becoming a CA process if necessary (that is, acting like a master) have been abstracted into the Application where they belong.
| * | Use the new name for the terminus.Richard Crowley2011-03-231-6/+1
| | |
| * | Factoring cert status app back into certificate.Richard Crowley2011-03-231-0/+13
| |/
| * maint: Implement an InterfaceCollection class to manage interfacesNick Lewis2011-03-221-5/+1
| | | | | | | | | | | | | | | | | | | | | | Having an instance variable on class Interface is insufficient for Interface::Indirector. This also changes the semantics of "Interface.interface" to handle registration and loading actions, and for "Interface.new" to only instantiate an Interface. Thus, consumers of the API should typically use "Interface.interface", unless they have reasons to not want an interface automatically registered. Paired-With: Pieter van de Bruggen
| * (#6786) Change interface storage and access.Pieter van de Bruggen2011-03-222-3/+4
| | | | | | | | | | | | | | | | | | | | | | Ruby's namespace mechanism introduced a number of problems, including incorrect name resolution for common and simple cases. Given that, we've refactored back to class-level data structures with accessor methods available. The current method names are unlikely to be the final UI. Reviewed-By: Daniel Pittman
| * (#6805) Add a "configurer" applicationNick Lewis2011-03-211-0/+23
| | | | | | | | | | | | | | | | | | This application is similar in basic functionality to the "agent" application, but implemented in terms of interfaces. It currently will retrieve facts, retrieve a catalog, apply the catalog, and submit a report. Options such as noop and daemonize are still to come. Reviewed-By: Pieter van de Bruggen
| * Fixing a load-order issue in Puppet::InterfaceLuke Kanies2011-03-212-2/+5
| | | | | | | | | | | | | | | | The application classes were having issues loading the Interface class in certain circumstances because of load order. This just pushes the loading as late as possible. Signed-off-by: Luke Kanies <luke@puppetlabs.com>
| * (#6785) Internal consistency for `--terminus`.Pieter van de Bruggen2011-03-211-3/+3
| | | | | | | | Paired-With: Richard Crowley
| * (#6786) Fixing a number of failing tests.Pieter van de Bruggen2011-03-212-2/+2
| | | | | | | | | | | | | | The initial merge of this branch hadn't actually been run against the full suite of specs; a number of specs began failing shortly afterward. Reviewed-By: Daniel Pittman
| * Adding a test for fix to #14Luke Kanies2011-03-021-1/+1
| | | | | | | | Signed-off-by: Luke Kanies <luke@puppetlabs.com>
| * (14) updated interface_base to support multiple command line argumentsDan Bode2011-03-011-1/+2
| |
| * Pretty-printing json using "jj"Luke Kanies2011-02-271-1/+6
| | | | | | | | Signed-off-by: Luke Kanies <luke@puppetlabs.com>
| * Fixing plugin usageLuke Kanies2011-02-242-7/+2
| | | | | | | | | | | | | | | | | | I had broken some usages of plugins by incorrectly selecting command-line arguments. The fix was to remove the #main method contained in the IndirectionBase subclass. Signed-off-by: Luke Kanies <luke@puppetlabs.com>
| * Adding Application options to InterfacesLuke Kanies2011-02-231-3/+7
| | | | | | | | | | | | | | | | | | | | | | | | This allows all of the actions to react to the CLI options. I've also removed the unnecessary 'name' variables I was using in various places - they were just the first of the arguments, and they weren't actually always names. Signed-off-by: Luke Kanies <luke@puppetlabs.com>
| * Adding render and exit_code override supportLuke Kanies2011-02-221-2/+16
| | | | | | | | | | | | | | This is mostly in response to feature requests from Dan. Signed-off-by: Luke Kanies <luke@puppetlabs.com>
| * Fixing 'puppet interface list'Luke Kanies2011-02-221-26/+4
| | | | | | | | | | | | | | Also added a test to hopefully confirm it won't break again. Signed-off-by: Luke Kanies <luke@puppetlabs.com>
| * Adding a simple "config" appLuke Kanies2011-02-221-0/+4
| | | | | | | | Signed-off-by: Luke Kanies <luke@puppetlabs.com>
| * Splitting the Application base classLuke Kanies2011-02-2214-51/+51
| | | | | | | | | | | | | | | | | | | | We now have an indirection_base class along with interface_base. I've also added some basic tests for most of the interfaces. Signed-off-by: Luke Kanies <luke@puppetlabs.com>
| * Switching Interfaces to be instancesLuke Kanies2011-02-221-2/+4
| | | | | | | | | | | | | | | | | | They were previously classes, which made a lot of things stupider than they needed to be. This will likely involve some porting, but not much. Signed-off-by: Luke Kanies <luke@puppetlabs.com>
| * Renaming 'data_baseclass' to 'interface_base'Luke Kanies2011-02-2213-25/+25
| | | | | | | | Signed-off-by: Luke Kanies <luke@puppetlabs.com>
| * Fixing Interface listingLuke Kanies2011-02-201-9/+33
| | | | | | | | | | | | It got broke when the Indirector base class was extracted. Signed-off-by: Luke Kanies <luke@puppetlabs.com>
| * (#3) Base application should catch SYSINTDan Bode2011-02-201-0/+8
| | | | | | | | We should exit cleanly rather than throw traces.
| * Only printing output if there is anyLuke Kanies2011-02-161-1/+1
| | | | | | | | Signed-off-by: Luke Kanies <luke@puppetlabs.com>
| * Enabling arbitrary interface namesLuke Kanies2011-02-163-5/+5
| | | | | | | | | | | | | | | | | | | | | | Previously the app, indirection, and interface names had to match exactly; now they can be arbitrary by just defining an overriding 'indirection_name' class method on the interface. I also renamed the file_bucket_file classes accordingly. Signed-off-by: Luke Kanies <luke@puppetlabs.com>
| * Fixing rendering to support arraysLuke Kanies2011-02-101-1/+2
| | | | | | | | | | | | | | This isn't 100% - it will probably only work for Yaml and JSON - but it's a good start. Signed-off-by: Luke Kanies <luke@puppetlabs.com>