diff options
481 files changed, 20409 insertions, 8696 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000000..0eb223c539 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,28 @@ +# Chef Client Changelog + +## Unreleased + +* Improves syntax check speed for Ruby 1.9+, especially when using bundler. +* Send X-Remote-Request-Id header in order to be able to correlate actions during a single run. +* Fix for CHEF-5048. +* Fix for CHEF-5052. +* Fix for CHEF-5018. +* Add --validator option to `knife client create` to be able to create validator clients via knife. +* Add --force option to `knife client delete` in order to prevent accidental deletion of validator clients. +* Add -r / --runlist option to chef-client which permanently sets or changes the run_list of a node. +* CHEF-5030: clean up debian ifconfig provider code +* CHEF-5001: spec tests for multiple rollbacks +* Added ohai7 'machinename' attribute as source of `node_name` information +* CHEF-4773: add ruby-shadow support to Mac and FreeBSD distros +* Service Provider for MacOSX now supports `enable` and `disable` +* CHEF-5086: Add reboot_pending? helper to DSL +* Upgrade ohai to 7.0.0.rc.0 +* Make the initial bootstrap message more user friendly (CHEF-5102) +* Correctly handle exceptions in formatters when exception.message is nil (CHEF-4743) +* Fix convergence message in deploy provider (CHEF-4929) +* Make group resource idempotent when gid is specified as a string. (CHEF-4927) +* Non-dupable elements are now handled when duping attribute arrays. (CHEF-4799) + +## Last Release: 11.10.0 (02/06/2014) + +http://docs.opscode.com/release/11-10/release_notes.html diff --git a/CHEF_MVPS.md b/CHEF_MVPS.md new file mode 100644 index 0000000000..dfd0985bba --- /dev/null +++ b/CHEF_MVPS.md @@ -0,0 +1,84 @@ +### Chef is proud of our community! + +Every release of Chef we pick someone from the community to name as the Most Valuable Player for that release. It could be someone who provided a big feature, reported a security vulnerability, or someone doing great things in the community that we want to highlight. + +#### Hall of Fame + +After receiving three MVP awards, we add someone to the hall of fame. We want to express our gratitude to their continuing participation and give newer community members the opportunity to be reconignized. + +* Matthew Kent +* Doug MacEachern +* Tollef Fog Heen +* Thom May +* Bryan Berry +* Bryan McLellan + +#### The MVP recipients + +| Release | Date | MVP | +|---------|------|-----| +| [Client 11.10.4](http://www.getchef.com/blog/2014/02/20/chef-client-patch-release-11-10-4/) | 2014-02-20 | Jon Cowie | +| [Client 11.10.2](http://www.getchef.com/blog/2014/02/18/chef-client-release-11-10-2-10-30-4/) | 2014-02-18 | Eric Tucker | +| [Client 11.10.0](http://www.getchef.com/blog/2014/02/06/chef-client-11-10-0-release/) | 2014-02-06 | Nikhil Benesch | +| [Client 11.8.2](http://www.getchef.com/blog/2013/12/06/release-chef-client-10-30-2-11-8-2-mixlib-shellout-1-3-0/) | 2013-12-06 | James Ogden | +| [Client 11.8.0](http://www.opscode.com/blog/2013/10/31/release-chef-client-11-8-0-ohai-6-20-0/) | 2013-10-31 | Eric Saxby | +| [Client 11.6.2](http://www.getchef.com/blog/2013/10/08/release-chef-client-11-6-2-10-28-2/) | 2013-10-08 | Jeff Blaine | +| [Client 11.6.0](http://www.opscode.com/blog/2013/07/23/chef-client-11-6-0-ohai-6-18-0-and-more/) | 2013-07-23 | Jesse Campbell | +| [Client 11.4.0](http://www.opscode.com/blog/2013/02/13/chef-client-11-4-0-10-22-0-released/) | 2013-02-13 | Vaidas Jablonskis | +| [Client 11.2.0](http://www.opscode.com/blog/2013/02/07/chef-client-11-2-0-10-20-0-released/) | 2013-02-06 | Mike Javorski | +| [Chef 11.0.0](http://www.opscode.com/blog/2013/02/04/chef-11-released/) | 2013-02-04 | Andrea Campi, Bryan Berry | +| [Chef 10.30.4](http://www.getchef.com/blog/2014/02/18/chef-client-release-11-10-2-10-30-4/) | 2014-02-18 | Christopher Laco | +| [Chef 10.30.2](http://www.getchef.com/blog/2013/12/06/release-chef-client-10-30-2-11-8-2-mixlib-shellout-1-3-0/) | 2013-12-06 | Phil Dibowitz | +| [Chef 10.28.2](http://www.getchef.com/blog/2013/10/08/release-chef-client-11-6-2-10-28-2/) | 2013-10-08 | Jeff Blaine | +| [Chef 10.28.0](http://www.opscode.com/blog/2013/09/03/chef-10-28-0-released/) | 2013-09-03 | Jeff Blaine | +| [Chef 10.26.0](http://www.opscode.com/blog/2013/05/08/chef-10-26-0-released/) | 2013-05-08 | Ranjib Dey | +| [Chef 10.24.0](http://www.opscode.com/blog/2013/02/15/chef-server-11-0-6-and-10-24-0-released/) | 2013-02-15 | Anthony Goddard | +| [Chef 10.22.0](http://www.opscode.com/blog/2013/02/13/chef-client-11-4-0-10-22-0-released/) | 2013-02-13 | Brian Bianco | +| [Chef 10.20.0](http://www.opscode.com/blog/2013/02/07/chef-client-11-2-0-10-20-0-released/) | 2013-02-06 | Chris Roberts | +| [Chef 10.18.2](http://www.opscode.com/blog/2013/01/18/chef-10-18-2-bugfix-release/) | 2013-01-18 | Fletcher Nichol | +| [Chef 10.18.0](http://www.opscode.com/blog/2013/01/16/chef-10-18-0-released/) | 2013-01-16 | Xabier de Zuazo | +| [Chef 10.16.6](http://www.opscode.com/blog/2013/01/11/chef-10-16-6-security-release/) | 2013-01-11 | Dan Kubb | +| [Chef 10.16.4](http://www.opscode.com/blog/2012/12/26/chef-10-16-4-released/) | 2012-12-26 | Avishai Ish-Shalom | +| [Chef 10.16.2](http://www.opscode.com/blog/2012/10/26/chef-10-16-2-released/) | 2012-10-26 | Jamie Winsor | +| [Chef 10.16.0](http://www.opscode.com/blog/2012/10/22/chef-10-16-0-released/) | 2012-10-22 | John Dewey | +| [Chef 10.14.4](http://www.opscode.com/blog/2012/09/28/chef-10-14-4-released/) | 2012-09-27 | Kendrick Martin | +| [Chef 10.14.2](http://www.opscode.com/blog/2012/09/11/chef-10-14-2-released/) | 2012-09-10 | Phil Dibowitz, Tim Smith | +| [Chef 10.14.0](http://www.opscode.com/blog/2012/09/07/chef-10-14-0-released/) | 2012-09-07 | Xabier de Zuazo | +| [Chef 10.12.0](http://www.opscode.com/blog/2012/06/19/chef-10-12-0-released/) | 2012-06-18 | Chris Roberts | +| [Chef 0.10.10](http://www.opscode.com/blog/2012/05/11/chef-0-10-10-released/) | 2012-05-11 | Juanje Ojeda, Igor Afonov | +| [Chef 0.10.8](http://www.opscode.com/blog/2011/12/15/chef-0-10-8-released/) | 2011-12-15 | Bryan Berry | +| [Chef 0.10.6](http://www.opscode.com/blog/2011/12/14/chef-0-10-6-released/) | 2011-12-13 | Andrea Campi | +| [Chef 0.10.4](http://www.opscode.com/blog/2011/08/11/chef-0-10-4-released/) | 2011-08-11 | Matthew Kent | +| [Chef 0.10.2](http://www.opscode.com/blog/2011/06/29/chef-0-10-2-and-0-9-18-released/) | 2011-06-29 | Daniel Oliver | +| [Chef 0.10.0](http://www.opscode.com/blog/2011/05/02/chef-0-10-0-released/) | 2011-05-02 | Grace Mollison, Darrin Eden | +| [Chef 0.9.18](http://www.opscode.com/blog/2011/06/29/chef-0-10-2-and-0-9-18-released/) | 2011-06-29 | Jesai Langenbach | +| [Chef 0.9.16](http://www.opscode.com/blog/2011/04/15/chef-0-9-16-released/) | 2011-04-15 | Michael Leinartas | +| [Chef 0.9.14](http://www.opscode.com/blog/2011/03/04/chef-0-9-14-released/) | 2011-03-04 | Gilles Devaux | +| [Chef 0.9.12](http://www.opscode.com/blog/2010/10/22/chef-0-9-12-released/) | 2010-10-22 | Laurent Désarmes | +| [Chef 0.9.10](http://www.opscode.com/blog/2010/10/19/chef-0-9-10-ohai-0-5-8-and-mixliblog-1-2-0-released/) | 2010-10-19 | Toomas Pelberg, Tommy Bishop | +| [Chef 0.9.8](http://www.opscode.com/blog/2010/08/05/chef-0-9-8-and-mixlib-authentication-1-1-4-released/) | 2010-08-05 | Joe Williams | +| [Chef 0.9.6](http://www.opscode.com/blog/2010/07/03/chef-0-9-6-released/) | 2010-07-03 | Caleb Tennis | +| [Chef 0.9.4](http://www.opscode.com/blog/2010/06/30/chef-0-9-4-released/) | 2010-06-30 | Ian Meyer | +| [Chef 0.9.0](http://www.opscode.com/blog/2010/06/21/chef-0-9-0-and-ohai-0-5-6-released/) | 2010-06-21 | Doug MacEachern | +| [Chef 0.8.16](http://www.opscode.com/blog/2010/05/11/chef-0-8-16-and-ohai-0-5-4-release/) | 2010-05-11 | Akzhan Abdulin | +| [Chef 0.8.14](http://www.opscode.com/blog/2010/05/07/chef-0-8-14-release/) | 2010-05-07 | Renaud Chaput | +| [Chef 0.8.10](http://www.opscode.com/blog/2010/04/02/chef-0-8-10-release/) | 2010-04-02 | Thom May, Tollef Fog Heen | +| [Chef 0.8.8](http://www.opscode.com/blog/2010/03/18/chef-0-8-8-release/) | 2010-03-18 | Eric Hankins | +| [Chef 0.8.6](http://www.opscode.com/blog/2010/03/05/chef-0-8-6-release/) | 2010-03-05 | Ian Meyer | +| [Chef 0.8.4](http://www.opscode.com/blog/2010/03/02/chef-0-8-4-release/) | 2010-03-02 | Tollef Fog Heen | +| [Chef 0.8.2](http://www.opscode.com/blog/2010/03/01/chef-0-8-2-release/) | 2010-03-01 | Scott M. Likens | +| [Chef 0.7.16](http://www.opscode.com/blog/2009/12/22/chef-0-7-16-release/) | 2009-12-22 | Bryan McLellan | +| [Chef 0.7.14](http://www.opscode.com/blog/2009/10/26/chef-0-7-14-ohai-0-3-6-releases/) | 2009-10-16 | Thom May | +| [Chef 0.7.12](http://www.opscode.com/blog/2009/10/06/chef-0-7-12rc0-ohai-0-3-4rc0-releases/) | 2009-10-06 | Diego Algorta | +| [Chef 0.7.10](http://www.opscode.com/blog/2009/09/04/chef-0-7-10-release/) | 2009-09-04 | Dan DeLeo | +| [Chef 0.7.8](http://www.opscode.com/blog/2009/08/13/chef-0-7-8-release/) | 2009-08-13 | Jeppe Nejsum Madsen | +| [Chef 0.7.6](http://www.opscode.com/blog/2009/08/08/chef-0-7-6-release/) | 2009-08-08 | Grant Zanetti | +| [Chef 0.7.4](http://www.opscode.com/blog/2009/06/26/back-to-back-chef-0-7-2-and-chef-0-7-4-released/) | 2009-06-26 | Hongli Lai | +| [Chef 0.7.2](http://www.opscode.com/blog/2009/06/26/back-to-back-chef-0-7-2-and-chef-0-7-4-released/) | 2009-06-26 | Joshua Sierles | +| [Chef 0.7.0](http://www.opscode.com/blog/2009/06/10/chef-0-7-0-release/) | 2009-06-10 | Matthew Kent | +| [Chef 0.6.2](http://www.opscode.com/blog/2009/04/29/chef-0-6-2-release/) | 2009-04-29 | David Balatero | +| [Chef 0.6.0](http://www.opscode.com/blog/2009/04/29/chef-0-6-0-release/) | 2009-04-29 | Matthew Kent | +| [Chef 0.5.6](http://www.opscode.com/blog/2009/03/06/chef-0-5-6/) | 2009-03-06 | Sean Cribbs | +| [Chef 0.5.4](http://www.opscode.com/blog/2009/02/13/chef-0-5-4/) | 2009-02-13 | Arjuna Christensen | +| [Chef 0.5.2](http://www.opscode.com/blog/2009/02/01/chef-0-5-2-and-ohai-0-1-4/) | 2009-02-01 | Bryan McLellan | + diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 523fadc45f..9d9839fd5c 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -24,7 +24,7 @@ Chef uses the Apache 2.0 license to strike a balance between open contribution a The license tells you what rights you have that are provided by the copyright holder. It is important that the contributor fully understands what rights they are licensing and agrees to them. Sometimes the copyright holder isn't the contributor, most often when the contributor is doing work for a company. -To make a good faith effort to ensure these criteria are met, Opscode requires a Contributor License Agreement (CLA) or a Corporate Contributor License +To make a good faith effort to ensure these criteria are met, Chef requires a Contributor License Agreement (CLA) or a Corporate Contributor License Agreement (CCLA) for all contributions. This is without exception due to some matters not being related to copyright and to avoid having to continually check with our lawyers about small patches. @@ -74,7 +74,7 @@ helpful to be clear about your use case and change so they can understand it eve ### Github and Pull Requests -All of Opscode's open source projects are available on [Github](http://www.github.com/opscode). +All of Chef's open source projects are available on [Github](http://www.github.com/opscode). We don't require you to use Github, and we will even take patch diffs attached to tickets on the tracker. However Github has a lot of convenient features, such as being able to see a diff of changes between a @@ -115,7 +115,7 @@ and accounting for it. ## Code Review -Opscode regularly reviews code contributions and provides suggestions for improvement in the code itself or the implementation. +Chef regularly reviews code contributions and provides suggestions for improvement in the code itself or the implementation. We find contributions by searching the ticket tracker for _resolved_ tickets with a status of _fixed_. If we have feedback we will reopen the ticket and you should resolve it again when you've made the changes or have a response to our feedback. When we believe @@ -134,14 +134,14 @@ The versioning for the Chef project is X.Y.Z. * Y is a minor release, which adds both new features and bug fixes * Z is a patch release, which adds just bug fixes -Major releases and have historically been once a year. Minor releases for Chef average every two months and patch releases come as needed. +Major releases have historically been once a year. Minor releases for Chef average every three months and patch releases come as needed. There are usually beta releases and release candidates (RC) of major and minor releases announced on the [chef-dev mailing list](http://lists.opscode.com/sympa/info/chef-dev). Once an RC is released, we wait at least three days to allow for testing for regressions before the final release. If a blocking regression is found then another RC is made containing the fix and the timer is reset. -Once the official release is made, the release notes are available on the [Opscode blog](http://www.opscode.com/blog). +Once the official release is made, the release notes are available on the [Chef blog](http://www.getchef.com/blog). ## Working with the community @@ -151,5 +151,5 @@ These resources will help you learn more about Chef and connect to other members * #chef and #chef-hacking IRC channels on irc.freenode.net * [Community Cookbook site](http://community.opscode.com) * [Chef wiki](http://wiki.opscode.com/display/chef) -* Opscode Chef [product page](http://www.opscode.com/chef) +* Chef [product page](http://www.getchef.com/chef) diff --git a/CONTRIBUTIONS.md b/CONTRIBUTIONS.md new file mode 100644 index 0000000000..2a1bd70da6 --- /dev/null +++ b/CONTRIBUTIONS.md @@ -0,0 +1,13 @@ +<!--- +This file is reset every time a new release is done. The contents of this file are for the currently unreleased version. + +Example Contribution: +* **kalistec**: Improved file resource greatly. +--> +# Chef Client Contributions: + +* **jonlives**: Changed the order of recipe and cookbook name setting. Fixes CHEF-5052. +* **jaymzh**: Added support for `enable` and `disable` to MacOSX service provider. +* **bossmc**: Made formatters more resilient to nil exception messages. +* **valodzka**: Fixed the convergence message in deploy provider. +* **brugidou**: Made attribute arrays able to handle non-dupable elements while being duped. diff --git a/DOC_CHANGES.md b/DOC_CHANGES.md new file mode 100644 index 0000000000..6380b22753 --- /dev/null +++ b/DOC_CHANGES.md @@ -0,0 +1,21 @@ +<!--- +This file is reset every time a new release is done. This file describes changes that have not yet been released. + +Example Doc Change: +### Headline for the required change +Description of the required change. +--> + +# Chef Client Doc Changes: + +### --validator option for `knife client create` +Boolean value. If set to true, knife creates a validator client o.w. it creates a user client. Default is false. + +### --force for `knife client delete` +Option that is required to be specified if user is attempting to delete a validator client. No effect while deleting a user client. + +### -r / --runlist option for chef-client +Option similar to `-o` which sets or changes the run_list of a node permanently. + +### OHAI 7 Upgrade +Unless there are major issues, 11.12.0 will include OHAI 7. We already have ohai 7 docs in place. We probably need to add some notes to ohai 6 notes that one should now use the newer version when possible. @@ -4,7 +4,6 @@ gemspec :name => "chef" gem "activesupport", "< 4.0.0", :group => :compat_testing, :platform => "ruby" group(:docgen) do - gem "ronn" gem "yard" end @@ -12,7 +11,7 @@ group(:development, :test) do gem "simplecov" gem 'rack', "~> 1.5.1" - gem 'ruby-shadow', :platforms => :ruby unless RUBY_PLATFORM.downcase.match(/(darwin|freebsd|aix|cygwin)/) + gem 'ruby-shadow', :platforms => :ruby unless RUBY_PLATFORM.downcase.match(/(aix|cygwin)/) end # If you want to load debugging tools into the bundle exec sandbox, @@ -1,5 +1,7 @@ # Chef +Want to try Chef? Get started with [learnchef](https://learnchef.opscode.com) + * Documentation: [http://docs.opscode.com](http://docs.opscode.com) * Source: [http://github.com/opscode/chef/tree/master](http://github.com/opscode/chef/tree/master) * Tickets/Issues: [http://tickets.opscode.com](http://tickets.opscode.com) @@ -9,62 +11,81 @@ Chef is a configuration management tool designed to bring automation to your entire infrastructure. -The [Chef Wiki](http://wiki.opscode.com/display/chef/Home) is the definitive -source of user documentation. +This README focuses on developers who want to modify Chef source code. +If you just want to use Chef, check out these resources: -This README focuses on developers who want to modify Chef source code. For -users who just want to run the latest and greatest Chef development version in -their environment, see the -[Installing Chef from HEAD](http://wiki.opscode.com/display/chef/Installing+Chef+from+HEAD) -page on the wiki. +* [learnchef](https://learnchef.opscode.com): Getting started guide +* [http://docs.opscode.com](http://docs.opscode.com): Comprehensive User Docs +* [Installer Downloads](http://www.getchef.com/chef/install/): Install Chef as a complete package -## Contributing/Development +## Installing From Git -Before working on the code, if you plan to contribute your changes, you need to -read the -[Opscode Contributing document](http://wiki.opscode.com/display/chef/How+to+Contribute). +**NOTE:** Unless you have a specific reason to install from source (to +try a new feature, contribute a patch, or run chef on an OS for which no +package is available), you should head to the [installer page](http://www.getchef.com/chef/install/) +to get a prebuilt package. -You will also need to set up the repository with the appropriate branches. We -document the process on the -[Working with Git](http://wiki.opscode.com/display/chef/Working+with+git) page -of the Chef wiki. +### Prerequisites -Once your repository is set up, you can start working on the code. We do use -TDD with RSpec, so you'll need to get a development environment running. +Install these via your platform's preferred method (apt, yum, ports, +emerge, etc.): -### Requirements +* git +* C compiler, header files, etc. On Ubuntu/debian, use the + `build-essential` package. +* ruby 1.8.7 or later (1.9.3+ recommended) +* rubygems +* bundler -Ruby 1.8.7+ (As of 2012-05-25 Ruby 1.8.6 should still work, except for CHEF-2329.) +### Chef Installation -### Environment +Then get the source and install it: -In order to have a development environment where changes to the Chef code can -be tested, we'll need to install a few things after setting up the Git -repository. + # Clone this repo + git clone https://github.com/opscode/chef.git + + # cd into the source tree + cd chef -#### Non-Gem Dependencies + # Install dependencies with bundler + bundle install -Install these via your platform's preferred method; for example apt, yum, -ports, emerge, etc. + # Build a gem + rake gem -* [Git](http://git-scm.com/) -* GCC and C Standard Libraries, header files, etc. (i.e., build-essential on -debian/ubuntu) -* Ruby development package + # Install the gem you just built + gem install pkg/chef-VERSION.gem -#### Runtime Rubygem Dependencies -First you'll need [bundler](http://github.com/carlhuda/bundler) which can -be installed with a simple `gem install bundler`. Afterwords, do the following: +## Contributing/Development - bundle install +Before working on the code, if you plan to contribute your changes, you need to +read the +[Chef Contributions document](http://docs.opscode.com/community_contributions.html). + +You will also need to set up the repository with the appropriate branches. We +document the process on the +[Working with Git](http://wiki.opscode.com/display/chef/Working+with+git) page +of the Chef wiki. + +Once your repository is set up, you can start working on the code. We do use +TDD with RSpec, so you'll need to get a development environment running. +Follow the above procedure ("Installing from Git") to get your local +copy of the source running. ## Testing We use RSpec for unit/spec tests. It is not necessary to start the development environment to run the specs--they are completely standalone. - rake spec + # Run All the Tests + bundle exec rake spec + + # Run a Single Test File + bundle exec rspec spec/PATH/TO/FILE_spec.rb + + # Run a Subset of Tests + bundle exec rspec spec/PATH/TO/DIR # License @@ -73,7 +94,7 @@ Chef - A configuration management system | | | |:---------------------|:-----------------------------------------| | **Author:** | Adam Jacob (<adam@opscode.com>) -| **Copyright:** | Copyright (c) 2008-2012 Opscode, Inc. +| **Copyright:** | Copyright (c) 2008-2014 Chef Software, Inc. | **License:** | Apache License, Version 2.0 Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md new file mode 100644 index 0000000000..12077a92a0 --- /dev/null +++ b/RELEASE_NOTES.md @@ -0,0 +1,33 @@ +<!--- +This file is reset every time a new release is done. The contents of this file are for the currently unreleased version. + +Example Note: + +## Example Heading +Details about the thing that changed that needs to get included in the Release Notes in markdown. +--> +# Chef Client Release Notes: + +#### reboot_pending? + +We have added a ```reboot_pending?``` method to the recipe DSL. This method returns true or false if the operating system +has a rebooting pending due to updates and a reboot being necessary to complete the installation. It does not report if a reboot has been requested, e.g. if someone has scheduled a restart using shutdown. It currently supports Windows and Ubuntu Linux. + +``` +Chef::Log.warn "There is a pending reboot, which will affect this Chef run" if reboot_pending? + +execute "Install Application" do + command 'C:\application\setup.exe' + not_if { reboot_pending? } +end +``` + +#### OHAI 7 + +After spending 3 months in the RC stage, OHAI 7 is now included in Chef Client 11.10.0. Note that Chef Client 10.32.0 still includes OHAI 6. + +For more information about the changes in OHAI 7 please see our previous blog post [here](http://www.getchef.com/blog/2014/01/20/ohai-7-0-release-candidate/). + +# Chef Client Breaking Changes: + +None. @@ -26,31 +26,11 @@ require './tasks/rspec.rb' GEM_NAME = "chef" -# This has to be here or else the docs get generated *after* the gem is created -task :gem => 'docs:all' - Dir[File.expand_path("../*gemspec", __FILE__)].reverse.each do |gemspec_path| gemspec = eval(IO.read(gemspec_path)) Gem::PackageTask.new(gemspec).define end -begin - require 'sdoc' - - Rake::RDocTask.new do |rdoc| - rdoc.title = "Chef Ruby API Documentation" - rdoc.main = "README.rdoc" - rdoc.options << '--fmt' << 'shtml' # explictly set shtml generator - rdoc.template = 'direct' # lighter template - rdoc.rdoc_files.include("README.rdoc", "LICENSE", "spec/tiny_server.rb", "lib/**/*.rb") - rdoc.rdoc_dir = "rdoc" - end -rescue LoadError - puts "sdoc is not available. (sudo) gem install sdoc to generate rdoc documentation." -rescue TypeError - puts "sdoc is not working on ruby-2.0.0 and throwing an odd TypeError, rdoc generation will be disabled on ruby 2.0 until that gets fixed." -end - task :install => :package do sh %{gem install pkg/#{GEM_NAME}-#{Chef::VERSION}.gem --no-rdoc --no-ri} end @@ -68,61 +48,6 @@ task :ship => :gem do end end -RONN_OPTS = "--manual='Chef Manual' --organization='Chef #{Chef::VERSION}' --date='#{Time.new.strftime('%Y-%m-%d')}'" - -namespace :docs do - desc "Regenerate HTML manual from markdown" - task :html - - desc "Regenerate help topics from man pages" - task :list do - topics = Array.new - - Dir['distro/common/man/man1/*.1'].each do |man| - topics << File.basename(man, '.1') - end - - File.open('lib/chef/knife/help_topics.rb', 'w') do |f| - f.puts "# Do not edit this file by hand" - f.puts "# This file is autogenerated by the docs:list rake task from the available manpages\n\n" - - f.puts "HELP_TOPICS = #{topics.inspect}" - end - end - - # we can have ronn in the path, but not in the bundle, require both - ronn_in_bundle = true - begin - require 'ronn' - rescue LoadError - ronn_in_bundle = false - end - - if ronn_in_bundle && system('which ronn > /dev/null') - ['distro/common/markdown/man1/*.mkd', 'distro/common/markdown/man8/*.mkd'].each do |dir| - Dir[dir].each do |mkd| - basename = File.basename(mkd, '.mkd') - if dir =~ /man1/ - htmlfile = "distro/common/html/#{basename}.1.html" - elsif dir =~ /man8/ - htmlfile = "distro/common/html/#{basename}.8.html" - end - - file(htmlfile => [mkd, 'lib/chef/version.rb']) do - sh "ronn -5 #{RONN_OPTS} --style=toc #{mkd} --pipe > #{htmlfile}" - end - task :html => htmlfile - end - end - else - puts "get with the program and install ronn" - end - - task :all => [:list, :html] -end - -task :docs => "docs:all" - begin require 'yard' DOC_FILES = [ "README.rdoc", "LICENSE", "spec/tiny_server.rb", "lib/**/*.rb" ] diff --git a/chef.gemspec b/chef.gemspec index a9b757f336..2724a2aa2b 100644 --- a/chef.gemspec +++ b/chef.gemspec @@ -16,8 +16,8 @@ Gem::Specification.new do |s| s.add_dependency "mixlib-cli", "~> 1.4" s.add_dependency "mixlib-log", "~> 1.3" s.add_dependency "mixlib-authentication", "~> 1.3" - s.add_dependency "mixlib-shellout", "~> 1.2" - s.add_dependency "ohai", "~> 6.0" + s.add_dependency "mixlib-shellout", "~> 1.3" + s.add_dependency "ohai", "= 7.0.0.rc.0" s.add_dependency "rest-client", ">= 1.0.4", "< 1.7.0" # rest-client has an unbounded dependency on mime-types. @@ -41,8 +41,8 @@ Gem::Specification.new do |s| s.add_dependency "pry", "~> 0.9" - %w(rdoc sdoc rake rack rspec_junit_formatter).each { |gem| s.add_development_dependency gem } - %w(rspec-core rspec-expectations rspec-mocks).each { |gem| s.add_development_dependency gem, "~> 2.13.0" } + %w(rake rack rspec_junit_formatter).each { |gem| s.add_development_dependency gem } + %w(rspec-core rspec-expectations rspec-mocks).each { |gem| s.add_development_dependency gem, "~> 2.14.0" } s.bindir = "bin" # chef-service-manager is a windows only executable. diff --git a/distro/common/html/_sources/ctl_chef_client.txt b/distro/common/html/_sources/ctl_chef_client.txt new file mode 100644 index 0000000000..99b0037154 --- /dev/null +++ b/distro/common/html/_sources/ctl_chef_client.txt @@ -0,0 +1,36 @@ +===================================================== +chef-client +===================================================== + +.. include:: ../../includes_chef_client/includes_chef_client.rst + +.. include:: ../../includes_ctl_chef_client/includes_ctl_chef_client.rst + +.. note:: .. include:: ../../includes_config/includes_config_rb_client.rst + +Options +===================================================== +.. include:: ../../includes_ctl_chef_client/includes_ctl_chef_client_11-8_options.rst + +Run with Elevated Privileges +===================================================== +.. include:: ../../includes_ctl_chef_client/includes_ctl_chef_client_elevated_privileges.rst + +Linux +----------------------------------------------------- +.. include:: ../../includes_ctl_chef_client/includes_ctl_chef_client_elevated_privileges_linux.rst + +Windows +----------------------------------------------------- +.. include:: ../../includes_ctl_chef_client/includes_ctl_chef_client_elevated_privileges_windows.rst + +Examples +===================================================== + +**Start a Chef run when the chef-client is running as a daemon** + +.. include:: ../../step_ctl_chef_client/step_ctl_chef_client_start_chef_run_daemon.rst + +**Start a Chef run manually** + +.. include:: ../../step_ctl_chef_client/step_ctl_chef_client_start_chef_run_manual.rst
\ No newline at end of file diff --git a/distro/common/html/_sources/ctl_chef_server.txt b/distro/common/html/_sources/ctl_chef_server.txt new file mode 100644 index 0000000000..9c38c30ef6 --- /dev/null +++ b/distro/common/html/_sources/ctl_chef_server.txt @@ -0,0 +1,26 @@ +===================================================== +chef-server-ctl +===================================================== + +.. include:: ../../includes_ctl_chef_server/includes_ctl_chef_server.rst + +Options +===================================================== +.. include:: ../../includes_ctl_chef_server/includes_ctl_chef_server_options.rst + + +Examples +===================================================== +The following examples show how to use |chef server ctl| to manage services. + +**View the status of a service** + +.. include:: ../../step_ctl_chef_server/step_ctl_chef_server_view_service_status.rst + +**Restart a service** + +.. include:: ../../step_ctl_chef_server/step_ctl_chef_server_restart_service.rst + +**Restart all services** + +.. include:: ../../step_ctl_chef_server/step_ctl_chef_server_restart_all_services.rst diff --git a/distro/common/html/_sources/ctl_chef_shell.txt b/distro/common/html/_sources/ctl_chef_shell.txt new file mode 100644 index 0000000000..75902f3141 --- /dev/null +++ b/distro/common/html/_sources/ctl_chef_shell.txt @@ -0,0 +1,15 @@ +===================================================== +chef-shell +===================================================== + +.. include:: ../../includes_chef_shell/includes_chef_shell.rst + +.. include:: ../../includes_ctl_chef_shell/includes_ctl_chef_shell.rst + +Modes +===================================================== +.. include:: ../../includes_chef_shell/includes_chef_shell_modes.rst + +Options +===================================================== +.. include:: ../../includes_ctl_chef_shell/includes_ctl_chef_shell_options.rst diff --git a/distro/common/html/_sources/ctl_chef_solo.txt b/distro/common/html/_sources/ctl_chef_solo.txt new file mode 100644 index 0000000000..a80c8bad3c --- /dev/null +++ b/distro/common/html/_sources/ctl_chef_solo.txt @@ -0,0 +1,25 @@ +===================================================== +chef-solo +===================================================== + +.. include:: ../../includes_chef_solo/includes_chef_solo.rst + +.. include:: ../../includes_ctl_chef_solo/includes_ctl_chef_solo.rst + +Options +===================================================== +.. include:: ../../includes_ctl_chef_solo/includes_ctl_chef_solo_options.rst + +Examples +===================================================== +**Use a URL** + +.. include:: ../../step_ctl_chef_solo/step_ctl_chef_solo_use_url.rst + +**Use a directory** + +.. include:: ../../step_ctl_chef_solo/step_ctl_chef_solo_use_directory.rst + +**Use a URL for cookbook and JSON data** + +.. include:: ../../step_ctl_chef_solo/step_ctl_chef_solo_url_for_cookbook_and_json.rst diff --git a/distro/common/html/_sources/index.txt b/distro/common/html/_sources/index.txt new file mode 100644 index 0000000000..1600827541 --- /dev/null +++ b/distro/common/html/_sources/index.txt @@ -0,0 +1,126 @@ +===================================================== +|chef client| Man Pages +===================================================== + +The following command line interfaces are available in the |chef client|: + +* :doc:`ctl_chef_client` +* :doc:`ctl_chef_server` +* :doc:`ctl_chef_shell` +* :doc:`ctl_chef_solo` +* :doc:`knife` + +knife +===================================================== +.. include:: ../../includes_knife/includes_knife.rst + +The following sections describe functionality common to all |knife| subcommands: + +* :doc:`knife_using` +* :doc:`knife_common_options` + +|knife| includes the following sub-commands: + +.. list-table:: + :widths: 150 450 + :header-rows: 1 + + * - Sub-command + - Description + * - :doc:`knife_bootstrap` + - .. include:: ../../includes_knife/includes_knife_bootstrap.rst + * - :doc:`knife_client` + - .. include:: ../../includes_knife/includes_knife_client.rst + * - :doc:`knife_configure` + - .. include:: ../../includes_knife/includes_knife_configure.rst + * - :doc:`knife_cookbook` + - .. include:: ../../includes_knife/includes_knife_cookbook.rst + * - :doc:`knife_cookbook_site` + - .. include:: ../../includes_knife/includes_knife_site_cookbook.rst + * - :doc:`knife_data_bag` + - .. include:: ../../includes_knife/includes_knife_data_bag.rst + * - :doc:`knife_delete` + - .. include:: ../../includes_knife/includes_knife_delete.rst + * - :doc:`knife_deps` + - .. include:: ../../includes_knife/includes_knife_deps.rst + * - :doc:`knife_diff` + - .. include:: ../../includes_knife/includes_knife_diff.rst + * - :doc:`knife_download` + - .. include:: ../../includes_knife/includes_knife_download.rst + * - :doc:`knife_edit` + - .. include:: ../../includes_knife/includes_knife_edit.rst + * - :doc:`knife_environment` + - .. include:: ../../includes_knife/includes_knife_environment.rst + * - :doc:`knife_exec` + - .. include:: ../../includes_knife/includes_knife_exec.rst + * - :doc:`knife_index_rebuild` + - .. include:: ../../includes_knife/includes_knife_index_rebuild.rst + * - :doc:`knife_list` + - .. include:: ../../includes_knife/includes_knife_list.rst + * - :doc:`knife_node` + - .. include:: ../../includes_knife/includes_knife_node.rst + * - :doc:`knife_raw` + - .. include:: ../../includes_knife/includes_knife_raw.rst + * - :doc:`knife_recipe_list` + - .. include:: ../../includes_knife/includes_knife_recipe_list.rst + * - :doc:`knife_role` + - .. include:: ../../includes_knife/includes_knife_role.rst + * - :doc:`knife_search` + - .. include:: ../../includes_knife/includes_knife_search.rst + * - :doc:`knife_show` + - .. include:: ../../includes_knife/includes_knife_show.rst + * - :doc:`knife_ssh` + - .. include:: ../../includes_knife/includes_knife_ssh.rst + * - :doc:`knife_status` + - .. include:: ../../includes_knife/includes_knife_status.rst + * - :doc:`knife_tag` + - .. include:: ../../includes_knife/includes_knife_tag.rst + * - :doc:`knife_upload` + - .. include:: ../../includes_knife/includes_knife_upload.rst + * - :doc:`knife_user` + - .. include:: ../../includes_knife/includes_knife_user.rst + * - :doc:`knife_xargs` + - .. include:: ../../includes_knife/includes_knife_xargs.rst + + +.. Hide the TOC from this file. + +.. toctree:: + :hidden: + + ctl_chef_client + ctl_chef_server + ctl_chef_shell + ctl_chef_solo + knife + knife_common_options + knife_bootstrap + knife_client + knife_configure + knife_cookbook + knife_cookbook_site + knife_data_bag + knife_delete + knife_deps + knife_diff + knife_download + knife_edit + knife_environment + knife_exec + knife_index_rebuild + knife_list + knife_node + knife_raw + knife_recipe_list + knife_role + knife_search + knife_show + knife_ssh + knife_status + knife_tag + knife_upload + knife_user + knife_using + knife_xargs + + diff --git a/distro/common/html/_sources/knife.txt b/distro/common/html/_sources/knife.txt new file mode 100644 index 0000000000..6320825e83 --- /dev/null +++ b/distro/common/html/_sources/knife.txt @@ -0,0 +1,74 @@ +===================================================== +knife +===================================================== + +.. include:: ../../includes_knife/includes_knife.rst + +The following sections describe functionality common to all |knife| subcommands: + +* :doc:`knife_using` +* :doc:`knife_common_options` + +|knife| includes the following sub-commands: + +.. list-table:: + :widths: 150 450 + :header-rows: 1 + + * - Sub-command + - Description + * - :doc:`knife_bootstrap` + - .. include:: ../../includes_knife/includes_knife_bootstrap.rst + * - :doc:`knife_client` + - .. include:: ../../includes_knife/includes_knife_client.rst + * - :doc:`knife_configure` + - .. include:: ../../includes_knife/includes_knife_configure.rst + * - :doc:`knife_cookbook` + - .. include:: ../../includes_knife/includes_knife_cookbook.rst + * - :doc:`knife_cookbook_site` + - .. include:: ../../includes_knife/includes_knife_site_cookbook.rst + * - :doc:`knife_data_bag` + - .. include:: ../../includes_knife/includes_knife_data_bag.rst + * - :doc:`knife_delete` + - .. include:: ../../includes_knife/includes_knife_delete.rst + * - :doc:`knife_deps` + - .. include:: ../../includes_knife/includes_knife_deps.rst + * - :doc:`knife_diff` + - .. include:: ../../includes_knife/includes_knife_diff.rst + * - :doc:`knife_download` + - .. include:: ../../includes_knife/includes_knife_download.rst + * - :doc:`knife_edit` + - .. include:: ../../includes_knife/includes_knife_edit.rst + * - :doc:`knife_environment` + - .. include:: ../../includes_knife/includes_knife_environment.rst + * - :doc:`knife_exec` + - .. include:: ../../includes_knife/includes_knife_exec.rst + * - :doc:`knife_index_rebuild` + - .. include:: ../../includes_knife/includes_knife_index_rebuild.rst + * - :doc:`knife_list` + - .. include:: ../../includes_knife/includes_knife_list.rst + * - :doc:`knife_node` + - .. include:: ../../includes_knife/includes_knife_node.rst + * - :doc:`knife_raw` + - .. include:: ../../includes_knife/includes_knife_raw.rst + * - :doc:`knife_recipe_list` + - .. include:: ../../includes_knife/includes_knife_recipe_list.rst + * - :doc:`knife_role` + - .. include:: ../../includes_knife/includes_knife_role.rst + * - :doc:`knife_search` + - .. include:: ../../includes_knife/includes_knife_search.rst + * - :doc:`knife_show` + - .. include:: ../../includes_knife/includes_knife_show.rst + * - :doc:`knife_ssh` + - .. include:: ../../includes_knife/includes_knife_ssh.rst + * - :doc:`knife_status` + - .. include:: ../../includes_knife/includes_knife_status.rst + * - :doc:`knife_tag` + - .. include:: ../../includes_knife/includes_knife_tag.rst + * - :doc:`knife_upload` + - .. include:: ../../includes_knife/includes_knife_upload.rst + * - :doc:`knife_user` + - .. include:: ../../includes_knife/includes_knife_user.rst + * - :doc:`knife_xargs` + - .. include:: ../../includes_knife/includes_knife_xargs.rst + diff --git a/distro/common/html/_sources/knife_bootstrap.txt b/distro/common/html/_sources/knife_bootstrap.txt new file mode 100644 index 0000000000..ee275b58f5 --- /dev/null +++ b/distro/common/html/_sources/knife_bootstrap.txt @@ -0,0 +1,56 @@ +===================================================== +knife bootstrap +===================================================== + +.. include:: ../../includes_chef/includes_chef_bootstrap.rst + +.. include:: ../../includes_knife/includes_knife_bootstrap.rst + +.. note:: To bootstrap the |chef client| on |windows| machines, the `knife-windows <http://docs.opscode.com/plugin_knife_windows.html>`_ plugins is required, which includes the necessary bootstrap scripts that are used to do the actual installation. + +Syntax +===================================================== +.. include:: ../../includes_knife/includes_knife_bootstrap_syntax.rst + +Options +===================================================== +.. note:: Review the list of :doc:`common options </knife_common_options>` available to this (and all) |knife| subcommands and plugins. + +.. include:: ../../includes_knife/includes_knife_bootstrap_options.rst + +Custom Templates +===================================================== +The ``chef-full`` distribution uses the |omnibus installer|. For most bootstrap operations, regardless of the platform on which the target node is running, using the ``chef-full`` distribution is the best approach for installing the |chef client| on a target node. In some situations, using another supported distribution is necessary. And in some situations, a custom template may be required. For example, the default bootstrap operation relies on an Internet connection to get the distribution to the target node. If a target node cannot access the Internet, then a custom template can be used to define a specific location for the distribution so that the target node may access it during the bootstrap operation. + +A custom bootstrap template file (``template_filename.erb``) must be located in a ``bootstrap/`` directory. Use the ``--distro`` option with the ``knife bootstrap`` subcommand to specify the bootstrap template file. For example, a bootstrap template file named "british_sea_power.erb": + +.. code-block:: bash + + $ knife bootstrap 123.456.7.8 -x username -P password --sudo --distro "british_sea_power.erb" + +The following examples show how a bootstrap template file can be customized for various platforms. + +Ubuntu 12.04 +----------------------------------------------------- +.. include:: ../../includes_knife/includes_knife_bootstrap_example_ubuntu.rst + +Debian and Apt +----------------------------------------------------- +.. include:: ../../includes_knife/includes_knife_bootstrap_example_debian.rst + +Microsoft Windows +----------------------------------------------------- +.. include:: ../../includes_knife/includes_knife_bootstrap_example_windows.rst + +Examples +===================================================== +The following examples show how to use this |knife| subcommand: + +**Use an SSH password** + +.. include:: ../../step_knife/step_knife_bootstrap_use_ssh_password.rst + +**Use a file that contains a private key** + +.. include:: ../../step_knife/step_knife_bootstrap_use_file_with_private_key.rst + diff --git a/distro/common/html/_sources/knife_client.txt b/distro/common/html/_sources/knife_client.txt new file mode 100644 index 0000000000..d9d6ba62a1 --- /dev/null +++ b/distro/common/html/_sources/knife_client.txt @@ -0,0 +1,151 @@ +===================================================== +knife client +===================================================== + +.. include:: ../../includes_knife/includes_knife_client.rst + +.. note:: Review the list of :doc:`common options </knife_common_options>` available to this (and all) |knife| subcommands and plugins. + +bulk delete +===================================================== +.. include:: ../../includes_knife/includes_knife_client_bulk_delete.rst + +Syntax +----------------------------------------------------- +.. include:: ../../includes_knife/includes_knife_client_bulk_delete_syntax.rst + +Options +----------------------------------------------------- +|no_options| + +Examples +----------------------------------------------------- +None. + +create +===================================================== +.. include:: ../../includes_knife/includes_knife_client_create.rst + +Syntax +----------------------------------------------------- +.. include:: ../../includes_knife/includes_knife_client_create_syntax.rst + +Options +----------------------------------------------------- +.. include:: ../../includes_knife/includes_knife_client_create_options.rst + +Examples +----------------------------------------------------- +The following examples show how to use this |knife| subcommand: + +**Create an admin client** + +.. include:: ../../step_knife/step_knife_client_create_admin.rst + +**Create an admin client for Enterprise Chef** + +.. include:: ../../step_knife/step_knife_client_create_hosted_and_private.rst + +delete +===================================================== +.. include:: ../../includes_knife/includes_knife_client_delete.rst + +Syntax +----------------------------------------------------- +.. include:: ../../includes_knife/includes_knife_client_delete_syntax.rst + +Options +----------------------------------------------------- +|no_options| + +Examples +----------------------------------------------------- +The following examples show how to use this |knife| subcommand: + +**Delete a client** + +.. include:: ../../step_knife/step_knife_client_delete.rst + +edit +===================================================== +.. include:: ../../includes_knife/includes_knife_client_edit.rst + +Syntax +----------------------------------------------------- +.. include:: ../../includes_knife/includes_knife_client_edit_syntax.rst + +Options +----------------------------------------------------- +|no_options| + +Examples +----------------------------------------------------- +The following examples show how to use this |knife| subcommand: + +**Edit a client** + +.. include:: ../../step_knife/step_knife_client_edit.rst + +list +===================================================== +.. include:: ../../includes_knife/includes_knife_client_list.rst + +Syntax +----------------------------------------------------- +.. include:: ../../includes_knife/includes_knife_client_list_syntax.rst + +Options +----------------------------------------------------- +.. include:: ../../includes_knife/includes_knife_client_list_options.rst + +Examples +----------------------------------------------------- +The following examples show how to use this |knife| subcommand: + +**View a list of clients** + +.. include:: ../../step_knife/step_knife_client_list_all.rst + +.. include:: ../../step_knife/step_knife_client_list_authenticate.rst + +reregister +===================================================== +.. include:: ../../includes_knife/includes_knife_client_reregister.rst + +Syntax +----------------------------------------------------- +.. include:: ../../includes_knife/includes_knife_client_reregister_syntax.rst + +Options +----------------------------------------------------- +.. include:: ../../includes_knife/includes_knife_client_reregister_options.rst + +Examples +----------------------------------------------------- +The following examples show how to use this |knife| subcommand: + +**Reregister clients** + +.. include:: ../../step_knife/step_knife_client_reregister.rst + +show +===================================================== +.. include:: ../../includes_knife/includes_knife_client_show.rst + +Syntax +----------------------------------------------------- +.. include:: ../../includes_knife/includes_knife_client_show_syntax.rst + +Options +----------------------------------------------------- +.. include:: ../../includes_knife/includes_knife_client_show_options.rst + +Examples +----------------------------------------------------- +The following examples show how to use this |knife| subcommand: + +**Show clients** + +.. include:: ../../step_knife/step_knife_client_show.rst + +.. include:: ../../step_knife/step_knife_common_view_json.rst
\ No newline at end of file diff --git a/distro/common/html/_sources/knife_common_options.txt b/distro/common/html/_sources/knife_common_options.txt new file mode 100644 index 0000000000..154db5c1ee --- /dev/null +++ b/distro/common/html/_sources/knife_common_options.txt @@ -0,0 +1,6 @@ +===================================================== +Common Options +===================================================== + +.. include:: ../../includes_knife/includes_knife_common_options.rst + diff --git a/distro/common/html/_sources/knife_configure.txt b/distro/common/html/_sources/knife_configure.txt new file mode 100644 index 0000000000..1e0485e7fa --- /dev/null +++ b/distro/common/html/_sources/knife_configure.txt @@ -0,0 +1,29 @@ +===================================================== +knife configure +===================================================== + +.. include:: ../../includes_knife/includes_knife_configure.rst + +Syntax +===================================================== +.. include:: ../../includes_knife/includes_knife_configure_syntax.rst + +Options +===================================================== +.. note:: Review the list of :doc:`common options </knife_common_options>` available to this (and all) |knife| subcommands and plugins. + +.. include:: ../../includes_knife/includes_knife_configure_options.rst + +Examples +===================================================== +The following examples show how to use this |knife| subcommand: + +**Configure knife.rb** + +.. include:: ../../step_knife/step_knife_configure_knife_rb.rst + +**Configure client.rb** + +.. include:: ../../step_knife/step_knife_configure_client_rb.rst + + diff --git a/distro/common/html/_sources/knife_cookbook.txt b/distro/common/html/_sources/knife_cookbook.txt new file mode 100644 index 0000000000..462e4dd76c --- /dev/null +++ b/distro/common/html/_sources/knife_cookbook.txt @@ -0,0 +1,236 @@ +===================================================== +knife cookbook +===================================================== + +.. include:: ../../includes_cookbooks/includes_cookbooks.rst + +.. include:: ../../includes_knife/includes_knife_cookbook.rst + +.. note:: Review the list of :doc:`common options </knife_common_options>` available to this (and all) |knife| subcommands and plugins. + +bulk delete +===================================================== +.. include:: ../../includes_knife/includes_knife_cookbook_bulk_delete.rst + +Syntax +----------------------------------------------------- +.. include:: ../../includes_knife/includes_knife_cookbook_bulk_delete_syntax.rst + +Options +----------------------------------------------------- +.. include:: ../../includes_knife/includes_knife_cookbook_bulk_delete_options.rst + +Examples +----------------------------------------------------- +The following examples show how to use this |knife| subcommand: + +**Bulk delete many cookbooks** + +.. include:: ../../step_knife/step_knife_cookbook_bulk_delete.rst + + +create +===================================================== +.. include:: ../../includes_knife/includes_knife_cookbook_create.rst + +Syntax +----------------------------------------------------- +.. include:: ../../includes_knife/includes_knife_cookbook_create_syntax.rst + +Options +----------------------------------------------------- +.. include:: ../../includes_knife/includes_knife_cookbook_create_options.rst + +Examples +----------------------------------------------------- +The following examples show how to use this |knife| subcommand: + +**Create a cookbook** + +.. include:: ../../step_knife/step_knife_cookbook_create_with_options.rst + + +delete +===================================================== +.. include:: ../../includes_knife/includes_knife_cookbook_delete.rst + +Syntax +----------------------------------------------------- +.. include:: ../../includes_knife/includes_knife_cookbook_delete_syntax.rst + +Options +----------------------------------------------------- +.. include:: ../../includes_knife/includes_knife_cookbook_delete_options.rst + +Examples +----------------------------------------------------- +The following examples show how to use this |knife| subcommand: + +**Delete a cookbook** + +.. include:: ../../step_knife/step_knife_cookbook_delete.rst + + +download +===================================================== +.. include:: ../../includes_knife/includes_knife_cookbook_download.rst + +Syntax +----------------------------------------------------- +.. include:: ../../includes_knife/includes_knife_cookbook_download_syntax.rst + +Options +----------------------------------------------------- +.. include:: ../../includes_knife/includes_knife_cookbook_download_options.rst + +Examples +----------------------------------------------------- +The following examples show how to use this |knife| subcommand: + +**Download a cookbook** + +.. include:: ../../step_knife/step_knife_cookbook_download.rst + + +list +===================================================== +.. include:: ../../includes_knife/includes_knife_cookbook_list.rst + +Syntax +----------------------------------------------------- +.. include:: ../../includes_knife/includes_knife_cookbook_list_syntax.rst + +Options +----------------------------------------------------- +.. include:: ../../includes_knife/includes_knife_cookbook_list_options.rst + +Examples +----------------------------------------------------- +The following examples show how to use this |knife| subcommand: + +**View a list of cookbooks** + +.. include:: ../../step_knife/step_knife_cookbook_list.rst + + +metadata +===================================================== +.. include:: ../../includes_knife/includes_knife_cookbook_metadata.rst + +Syntax +----------------------------------------------------- +.. include:: ../../includes_knife/includes_knife_cookbook_metadata_syntax.rst + +Options +----------------------------------------------------- +.. include:: ../../includes_knife/includes_knife_cookbook_metadata_options.rst + +Examples +----------------------------------------------------- +The following examples show how to use this |knife| subcommand: + +**Generate metadata** + +.. include:: ../../step_knife/step_knife_cookbook_metadata.rst + + +metadata from file +===================================================== +.. include:: ../../includes_knife/includes_knife_cookbook_metadata_from_file.rst + +Syntax +----------------------------------------------------- +.. include:: ../../includes_knife/includes_knife_cookbook_metadata_from_file_syntax.rst + +Options +----------------------------------------------------- +|no_options| + +Examples +----------------------------------------------------- +The following examples show how to use this |knife| subcommand: + +**View metadata** + +.. include:: ../../step_knife/step_knife_cookbook_metadata_from_file.rst + + +show +===================================================== +.. include:: ../../includes_knife/includes_knife_cookbook_show.rst + +Syntax +----------------------------------------------------- +.. include:: ../../includes_knife/includes_knife_cookbook_show_syntax.rst + +Options +----------------------------------------------------- +.. include:: ../../includes_knife/includes_knife_cookbook_show_options.rst + +Examples +----------------------------------------------------- +The following examples show how to use this |knife| subcommand: + +**Show cookbook data** + +.. include:: ../../step_knife/step_knife_cookbook_show_cookbook_data.rst + +**Show cookbook versions** + +.. include:: ../../step_knife/step_knife_cookbook_show_cookbook_versions.rst + +**Show a cookbook version** + +.. include:: ../../step_knife/step_knife_cookbook_show_cookbook_version.rst + +**Show cookbook data as JSON** + +.. include:: ../../step_knife/step_knife_common_view_json.rst + + +test +===================================================== +.. include:: ../../includes_knife/includes_knife_cookbook_test.rst + +Syntax +----------------------------------------------------- +.. include:: ../../includes_knife/includes_knife_cookbook_test_syntax.rst + +Options +----------------------------------------------------- +.. include:: ../../includes_knife/includes_knife_cookbook_test_options.rst + +Examples +----------------------------------------------------- +The following examples show how to use this |knife| subcommand: + +**Test a cookbook** + +.. include:: ../../step_knife/step_knife_cookbook_test.rst + + +upload +===================================================== +.. include:: ../../includes_knife/includes_knife_cookbook_upload.rst + +Syntax +----------------------------------------------------- +.. include:: ../../includes_knife/includes_knife_cookbook_upload_syntax.rst + +Options +----------------------------------------------------- +.. include:: ../../includes_knife/includes_knife_cookbook_upload_options.rst + +Examples +----------------------------------------------------- +The following examples show how to use this |knife| subcommand: + +**Upload a cookbook** + +.. include:: ../../step_knife/step_knife_cookbook_upload.rst + +**Freeze a cookbook** + +.. include:: ../../step_knife/step_knife_cookbook_upload_freeze.rst + +.. include:: ../../step_knife/step_knife_cookbook_upload_force.rst diff --git a/distro/common/html/_sources/knife_cookbook_site.txt b/distro/common/html/_sources/knife_cookbook_site.txt new file mode 100644 index 0000000000..92fadaa819 --- /dev/null +++ b/distro/common/html/_sources/knife_cookbook_site.txt @@ -0,0 +1,157 @@ +===================================================== +knife cookbook site +===================================================== + +.. include:: ../../includes_api_cookbooks_site/includes_api_cookbooks_site.rst + +.. include:: ../../includes_knife/includes_knife_site_cookbook.rst + +.. note:: Review the list of :doc:`common options </knife_common_options>` available to this (and all) |knife| subcommands and plugins. + +download +===================================================== +.. include:: ../../includes_knife/includes_knife_site_cookbook_download.rst + +Syntax +----------------------------------------------------- +.. include:: ../../includes_knife/includes_knife_site_cookbook_download_syntax.rst + +Options +----------------------------------------------------- +.. include:: ../../includes_knife/includes_knife_site_cookbook_download_options.rst + +Examples +----------------------------------------------------- +The following examples show how to use this |knife| subcommand: + +**Download a cookbook** + +.. include:: ../../step_knife/step_knife_site_cookbook_download.rst + +install +===================================================== +.. include:: ../../includes_knife/includes_knife_site_cookbook_install.rst + +Syntax +----------------------------------------------------- +.. include:: ../../includes_knife/includes_knife_site_cookbook_install_syntax.rst + +Options +----------------------------------------------------- +.. include:: ../../includes_knife/includes_knife_site_cookbook_install_options.rst + +Examples +----------------------------------------------------- +The following examples show how to use this |knife| subcommand: + +**Install a cookbook** + +.. include:: ../../step_knife/step_knife_site_cookbook_install.rst + +list +===================================================== +.. include:: ../../includes_knife/includes_knife_site_cookbook_list.rst + +Syntax +----------------------------------------------------- +.. include:: ../../includes_knife/includes_knife_site_cookbook_list_syntax.rst + +Options +----------------------------------------------------- +.. include:: ../../includes_knife/includes_knife_site_cookbook_list_options.rst + +Examples +----------------------------------------------------- +The following examples show how to use this |knife| subcommand: + +**View a list of cookbooks** + +.. include:: ../../step_knife/step_knife_site_cookbook_list.rst + +search +===================================================== +.. include:: ../../includes_knife/includes_knife_site_cookbook_search.rst + +Syntax +----------------------------------------------------- +.. include:: ../../includes_knife/includes_knife_site_cookbook_search_syntax.rst + +Options +----------------------------------------------------- +|no_options| + +Examples +----------------------------------------------------- +The following examples show how to use this |knife| subcommand: + +**Search for cookbooks** + +.. include:: ../../step_knife/step_knife_site_cookbook_search.rst + +share +===================================================== +.. include:: ../../includes_knife/includes_knife_site_cookbook_share.rst + +Syntax +----------------------------------------------------- +.. include:: ../../includes_knife/includes_knife_site_cookbook_share_syntax.rst + +Options +----------------------------------------------------- +.. include:: ../../includes_knife/includes_knife_site_cookbook_share_options.rst + +Examples +----------------------------------------------------- +The following examples show how to use this |knife| subcommand: + +**Share a cookbook** + +.. include:: ../../step_knife/step_knife_site_cookbook_share.rst + + +show +===================================================== +.. include:: ../../includes_knife/includes_knife_site_cookbook_show.rst + +Syntax +----------------------------------------------------- +.. include:: ../../includes_knife/includes_knife_site_cookbook_show_syntax.rst + +Options +----------------------------------------------------- +.. include:: ../../includes_knife/includes_knife_site_cookbook_show_options.rst + +Examples +----------------------------------------------------- +The following examples show how to use this |knife| subcommand: + +**Show cookbook data** + +.. include:: ../../step_knife/step_knife_site_cookbook_show.rst + +**Show cookbook data as JSON** + +.. include:: ../../step_knife/step_knife_common_view_json.rst + + +unshare +===================================================== +.. include:: ../../includes_knife/includes_knife_site_cookbook_unshare.rst + +Syntax +----------------------------------------------------- +.. include:: ../../includes_knife/includes_knife_site_cookbook_unshare_syntax.rst + +Options +----------------------------------------------------- +|no_options| + +Examples +----------------------------------------------------- +The following examples show how to use this |knife| subcommand: + +**Unshare a cookbook** + +.. include:: ../../step_knife/step_knife_site_cookbook_unshare.rst + + diff --git a/distro/common/html/_sources/knife_data_bag.txt b/distro/common/html/_sources/knife_data_bag.txt new file mode 100644 index 0000000000..32888e6f8b --- /dev/null +++ b/distro/common/html/_sources/knife_data_bag.txt @@ -0,0 +1,160 @@ +===================================================== +knife data bag +===================================================== + +.. include:: ../../includes_data_bag/includes_data_bag.rst + +.. include:: ../../includes_data_bag/includes_data_bag_encryption.rst + +.. include:: ../../includes_knife/includes_knife_data_bag.rst + +.. note:: Review the list of :doc:`common options </knife_common_options>` available to this (and all) |knife| subcommands and plugins. + +create +===================================================== +.. include:: ../../includes_knife/includes_knife_data_bag_create.rst + +Syntax +----------------------------------------------------- +.. include:: ../../includes_knife/includes_knife_data_bag_create_syntax.rst + +Options +----------------------------------------------------- +.. include:: ../../includes_knife/includes_knife_data_bag_create_options.rst + +Examples +----------------------------------------------------- +The following examples show how to use this |knife| subcommand: + +**Create a data bag** + +.. include:: ../../step_knife/step_knife_data_bag_create.rst + +delete +===================================================== +.. include:: ../../includes_knife/includes_knife_data_bag_delete.rst + +Syntax +----------------------------------------------------- +.. include:: ../../includes_knife/includes_knife_data_bag_delete_syntax.rst + +Options +----------------------------------------------------- +.. include:: ../../includes_knife/includes_knife_data_bag_delete_options.rst + +Examples +----------------------------------------------------- +The following examples show how to use this |knife| subcommand: + +**Delete a data bag** + +.. include:: ../../step_knife/step_knife_data_bag_delete.rst + +**Delete a data bag item** + +.. include:: ../../step_knife/step_knife_data_bag_delete_item.rst + +edit +===================================================== +.. include:: ../../includes_knife/includes_knife_data_bag_edit.rst + +Syntax +----------------------------------------------------- +.. include:: ../../includes_knife/includes_knife_data_bag_edit_syntax.rst + +Options +----------------------------------------------------- +.. include:: ../../includes_knife/includes_knife_data_bag_edit_options.rst + +Examples +----------------------------------------------------- +The following examples show how to use this |knife| subcommand: + +**Edit a data bag** + +.. include:: ../../step_knife/step_knife_data_bag_edit.rst + +**Edit a data bag item** + +.. include:: ../../step_knife/step_knife_data_bag_edit_item.rst + +from file +===================================================== +.. include:: ../../includes_knife/includes_knife_data_bag_from_file.rst + +Syntax +----------------------------------------------------- +.. include:: ../../includes_knife/includes_knife_data_bag_from_file_syntax.rst + +Options +----------------------------------------------------- +.. include:: ../../includes_knife/includes_knife_data_bag_from_file_options.rst + +Examples +----------------------------------------------------- +The following examples show how to use this |knife| subcommand: + +**Create a data bag from a file** + +.. include:: ../../step_knife/step_knife_data_bag_from_file_create.rst + +**Create an encrypted data bag from a file** + +.. include:: ../../step_knife/step_knife_data_bag_from_file_create_encrypted.rst + + +list +===================================================== +.. include:: ../../includes_knife/includes_knife_data_bag_list.rst + +Syntax +----------------------------------------------------- +.. include:: ../../includes_knife/includes_knife_data_bag_list_syntax.rst + +Options +----------------------------------------------------- +.. include:: ../../includes_knife/includes_knife_data_bag_list_options.rst + +Examples +----------------------------------------------------- +The following examples show how to use this |knife| subcommand: + +**View a list of data bags** + +.. include:: ../../step_knife/step_knife_data_bag_list.rst + +show +===================================================== +.. include:: ../../includes_knife/includes_knife_data_bag_show.rst + +Syntax +----------------------------------------------------- +.. include:: ../../includes_knife/includes_knife_data_bag_show_syntax.rst + +Options +----------------------------------------------------- +.. include:: ../../includes_knife/includes_knife_data_bag_show_options.rst + +Examples +----------------------------------------------------- +The following examples show how to use this |knife| subcommand: + +**Show a data bag** + +.. include:: ../../step_knife/step_knife_data_bag_show.rst + +**Show a data bag item** + +.. include:: ../../step_knife/step_knife_data_bag_show_item.rst + +**Show a data bag, encrypted** + +.. include:: ../../step_knife/step_knife_data_bag_show_item_encrypted.rst + +**Show a data bag, decrypted** + +.. include:: ../../step_knife/step_knife_data_bag_show_item_decrypted.rst + +**Show a data bag as JSON** + +.. include:: ../../step_knife/step_knife_data_bag_show_as_json.rst
\ No newline at end of file diff --git a/distro/common/html/_sources/knife_delete.txt b/distro/common/html/_sources/knife_delete.txt new file mode 100644 index 0000000000..55e239792a --- /dev/null +++ b/distro/common/html/_sources/knife_delete.txt @@ -0,0 +1,26 @@ +===================================================== +knife delete +===================================================== + +.. include:: ../../includes_knife/includes_knife_delete.rst + +Syntax +===================================================== +.. include:: ../../includes_knife/includes_knife_delete_syntax.rst + +Options +===================================================== +.. note:: Review the list of :doc:`common options </knife_common_options>` available to this (and all) |knife| subcommands and plugins. + +.. include:: ../../includes_knife/includes_knife_delete_options.rst + +Examples +===================================================== +None. + + + + + + + diff --git a/distro/common/html/_sources/knife_deps.txt b/distro/common/html/_sources/knife_deps.txt new file mode 100644 index 0000000000..b9c7da5e9d --- /dev/null +++ b/distro/common/html/_sources/knife_deps.txt @@ -0,0 +1,61 @@ +===================================================== +knife deps +===================================================== + +.. include:: ../../includes_knife/includes_knife_deps.rst + +Syntax +===================================================== +.. include:: ../../includes_knife/includes_knife_deps_syntax.rst + +Options +===================================================== +.. note:: Review the list of :doc:`common options </knife_common_options>` available to this (and all) |knife| subcommands and plugins. + +.. include:: ../../includes_knife/includes_knife_deps_options.rst + +Examples +===================================================== +The following examples show how to use this |knife| subcommand: + +**Find dependencies for a node** + +.. include:: ../../step_knife/step_knife_deps_node.rst + +**Find dependencies for a role** + +.. include:: ../../step_knife/step_knife_deps_role.rst + +**Find dependencies for a cookbook** + +.. include:: ../../step_knife/step_knife_deps_cookbook.rst + +**Find dependencies for an environment** + +.. include:: ../../step_knife/step_knife_deps_environment.rst + +**Find dependencies for a combination of nodes, roles, and so on** + +.. include:: ../../step_knife/step_knife_deps_combo.rst + +**Use a wildcard** + +.. include:: ../../step_knife/step_knife_deps_wildcard.rst + +**Return as tree** + +.. include:: ../../step_knife/step_knife_deps_return_as_tree.rst + +**Pass knife deps output to knife upload** + +.. include:: ../../step_knife/step_knife_deps_pass_output_to_knife_upload.rst + +**Pass knife deps output to knife xargs** + +.. include:: ../../step_knife/step_knife_deps_pass_output_to_knife_xargs.rst + + + + + + diff --git a/distro/common/html/_sources/knife_diff.txt b/distro/common/html/_sources/knife_diff.txt new file mode 100644 index 0000000000..de467b3887 --- /dev/null +++ b/distro/common/html/_sources/knife_diff.txt @@ -0,0 +1,34 @@ +===================================================== +knife diff +===================================================== + +.. include:: ../../includes_knife/includes_knife_diff.rst + +Syntax +===================================================== +.. include:: ../../includes_knife/includes_knife_diff_syntax.rst + +Options +===================================================== +.. note:: Review the list of :doc:`common options </knife_common_options>` available to this (and all) |knife| subcommands and plugins. + +.. include:: ../../includes_knife/includes_knife_diff_options.rst + +Examples +===================================================== +The following examples show how to use this |knife| subcommand: + +**Compare files that contain JSON data** + +.. include:: ../../step_knife/step_knife_diff_compare_json_files.rst + +**Compare the chef-repo and the server** + +.. include:: ../../step_knife/step_knife_diff_compare_repo_and_server.rst + +**Compare, then return results** + +.. include:: ../../step_knife/step_knife_diff_compare_then_return_results.rst + + + diff --git a/distro/common/html/_sources/knife_download.txt b/distro/common/html/_sources/knife_download.txt new file mode 100644 index 0000000000..d2497b7d3a --- /dev/null +++ b/distro/common/html/_sources/knife_download.txt @@ -0,0 +1,44 @@ +===================================================== +knife download +===================================================== + +.. include:: ../../includes_knife/includes_knife_download.rst + +Syntax +===================================================== +.. include:: ../../includes_knife/includes_knife_download_syntax.rst + +Options +===================================================== +.. note:: Review the list of :doc:`common options </knife_common_options>` available to this (and all) |knife| subcommands and plugins. + +.. include:: ../../includes_knife/includes_knife_download_options.rst + +Examples +===================================================== +The following examples show how to use this |knife| subcommand: + +**Download the entire chef-repo** + +.. include:: ../../step_knife/step_knife_download_repository.rst + +**Download the /cookbooks directory** + +.. include:: ../../step_knife/step_knife_download_directory_cookbooks.rst + +**Download the /environments directory** + +.. include:: ../../step_knife/step_knife_download_directory_environments.rst + +**Download an environment** + +.. include:: ../../step_knife/step_knife_download_directory_environment.rst + +**Download the /roles directory** + +.. include:: ../../step_knife/step_knife_download_directory_roles.rst + +**Download cookbooks and roles** + +.. include:: ../../step_knife/step_knife_download_directory_cookbooks_and_role.rst + diff --git a/distro/common/html/_sources/knife_edit.txt b/distro/common/html/_sources/knife_edit.txt new file mode 100644 index 0000000000..d9e44f44bc --- /dev/null +++ b/distro/common/html/_sources/knife_edit.txt @@ -0,0 +1,26 @@ +===================================================== +knife edit +===================================================== + +.. include:: ../../includes_knife/includes_knife_edit.rst + +Syntax +===================================================== +.. include:: ../../includes_knife/includes_knife_edit_syntax.rst + +Options +===================================================== +.. note:: Review the list of :doc:`common options </knife_common_options>` available to this (and all) |knife| subcommands and plugins. + +.. include:: ../../includes_knife/includes_knife_edit_options.rst + +Examples +===================================================== +None. + + + + + + + diff --git a/distro/common/html/_sources/knife_environment.txt b/distro/common/html/_sources/knife_environment.txt new file mode 100644 index 0000000000..a16e102ea0 --- /dev/null +++ b/distro/common/html/_sources/knife_environment.txt @@ -0,0 +1,158 @@ +===================================================== +knife environment +===================================================== + +.. include:: ../../includes_environment/includes_environment.rst + +.. include:: ../../includes_knife/includes_knife_environment.rst + +.. note:: Review the list of :doc:`common options </knife_common_options>` available to this (and all) |knife| subcommands and plugins. + +compare +===================================================== +.. include:: ../../includes_knife/includes_knife_environment_compare.rst + +**Syntax** + +.. include:: ../../includes_knife/includes_knife_environment_compare_syntax.rst + +**Options** + +.. include:: ../../includes_knife/includes_knife_environment_compare_options.rst + +**Example** + +.. include:: ../../step_knife/step_knife_environment_compare_single.rst + +.. include:: ../../step_knife/step_knife_environment_compare_multiple.rst + +.. include:: ../../step_knife/step_knife_environment_compare_all.rst + +create +===================================================== +.. include:: ../../includes_knife/includes_knife_environment_create.rst + +Syntax +----------------------------------------------------- +.. include:: ../../includes_knife/includes_knife_environment_create_syntax.rst + +Options +----------------------------------------------------- +.. include:: ../../includes_knife/includes_knife_environment_create_options.rst + +Examples +----------------------------------------------------- +The following examples show how to use this |knife| subcommand: + +**Create an environment** + +.. include:: ../../step_knife/step_knife_environment_create.rst + + +delete +===================================================== +.. include:: ../../includes_knife/includes_knife_environment_delete.rst + +Syntax +----------------------------------------------------- +.. include:: ../../includes_knife/includes_knife_environment_delete_syntax.rst + +Options +----------------------------------------------------- +|no_options| + +Examples +----------------------------------------------------- +The following examples show how to use this |knife| subcommand: + +**Delete an environment** + +.. include:: ../../step_knife/step_knife_environment_delete.rst + + +edit +===================================================== +.. include:: ../../includes_knife/includes_knife_environment_edit.rst + +Syntax +----------------------------------------------------- +.. include:: ../../includes_knife/includes_knife_environment_edit_syntax.rst + +Options +----------------------------------------------------- +|no_options| + +Examples +----------------------------------------------------- +The following examples show how to use this |knife| subcommand: + +**Edit an environment** + +.. include:: ../../step_knife/step_knife_environment_edit.rst + + +from file +===================================================== +.. include:: ../../includes_knife/includes_knife_environment_from_file.rst + +Syntax +----------------------------------------------------- +.. include:: ../../includes_knife/includes_knife_environment_from_file_syntax.rst + +Options +----------------------------------------------------- +.. include:: ../../includes_knife/includes_knife_environment_from_file_options.rst + +Examples +----------------------------------------------------- +The following examples show how to use this |knife| subcommand: + +**Create an environment from a JSON file** + +.. include:: ../../step_knife/step_knife_environment_from_file.rst + + +list +===================================================== +.. include:: ../../includes_knife/includes_knife_environment_list.rst + +Syntax +----------------------------------------------------- +.. include:: ../../includes_knife/includes_knife_environment_list_syntax.rst + +Options +----------------------------------------------------- +.. include:: ../../includes_knife/includes_knife_environment_list_options.rst + +Examples +----------------------------------------------------- +The following examples show how to use this |knife| subcommand: + +**View a list of environments** + +.. include:: ../../step_knife/step_knife_environment_list.rst + + +show +===================================================== +.. include:: ../../includes_knife/includes_knife_environment_show.rst + +Syntax +----------------------------------------------------- +.. include:: ../../includes_knife/includes_knife_environment_show_syntax.rst + +Options +----------------------------------------------------- +.. include:: ../../includes_knife/includes_knife_environment_show_options.rst + +Examples +----------------------------------------------------- +The following examples show how to use this |knife| subcommand: + +**Show environments** + +.. include:: ../../step_knife/step_knife_environment_show.rst + +**Show environments as JSON** + +.. include:: ../../step_knife/step_knife_common_view_json.rst diff --git a/distro/common/html/_sources/knife_exec.txt b/distro/common/html/_sources/knife_exec.txt new file mode 100644 index 0000000000..85e7d9f628 --- /dev/null +++ b/distro/common/html/_sources/knife_exec.txt @@ -0,0 +1,47 @@ +===================================================== +knife exec +===================================================== + +.. include:: ../../includes_knife/includes_knife_exec.rst + +Authenticated API Requests +===================================================== +.. include:: ../../includes_knife/includes_knife_exec_authenticated_api_requests.rst + +|ruby| Scripts +===================================================== +.. include:: ../../includes_knife/includes_knife_exec_ruby.rst + +Syntax +===================================================== +.. include:: ../../includes_knife/includes_knife_exec_syntax.rst + +Options +===================================================== +.. note:: Review the list of :doc:`common options </knife_common_options>` available to this (and all) |knife| subcommands and plugins. + +.. include:: ../../includes_knife/includes_knife_exec_options.rst + +Examples +===================================================== +The following examples show how to use this |knife| subcommand: + +**Run Ruby scripts** + +.. include:: ../../step_knife/step_knife_exec_run_ruby_scripts.rst + +**Chef Knife status** + +.. include:: ../../step_knife/step_knife_exec_check_knife_status.rst + +**List available free memory** + +.. include:: ../../step_knife/step_knife_exec_list_available_free_memory.rst + +**List available search indexes** + +.. include:: ../../step_knife/step_knife_exec_list_available_search_indexes.rst + +**Query for multiple attributes** + +.. include:: ../../step_knife/step_knife_exec_query_for_multiple_attributes.rst diff --git a/distro/common/html/_sources/knife_index_rebuild.txt b/distro/common/html/_sources/knife_index_rebuild.txt new file mode 100644 index 0000000000..3107f89275 --- /dev/null +++ b/distro/common/html/_sources/knife_index_rebuild.txt @@ -0,0 +1,21 @@ +===================================================== +knife index rebuild +===================================================== + +.. include:: ../../includes_knife/includes_knife_index_rebuild.rst + +.. note:: This subcommand ONLY works when run against the open source |chef server| version 10.x. This subcommand will NOT run against open source |chef server| 11, |chef server oec| (including hosted |chef server oec|), or |chef private|. + +Syntax +===================================================== +.. include:: ../../includes_knife/includes_knife_index_rebuild_syntax.rst + +Options +===================================================== +.. note:: Review the list of :doc:`common options </knife_common_options>` available to this (and all) |knife| subcommands and plugins. + +|no_options| + +Examples +===================================================== +None.
\ No newline at end of file diff --git a/distro/common/html/_sources/knife_list.txt b/distro/common/html/_sources/knife_list.txt new file mode 100644 index 0000000000..bad0be1e09 --- /dev/null +++ b/distro/common/html/_sources/knife_list.txt @@ -0,0 +1,33 @@ +===================================================== +knife list +===================================================== + +.. include:: ../../includes_knife/includes_knife_list.rst + +Syntax +===================================================== +.. include:: ../../includes_knife/includes_knife_list_syntax.rst + +Options +===================================================== +.. note:: Review the list of :doc:`common options </knife_common_options>` available to this (and all) |knife| subcommands and plugins. + +.. include:: ../../includes_knife/includes_knife_list_options.rst + +Examples +===================================================== +The following examples show how to use this |knife| subcommand: + +**List roles** + +.. include:: ../../step_knife/step_knife_list_roles.rst + +**List roles and environments** + +.. include:: ../../step_knife/step_knife_list_roles_and_environments.rst + +**List everything** + +.. include:: ../../step_knife/step_knife_list_everything.rst + + diff --git a/distro/common/html/_sources/knife_node.txt b/distro/common/html/_sources/knife_node.txt new file mode 100644 index 0000000000..165db5079f --- /dev/null +++ b/distro/common/html/_sources/knife_node.txt @@ -0,0 +1,250 @@ +===================================================== +knife node +===================================================== + +.. include:: ../../includes_node/includes_node.rst + +.. include:: ../../includes_knife/includes_knife_node.rst + +.. note:: Review the list of :doc:`common options </knife_common_options>` available to this (and all) |knife| subcommands and plugins. + + +bulk delete +===================================================== +.. include:: ../../includes_knife/includes_knife_node_bulk_delete.rst + +Syntax +----------------------------------------------------- +.. include:: ../../includes_knife/includes_knife_node_bulk_delete_syntax.rst + +Options +----------------------------------------------------- +|no_options| + +Examples +----------------------------------------------------- +The following examples show how to use this |knife| subcommand: + +**Bulk delete nodes** + +.. include:: ../../step_knife/step_knife_node_bulk_delete.rst + + +create +===================================================== +.. include:: ../../includes_knife/includes_knife_node_create.rst + +Syntax +----------------------------------------------------- +.. include:: ../../includes_knife/includes_knife_node_create_syntax.rst + +Options +----------------------------------------------------- +|no_options| + +Examples +----------------------------------------------------- +The following examples show how to use this |knife| subcommand: + +**Create a node** + +.. include:: ../../step_knife/step_knife_node_create.rst + + +delete +===================================================== +.. include:: ../../includes_knife/includes_knife_node_delete.rst + +Syntax +----------------------------------------------------- +.. include:: ../../includes_knife/includes_knife_node_delete_syntax.rst + +Options +----------------------------------------------------- +|no_options| + +Examples +----------------------------------------------------- +The following examples show how to use this |knife| subcommand: + +**Delete a node** + +.. include:: ../../step_knife/step_knife_node_delete.rst + + +edit +===================================================== +.. include:: ../../includes_knife/includes_knife_node_edit.rst + +Syntax +----------------------------------------------------- +.. include:: ../../includes_knife/includes_knife_node_edit_syntax.rst + +Options +----------------------------------------------------- +.. include:: ../../includes_knife/includes_knife_node_edit_options.rst + +Examples +----------------------------------------------------- +The following examples show how to use this |knife| subcommand: + +**Edit a node** + +.. include:: ../../step_knife/step_knife_node_edit.rst + + +from file +===================================================== +.. include:: ../../includes_knife/includes_knife_node_from_file.rst + +Syntax +----------------------------------------------------- +.. include:: ../../includes_knife/includes_knife_node_from_file_syntax.rst + +Options +----------------------------------------------------- +|no_options| + +Examples +----------------------------------------------------- +The following examples show how to use this |knife| subcommand: + +**Create a node using a JSON file** + +.. include:: ../../step_knife/step_knife_node_from_file.rst + + +list +===================================================== +.. include:: ../../includes_knife/includes_knife_node_list.rst + +Syntax +----------------------------------------------------- +.. include:: ../../includes_knife/includes_knife_node_list_syntax.rst + +Options +----------------------------------------------------- +.. include:: ../../includes_knife/includes_knife_node_list_options.rst + +Examples +----------------------------------------------------- +The following examples show how to use this |knife| subcommand: + +**View a list of nodes** + +.. include:: ../../step_knife/step_knife_node_list_all.rst + + +run_list add +===================================================== +.. include:: ../../includes_node/includes_node_run_list.rst + +.. include:: ../../includes_knife/includes_knife_node_run_list_add.rst + +.. include:: ../../includes_node/includes_node_run_list_format.rst + +Syntax +----------------------------------------------------- +.. include:: ../../includes_knife/includes_knife_node_run_list_add_syntax.rst + +Options +----------------------------------------------------- +.. include:: ../../includes_knife/includes_knife_node_run_list_add_options.rst + +Examples +----------------------------------------------------- +The following examples show how to use this |knife| subcommand: + +**Add a role** + +.. include:: ../../step_knife/step_knife_node_run_list_add_role.rst + +**Add roles and recipes** + +.. include:: ../../step_knife/step_knife_node_run_list_add_roles_and_recipes.rst + +**Add a recipe with a FQDN** + +.. include:: ../../step_knife/step_knife_node_run_list_add_recipe_with_fqdn.rst + +**Add a recipe with a cookbook** + +.. include:: ../../step_knife/step_knife_node_run_list_add_recipe_with_cookbook.rst + +**Add the default recipe** + +.. include:: ../../step_knife/step_knife_node_run_list_add_default_recipe.rst + + +run_list remove +===================================================== +.. include:: ../../includes_knife/includes_knife_node_run_list_remove.rst + +Syntax +----------------------------------------------------- +.. include:: ../../includes_knife/includes_knife_node_run_list_remove_syntax.rst + +Options +----------------------------------------------------- +|no_options| + +Examples +----------------------------------------------------- +The following examples show how to use this |knife| subcommand: + +**Remove a role** + +.. include:: ../../step_knife/step_knife_node_run_list_remove_role.rst + +**Remove a run-list** + +.. include:: ../../step_knife/step_knife_node_run_list_remove_run_list.rst + + +show +===================================================== +.. include:: ../../includes_knife/includes_knife_node_show.rst + +Syntax +----------------------------------------------------- +.. include:: ../../includes_knife/includes_knife_node_show_syntax.rst + +Options +----------------------------------------------------- +.. include:: ../../includes_knife/includes_knife_node_show_options.rst + +Examples +----------------------------------------------------- +The following examples show how to use this |knife| subcommand: + +**Show all data about nodes** + +.. include:: ../../step_knife/step_knife_node_show_all_data.rst + +**Show basic information about nodes** + +.. include:: ../../step_knife/step_knife_node_show_all_data_basic.rst + +**Show all data about nodes, truncated** + +.. include:: ../../step_knife/step_knife_node_show_all_data_truncated.rst + +**Show attributes** + +.. include:: ../../step_knife/step_knife_node_show_attribute.rst + +**Show the FQDN** + +.. include:: ../../step_knife/step_knife_node_show_fqdn.rst + +**Show a run-list** + +.. include:: ../../step_knife/step_knife_node_show_run_list.rst + +**Show as JSON data** + +.. include:: ../../step_knife/step_knife_common_view_json.rst + +**Show as raw JSON data** + +.. include:: ../../step_knife/step_knife_common_view_json_raw.rst diff --git a/distro/common/html/_sources/knife_raw.txt b/distro/common/html/_sources/knife_raw.txt new file mode 100644 index 0000000000..3a27c0456a --- /dev/null +++ b/distro/common/html/_sources/knife_raw.txt @@ -0,0 +1,35 @@ +===================================================== +knife raw +===================================================== + +.. include:: ../../includes_knife/includes_knife_raw.rst + +Syntax +===================================================== +.. include:: ../../includes_knife/includes_knife_raw_syntax.rst + +Options +===================================================== +.. note:: Review the list of :doc:`common options </knife_common_options>` available to this (and all) |knife| subcommands and plugins. + +.. include:: ../../includes_knife/includes_knife_raw_options.rst + +Examples +===================================================== +The following examples show how to use this |knife| subcommand: + +**View a client** + +.. include:: ../../step_knife/step_knife_raw_view_client.rst + +**View a node** + +.. include:: ../../step_knife/step_knife_raw_view_node.rst + +**Delete a data bag** + +.. include:: ../../step_knife/step_knife_raw_delete_data_bag.rst + + + + diff --git a/distro/common/html/_sources/knife_recipe_list.txt b/distro/common/html/_sources/knife_recipe_list.txt new file mode 100644 index 0000000000..51d8bad845 --- /dev/null +++ b/distro/common/html/_sources/knife_recipe_list.txt @@ -0,0 +1,23 @@ +===================================================== +knife recipe list +===================================================== + +.. include:: ../../includes_knife/includes_knife_recipe_list.rst + +Syntax +===================================================== +.. include:: ../../includes_knife/includes_knife_recipe_list_syntax.rst + +Options +===================================================== +.. note:: Review the list of :doc:`common options </knife_common_options>` available to this (and all) |knife| subcommands and plugins. + +|no_options| + +Examples +===================================================== +The following examples show how to use this |knife| subcommand: + +**View a list of recipes** + +.. include:: ../../step_knife/step_knife_recipe_list.rst diff --git a/distro/common/html/_sources/knife_role.txt b/distro/common/html/_sources/knife_role.txt new file mode 100644 index 0000000000..edd218ddc6 --- /dev/null +++ b/distro/common/html/_sources/knife_role.txt @@ -0,0 +1,157 @@ +===================================================== +knife role +===================================================== + +.. include:: ../../includes_role/includes_role.rst + +.. include:: ../../includes_knife/includes_knife_role.rst + +.. note:: To add a role to a node and then build out the run-list for that node, use the :doc:`knife node </knife_node>` sub-command and its ``run_list add`` argument. + +.. note:: Review the list of :doc:`common options </knife_common_options>` available to this (and all) |knife| subcommands and plugins. + +bulk delete +===================================================== +.. include:: ../../includes_knife/includes_knife_role_bulk_delete.rst + +Syntax +----------------------------------------------------- +.. include:: ../../includes_knife/includes_knife_role_bulk_delete_syntax.rst + +Options +----------------------------------------------------- +|no_options| + +Examples +----------------------------------------------------- +The following examples show how to use this |knife| subcommand: + +**Bulk delete roles** + +.. include:: ../../step_knife/step_knife_role_bulk_delete.rst + +create +===================================================== +.. include:: ../../includes_knife/includes_knife_role_create.rst + +Syntax +----------------------------------------------------- +.. include:: ../../includes_knife/includes_knife_role_create_syntax.rst + +Options +----------------------------------------------------- +.. include:: ../../includes_knife/includes_knife_role_create_options.rst + +Examples +----------------------------------------------------- +The following examples show how to use this |knife| subcommand: + +**Create a role** + +.. include:: ../../step_knife/step_knife_role_create.rst + +delete +===================================================== +.. include:: ../../includes_knife/includes_knife_role_delete.rst + +Syntax +----------------------------------------------------- +.. include:: ../../includes_knife/includes_knife_role_delete_syntax.rst + +Options +----------------------------------------------------- +|no_options| + +Examples +----------------------------------------------------- +The following examples show how to use this |knife| subcommand: + +**Delete a role** + +.. include:: ../../step_knife/step_knife_role_delete.rst + +edit +===================================================== +.. include:: ../../includes_knife/includes_knife_role_edit.rst + +Syntax +----------------------------------------------------- +.. include:: ../../includes_knife/includes_knife_role_edit_syntax.rst + +Options +----------------------------------------------------- +|no_options| + +Examples +----------------------------------------------------- +The following examples show how to use this |knife| subcommand: + +**Edit a role** + +.. include:: ../../step_knife/step_knife_role_edit.rst + +from file +===================================================== +.. include:: ../../includes_knife/includes_knife_role_from_file.rst + +Syntax +----------------------------------------------------- +.. include:: ../../includes_knife/includes_knife_role_from_file_syntax.rst + +Options +----------------------------------------------------- +|no_options| + +Examples +----------------------------------------------------- +The following examples show how to use this |knife| subcommand: + +**Create a role using JSON data** + +.. include:: ../../step_knife/step_knife_role_from_file.rst + +list +===================================================== +.. include:: ../../includes_knife/includes_knife_role_list.rst + +Syntax +----------------------------------------------------- +.. include:: ../../includes_knife/includes_knife_role_list_syntax.rst + +Options +----------------------------------------------------- +.. include:: ../../includes_knife/includes_knife_role_list_options.rst + +Examples +----------------------------------------------------- +The following examples show how to use this |knife| subcommand: + +**View a list of roles** + +.. include:: ../../step_knife/step_knife_role_list.rst + +show +===================================================== +.. include:: ../../includes_knife/includes_knife_role_show.rst + +Syntax +----------------------------------------------------- +.. include:: ../../includes_knife/includes_knife_role_show_syntax.rst + +Options +----------------------------------------------------- +.. include:: ../../includes_knife/includes_knife_role_show_options.rst + +Examples +----------------------------------------------------- +The following examples show how to use this |knife| subcommand: + +**Show as JSON data** + +.. include:: ../../step_knife/step_knife_common_view_json.rst + +**Show as raw JSON data** + +.. include:: ../../step_knife/step_knife_common_view_json_raw.rst + + diff --git a/distro/common/html/_sources/knife_search.txt b/distro/common/html/_sources/knife_search.txt new file mode 100644 index 0000000000..c55ffc0308 --- /dev/null +++ b/distro/common/html/_sources/knife_search.txt @@ -0,0 +1,53 @@ +===================================================== +knife search +===================================================== + +.. include:: ../../includes_search/includes_search.rst + +.. include:: ../../includes_knife/includes_knife_search.rst + +Syntax +===================================================== +.. include:: ../../includes_knife/includes_knife_search_syntax.rst + +Options +===================================================== +.. note:: Review the list of :doc:`common options </knife_common_options>` available to this (and all) |knife| subcommands and plugins. + +.. include:: ../../includes_knife/includes_knife_search_options.rst + +Examples +===================================================== +The following examples show how to use this |knife| subcommand: + +**Search by platform ID** + +.. include:: ../../step_knife/step_knife_search_by_platform_ids.rst + +**Search by instance type** + +.. include:: ../../step_knife/step_knife_search_by_platform_instance_type.rst + +**Search by node** + +.. include:: ../../step_knife/step_knife_search_by_node.rst + +**Search by node and environment** + +.. include:: ../../step_knife/step_knife_search_by_node_and_environment.rst + +**Search for nested attributes** + +.. include:: ../../step_knife/step_knife_search_by_nested_attribute.rst + +**Search for multiple attributes** + +.. include:: ../../step_knife/step_knife_search_by_query_for_many_attributes.rst + +**Search for nested attributes using a search query** + +.. include:: ../../step_knife/step_knife_search_by_query_for_nested_attribute.rst + +**Use a test query** + +.. include:: ../../step_knife/step_knife_search_test_query_for_ssh.rst diff --git a/distro/common/html/_sources/knife_show.txt b/distro/common/html/_sources/knife_show.txt new file mode 100644 index 0000000000..c9ca6958e3 --- /dev/null +++ b/distro/common/html/_sources/knife_show.txt @@ -0,0 +1,27 @@ +===================================================== +knife show +===================================================== + +.. include:: ../../includes_knife/includes_knife_show.rst + +Syntax +===================================================== +.. include:: ../../includes_knife/includes_knife_show_syntax.rst + +Options +===================================================== +.. note:: Review the list of :doc:`common options </knife_common_options>` available to this (and all) |knife| subcommands and plugins. + +.. include:: ../../includes_knife/includes_knife_show_options.rst + +Examples +===================================================== +The following examples show how to use this |knife| subcommand: + +**Show all cookbooks** + +.. include:: ../../step_knife/step_knife_show_all_cookbooks.rst + +**Show roles and environments** + +.. include:: ../../step_knife/step_knife_show_roles_and_environments.rst
\ No newline at end of file diff --git a/distro/common/html/_sources/knife_ssh.txt b/distro/common/html/_sources/knife_ssh.txt new file mode 100644 index 0000000000..bc7f4e5977 --- /dev/null +++ b/distro/common/html/_sources/knife_ssh.txt @@ -0,0 +1,43 @@ +===================================================== +knife ssh +===================================================== + +.. include:: ../../includes_knife/includes_knife_ssh.rst + +Syntax +===================================================== +.. include:: ../../includes_knife/includes_knife_ssh_syntax.rst + +Options +===================================================== +.. note:: Review the list of :doc:`common options </knife_common_options>` available to this (and all) |knife| subcommands and plugins. + +.. include:: ../../includes_knife/includes_knife_ssh_options.rst + +Examples +===================================================== +The following examples show how to use this |knife| subcommand: + +**Find server uptime** + +.. include:: ../../step_knife/step_knife_ssh_find_uptime.rst + +**Run the chef-client on all nodes** + +.. include:: ../../step_knife/step_knife_ssh_run_chef_client_on_all_nodes.rst + +**Force a chef-client run** + +.. include:: ../../step_knife/step_knife_ssh_force_chef_run.rst + +**Run a command based on search query** + +.. include:: ../../step_knife/step_knife_ssh_query_for_nodes.rst + +**Upgrade all nodes** + +.. include:: ../../step_knife/step_knife_ssh_upgrade_nodes.rst + +**Specify the shell type** + +.. include:: ../../step_knife/step_knife_ssh_shell_type.rst diff --git a/distro/common/html/_sources/knife_status.txt b/distro/common/html/_sources/knife_status.txt new file mode 100644 index 0000000000..194b985f67 --- /dev/null +++ b/distro/common/html/_sources/knife_status.txt @@ -0,0 +1,37 @@ +===================================================== +knife status +===================================================== + +.. include:: ../../includes_knife/includes_knife_status.rst + +Syntax +===================================================== +.. include:: ../../includes_knife/includes_knife_status_syntax.rst + +Options +===================================================== +.. note:: Review the list of :doc:`common options </knife_common_options>` available to this (and all) |knife| subcommands and plugins. + +.. include:: ../../includes_knife/includes_knife_status_options.rst + +Examples +===================================================== +The following examples show how to use this |knife| subcommand: + +**View status, include run-lists** + +.. include:: ../../step_knife/step_knife_status_include_run_lists.rst + +**View status using a date range** + +.. include:: ../../step_knife/step_knife_status_past_hour.rst + +**View status using a query** + +.. include:: ../../step_knife/step_knife_status_returned_by_query.rst + +**View status for all nodes** + +.. include:: ../../step_knife/step_knife_status_view_for_all_nodes.rst + + diff --git a/distro/common/html/_sources/knife_tag.txt b/distro/common/html/_sources/knife_tag.txt new file mode 100644 index 0000000000..6fea1e321d --- /dev/null +++ b/distro/common/html/_sources/knife_tag.txt @@ -0,0 +1,69 @@ +===================================================== +knife tag +===================================================== + +.. include:: ../../includes_chef/includes_chef_tags.rst + +.. include:: ../../includes_knife/includes_knife_tag.rst + +.. note:: Review the list of :doc:`common options </knife_common_options>` available to this (and all) |knife| subcommands and plugins. + +create +===================================================== +.. include:: ../../includes_knife/includes_knife_tag_create.rst + +Syntax +----------------------------------------------------- +.. include:: ../../includes_knife/includes_knife_tag_create_syntax.rst + +Options +----------------------------------------------------- +|no_options| + +Examples +----------------------------------------------------- +The following examples show how to use this |knife| subcommand: + +**Create tags** + +.. include:: ../../step_knife/step_knife_tag_create.rst + +delete +===================================================== +.. include:: ../../includes_knife/includes_knife_tag_delete.rst + +Syntax +----------------------------------------------------- +.. include:: ../../includes_knife/includes_knife_tag_delete_syntax.rst + +Options +----------------------------------------------------- +|no_options| + +Examples +----------------------------------------------------- +The following examples show how to use this |knife| subcommand: + +**Delete tags** + +.. include:: ../../step_knife/step_knife_tag_delete.rst + +list +===================================================== +.. include:: ../../includes_knife/includes_knife_tag_list.rst + +Syntax +----------------------------------------------------- +.. include:: ../../includes_knife/includes_knife_tag_list_syntax.rst + +Options +----------------------------------------------------- +|no_options| + +Examples +----------------------------------------------------- +The following examples show how to use this |knife| subcommand: + +**View a list of tags** + +.. include:: ../../step_knife/step_knife_tag_list.rst diff --git a/distro/common/html/_sources/knife_upload.txt b/distro/common/html/_sources/knife_upload.txt new file mode 100644 index 0000000000..bd37725108 --- /dev/null +++ b/distro/common/html/_sources/knife_upload.txt @@ -0,0 +1,49 @@ +===================================================== +knife upload +===================================================== + +.. include:: ../../includes_knife/includes_knife_upload.rst + +Syntax +===================================================== +.. include:: ../../includes_knife/includes_knife_upload_syntax.rst + +Options +===================================================== +.. note:: Review the list of :doc:`common options </knife_common_options>` available to this (and all) |knife| subcommands and plugins. + +.. include:: ../../includes_knife/includes_knife_upload_options.rst + +Examples +===================================================== +The following examples show how to use this |knife| subcommand: + +**Upload the entire chef-repo** + +.. include:: ../../step_knife/step_knife_upload_repository.rst + +**Upload the /cookbooks directory** + +.. include:: ../../step_knife/step_knife_upload_directory_cookbooks.rst + +**Upload the /environments directory** + +.. include:: ../../step_knife/step_knife_upload_directory_environments.rst + +**Upload a single environment** + +.. include:: ../../step_knife/step_knife_upload_directory_environment.rst + +**Upload the /roles directory** + +.. include:: ../../step_knife/step_knife_upload_directory_roles.rst + +**Upload cookbooks and roles** + +.. include:: ../../step_knife/step_knife_upload_directory_cookbooks_and_role.rst + +**Use output of knife deps to pass command to knife upload** + +.. include:: ../../step_knife/step_knife_upload_pass_to_knife_deps.rst + + diff --git a/distro/common/html/_sources/knife_user.txt b/distro/common/html/_sources/knife_user.txt new file mode 100644 index 0000000000..1642d30f7b --- /dev/null +++ b/distro/common/html/_sources/knife_user.txt @@ -0,0 +1,127 @@ +===================================================== +knife user +===================================================== + +.. include:: ../../includes_knife/includes_knife_user.rst + +.. note:: This subcommand ONLY works when run against the open source |chef server| and will not run against |chef server oec| (including hosted |chef server oec|), or |chef private|. + +.. note:: Review the list of :doc:`common options </knife_common_options>` available to this (and all) |knife| subcommands and plugins. + +create +===================================================== +.. include:: ../../includes_knife/includes_knife_user_create.rst + +Syntax +----------------------------------------------------- +.. include:: ../../includes_knife/includes_knife_user_create_syntax.rst + +Options +----------------------------------------------------- +.. include:: ../../includes_knife/includes_knife_user_create_options.rst + +Examples +----------------------------------------------------- +The following examples show how to use this |knife| subcommand: + +**Create a user** + +.. include:: ../../step_knife/step_knife_user_create.rst + +delete +===================================================== +.. include:: ../../includes_knife/includes_knife_user_delete.rst + +Syntax +----------------------------------------------------- +.. include:: ../../includes_knife/includes_knife_user_delete_syntax.rst + +Options +----------------------------------------------------- +|no_options| + +Examples +----------------------------------------------------- +The following examples show how to use this |knife| subcommand: + +**Delete a user** + +.. include:: ../../step_knife/step_knife_user_delete.rst + +edit +===================================================== +.. include:: ../../includes_knife/includes_knife_user_edit.rst + +Syntax +----------------------------------------------------- +.. include:: ../../includes_knife/includes_knife_user_edit_syntax.rst + +Options +----------------------------------------------------- +|no_options| + +Examples +----------------------------------------------------- +None. + + +list +===================================================== +.. include:: ../../includes_knife/includes_knife_user_list.rst + +Syntax +----------------------------------------------------- +.. include:: ../../includes_knife/includes_knife_user_list_syntax.rst + +Options +----------------------------------------------------- +.. include:: ../../includes_knife/includes_knife_user_list_options.rst + +Examples +----------------------------------------------------- +None. + +reregister +===================================================== +.. include:: ../../includes_knife/includes_knife_user_reregister.rst + +Syntax +----------------------------------------------------- +.. include:: ../../includes_knife/includes_knife_user_reregister_syntax.rst + +Options +----------------------------------------------------- +.. include:: ../../includes_knife/includes_knife_user_reregister_options.rst + +Examples +----------------------------------------------------- +The following examples show how to use this |knife| subcommand: + +**Regenerate the RSA key-pair** + +.. include:: ../../step_knife/step_knife_user_reregister.rst + +show +===================================================== +.. include:: ../../includes_knife/includes_knife_user_show.rst + +Syntax +----------------------------------------------------- +.. include:: ../../includes_knife/includes_knife_user_show_syntax.rst + +Options +----------------------------------------------------- +.. include:: ../../includes_knife/includes_knife_user_show_options.rst + +Examples +----------------------------------------------------- +The following examples show how to use this |knife| subcommand: + +**Show user data** + +.. include:: ../../step_knife/step_knife_user_show.rst + +**Show user data as JSON** + +.. include:: ../../step_knife/step_knife_user_show_json.rst + diff --git a/distro/common/html/_sources/knife_using.txt b/distro/common/html/_sources/knife_using.txt new file mode 100644 index 0000000000..9484b167c4 --- /dev/null +++ b/distro/common/html/_sources/knife_using.txt @@ -0,0 +1,43 @@ +===================================================== +Working with Knife +===================================================== + +.. include:: ../../includes_knife/includes_knife_using.rst + +JSON Data Format +===================================================== +.. include:: ../../includes_knife/includes_knife_using_json.rst + +Set the Text Editor +----------------------------------------------------- +.. include:: ../../step_knife/step_knife_common_set_editor.rst + +Using Quotes +===================================================== +.. include:: ../../includes_knife/includes_knife_using_quotes.rst + +Sub-commands +===================================================== +.. include:: ../../includes_knife/includes_knife_using_subcommands.rst + +Verb Sub-commands +===================================================== +.. include:: ../../includes_knife/includes_knife_verbs.rst + +Wildcard Search +----------------------------------------------------- +.. include:: ../../includes_knife/includes_knife_verbs_wildcard.rst + +Plug-ins +===================================================== +.. include:: ../../includes_knife/includes_knife_using_plugins.rst + +Syntax +===================================================== +.. include:: ../../includes_knife/includes_knife_using_syntax.rst + +Many Users, Same Repo +===================================================== +.. include:: ../../includes_repository/includes_repository_many_users_same_repo.rst + + diff --git a/distro/common/html/_sources/knife_xargs.txt b/distro/common/html/_sources/knife_xargs.txt new file mode 100644 index 0000000000..852ba282aa --- /dev/null +++ b/distro/common/html/_sources/knife_xargs.txt @@ -0,0 +1,30 @@ +===================================================== +knife xargs +===================================================== + +.. include:: ../../includes_knife/includes_knife_xargs.rst + +Syntax +===================================================== +.. include:: ../../includes_knife/includes_knife_xargs_syntax.rst + +Options +===================================================== +.. note:: Review the list of :doc:`common options </knife_common_options>` available to this (and all) |knife| subcommands and plugins. + +.. include:: ../../includes_knife/includes_knife_xargs_options.rst + +Examples +===================================================== +The following examples show how to use this |knife| subcommand: + +**Use output of knife deps to pass command to knife xargs** + +.. include:: ../../step_knife/step_knife_xargs_pass_command_to.rst + + + + + + + diff --git a/distro/common/html/_static/ajax-loader.gif b/distro/common/html/_static/ajax-loader.gif Binary files differnew file mode 100644 index 0000000000..61faf8cab2 --- /dev/null +++ b/distro/common/html/_static/ajax-loader.gif diff --git a/distro/common/html/_static/basic.css b/distro/common/html/_static/basic.css new file mode 100644 index 0000000000..43e8bafaf3 --- /dev/null +++ b/distro/common/html/_static/basic.css @@ -0,0 +1,540 @@ +/* + * basic.css + * ~~~~~~~~~ + * + * Sphinx stylesheet -- basic theme. + * + * :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. + * :license: BSD, see LICENSE for details. + * + */ + +/* -- main layout ----------------------------------------------------------- */ + +div.clearer { + clear: both; +} + +/* -- relbar ---------------------------------------------------------------- */ + +div.related { + width: 100%; + font-size: 90%; +} + +div.related h3 { + display: none; +} + +div.related ul { + margin: 0; + padding: 0 0 0 10px; + list-style: none; +} + +div.related li { + display: inline; +} + +div.related li.right { + float: right; + margin-right: 5px; +} + +/* -- sidebar --------------------------------------------------------------- */ + +div.sphinxsidebarwrapper { + padding: 10px 5px 0 10px; +} + +div.sphinxsidebar { + float: left; + width: 230px; + margin-left: -100%; + font-size: 90%; +} + +div.sphinxsidebar ul { + list-style: none; +} + +div.sphinxsidebar ul ul, +div.sphinxsidebar ul.want-points { + margin-left: 20px; + list-style: square; +} + +div.sphinxsidebar ul ul { + margin-top: 0; + margin-bottom: 0; +} + +div.sphinxsidebar form { + margin-top: 10px; +} + +div.sphinxsidebar input { + border: 1px solid #98dbcc; + font-family: sans-serif; + font-size: 1em; +} + +div.sphinxsidebar #searchbox input[type="text"] { + width: 170px; +} + +div.sphinxsidebar #searchbox input[type="submit"] { + width: 30px; +} + +img { + border: 0; +} + +/* -- search page ----------------------------------------------------------- */ + +ul.search { + margin: 10px 0 0 20px; + padding: 0; +} + +ul.search li { + padding: 5px 0 5px 20px; + background-image: url(file.png); + background-repeat: no-repeat; + background-position: 0 7px; +} + +ul.search li a { + font-weight: bold; +} + +ul.search li div.context { + color: #888; + margin: 2px 0 0 30px; + text-align: left; +} + +ul.keywordmatches li.goodmatch a { + font-weight: bold; +} + +/* -- index page ------------------------------------------------------------ */ + +table.contentstable { + width: 90%; +} + +table.contentstable p.biglink { + line-height: 150%; +} + +a.biglink { + font-size: 1.3em; +} + +span.linkdescr { + font-style: italic; + padding-top: 5px; + font-size: 90%; +} + +/* -- general index --------------------------------------------------------- */ + +table.indextable { + width: 100%; +} + +table.indextable td { + text-align: left; + vertical-align: top; +} + +table.indextable dl, table.indextable dd { + margin-top: 0; + margin-bottom: 0; +} + +table.indextable tr.pcap { + height: 10px; +} + +table.indextable tr.cap { + margin-top: 10px; + background-color: #f2f2f2; +} + +img.toggler { + margin-right: 3px; + margin-top: 3px; + cursor: pointer; +} + +div.modindex-jumpbox { + border-top: 1px solid #ddd; + border-bottom: 1px solid #ddd; + margin: 1em 0 1em 0; + padding: 0.4em; +} + +div.genindex-jumpbox { + border-top: 1px solid #ddd; + border-bottom: 1px solid #ddd; + margin: 1em 0 1em 0; + padding: 0.4em; +} + +/* -- general body styles --------------------------------------------------- */ + +a.headerlink { + visibility: hidden; +} + +h1:hover > a.headerlink, +h2:hover > a.headerlink, +h3:hover > a.headerlink, +h4:hover > a.headerlink, +h5:hover > a.headerlink, +h6:hover > a.headerlink, +dt:hover > a.headerlink { + visibility: visible; +} + +div.body p.caption { + text-align: inherit; +} + +div.body td { + text-align: left; +} + +.field-list ul { + padding-left: 1em; +} + +.first { + margin-top: 0 !important; +} + +p.rubric { + margin-top: 30px; + font-weight: bold; +} + +img.align-left, .figure.align-left, object.align-left { + clear: left; + float: left; + margin-right: 1em; +} + +img.align-right, .figure.align-right, object.align-right { + clear: right; + float: right; + margin-left: 1em; +} + +img.align-center, .figure.align-center, object.align-center { + display: block; + margin-left: auto; + margin-right: auto; +} + +.align-left { + text-align: left; +} + +.align-center { + text-align: center; +} + +.align-right { + text-align: right; +} + +/* -- sidebars -------------------------------------------------------------- */ + +div.sidebar { + margin: 0 0 0.5em 1em; + border: 1px solid #ddb; + padding: 7px 7px 0 7px; + background-color: #ffe; + width: 40%; + float: right; +} + +p.sidebar-title { + font-weight: bold; +} + +/* -- topics ---------------------------------------------------------------- */ + +div.topic { + border: 1px solid #ccc; + padding: 7px 7px 0 7px; + margin: 10px 0 10px 0; +} + +p.topic-title { + font-size: 1.1em; + font-weight: bold; + margin-top: 10px; +} + +/* -- admonitions ----------------------------------------------------------- */ + +div.admonition { + margin-top: 10px; + margin-bottom: 10px; + padding: 7px; +} + +div.admonition dt { + font-weight: bold; +} + +div.admonition dl { + margin-bottom: 0; +} + +p.admonition-title { + margin: 0px 10px 5px 0px; + font-weight: bold; +} + +div.body p.centered { + text-align: center; + margin-top: 25px; +} + +/* -- tables ---------------------------------------------------------------- */ + +table.docutils { + border: 0; + border-collapse: collapse; +} + +table.docutils td, table.docutils th { + padding: 1px 8px 1px 5px; + border-top: 0; + border-left: 0; + border-right: 0; + border-bottom: 1px solid #aaa; +} + +table.field-list td, table.field-list th { + border: 0 !important; +} + +table.footnote td, table.footnote th { + border: 0 !important; +} + +th { + text-align: left; + padding-right: 5px; +} + +table.citation { + border-left: solid 1px gray; + margin-left: 1px; +} + +table.citation td { + border-bottom: none; +} + +/* -- other body styles ----------------------------------------------------- */ + +ol.arabic { + list-style: decimal; +} + +ol.loweralpha { + list-style: lower-alpha; +} + +ol.upperalpha { + list-style: upper-alpha; +} + +ol.lowerroman { + list-style: lower-roman; +} + +ol.upperroman { + list-style: upper-roman; +} + +dl { + margin-bottom: 15px; +} + +dd p { + margin-top: 0px; +} + +dd ul, dd table { + margin-bottom: 10px; +} + +dd { + margin-top: 3px; + margin-bottom: 10px; + margin-left: 30px; +} + +dt:target, .highlighted { + background-color: #fbe54e; +} + +dl.glossary dt { + font-weight: bold; + font-size: 1.1em; +} + +.field-list ul { + margin: 0; + padding-left: 1em; +} + +.field-list p { + margin: 0; +} + +.refcount { + color: #060; +} + +.optional { + font-size: 1.3em; +} + +.versionmodified { + font-style: italic; +} + +.system-message { + background-color: #fda; + padding: 5px; + border: 3px solid red; +} + +.footnote:target { + background-color: #ffa; +} + +.line-block { + display: block; + margin-top: 1em; + margin-bottom: 1em; +} + +.line-block .line-block { + margin-top: 0; + margin-bottom: 0; + margin-left: 1.5em; +} + +.guilabel, .menuselection { + font-family: sans-serif; +} + +.accelerator { + text-decoration: underline; +} + +.classifier { + font-style: oblique; +} + +abbr, acronym { + border-bottom: dotted 1px; + cursor: help; +} + +/* -- code displays --------------------------------------------------------- */ + +pre { + overflow: auto; + overflow-y: hidden; /* fixes display issues on Chrome browsers */ +} + +td.linenos pre { + padding: 5px 0px; + border: 0; + background-color: transparent; + color: #aaa; +} + +table.highlighttable { + margin-left: 0.5em; +} + +table.highlighttable td { + padding: 0 0.5em 0 0.5em; +} + +tt.descname { + background-color: transparent; + font-weight: bold; + font-size: 1.2em; +} + +tt.descclassname { + background-color: transparent; +} + +tt.xref, a tt { + background-color: transparent; + font-weight: bold; +} + +h1 tt, h2 tt, h3 tt, h4 tt, h5 tt, h6 tt { + background-color: transparent; +} + +.viewcode-link { + float: right; +} + +.viewcode-back { + float: right; + font-family: sans-serif; +} + +div.viewcode-block:target { + margin: -1px -10px; + padding: 0 10px; +} + +/* -- math display ---------------------------------------------------------- */ + +img.math { + vertical-align: middle; +} + +div.body div.math p { + text-align: center; +} + +span.eqno { + float: right; +} + +/* -- printout stylesheet --------------------------------------------------- */ + +@media print { + div.document, + div.documentwrapper, + div.bodywrapper { + margin: 0 !important; + width: 100%; + } + + div.sphinxsidebar, + div.related, + div.footer, + #top-link { + display: none; + } +}
\ No newline at end of file diff --git a/distro/common/html/_static/chef.css b/distro/common/html/_static/chef.css new file mode 100644 index 0000000000..62ff55d310 --- /dev/null +++ b/distro/common/html/_static/chef.css @@ -0,0 +1,507 @@ +/* + * opscode.css_t + * ~~~~~~~~~~~~~~~ + * + * Sphinx stylesheet -- opscode theme. Originally created by + * Opscode for docs.opscode.com. + * + * :copyright: None. + * :license: This work is licensed under a Creative Commons + * Attribution 3.0 Unported License + * + */ + +/* + * Colors + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * + * #f18a20 is Opscode orange. + * #212c35 is Opscode blue. + * + * #212c35 is used for text color and header colors + * #f18a20 for header underlines and border treatments + * + * Triads for #f18a20: #273fa4 (blue) and #18b246 (green) + * Triads for #212c35: #524a31 (tan) and #523a31 (salmon) + * Triads should only be used to accent the Opscode blue or orange + * + * For div.admonition: #6bb1e1 + * For div.warning: #fcb614 + * + * For subheaders and other treatments: #7c858c, then #b5bec6, then #d8dde3 + * For table headers: #7c858c (with #000000 text color) + * For links: #4d97c6, rollover #f18a20 + * + * Alternate colors in the official color palette (but try not to use): #59b6b2, #6d3528 + * + * For regular text: 'Helvetica Neue', 'Helvetica', 'Arial', sans-serif; + * For monospace text: 'Consolas', 'Deja Vu Sans Mono', 'Bitstream Vera Sans Mono', monospace; + * + * For div.related, the 8px ensures that the | is spaced evenly. + * + */ + +@import url("basic.css"); + +/* -- the background color for the whole page and the borders for the topic page, header, footer */ +/* -- IMPORTANT -- color is the color of the text on div.document; must be black or Opscode blue */ + +body { + font-family: 'Helvetica Neue', 'Helvetica', 'Arial', sans-serif; + font-size: 14px; + letter-spacing: -0.00em; + line-height: 150%; + text-align: center; + background-color: #7c858c; + color: #212c35; + padding: 0; + border: 4px solid #7c858c; + border-top: 0px solid #7c858c; + border-bottom: 0px solid #7c858c; + margin: 0px 80px 0px 80px; + min-width: 740px; +} + + + +/* -- the actual topic background, must be white all the time no exceptions */ + +div.document { + background-color: #ffffff; + text-align: left; + background-image: url(contents.png); + background-repeat: repeat-x; +} + + + +/* -- the vertical line between the topics and the TOC */ + +div.bodywrapper { + margin: 0 240px 0 0; + border-right: 4px solid #d8dde3; +} + +div.body { + margin: 0; + padding: 0.5em 20px 20px 20px; +} + +div.related { + font-size: 1em; +} + +/* -- the borders above and below the header and footer */ + +div.related ul { + background-color: #ffffff; + height: 1.8em; + border-top: 4px solid #d8dde3; + border-bottom: 4px solid #4d97c6; +} + +div.related ul li { + margin: 0; + padding: 0; + height: 2em; + float: left; +} + +div.related ul li.right { + float: right; + margin-right: 5px; +} + + + +/* -- the Sphinx-specific navigation text located just below the header and just above the footer */ + +div.related ul li a { + margin: 0; + padding: 0 8px 0 5px; + line-height: 1.75em; + color: #212c35; +} + +div.related ul li a:hover { + color: #f18a20; +} + + +div.sphinxsidebarwrapper { + padding: 0; +} + +div.sphinxsidebar { + margin: 0; + padding: 0.5em 15px 15px 0; + width: 210px; + float: right; + font-size: 1em; + text-align: left; + +} + + + +/* -- The colors of the TOC sidebar; h3 is headers, a is the text links and both should be same color */ + +div.sphinxsidebar h3, div.sphinxsidebar h4 { + margin: 1em 0 0.5em 0; + font-size: 1em; + padding: 0.1em 0 0.1em 0.5em; + color: #ffffff; + border: 1px solid #ffffff; + background-color: #7c858c; +} + +div.sphinxsidebar a { + color: #212c35; + padding: 0.1em 0 0.1em 0.5em; + text-decoration: none; +} + +div.sphinxsidebar h3 a { + color: #ffffff; +} + +div.sphinxsidebar ul { + padding-left: 1.5em; + margin-top: 7px; + padding: 0; + line-height: 130%; +} + +div.sphinxsidebar ul ul { + margin-left: 20px; +} + + + + +/* + * footer + * ~~~~~~~~~~~~~~~~~~~ + * + */ + + +div.footer { + background-color: #ffffff; + color: #212c35; + padding: 3px 5px 3px 5px; + clear: both; + font-size: 0.8em; + text-align: left; +} + +div.footer a { + color: #4d97c6; + text-decoration: none; +} + +div.footer a:hover { + color: #f18a20; +} + +/* -- body styles ----------------------------------------------------------- */ + +p { + margin: 0.8em 0 0.5em 0; +} + + +a { + color: #4d97c6; + text-decoration: none; +} + +a:hover { + color: #f18a20; +} + +div.body a { + text-decoration: none; +} + +em { + font-style: normal; +} + +/* -- header styles, basically Opscode blue with colored underlines and decreasing border bottom sizes */ + +h1 { + margin: 0.5; + padding: 0.7em 0 0.3em 0; + font-size: 1.75em; + color: #212c35; + border-bottom:solid 4px #f18a20; +} + +h2 { + margin: 1.3em 0 0.2em 0; + font-size: 1.55em; + color: #212c35; + padding: 0.7em 0 0.3em 0; + border-bottom:solid 2px #7c858c; +} + +h3 { + margin: 1em 0 -0.3em 0; + font-size: 1.35em; + color: #212c35; + padding: 0.7em 0 0.3em 0; + border-bottom:solid 1px #7c858c; +} + +h4 { + margin: 1em 0 -0.3em 0; + font-size: 1.15em; + color: #212c35; + padding: 0.7em 0 0.3em 0; + border-bottom:solid 0px #7c858c; +} + +div.body h1 a, div.body h2 a, div.body h3 a, div.body h4 a, div.body h5 a, div.body h6 a { + color: #ffffff!important; +} + +h1 a.anchor, h2 a.anchor, h3 a.anchor, h4 a.anchor, h5 a.anchor, h6 a.anchor { + display: none; + margin: 0 0 0 0.3em; + padding: 0 0.2em 0 0.2em; + color: #ffffff!important; +} + +h1:hover a.anchor, h2:hover a.anchor, h3:hover a.anchor, h4:hover a.anchor, +h5:hover a.anchor, h6:hover a.anchor { + display: inline; +} + +h1 a.anchor:hover, h2 a.anchor:hover, h3 a.anchor:hover, h4 a.anchor:hover, +h5 a.anchor:hover, h6 a.anchor:hover { + color: #ffffff; + background-color: #ffffff; +} + + + + +a.headerlink { + color: #ffffff!important; + font-size: 1em; + margin-left: 6px; + padding: 0 4px 0 4px; + text-decoration: none!important; +} + +a.headerlink:hover { + background-color: #ffffff; + color: #ffffff!important; +} + +cite, code, tt { + font-family: 'Consolas', 'Deja Vu Sans Mono', 'Bitstream Vera Sans Mono', monospace; + font-size: 0.95em; + letter-spacing: 0.01em; +} + + + + + +tt { + background-color: #ebecf1; + border-bottom: 1px solid #d8dde3; + color: #212c35; +} + +tt.descname, tt.descclassname, tt.xref { + border: 0; +} + +/* -- has Opscode orange for testing */ + +hr { + border: 1px solid #f18a20; + margin: 2em; +} + +/* -- has Opscode orange for testing */ + +a tt { + border: 0; + color: #f18a20; +} + +/* -- has Opscode orange for testing */ + +a tt:hover { + color: #f18a20; +} + +/* -- has Opscode orange for testing */ + +pre { + font-family: 'Consolas', 'Deja Vu Sans Mono', 'Bitstream Vera Sans Mono', monospace; + font-size: 0.95em; + letter-spacing: 0.015em; + line-height: 120%; + padding: 0.5em; + border: 0.0px solid #d8dde3; + background-color: #ebecf1; +} + +pre a { + color: inherit; + text-decoration: underline; +} + +td.linenos pre { + padding: 0.5em 0; +} + +/* -- has Opscode orange for testing */ + +div.quotebar { + background-color: #f18a20; + max-width: 250px; + float: right; + padding: 2px 7px; + border: 1px solid #f18a20; +} + +/* -- has Opscode orange for testing */ + +div.topic { + background-color: #f18a20; +} + + +/* -- table styles */ + +table.docutils { + border: 0; + border-collapse: separate; + border-spacing:4px; + +} + +table.docutils th { + padding: 1px 8px 1px 5px; + border-top: 0; + border-left: 0; + border-right: 0; + border-bottom: 0px solid #ffffff; + background-color: #7c858c; + color: #ffffff; +} + +table.docutils td { + padding: 5px 5px 5px 5px; + border-top: 0; + border-left: 0; + border-right: 0; + border-bottom: 1px dashed #7c858c; +} + +table.field-list td, table.field-list th { + border: 0 !important; +} + +table.footnote td, table.footnote th { + border: 0 !important; +} + +th { + text-align: left; + padding-right: 5px; +} + +table.citation { + border-left: solid 1px gray; + margin-left: 1px; +} + +table.citation td { + border-bottom: none; +} + + + + + + + +div.admonition, div.warning { + font-size: 0.9em; + margin: 1em 0 1em 0; + border: 1px solid #6bb1e1; + background-color: #ffffff; + padding: 0; +} + +div.admonition p, div.warning p { + margin: 0.5em 1em 0.5em 1em; + padding: 0; +} + +div.admonition pre, div.warning pre { + margin: 0.4em 1em 0.4em 1em; +} + +div.admonition p.admonition-title, +div.warning p.admonition-title { + margin: 0; + padding: 0.1em 0 0.1em 0.5em; + color: #ffffff; + border-bottom: 1px solid #6bb1e1; + font-weight: bold; + background-color: #6bb1e1; +} + + + + +div.warning { + border: 1px solid #fcb614; +} + +div.warning p.admonition-title { + background-color: #fcb614; + border-bottom-color: #fcb614; +} + +div.admonition ul, div.admonition ol, +div.warning ul, div.warning ol { + margin: 0.1em 0.5em 0.5em 3em; + padding: 0; +} + + + + +div.versioninfo { + margin: 1em 0 0 0; + border: 1px solid #ffffff; + background-color: #ffffff; + padding: 8px; + line-height: 1.3em; + font-size: 0.9em; +} + + + + +.viewcode-back { + font-family: 'Helvetica Neue', 'Helvetica', 'Arial', sans-serif; +} + + + + +div.viewcode-block:target { + background-color: #ffffff; + border-top: 1px solid #ffffff; + border-bottom: 1px solid #ffffff; +}
\ No newline at end of file diff --git a/distro/common/html/_static/chef.ico b/distro/common/html/_static/chef.ico Binary files differnew file mode 100644 index 0000000000..05e0b7e41c --- /dev/null +++ b/distro/common/html/_static/chef.ico diff --git a/distro/common/html/_static/chef_html_logo.png b/distro/common/html/_static/chef_html_logo.png Binary files differnew file mode 100644 index 0000000000..7e0389d95a --- /dev/null +++ b/distro/common/html/_static/chef_html_logo.png diff --git a/distro/common/html/_static/chef_logo.png b/distro/common/html/_static/chef_logo.png Binary files differnew file mode 100644 index 0000000000..c711d7677b --- /dev/null +++ b/distro/common/html/_static/chef_logo.png diff --git a/distro/common/html/_static/comment-bright.png b/distro/common/html/_static/comment-bright.png Binary files differnew file mode 100644 index 0000000000..551517b8c8 --- /dev/null +++ b/distro/common/html/_static/comment-bright.png diff --git a/distro/common/html/_static/comment-close.png b/distro/common/html/_static/comment-close.png Binary files differnew file mode 100644 index 0000000000..09b54be46d --- /dev/null +++ b/distro/common/html/_static/comment-close.png diff --git a/distro/common/html/_static/comment.png b/distro/common/html/_static/comment.png Binary files differnew file mode 100644 index 0000000000..92feb52b88 --- /dev/null +++ b/distro/common/html/_static/comment.png diff --git a/distro/common/html/_static/contents.png b/distro/common/html/_static/contents.png Binary files differnew file mode 100644 index 0000000000..7fb82154a1 --- /dev/null +++ b/distro/common/html/_static/contents.png diff --git a/distro/common/html/_static/doctools.js b/distro/common/html/_static/doctools.js new file mode 100644 index 0000000000..d4619fdfb1 --- /dev/null +++ b/distro/common/html/_static/doctools.js @@ -0,0 +1,247 @@ +/* + * doctools.js + * ~~~~~~~~~~~ + * + * Sphinx JavaScript utilities for all documentation. + * + * :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. + * :license: BSD, see LICENSE for details. + * + */ + +/** + * select a different prefix for underscore + */ +$u = _.noConflict(); + +/** + * make the code below compatible with browsers without + * an installed firebug like debugger +if (!window.console || !console.firebug) { + var names = ["log", "debug", "info", "warn", "error", "assert", "dir", + "dirxml", "group", "groupEnd", "time", "timeEnd", "count", "trace", + "profile", "profileEnd"]; + window.console = {}; + for (var i = 0; i < names.length; ++i) + window.console[names[i]] = function() {}; +} + */ + +/** + * small helper function to urldecode strings + */ +jQuery.urldecode = function(x) { + return decodeURIComponent(x).replace(/\+/g, ' '); +} + +/** + * small helper function to urlencode strings + */ +jQuery.urlencode = encodeURIComponent; + +/** + * This function returns the parsed url parameters of the + * current request. Multiple values per key are supported, + * it will always return arrays of strings for the value parts. + */ +jQuery.getQueryParameters = function(s) { + if (typeof s == 'undefined') + s = document.location.search; + var parts = s.substr(s.indexOf('?') + 1).split('&'); + var result = {}; + for (var i = 0; i < parts.length; i++) { + var tmp = parts[i].split('=', 2); + var key = jQuery.urldecode(tmp[0]); + var value = jQuery.urldecode(tmp[1]); + if (key in result) + result[key].push(value); + else + result[key] = [value]; + } + return result; +}; + +/** + * small function to check if an array contains + * a given item. + */ +jQuery.contains = function(arr, item) { + for (var i = 0; i < arr.length; i++) { + if (arr[i] == item) + return true; + } + return false; +}; + +/** + * highlight a given string on a jquery object by wrapping it in + * span elements with the given class name. + */ +jQuery.fn.highlightText = function(text, className) { + function highlight(node) { + if (node.nodeType == 3) { + var val = node.nodeValue; + var pos = val.toLowerCase().indexOf(text); + if (pos >= 0 && !jQuery(node.parentNode).hasClass(className)) { + var span = document.createElement("span"); + span.className = className; + span.appendChild(document.createTextNode(val.substr(pos, text.length))); + node.parentNode.insertBefore(span, node.parentNode.insertBefore( + document.createTextNode(val.substr(pos + text.length)), + node.nextSibling)); + node.nodeValue = val.substr(0, pos); + } + } + else if (!jQuery(node).is("button, select, textarea")) { + jQuery.each(node.childNodes, function() { + highlight(this); + }); + } + } + return this.each(function() { + highlight(this); + }); +}; + +/** + * Small JavaScript module for the documentation. + */ +var Documentation = { + + init : function() { + this.fixFirefoxAnchorBug(); + this.highlightSearchWords(); + this.initIndexTable(); + }, + + /** + * i18n support + */ + TRANSLATIONS : {}, + PLURAL_EXPR : function(n) { return n == 1 ? 0 : 1; }, + LOCALE : 'unknown', + + // gettext and ngettext don't access this so that the functions + // can safely bound to a different name (_ = Documentation.gettext) + gettext : function(string) { + var translated = Documentation.TRANSLATIONS[string]; + if (typeof translated == 'undefined') + return string; + return (typeof translated == 'string') ? translated : translated[0]; + }, + + ngettext : function(singular, plural, n) { + var translated = Documentation.TRANSLATIONS[singular]; + if (typeof translated == 'undefined') + return (n == 1) ? singular : plural; + return translated[Documentation.PLURALEXPR(n)]; + }, + + addTranslations : function(catalog) { + for (var key in catalog.messages) + this.TRANSLATIONS[key] = catalog.messages[key]; + this.PLURAL_EXPR = new Function('n', 'return +(' + catalog.plural_expr + ')'); + this.LOCALE = catalog.locale; + }, + + /** + * add context elements like header anchor links + */ + addContextElements : function() { + $('div[id] > :header:first').each(function() { + $('<a class="headerlink">\u00B6</a>'). + attr('href', '#' + this.id). + attr('title', _('Permalink to this headline')). + appendTo(this); + }); + $('dt[id]').each(function() { + $('<a class="headerlink">\u00B6</a>'). + attr('href', '#' + this.id). + attr('title', _('Permalink to this definition')). + appendTo(this); + }); + }, + + /** + * workaround a firefox stupidity + */ + fixFirefoxAnchorBug : function() { + if (document.location.hash && $.browser.mozilla) + window.setTimeout(function() { + document.location.href += ''; + }, 10); + }, + + /** + * highlight the search words provided in the url in the text + */ + highlightSearchWords : function() { + var params = $.getQueryParameters(); + var terms = (params.highlight) ? params.highlight[0].split(/\s+/) : []; + if (terms.length) { + var body = $('div.body'); + window.setTimeout(function() { + $.each(terms, function() { + body.highlightText(this.toLowerCase(), 'highlighted'); + }); + }, 10); + $('<p class="highlight-link"><a href="javascript:Documentation.' + + 'hideSearchWords()">' + _('Hide Search Matches') + '</a></p>') + .appendTo($('#searchbox')); + } + }, + + /** + * init the domain index toggle buttons + */ + initIndexTable : function() { + var togglers = $('img.toggler').click(function() { + var src = $(this).attr('src'); + var idnum = $(this).attr('id').substr(7); + $('tr.cg-' + idnum).toggle(); + if (src.substr(-9) == 'minus.png') + $(this).attr('src', src.substr(0, src.length-9) + 'plus.png'); + else + $(this).attr('src', src.substr(0, src.length-8) + 'minus.png'); + }).css('display', ''); + if (DOCUMENTATION_OPTIONS.COLLAPSE_INDEX) { + togglers.click(); + } + }, + + /** + * helper function to hide the search marks again + */ + hideSearchWords : function() { + $('#searchbox .highlight-link').fadeOut(300); + $('span.highlighted').removeClass('highlighted'); + }, + + /** + * make the url absolute + */ + makeURL : function(relativeURL) { + return DOCUMENTATION_OPTIONS.URL_ROOT + '/' + relativeURL; + }, + + /** + * get the current relative url + */ + getCurrentURL : function() { + var path = document.location.pathname; + var parts = path.split(/\//); + $.each(DOCUMENTATION_OPTIONS.URL_ROOT.split(/\//), function() { + if (this == '..') + parts.pop(); + }); + var url = parts.join('/'); + return path.substring(url.lastIndexOf('/') + 1, path.length - 1); + } +}; + +// quick alias for translations +_ = Documentation.gettext; + +$(document).ready(function() { + Documentation.init(); +}); diff --git a/distro/common/html/_static/down-pressed.png b/distro/common/html/_static/down-pressed.png Binary files differnew file mode 100644 index 0000000000..6f7ad78278 --- /dev/null +++ b/distro/common/html/_static/down-pressed.png diff --git a/distro/common/html/_static/down.png b/distro/common/html/_static/down.png Binary files differnew file mode 100644 index 0000000000..3003a88770 --- /dev/null +++ b/distro/common/html/_static/down.png diff --git a/distro/common/html/_static/file.png b/distro/common/html/_static/file.png Binary files differnew file mode 100644 index 0000000000..d18082e397 --- /dev/null +++ b/distro/common/html/_static/file.png diff --git a/distro/common/html/_static/guide.css b/distro/common/html/_static/guide.css new file mode 100644 index 0000000000..2163fdc4f4 --- /dev/null +++ b/distro/common/html/_static/guide.css @@ -0,0 +1,505 @@ +/* + * opscode.css_t + * ~~~~~~~~~~~~~~~ + * + * Sphinx stylesheet -- opscode theme. Originally created by + * Opscode for docs.opscode.com. + * + * :copyright: None. + * :license: This work is licensed under a Creative Commons + * Attribution 3.0 Unported License + * + */ + +/* + * Colors + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * + * #f18a20 is Opscode orange. + * #212c35 is Opscode blue. + * + * #212c35 is used for text color and header colors + * #f18a20 for header underlines and border treatments + * + * Triads for #f18a20: #273fa4 (blue) and #18b246 (green) + * Triads for #212c35: #524a31 (tan) and #523a31 (salmon) + * Triads should only be used to accent the Opscode blue or orange + * + * For div.admonition: #6bb1e1 + * For div.warning: #fcb614 + * + * For subheaders and other treatments: #7c858c, then #b5bec6, then #d8dde3 + * For table headers: #7c858c (with #000000 text color) + * For links: #6d3528, rollover #59b6b2 + * + * Alternate colors in the official color palette (but try not to use): #59b6b2, #6d3528 + * + * For regular text: 'Helvetica Neue', 'Helvetica', 'Arial', sans-serif; + * For monospace text: 'Consolas', 'Deja Vu Sans Mono', 'Bitstream Vera Sans Mono', monospace; + * + * For div.related, the 8px ensures that the | is spaced evenly. + * + */ + +@import url("basic.css"); + +/* -- the background color for the whole page and the borders for the topic page, header, footer */ +/* -- IMPORTANT -- color is the color of the text on div.document; must be black or Opscode blue */ + +body { + font-family: 'Helvetica Neue', 'Helvetica', 'Arial', sans-serif; + font-size: 14px; + letter-spacing: -0.00em; + line-height: 150%; + text-align: center; + background-color: #7c858c; + color: #212c35; + padding: 0; + border: 4px solid #7c858c; + border-top: 0px solid #7c858c; + border-bottom: 0px solid #7c858c; + margin: 0px 80px 0px 80px; + min-width: 740px; +} + + + +/* -- the actual topic background, must be white all the time no exceptions */ + +div.document { + background-color: #ffffff; + text-align: left; + background-image: url(contents.png); + background-repeat: repeat-x; +} + + + +/* -- the vertical line between the topics and the TOC */ + +div.bodywrapper { + margin: 0 240px 0 0; + border-right: 4px solid #d8dde3; +} + +div.body { + margin: 0; + padding: 0.5em 20px 20px 20px; +} + +div.related { + font-size: 1em; +} + + + +/* -- the borders above and below the header and footer */ + +div.related ul { + background-color: #ffffff; + height: 1.8em; + border-top: 4px solid #d8dde3; + border-bottom: 4px solid #d8dde3; +} + +div.related ul li { + margin: 0; + padding: 0; + height: 2em; + float: left; +} + +div.related ul li.right { + float: right; + margin-right: 5px; +} + + + +/* -- the Sphinx-specific navigation text located just below the header and just above the footer */ + +div.related ul li a { + margin: 0; + padding: 0 8px 0 5px; + line-height: 1.75em; + color: #7c858c; +} + +div.related ul li a:hover { + color: #b5bec6; +} + + +div.sphinxsidebarwrapper { + padding: 0; +} + +div.sphinxsidebar { + margin: 0; + padding: 0.5em 15px 15px 0; + width: 210px; + float: right; + font-size: 1em; + text-align: left; + +} + + + +/* -- The colors of the TOC sidebar; h3 is headers, a is the text links and both should be same color */ + +div.sphinxsidebar h3, div.sphinxsidebar h4 { + margin: 1em 0 0.5em 0; + font-size: 1em; + padding: 0.1em 0 0.1em 0.5em; + color: #ffffff; + border: 1px solid #ffffff; + background-color: #7c858c; +} + +div.sphinxsidebar a { + color: #212c35; + padding: 0.1em 0 0.1em 0.5em; + text-decoration: none; +} + +div.sphinxsidebar h3 a { + color: #ffffff; +} + +div.sphinxsidebar ul { + padding-left: 1.5em; + margin-top: 7px; + padding: 0; + line-height: 130%; +} + +div.sphinxsidebar ul ul { + margin-left: 20px; +} + + + + +/* + * footer + * ~~~~~~~~~~~~~~~~~~~ + * + */ + + +div.footer { + background-color: #ffffff; + color: #ffffff; + padding: 3px 8px 3px 0; + clear: both; + font-size: 0.8em; + text-align: right; +} + +div.footer a { + color: #ffffff; + text-decoration: none; +} + +/* -- body styles ----------------------------------------------------------- */ + +p { + margin: 0.8em 0 0.5em 0; +} + + +a { + color: #4d97c6; + text-decoration: none; +} + +a:hover { + color: #7c858c; +} + +div.body a { + text-decoration: none; +} + +em { + font-style: normal; +} + +/* -- header styles, basically Opscode blue with colored underlines and decreasing border bottom sizes */ + +h1 { + margin: 0.5; + padding: 0.7em 0 0.3em 0; + font-size: 1.75em; + color: #212c35; + border-bottom:solid 4px #f18a20; +} + +h2 { + margin: 1.3em 0 0.2em 0; + font-size: 1.55em; + color: #212c35; + padding: 0.7em 0 0.3em 0; + border-bottom:solid 2px #7c858c; +} + +h3 { + margin: 1em 0 -0.3em 0; + font-size: 1.35em; + color: #212c35; + padding: 0.7em 0 0.3em 0; + border-bottom:solid 1px #7c858c; +} + +h4 { + margin: 1em 0 -0.3em 0; + font-size: 1.15em; + color: #212c35; + padding: 0.7em 0 0.3em 0; + border-bottom:solid 0px #7c858c; +} + +div.body h1 a, div.body h2 a, div.body h3 a, div.body h4 a, div.body h5 a, div.body h6 a { + color: #ffffff!important; +} + +h1 a.anchor, h2 a.anchor, h3 a.anchor, h4 a.anchor, h5 a.anchor, h6 a.anchor { + display: none; + margin: 0 0 0 0.3em; + padding: 0 0.2em 0 0.2em; + color: #ffffff!important; +} + +h1:hover a.anchor, h2:hover a.anchor, h3:hover a.anchor, h4:hover a.anchor, +h5:hover a.anchor, h6:hover a.anchor { + display: inline; +} + +h1 a.anchor:hover, h2 a.anchor:hover, h3 a.anchor:hover, h4 a.anchor:hover, +h5 a.anchor:hover, h6 a.anchor:hover { + color: #ffffff; + background-color: #ffffff; +} + + + + +a.headerlink { + color: #ffffff!important; + font-size: 1em; + margin-left: 6px; + padding: 0 4px 0 4px; + text-decoration: none!important; +} + +a.headerlink:hover { + background-color: #ffffff; + color: #ffffff!important; +} + +cite, code, tt { + font-family: 'Consolas', 'Deja Vu Sans Mono', 'Bitstream Vera Sans Mono', monospace; + font-size: 0.95em; + letter-spacing: 0.01em; +} + + + + + +tt { + background-color: #ebecf1; + border-bottom: 1px solid #d8dde3; + color: #212c35; +} + +tt.descname, tt.descclassname, tt.xref { + border: 0; +} + +/* -- has Opscode orange for testing */ + +hr { + border: 1px solid #f18a20; + margin: 2em; +} + +/* -- has Opscode orange for testing */ + +a tt { + border: 0; + color: #f18a20; +} + +/* -- has Opscode orange for testing */ + +a tt:hover { + color: #f18a20; +} + +/* -- has Opscode orange for testing */ + +pre { + font-family: 'Consolas', 'Deja Vu Sans Mono', 'Bitstream Vera Sans Mono', monospace; + font-size: 0.95em; + letter-spacing: 0.015em; + line-height: 120%; + padding: 0.5em; + border: 0.0px solid #d8dde3; + background-color: #ebecf1; +} + +pre a { + color: inherit; + text-decoration: underline; +} + +td.linenos pre { + padding: 0.5em 0; +} + +/* -- has Opscode orange for testing */ + +div.quotebar { + background-color: #f18a20; + max-width: 250px; + float: right; + padding: 2px 7px; + border: 1px solid #f18a20; +} + +/* -- has Opscode orange for testing */ + +div.topic { + background-color: #f18a20; +} + + +/* -- table styles */ + +table.docutils { + border: 0; + border-collapse: separate; + border-spacing:4px; + +} + +table.docutils th { + padding: 1px 8px 1px 5px; + border-top: 0; + border-left: 0; + border-right: 0; + border-bottom: 0px solid #ffffff; + background-color: #7c858c; + color: #ffffff; +} + +table.docutils td { + padding: 5px 5px 5px 5px; + border-top: 0; + border-left: 0; + border-right: 0; + border-bottom: 1px dashed #7c858c; +} + +table.field-list td, table.field-list th { + border: 0 !important; +} + +table.footnote td, table.footnote th { + border: 0 !important; +} + +th { + text-align: left; + padding-right: 5px; +} + +table.citation { + border-left: solid 1px gray; + margin-left: 1px; +} + +table.citation td { + border-bottom: none; +} + + + + + + + +div.admonition, div.warning { + font-size: 0.9em; + margin: 1em 0 1em 0; + border: 1px solid #6bb1e1; + background-color: #ffffff; + padding: 0; +} + +div.admonition p, div.warning p { + margin: 0.5em 1em 0.5em 1em; + padding: 0; +} + +div.admonition pre, div.warning pre { + margin: 0.4em 1em 0.4em 1em; +} + +div.admonition p.admonition-title, +div.warning p.admonition-title { + margin: 0; + padding: 0.1em 0 0.1em 0.5em; + color: #ffffff; + border-bottom: 1px solid #6bb1e1; + font-weight: bold; + background-color: #6bb1e1; +} + + + + +div.warning { + border: 1px solid #fcb614; +} + +div.warning p.admonition-title { + background-color: #fcb614; + border-bottom-color: #fcb614; +} + +div.admonition ul, div.admonition ol, +div.warning ul, div.warning ol { + margin: 0.1em 0.5em 0.5em 3em; + padding: 0; +} + + + + +div.versioninfo { + margin: 1em 0 0 0; + border: 1px solid #ffffff; + background-color: #ffffff; + padding: 8px; + line-height: 1.3em; + font-size: 0.9em; +} + + + + +.viewcode-back { + font-family: 'Helvetica Neue', 'Helvetica', 'Arial', sans-serif; +} + + + + +div.viewcode-block:target { + background-color: #ffffff; + border-top: 1px solid #ffffff; + border-bottom: 1px solid #ffffff; +}
\ No newline at end of file diff --git a/distro/common/html/_static/jquery.js b/distro/common/html/_static/jquery.js new file mode 100644 index 0000000000..7c24308023 --- /dev/null +++ b/distro/common/html/_static/jquery.js @@ -0,0 +1,154 @@ +/*! + * jQuery JavaScript Library v1.4.2 + * http://jquery.com/ + * + * Copyright 2010, John Resig + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * Includes Sizzle.js + * http://sizzlejs.com/ + * Copyright 2010, The Dojo Foundation + * Released under the MIT, BSD, and GPL Licenses. + * + * Date: Sat Feb 13 22:33:48 2010 -0500 + */ +(function(A,w){function ma(){if(!c.isReady){try{s.documentElement.doScroll("left")}catch(a){setTimeout(ma,1);return}c.ready()}}function Qa(a,b){b.src?c.ajax({url:b.src,async:false,dataType:"script"}):c.globalEval(b.text||b.textContent||b.innerHTML||"");b.parentNode&&b.parentNode.removeChild(b)}function X(a,b,d,f,e,j){var i=a.length;if(typeof b==="object"){for(var o in b)X(a,o,b[o],f,e,d);return a}if(d!==w){f=!j&&f&&c.isFunction(d);for(o=0;o<i;o++)e(a[o],b,f?d.call(a[o],o,e(a[o],b)):d,j);return a}return i? +e(a[0],b):w}function J(){return(new Date).getTime()}function Y(){return false}function Z(){return true}function na(a,b,d){d[0].type=a;return c.event.handle.apply(b,d)}function oa(a){var b,d=[],f=[],e=arguments,j,i,o,k,n,r;i=c.data(this,"events");if(!(a.liveFired===this||!i||!i.live||a.button&&a.type==="click")){a.liveFired=this;var u=i.live.slice(0);for(k=0;k<u.length;k++){i=u[k];i.origType.replace(O,"")===a.type?f.push(i.selector):u.splice(k--,1)}j=c(a.target).closest(f,a.currentTarget);n=0;for(r= +j.length;n<r;n++)for(k=0;k<u.length;k++){i=u[k];if(j[n].selector===i.selector){o=j[n].elem;f=null;if(i.preType==="mouseenter"||i.preType==="mouseleave")f=c(a.relatedTarget).closest(i.selector)[0];if(!f||f!==o)d.push({elem:o,handleObj:i})}}n=0;for(r=d.length;n<r;n++){j=d[n];a.currentTarget=j.elem;a.data=j.handleObj.data;a.handleObj=j.handleObj;if(j.handleObj.origHandler.apply(j.elem,e)===false){b=false;break}}return b}}function pa(a,b){return"live."+(a&&a!=="*"?a+".":"")+b.replace(/\./g,"`").replace(/ /g, +"&")}function qa(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function ra(a,b){var d=0;b.each(function(){if(this.nodeName===(a[d]&&a[d].nodeName)){var f=c.data(a[d++]),e=c.data(this,f);if(f=f&&f.events){delete e.handle;e.events={};for(var j in f)for(var i in f[j])c.event.add(this,j,f[j][i],f[j][i].data)}}})}function sa(a,b,d){var f,e,j;b=b&&b[0]?b[0].ownerDocument||b[0]:s;if(a.length===1&&typeof a[0]==="string"&&a[0].length<512&&b===s&&!ta.test(a[0])&&(c.support.checkClone||!ua.test(a[0]))){e= +true;if(j=c.fragments[a[0]])if(j!==1)f=j}if(!f){f=b.createDocumentFragment();c.clean(a,b,f,d)}if(e)c.fragments[a[0]]=j?f:1;return{fragment:f,cacheable:e}}function K(a,b){var d={};c.each(va.concat.apply([],va.slice(0,b)),function(){d[this]=a});return d}function wa(a){return"scrollTo"in a&&a.document?a:a.nodeType===9?a.defaultView||a.parentWindow:false}var c=function(a,b){return new c.fn.init(a,b)},Ra=A.jQuery,Sa=A.$,s=A.document,T,Ta=/^[^<]*(<[\w\W]+>)[^>]*$|^#([\w-]+)$/,Ua=/^.[^:#\[\.,]*$/,Va=/\S/, +Wa=/^(\s|\u00A0)+|(\s|\u00A0)+$/g,Xa=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,P=navigator.userAgent,xa=false,Q=[],L,$=Object.prototype.toString,aa=Object.prototype.hasOwnProperty,ba=Array.prototype.push,R=Array.prototype.slice,ya=Array.prototype.indexOf;c.fn=c.prototype={init:function(a,b){var d,f;if(!a)return this;if(a.nodeType){this.context=this[0]=a;this.length=1;return this}if(a==="body"&&!b){this.context=s;this[0]=s.body;this.selector="body";this.length=1;return this}if(typeof a==="string")if((d=Ta.exec(a))&& +(d[1]||!b))if(d[1]){f=b?b.ownerDocument||b:s;if(a=Xa.exec(a))if(c.isPlainObject(b)){a=[s.createElement(a[1])];c.fn.attr.call(a,b,true)}else a=[f.createElement(a[1])];else{a=sa([d[1]],[f]);a=(a.cacheable?a.fragment.cloneNode(true):a.fragment).childNodes}return c.merge(this,a)}else{if(b=s.getElementById(d[2])){if(b.id!==d[2])return T.find(a);this.length=1;this[0]=b}this.context=s;this.selector=a;return this}else if(!b&&/^\w+$/.test(a)){this.selector=a;this.context=s;a=s.getElementsByTagName(a);return c.merge(this, +a)}else return!b||b.jquery?(b||T).find(a):c(b).find(a);else if(c.isFunction(a))return T.ready(a);if(a.selector!==w){this.selector=a.selector;this.context=a.context}return c.makeArray(a,this)},selector:"",jquery:"1.4.2",length:0,size:function(){return this.length},toArray:function(){return R.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this.slice(a)[0]:this[a]},pushStack:function(a,b,d){var f=c();c.isArray(a)?ba.apply(f,a):c.merge(f,a);f.prevObject=this;f.context=this.context;if(b=== +"find")f.selector=this.selector+(this.selector?" ":"")+d;else if(b)f.selector=this.selector+"."+b+"("+d+")";return f},each:function(a,b){return c.each(this,a,b)},ready:function(a){c.bindReady();if(c.isReady)a.call(s,c);else Q&&Q.push(a);return this},eq:function(a){return a===-1?this.slice(a):this.slice(a,+a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(R.apply(this,arguments),"slice",R.call(arguments).join(","))},map:function(a){return this.pushStack(c.map(this, +function(b,d){return a.call(b,d,b)}))},end:function(){return this.prevObject||c(null)},push:ba,sort:[].sort,splice:[].splice};c.fn.init.prototype=c.fn;c.extend=c.fn.extend=function(){var a=arguments[0]||{},b=1,d=arguments.length,f=false,e,j,i,o;if(typeof a==="boolean"){f=a;a=arguments[1]||{};b=2}if(typeof a!=="object"&&!c.isFunction(a))a={};if(d===b){a=this;--b}for(;b<d;b++)if((e=arguments[b])!=null)for(j in e){i=a[j];o=e[j];if(a!==o)if(f&&o&&(c.isPlainObject(o)||c.isArray(o))){i=i&&(c.isPlainObject(i)|| +c.isArray(i))?i:c.isArray(o)?[]:{};a[j]=c.extend(f,i,o)}else if(o!==w)a[j]=o}return a};c.extend({noConflict:function(a){A.$=Sa;if(a)A.jQuery=Ra;return c},isReady:false,ready:function(){if(!c.isReady){if(!s.body)return setTimeout(c.ready,13);c.isReady=true;if(Q){for(var a,b=0;a=Q[b++];)a.call(s,c);Q=null}c.fn.triggerHandler&&c(s).triggerHandler("ready")}},bindReady:function(){if(!xa){xa=true;if(s.readyState==="complete")return c.ready();if(s.addEventListener){s.addEventListener("DOMContentLoaded", +L,false);A.addEventListener("load",c.ready,false)}else if(s.attachEvent){s.attachEvent("onreadystatechange",L);A.attachEvent("onload",c.ready);var a=false;try{a=A.frameElement==null}catch(b){}s.documentElement.doScroll&&a&&ma()}}},isFunction:function(a){return $.call(a)==="[object Function]"},isArray:function(a){return $.call(a)==="[object Array]"},isPlainObject:function(a){if(!a||$.call(a)!=="[object Object]"||a.nodeType||a.setInterval)return false;if(a.constructor&&!aa.call(a,"constructor")&&!aa.call(a.constructor.prototype, +"isPrototypeOf"))return false;var b;for(b in a);return b===w||aa.call(a,b)},isEmptyObject:function(a){for(var b in a)return false;return true},error:function(a){throw a;},parseJSON:function(a){if(typeof a!=="string"||!a)return null;a=c.trim(a);if(/^[\],:{}\s]*$/.test(a.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,"")))return A.JSON&&A.JSON.parse?A.JSON.parse(a):(new Function("return "+ +a))();else c.error("Invalid JSON: "+a)},noop:function(){},globalEval:function(a){if(a&&Va.test(a)){var b=s.getElementsByTagName("head")[0]||s.documentElement,d=s.createElement("script");d.type="text/javascript";if(c.support.scriptEval)d.appendChild(s.createTextNode(a));else d.text=a;b.insertBefore(d,b.firstChild);b.removeChild(d)}},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,b,d){var f,e=0,j=a.length,i=j===w||c.isFunction(a);if(d)if(i)for(f in a){if(b.apply(a[f], +d)===false)break}else for(;e<j;){if(b.apply(a[e++],d)===false)break}else if(i)for(f in a){if(b.call(a[f],f,a[f])===false)break}else for(d=a[0];e<j&&b.call(d,e,d)!==false;d=a[++e]);return a},trim:function(a){return(a||"").replace(Wa,"")},makeArray:function(a,b){b=b||[];if(a!=null)a.length==null||typeof a==="string"||c.isFunction(a)||typeof a!=="function"&&a.setInterval?ba.call(b,a):c.merge(b,a);return b},inArray:function(a,b){if(b.indexOf)return b.indexOf(a);for(var d=0,f=b.length;d<f;d++)if(b[d]=== +a)return d;return-1},merge:function(a,b){var d=a.length,f=0;if(typeof b.length==="number")for(var e=b.length;f<e;f++)a[d++]=b[f];else for(;b[f]!==w;)a[d++]=b[f++];a.length=d;return a},grep:function(a,b,d){for(var f=[],e=0,j=a.length;e<j;e++)!d!==!b(a[e],e)&&f.push(a[e]);return f},map:function(a,b,d){for(var f=[],e,j=0,i=a.length;j<i;j++){e=b(a[j],j,d);if(e!=null)f[f.length]=e}return f.concat.apply([],f)},guid:1,proxy:function(a,b,d){if(arguments.length===2)if(typeof b==="string"){d=a;a=d[b];b=w}else if(b&& +!c.isFunction(b)){d=b;b=w}if(!b&&a)b=function(){return a.apply(d||this,arguments)};if(a)b.guid=a.guid=a.guid||b.guid||c.guid++;return b},uaMatch:function(a){a=a.toLowerCase();a=/(webkit)[ \/]([\w.]+)/.exec(a)||/(opera)(?:.*version)?[ \/]([\w.]+)/.exec(a)||/(msie) ([\w.]+)/.exec(a)||!/compatible/.test(a)&&/(mozilla)(?:.*? rv:([\w.]+))?/.exec(a)||[];return{browser:a[1]||"",version:a[2]||"0"}},browser:{}});P=c.uaMatch(P);if(P.browser){c.browser[P.browser]=true;c.browser.version=P.version}if(c.browser.webkit)c.browser.safari= +true;if(ya)c.inArray=function(a,b){return ya.call(b,a)};T=c(s);if(s.addEventListener)L=function(){s.removeEventListener("DOMContentLoaded",L,false);c.ready()};else if(s.attachEvent)L=function(){if(s.readyState==="complete"){s.detachEvent("onreadystatechange",L);c.ready()}};(function(){c.support={};var a=s.documentElement,b=s.createElement("script"),d=s.createElement("div"),f="script"+J();d.style.display="none";d.innerHTML=" <link/><table></table><a href='/a' style='color:red;float:left;opacity:.55;'>a</a><input type='checkbox'/>"; +var e=d.getElementsByTagName("*"),j=d.getElementsByTagName("a")[0];if(!(!e||!e.length||!j)){c.support={leadingWhitespace:d.firstChild.nodeType===3,tbody:!d.getElementsByTagName("tbody").length,htmlSerialize:!!d.getElementsByTagName("link").length,style:/red/.test(j.getAttribute("style")),hrefNormalized:j.getAttribute("href")==="/a",opacity:/^0.55$/.test(j.style.opacity),cssFloat:!!j.style.cssFloat,checkOn:d.getElementsByTagName("input")[0].value==="on",optSelected:s.createElement("select").appendChild(s.createElement("option")).selected, +parentNode:d.removeChild(d.appendChild(s.createElement("div"))).parentNode===null,deleteExpando:true,checkClone:false,scriptEval:false,noCloneEvent:true,boxModel:null};b.type="text/javascript";try{b.appendChild(s.createTextNode("window."+f+"=1;"))}catch(i){}a.insertBefore(b,a.firstChild);if(A[f]){c.support.scriptEval=true;delete A[f]}try{delete b.test}catch(o){c.support.deleteExpando=false}a.removeChild(b);if(d.attachEvent&&d.fireEvent){d.attachEvent("onclick",function k(){c.support.noCloneEvent= +false;d.detachEvent("onclick",k)});d.cloneNode(true).fireEvent("onclick")}d=s.createElement("div");d.innerHTML="<input type='radio' name='radiotest' checked='checked'/>";a=s.createDocumentFragment();a.appendChild(d.firstChild);c.support.checkClone=a.cloneNode(true).cloneNode(true).lastChild.checked;c(function(){var k=s.createElement("div");k.style.width=k.style.paddingLeft="1px";s.body.appendChild(k);c.boxModel=c.support.boxModel=k.offsetWidth===2;s.body.removeChild(k).style.display="none"});a=function(k){var n= +s.createElement("div");k="on"+k;var r=k in n;if(!r){n.setAttribute(k,"return;");r=typeof n[k]==="function"}return r};c.support.submitBubbles=a("submit");c.support.changeBubbles=a("change");a=b=d=e=j=null}})();c.props={"for":"htmlFor","class":"className",readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",colspan:"colSpan",tabindex:"tabIndex",usemap:"useMap",frameborder:"frameBorder"};var G="jQuery"+J(),Ya=0,za={};c.extend({cache:{},expando:G,noData:{embed:true,object:true, +applet:true},data:function(a,b,d){if(!(a.nodeName&&c.noData[a.nodeName.toLowerCase()])){a=a==A?za:a;var f=a[G],e=c.cache;if(!f&&typeof b==="string"&&d===w)return null;f||(f=++Ya);if(typeof b==="object"){a[G]=f;e[f]=c.extend(true,{},b)}else if(!e[f]){a[G]=f;e[f]={}}a=e[f];if(d!==w)a[b]=d;return typeof b==="string"?a[b]:a}},removeData:function(a,b){if(!(a.nodeName&&c.noData[a.nodeName.toLowerCase()])){a=a==A?za:a;var d=a[G],f=c.cache,e=f[d];if(b){if(e){delete e[b];c.isEmptyObject(e)&&c.removeData(a)}}else{if(c.support.deleteExpando)delete a[c.expando]; +else a.removeAttribute&&a.removeAttribute(c.expando);delete f[d]}}}});c.fn.extend({data:function(a,b){if(typeof a==="undefined"&&this.length)return c.data(this[0]);else if(typeof a==="object")return this.each(function(){c.data(this,a)});var d=a.split(".");d[1]=d[1]?"."+d[1]:"";if(b===w){var f=this.triggerHandler("getData"+d[1]+"!",[d[0]]);if(f===w&&this.length)f=c.data(this[0],a);return f===w&&d[1]?this.data(d[0]):f}else return this.trigger("setData"+d[1]+"!",[d[0],b]).each(function(){c.data(this, +a,b)})},removeData:function(a){return this.each(function(){c.removeData(this,a)})}});c.extend({queue:function(a,b,d){if(a){b=(b||"fx")+"queue";var f=c.data(a,b);if(!d)return f||[];if(!f||c.isArray(d))f=c.data(a,b,c.makeArray(d));else f.push(d);return f}},dequeue:function(a,b){b=b||"fx";var d=c.queue(a,b),f=d.shift();if(f==="inprogress")f=d.shift();if(f){b==="fx"&&d.unshift("inprogress");f.call(a,function(){c.dequeue(a,b)})}}});c.fn.extend({queue:function(a,b){if(typeof a!=="string"){b=a;a="fx"}if(b=== +w)return c.queue(this[0],a);return this.each(function(){var d=c.queue(this,a,b);a==="fx"&&d[0]!=="inprogress"&&c.dequeue(this,a)})},dequeue:function(a){return this.each(function(){c.dequeue(this,a)})},delay:function(a,b){a=c.fx?c.fx.speeds[a]||a:a;b=b||"fx";return this.queue(b,function(){var d=this;setTimeout(function(){c.dequeue(d,b)},a)})},clearQueue:function(a){return this.queue(a||"fx",[])}});var Aa=/[\n\t]/g,ca=/\s+/,Za=/\r/g,$a=/href|src|style/,ab=/(button|input)/i,bb=/(button|input|object|select|textarea)/i, +cb=/^(a|area)$/i,Ba=/radio|checkbox/;c.fn.extend({attr:function(a,b){return X(this,a,b,true,c.attr)},removeAttr:function(a){return this.each(function(){c.attr(this,a,"");this.nodeType===1&&this.removeAttribute(a)})},addClass:function(a){if(c.isFunction(a))return this.each(function(n){var r=c(this);r.addClass(a.call(this,n,r.attr("class")))});if(a&&typeof a==="string")for(var b=(a||"").split(ca),d=0,f=this.length;d<f;d++){var e=this[d];if(e.nodeType===1)if(e.className){for(var j=" "+e.className+" ", +i=e.className,o=0,k=b.length;o<k;o++)if(j.indexOf(" "+b[o]+" ")<0)i+=" "+b[o];e.className=c.trim(i)}else e.className=a}return this},removeClass:function(a){if(c.isFunction(a))return this.each(function(k){var n=c(this);n.removeClass(a.call(this,k,n.attr("class")))});if(a&&typeof a==="string"||a===w)for(var b=(a||"").split(ca),d=0,f=this.length;d<f;d++){var e=this[d];if(e.nodeType===1&&e.className)if(a){for(var j=(" "+e.className+" ").replace(Aa," "),i=0,o=b.length;i<o;i++)j=j.replace(" "+b[i]+" ", +" ");e.className=c.trim(j)}else e.className=""}return this},toggleClass:function(a,b){var d=typeof a,f=typeof b==="boolean";if(c.isFunction(a))return this.each(function(e){var j=c(this);j.toggleClass(a.call(this,e,j.attr("class"),b),b)});return this.each(function(){if(d==="string")for(var e,j=0,i=c(this),o=b,k=a.split(ca);e=k[j++];){o=f?o:!i.hasClass(e);i[o?"addClass":"removeClass"](e)}else if(d==="undefined"||d==="boolean"){this.className&&c.data(this,"__className__",this.className);this.className= +this.className||a===false?"":c.data(this,"__className__")||""}})},hasClass:function(a){a=" "+a+" ";for(var b=0,d=this.length;b<d;b++)if((" "+this[b].className+" ").replace(Aa," ").indexOf(a)>-1)return true;return false},val:function(a){if(a===w){var b=this[0];if(b){if(c.nodeName(b,"option"))return(b.attributes.value||{}).specified?b.value:b.text;if(c.nodeName(b,"select")){var d=b.selectedIndex,f=[],e=b.options;b=b.type==="select-one";if(d<0)return null;var j=b?d:0;for(d=b?d+1:e.length;j<d;j++){var i= +e[j];if(i.selected){a=c(i).val();if(b)return a;f.push(a)}}return f}if(Ba.test(b.type)&&!c.support.checkOn)return b.getAttribute("value")===null?"on":b.value;return(b.value||"").replace(Za,"")}return w}var o=c.isFunction(a);return this.each(function(k){var n=c(this),r=a;if(this.nodeType===1){if(o)r=a.call(this,k,n.val());if(typeof r==="number")r+="";if(c.isArray(r)&&Ba.test(this.type))this.checked=c.inArray(n.val(),r)>=0;else if(c.nodeName(this,"select")){var u=c.makeArray(r);c("option",this).each(function(){this.selected= +c.inArray(c(this).val(),u)>=0});if(!u.length)this.selectedIndex=-1}else this.value=r}})}});c.extend({attrFn:{val:true,css:true,html:true,text:true,data:true,width:true,height:true,offset:true},attr:function(a,b,d,f){if(!a||a.nodeType===3||a.nodeType===8)return w;if(f&&b in c.attrFn)return c(a)[b](d);f=a.nodeType!==1||!c.isXMLDoc(a);var e=d!==w;b=f&&c.props[b]||b;if(a.nodeType===1){var j=$a.test(b);if(b in a&&f&&!j){if(e){b==="type"&&ab.test(a.nodeName)&&a.parentNode&&c.error("type property can't be changed"); +a[b]=d}if(c.nodeName(a,"form")&&a.getAttributeNode(b))return a.getAttributeNode(b).nodeValue;if(b==="tabIndex")return(b=a.getAttributeNode("tabIndex"))&&b.specified?b.value:bb.test(a.nodeName)||cb.test(a.nodeName)&&a.href?0:w;return a[b]}if(!c.support.style&&f&&b==="style"){if(e)a.style.cssText=""+d;return a.style.cssText}e&&a.setAttribute(b,""+d);a=!c.support.hrefNormalized&&f&&j?a.getAttribute(b,2):a.getAttribute(b);return a===null?w:a}return c.style(a,b,d)}});var O=/\.(.*)$/,db=function(a){return a.replace(/[^\w\s\.\|`]/g, +function(b){return"\\"+b})};c.event={add:function(a,b,d,f){if(!(a.nodeType===3||a.nodeType===8)){if(a.setInterval&&a!==A&&!a.frameElement)a=A;var e,j;if(d.handler){e=d;d=e.handler}if(!d.guid)d.guid=c.guid++;if(j=c.data(a)){var i=j.events=j.events||{},o=j.handle;if(!o)j.handle=o=function(){return typeof c!=="undefined"&&!c.event.triggered?c.event.handle.apply(o.elem,arguments):w};o.elem=a;b=b.split(" ");for(var k,n=0,r;k=b[n++];){j=e?c.extend({},e):{handler:d,data:f};if(k.indexOf(".")>-1){r=k.split("."); +k=r.shift();j.namespace=r.slice(0).sort().join(".")}else{r=[];j.namespace=""}j.type=k;j.guid=d.guid;var u=i[k],z=c.event.special[k]||{};if(!u){u=i[k]=[];if(!z.setup||z.setup.call(a,f,r,o)===false)if(a.addEventListener)a.addEventListener(k,o,false);else a.attachEvent&&a.attachEvent("on"+k,o)}if(z.add){z.add.call(a,j);if(!j.handler.guid)j.handler.guid=d.guid}u.push(j);c.event.global[k]=true}a=null}}},global:{},remove:function(a,b,d,f){if(!(a.nodeType===3||a.nodeType===8)){var e,j=0,i,o,k,n,r,u,z=c.data(a), +C=z&&z.events;if(z&&C){if(b&&b.type){d=b.handler;b=b.type}if(!b||typeof b==="string"&&b.charAt(0)==="."){b=b||"";for(e in C)c.event.remove(a,e+b)}else{for(b=b.split(" ");e=b[j++];){n=e;i=e.indexOf(".")<0;o=[];if(!i){o=e.split(".");e=o.shift();k=new RegExp("(^|\\.)"+c.map(o.slice(0).sort(),db).join("\\.(?:.*\\.)?")+"(\\.|$)")}if(r=C[e])if(d){n=c.event.special[e]||{};for(B=f||0;B<r.length;B++){u=r[B];if(d.guid===u.guid){if(i||k.test(u.namespace)){f==null&&r.splice(B--,1);n.remove&&n.remove.call(a,u)}if(f!= +null)break}}if(r.length===0||f!=null&&r.length===1){if(!n.teardown||n.teardown.call(a,o)===false)Ca(a,e,z.handle);delete C[e]}}else for(var B=0;B<r.length;B++){u=r[B];if(i||k.test(u.namespace)){c.event.remove(a,n,u.handler,B);r.splice(B--,1)}}}if(c.isEmptyObject(C)){if(b=z.handle)b.elem=null;delete z.events;delete z.handle;c.isEmptyObject(z)&&c.removeData(a)}}}}},trigger:function(a,b,d,f){var e=a.type||a;if(!f){a=typeof a==="object"?a[G]?a:c.extend(c.Event(e),a):c.Event(e);if(e.indexOf("!")>=0){a.type= +e=e.slice(0,-1);a.exclusive=true}if(!d){a.stopPropagation();c.event.global[e]&&c.each(c.cache,function(){this.events&&this.events[e]&&c.event.trigger(a,b,this.handle.elem)})}if(!d||d.nodeType===3||d.nodeType===8)return w;a.result=w;a.target=d;b=c.makeArray(b);b.unshift(a)}a.currentTarget=d;(f=c.data(d,"handle"))&&f.apply(d,b);f=d.parentNode||d.ownerDocument;try{if(!(d&&d.nodeName&&c.noData[d.nodeName.toLowerCase()]))if(d["on"+e]&&d["on"+e].apply(d,b)===false)a.result=false}catch(j){}if(!a.isPropagationStopped()&& +f)c.event.trigger(a,b,f,true);else if(!a.isDefaultPrevented()){f=a.target;var i,o=c.nodeName(f,"a")&&e==="click",k=c.event.special[e]||{};if((!k._default||k._default.call(d,a)===false)&&!o&&!(f&&f.nodeName&&c.noData[f.nodeName.toLowerCase()])){try{if(f[e]){if(i=f["on"+e])f["on"+e]=null;c.event.triggered=true;f[e]()}}catch(n){}if(i)f["on"+e]=i;c.event.triggered=false}}},handle:function(a){var b,d,f,e;a=arguments[0]=c.event.fix(a||A.event);a.currentTarget=this;b=a.type.indexOf(".")<0&&!a.exclusive; +if(!b){d=a.type.split(".");a.type=d.shift();f=new RegExp("(^|\\.)"+d.slice(0).sort().join("\\.(?:.*\\.)?")+"(\\.|$)")}e=c.data(this,"events");d=e[a.type];if(e&&d){d=d.slice(0);e=0;for(var j=d.length;e<j;e++){var i=d[e];if(b||f.test(i.namespace)){a.handler=i.handler;a.data=i.data;a.handleObj=i;i=i.handler.apply(this,arguments);if(i!==w){a.result=i;if(i===false){a.preventDefault();a.stopPropagation()}}if(a.isImmediatePropagationStopped())break}}}return a.result},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode layerX layerY metaKey newValue offsetX offsetY originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "), +fix:function(a){if(a[G])return a;var b=a;a=c.Event(b);for(var d=this.props.length,f;d;){f=this.props[--d];a[f]=b[f]}if(!a.target)a.target=a.srcElement||s;if(a.target.nodeType===3)a.target=a.target.parentNode;if(!a.relatedTarget&&a.fromElement)a.relatedTarget=a.fromElement===a.target?a.toElement:a.fromElement;if(a.pageX==null&&a.clientX!=null){b=s.documentElement;d=s.body;a.pageX=a.clientX+(b&&b.scrollLeft||d&&d.scrollLeft||0)-(b&&b.clientLeft||d&&d.clientLeft||0);a.pageY=a.clientY+(b&&b.scrollTop|| +d&&d.scrollTop||0)-(b&&b.clientTop||d&&d.clientTop||0)}if(!a.which&&(a.charCode||a.charCode===0?a.charCode:a.keyCode))a.which=a.charCode||a.keyCode;if(!a.metaKey&&a.ctrlKey)a.metaKey=a.ctrlKey;if(!a.which&&a.button!==w)a.which=a.button&1?1:a.button&2?3:a.button&4?2:0;return a},guid:1E8,proxy:c.proxy,special:{ready:{setup:c.bindReady,teardown:c.noop},live:{add:function(a){c.event.add(this,a.origType,c.extend({},a,{handler:oa}))},remove:function(a){var b=true,d=a.origType.replace(O,"");c.each(c.data(this, +"events").live||[],function(){if(d===this.origType.replace(O,""))return b=false});b&&c.event.remove(this,a.origType,oa)}},beforeunload:{setup:function(a,b,d){if(this.setInterval)this.onbeforeunload=d;return false},teardown:function(a,b){if(this.onbeforeunload===b)this.onbeforeunload=null}}}};var Ca=s.removeEventListener?function(a,b,d){a.removeEventListener(b,d,false)}:function(a,b,d){a.detachEvent("on"+b,d)};c.Event=function(a){if(!this.preventDefault)return new c.Event(a);if(a&&a.type){this.originalEvent= +a;this.type=a.type}else this.type=a;this.timeStamp=J();this[G]=true};c.Event.prototype={preventDefault:function(){this.isDefaultPrevented=Z;var a=this.originalEvent;if(a){a.preventDefault&&a.preventDefault();a.returnValue=false}},stopPropagation:function(){this.isPropagationStopped=Z;var a=this.originalEvent;if(a){a.stopPropagation&&a.stopPropagation();a.cancelBubble=true}},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=Z;this.stopPropagation()},isDefaultPrevented:Y,isPropagationStopped:Y, +isImmediatePropagationStopped:Y};var Da=function(a){var b=a.relatedTarget;try{for(;b&&b!==this;)b=b.parentNode;if(b!==this){a.type=a.data;c.event.handle.apply(this,arguments)}}catch(d){}},Ea=function(a){a.type=a.data;c.event.handle.apply(this,arguments)};c.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(a,b){c.event.special[a]={setup:function(d){c.event.add(this,b,d&&d.selector?Ea:Da,a)},teardown:function(d){c.event.remove(this,b,d&&d.selector?Ea:Da)}}});if(!c.support.submitBubbles)c.event.special.submit= +{setup:function(){if(this.nodeName.toLowerCase()!=="form"){c.event.add(this,"click.specialSubmit",function(a){var b=a.target,d=b.type;if((d==="submit"||d==="image")&&c(b).closest("form").length)return na("submit",this,arguments)});c.event.add(this,"keypress.specialSubmit",function(a){var b=a.target,d=b.type;if((d==="text"||d==="password")&&c(b).closest("form").length&&a.keyCode===13)return na("submit",this,arguments)})}else return false},teardown:function(){c.event.remove(this,".specialSubmit")}}; +if(!c.support.changeBubbles){var da=/textarea|input|select/i,ea,Fa=function(a){var b=a.type,d=a.value;if(b==="radio"||b==="checkbox")d=a.checked;else if(b==="select-multiple")d=a.selectedIndex>-1?c.map(a.options,function(f){return f.selected}).join("-"):"";else if(a.nodeName.toLowerCase()==="select")d=a.selectedIndex;return d},fa=function(a,b){var d=a.target,f,e;if(!(!da.test(d.nodeName)||d.readOnly)){f=c.data(d,"_change_data");e=Fa(d);if(a.type!=="focusout"||d.type!=="radio")c.data(d,"_change_data", +e);if(!(f===w||e===f))if(f!=null||e){a.type="change";return c.event.trigger(a,b,d)}}};c.event.special.change={filters:{focusout:fa,click:function(a){var b=a.target,d=b.type;if(d==="radio"||d==="checkbox"||b.nodeName.toLowerCase()==="select")return fa.call(this,a)},keydown:function(a){var b=a.target,d=b.type;if(a.keyCode===13&&b.nodeName.toLowerCase()!=="textarea"||a.keyCode===32&&(d==="checkbox"||d==="radio")||d==="select-multiple")return fa.call(this,a)},beforeactivate:function(a){a=a.target;c.data(a, +"_change_data",Fa(a))}},setup:function(){if(this.type==="file")return false;for(var a in ea)c.event.add(this,a+".specialChange",ea[a]);return da.test(this.nodeName)},teardown:function(){c.event.remove(this,".specialChange");return da.test(this.nodeName)}};ea=c.event.special.change.filters}s.addEventListener&&c.each({focus:"focusin",blur:"focusout"},function(a,b){function d(f){f=c.event.fix(f);f.type=b;return c.event.handle.call(this,f)}c.event.special[b]={setup:function(){this.addEventListener(a, +d,true)},teardown:function(){this.removeEventListener(a,d,true)}}});c.each(["bind","one"],function(a,b){c.fn[b]=function(d,f,e){if(typeof d==="object"){for(var j in d)this[b](j,f,d[j],e);return this}if(c.isFunction(f)){e=f;f=w}var i=b==="one"?c.proxy(e,function(k){c(this).unbind(k,i);return e.apply(this,arguments)}):e;if(d==="unload"&&b!=="one")this.one(d,f,e);else{j=0;for(var o=this.length;j<o;j++)c.event.add(this[j],d,i,f)}return this}});c.fn.extend({unbind:function(a,b){if(typeof a==="object"&& +!a.preventDefault)for(var d in a)this.unbind(d,a[d]);else{d=0;for(var f=this.length;d<f;d++)c.event.remove(this[d],a,b)}return this},delegate:function(a,b,d,f){return this.live(b,d,f,a)},undelegate:function(a,b,d){return arguments.length===0?this.unbind("live"):this.die(b,null,d,a)},trigger:function(a,b){return this.each(function(){c.event.trigger(a,b,this)})},triggerHandler:function(a,b){if(this[0]){a=c.Event(a);a.preventDefault();a.stopPropagation();c.event.trigger(a,b,this[0]);return a.result}}, +toggle:function(a){for(var b=arguments,d=1;d<b.length;)c.proxy(a,b[d++]);return this.click(c.proxy(a,function(f){var e=(c.data(this,"lastToggle"+a.guid)||0)%d;c.data(this,"lastToggle"+a.guid,e+1);f.preventDefault();return b[e].apply(this,arguments)||false}))},hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}});var Ga={focus:"focusin",blur:"focusout",mouseenter:"mouseover",mouseleave:"mouseout"};c.each(["live","die"],function(a,b){c.fn[b]=function(d,f,e,j){var i,o=0,k,n,r=j||this.selector, +u=j?this:c(this.context);if(c.isFunction(f)){e=f;f=w}for(d=(d||"").split(" ");(i=d[o++])!=null;){j=O.exec(i);k="";if(j){k=j[0];i=i.replace(O,"")}if(i==="hover")d.push("mouseenter"+k,"mouseleave"+k);else{n=i;if(i==="focus"||i==="blur"){d.push(Ga[i]+k);i+=k}else i=(Ga[i]||i)+k;b==="live"?u.each(function(){c.event.add(this,pa(i,r),{data:f,selector:r,handler:e,origType:i,origHandler:e,preType:n})}):u.unbind(pa(i,r),e)}}return this}});c.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error".split(" "), +function(a,b){c.fn[b]=function(d){return d?this.bind(b,d):this.trigger(b)};if(c.attrFn)c.attrFn[b]=true});A.attachEvent&&!A.addEventListener&&A.attachEvent("onunload",function(){for(var a in c.cache)if(c.cache[a].handle)try{c.event.remove(c.cache[a].handle.elem)}catch(b){}});(function(){function a(g){for(var h="",l,m=0;g[m];m++){l=g[m];if(l.nodeType===3||l.nodeType===4)h+=l.nodeValue;else if(l.nodeType!==8)h+=a(l.childNodes)}return h}function b(g,h,l,m,q,p){q=0;for(var v=m.length;q<v;q++){var t=m[q]; +if(t){t=t[g];for(var y=false;t;){if(t.sizcache===l){y=m[t.sizset];break}if(t.nodeType===1&&!p){t.sizcache=l;t.sizset=q}if(t.nodeName.toLowerCase()===h){y=t;break}t=t[g]}m[q]=y}}}function d(g,h,l,m,q,p){q=0;for(var v=m.length;q<v;q++){var t=m[q];if(t){t=t[g];for(var y=false;t;){if(t.sizcache===l){y=m[t.sizset];break}if(t.nodeType===1){if(!p){t.sizcache=l;t.sizset=q}if(typeof h!=="string"){if(t===h){y=true;break}}else if(k.filter(h,[t]).length>0){y=t;break}}t=t[g]}m[q]=y}}}var f=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g, +e=0,j=Object.prototype.toString,i=false,o=true;[0,0].sort(function(){o=false;return 0});var k=function(g,h,l,m){l=l||[];var q=h=h||s;if(h.nodeType!==1&&h.nodeType!==9)return[];if(!g||typeof g!=="string")return l;for(var p=[],v,t,y,S,H=true,M=x(h),I=g;(f.exec(""),v=f.exec(I))!==null;){I=v[3];p.push(v[1]);if(v[2]){S=v[3];break}}if(p.length>1&&r.exec(g))if(p.length===2&&n.relative[p[0]])t=ga(p[0]+p[1],h);else for(t=n.relative[p[0]]?[h]:k(p.shift(),h);p.length;){g=p.shift();if(n.relative[g])g+=p.shift(); +t=ga(g,t)}else{if(!m&&p.length>1&&h.nodeType===9&&!M&&n.match.ID.test(p[0])&&!n.match.ID.test(p[p.length-1])){v=k.find(p.shift(),h,M);h=v.expr?k.filter(v.expr,v.set)[0]:v.set[0]}if(h){v=m?{expr:p.pop(),set:z(m)}:k.find(p.pop(),p.length===1&&(p[0]==="~"||p[0]==="+")&&h.parentNode?h.parentNode:h,M);t=v.expr?k.filter(v.expr,v.set):v.set;if(p.length>0)y=z(t);else H=false;for(;p.length;){var D=p.pop();v=D;if(n.relative[D])v=p.pop();else D="";if(v==null)v=h;n.relative[D](y,v,M)}}else y=[]}y||(y=t);y||k.error(D|| +g);if(j.call(y)==="[object Array]")if(H)if(h&&h.nodeType===1)for(g=0;y[g]!=null;g++){if(y[g]&&(y[g]===true||y[g].nodeType===1&&E(h,y[g])))l.push(t[g])}else for(g=0;y[g]!=null;g++)y[g]&&y[g].nodeType===1&&l.push(t[g]);else l.push.apply(l,y);else z(y,l);if(S){k(S,q,l,m);k.uniqueSort(l)}return l};k.uniqueSort=function(g){if(B){i=o;g.sort(B);if(i)for(var h=1;h<g.length;h++)g[h]===g[h-1]&&g.splice(h--,1)}return g};k.matches=function(g,h){return k(g,null,null,h)};k.find=function(g,h,l){var m,q;if(!g)return[]; +for(var p=0,v=n.order.length;p<v;p++){var t=n.order[p];if(q=n.leftMatch[t].exec(g)){var y=q[1];q.splice(1,1);if(y.substr(y.length-1)!=="\\"){q[1]=(q[1]||"").replace(/\\/g,"");m=n.find[t](q,h,l);if(m!=null){g=g.replace(n.match[t],"");break}}}}m||(m=h.getElementsByTagName("*"));return{set:m,expr:g}};k.filter=function(g,h,l,m){for(var q=g,p=[],v=h,t,y,S=h&&h[0]&&x(h[0]);g&&h.length;){for(var H in n.filter)if((t=n.leftMatch[H].exec(g))!=null&&t[2]){var M=n.filter[H],I,D;D=t[1];y=false;t.splice(1,1);if(D.substr(D.length- +1)!=="\\"){if(v===p)p=[];if(n.preFilter[H])if(t=n.preFilter[H](t,v,l,p,m,S)){if(t===true)continue}else y=I=true;if(t)for(var U=0;(D=v[U])!=null;U++)if(D){I=M(D,t,U,v);var Ha=m^!!I;if(l&&I!=null)if(Ha)y=true;else v[U]=false;else if(Ha){p.push(D);y=true}}if(I!==w){l||(v=p);g=g.replace(n.match[H],"");if(!y)return[];break}}}if(g===q)if(y==null)k.error(g);else break;q=g}return v};k.error=function(g){throw"Syntax error, unrecognized expression: "+g;};var n=k.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF-]|\\.)+)/, +CLASS:/\.((?:[\w\u00c0-\uFFFF-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/},leftMatch:{},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(g){return g.getAttribute("href")}}, +relative:{"+":function(g,h){var l=typeof h==="string",m=l&&!/\W/.test(h);l=l&&!m;if(m)h=h.toLowerCase();m=0;for(var q=g.length,p;m<q;m++)if(p=g[m]){for(;(p=p.previousSibling)&&p.nodeType!==1;);g[m]=l||p&&p.nodeName.toLowerCase()===h?p||false:p===h}l&&k.filter(h,g,true)},">":function(g,h){var l=typeof h==="string";if(l&&!/\W/.test(h)){h=h.toLowerCase();for(var m=0,q=g.length;m<q;m++){var p=g[m];if(p){l=p.parentNode;g[m]=l.nodeName.toLowerCase()===h?l:false}}}else{m=0;for(q=g.length;m<q;m++)if(p=g[m])g[m]= +l?p.parentNode:p.parentNode===h;l&&k.filter(h,g,true)}},"":function(g,h,l){var m=e++,q=d;if(typeof h==="string"&&!/\W/.test(h)){var p=h=h.toLowerCase();q=b}q("parentNode",h,m,g,p,l)},"~":function(g,h,l){var m=e++,q=d;if(typeof h==="string"&&!/\W/.test(h)){var p=h=h.toLowerCase();q=b}q("previousSibling",h,m,g,p,l)}},find:{ID:function(g,h,l){if(typeof h.getElementById!=="undefined"&&!l)return(g=h.getElementById(g[1]))?[g]:[]},NAME:function(g,h){if(typeof h.getElementsByName!=="undefined"){var l=[]; +h=h.getElementsByName(g[1]);for(var m=0,q=h.length;m<q;m++)h[m].getAttribute("name")===g[1]&&l.push(h[m]);return l.length===0?null:l}},TAG:function(g,h){return h.getElementsByTagName(g[1])}},preFilter:{CLASS:function(g,h,l,m,q,p){g=" "+g[1].replace(/\\/g,"")+" ";if(p)return g;p=0;for(var v;(v=h[p])!=null;p++)if(v)if(q^(v.className&&(" "+v.className+" ").replace(/[\t\n]/g," ").indexOf(g)>=0))l||m.push(v);else if(l)h[p]=false;return false},ID:function(g){return g[1].replace(/\\/g,"")},TAG:function(g){return g[1].toLowerCase()}, +CHILD:function(g){if(g[1]==="nth"){var h=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(g[2]==="even"&&"2n"||g[2]==="odd"&&"2n+1"||!/\D/.test(g[2])&&"0n+"+g[2]||g[2]);g[2]=h[1]+(h[2]||1)-0;g[3]=h[3]-0}g[0]=e++;return g},ATTR:function(g,h,l,m,q,p){h=g[1].replace(/\\/g,"");if(!p&&n.attrMap[h])g[1]=n.attrMap[h];if(g[2]==="~=")g[4]=" "+g[4]+" ";return g},PSEUDO:function(g,h,l,m,q){if(g[1]==="not")if((f.exec(g[3])||"").length>1||/^\w/.test(g[3]))g[3]=k(g[3],null,null,h);else{g=k.filter(g[3],h,l,true^q);l||m.push.apply(m, +g);return false}else if(n.match.POS.test(g[0])||n.match.CHILD.test(g[0]))return true;return g},POS:function(g){g.unshift(true);return g}},filters:{enabled:function(g){return g.disabled===false&&g.type!=="hidden"},disabled:function(g){return g.disabled===true},checked:function(g){return g.checked===true},selected:function(g){return g.selected===true},parent:function(g){return!!g.firstChild},empty:function(g){return!g.firstChild},has:function(g,h,l){return!!k(l[3],g).length},header:function(g){return/h\d/i.test(g.nodeName)}, +text:function(g){return"text"===g.type},radio:function(g){return"radio"===g.type},checkbox:function(g){return"checkbox"===g.type},file:function(g){return"file"===g.type},password:function(g){return"password"===g.type},submit:function(g){return"submit"===g.type},image:function(g){return"image"===g.type},reset:function(g){return"reset"===g.type},button:function(g){return"button"===g.type||g.nodeName.toLowerCase()==="button"},input:function(g){return/input|select|textarea|button/i.test(g.nodeName)}}, +setFilters:{first:function(g,h){return h===0},last:function(g,h,l,m){return h===m.length-1},even:function(g,h){return h%2===0},odd:function(g,h){return h%2===1},lt:function(g,h,l){return h<l[3]-0},gt:function(g,h,l){return h>l[3]-0},nth:function(g,h,l){return l[3]-0===h},eq:function(g,h,l){return l[3]-0===h}},filter:{PSEUDO:function(g,h,l,m){var q=h[1],p=n.filters[q];if(p)return p(g,l,h,m);else if(q==="contains")return(g.textContent||g.innerText||a([g])||"").indexOf(h[3])>=0;else if(q==="not"){h= +h[3];l=0;for(m=h.length;l<m;l++)if(h[l]===g)return false;return true}else k.error("Syntax error, unrecognized expression: "+q)},CHILD:function(g,h){var l=h[1],m=g;switch(l){case "only":case "first":for(;m=m.previousSibling;)if(m.nodeType===1)return false;if(l==="first")return true;m=g;case "last":for(;m=m.nextSibling;)if(m.nodeType===1)return false;return true;case "nth":l=h[2];var q=h[3];if(l===1&&q===0)return true;h=h[0];var p=g.parentNode;if(p&&(p.sizcache!==h||!g.nodeIndex)){var v=0;for(m=p.firstChild;m;m= +m.nextSibling)if(m.nodeType===1)m.nodeIndex=++v;p.sizcache=h}g=g.nodeIndex-q;return l===0?g===0:g%l===0&&g/l>=0}},ID:function(g,h){return g.nodeType===1&&g.getAttribute("id")===h},TAG:function(g,h){return h==="*"&&g.nodeType===1||g.nodeName.toLowerCase()===h},CLASS:function(g,h){return(" "+(g.className||g.getAttribute("class"))+" ").indexOf(h)>-1},ATTR:function(g,h){var l=h[1];g=n.attrHandle[l]?n.attrHandle[l](g):g[l]!=null?g[l]:g.getAttribute(l);l=g+"";var m=h[2];h=h[4];return g==null?m==="!=":m=== +"="?l===h:m==="*="?l.indexOf(h)>=0:m==="~="?(" "+l+" ").indexOf(h)>=0:!h?l&&g!==false:m==="!="?l!==h:m==="^="?l.indexOf(h)===0:m==="$="?l.substr(l.length-h.length)===h:m==="|="?l===h||l.substr(0,h.length+1)===h+"-":false},POS:function(g,h,l,m){var q=n.setFilters[h[2]];if(q)return q(g,l,h,m)}}},r=n.match.POS;for(var u in n.match){n.match[u]=new RegExp(n.match[u].source+/(?![^\[]*\])(?![^\(]*\))/.source);n.leftMatch[u]=new RegExp(/(^(?:.|\r|\n)*?)/.source+n.match[u].source.replace(/\\(\d+)/g,function(g, +h){return"\\"+(h-0+1)}))}var z=function(g,h){g=Array.prototype.slice.call(g,0);if(h){h.push.apply(h,g);return h}return g};try{Array.prototype.slice.call(s.documentElement.childNodes,0)}catch(C){z=function(g,h){h=h||[];if(j.call(g)==="[object Array]")Array.prototype.push.apply(h,g);else if(typeof g.length==="number")for(var l=0,m=g.length;l<m;l++)h.push(g[l]);else for(l=0;g[l];l++)h.push(g[l]);return h}}var B;if(s.documentElement.compareDocumentPosition)B=function(g,h){if(!g.compareDocumentPosition|| +!h.compareDocumentPosition){if(g==h)i=true;return g.compareDocumentPosition?-1:1}g=g.compareDocumentPosition(h)&4?-1:g===h?0:1;if(g===0)i=true;return g};else if("sourceIndex"in s.documentElement)B=function(g,h){if(!g.sourceIndex||!h.sourceIndex){if(g==h)i=true;return g.sourceIndex?-1:1}g=g.sourceIndex-h.sourceIndex;if(g===0)i=true;return g};else if(s.createRange)B=function(g,h){if(!g.ownerDocument||!h.ownerDocument){if(g==h)i=true;return g.ownerDocument?-1:1}var l=g.ownerDocument.createRange(),m= +h.ownerDocument.createRange();l.setStart(g,0);l.setEnd(g,0);m.setStart(h,0);m.setEnd(h,0);g=l.compareBoundaryPoints(Range.START_TO_END,m);if(g===0)i=true;return g};(function(){var g=s.createElement("div"),h="script"+(new Date).getTime();g.innerHTML="<a name='"+h+"'/>";var l=s.documentElement;l.insertBefore(g,l.firstChild);if(s.getElementById(h)){n.find.ID=function(m,q,p){if(typeof q.getElementById!=="undefined"&&!p)return(q=q.getElementById(m[1]))?q.id===m[1]||typeof q.getAttributeNode!=="undefined"&& +q.getAttributeNode("id").nodeValue===m[1]?[q]:w:[]};n.filter.ID=function(m,q){var p=typeof m.getAttributeNode!=="undefined"&&m.getAttributeNode("id");return m.nodeType===1&&p&&p.nodeValue===q}}l.removeChild(g);l=g=null})();(function(){var g=s.createElement("div");g.appendChild(s.createComment(""));if(g.getElementsByTagName("*").length>0)n.find.TAG=function(h,l){l=l.getElementsByTagName(h[1]);if(h[1]==="*"){h=[];for(var m=0;l[m];m++)l[m].nodeType===1&&h.push(l[m]);l=h}return l};g.innerHTML="<a href='#'></a>"; +if(g.firstChild&&typeof g.firstChild.getAttribute!=="undefined"&&g.firstChild.getAttribute("href")!=="#")n.attrHandle.href=function(h){return h.getAttribute("href",2)};g=null})();s.querySelectorAll&&function(){var g=k,h=s.createElement("div");h.innerHTML="<p class='TEST'></p>";if(!(h.querySelectorAll&&h.querySelectorAll(".TEST").length===0)){k=function(m,q,p,v){q=q||s;if(!v&&q.nodeType===9&&!x(q))try{return z(q.querySelectorAll(m),p)}catch(t){}return g(m,q,p,v)};for(var l in g)k[l]=g[l];h=null}}(); +(function(){var g=s.createElement("div");g.innerHTML="<div class='test e'></div><div class='test'></div>";if(!(!g.getElementsByClassName||g.getElementsByClassName("e").length===0)){g.lastChild.className="e";if(g.getElementsByClassName("e").length!==1){n.order.splice(1,0,"CLASS");n.find.CLASS=function(h,l,m){if(typeof l.getElementsByClassName!=="undefined"&&!m)return l.getElementsByClassName(h[1])};g=null}}})();var E=s.compareDocumentPosition?function(g,h){return!!(g.compareDocumentPosition(h)&16)}: +function(g,h){return g!==h&&(g.contains?g.contains(h):true)},x=function(g){return(g=(g?g.ownerDocument||g:0).documentElement)?g.nodeName!=="HTML":false},ga=function(g,h){var l=[],m="",q;for(h=h.nodeType?[h]:h;q=n.match.PSEUDO.exec(g);){m+=q[0];g=g.replace(n.match.PSEUDO,"")}g=n.relative[g]?g+"*":g;q=0;for(var p=h.length;q<p;q++)k(g,h[q],l);return k.filter(m,l)};c.find=k;c.expr=k.selectors;c.expr[":"]=c.expr.filters;c.unique=k.uniqueSort;c.text=a;c.isXMLDoc=x;c.contains=E})();var eb=/Until$/,fb=/^(?:parents|prevUntil|prevAll)/, +gb=/,/;R=Array.prototype.slice;var Ia=function(a,b,d){if(c.isFunction(b))return c.grep(a,function(e,j){return!!b.call(e,j,e)===d});else if(b.nodeType)return c.grep(a,function(e){return e===b===d});else if(typeof b==="string"){var f=c.grep(a,function(e){return e.nodeType===1});if(Ua.test(b))return c.filter(b,f,!d);else b=c.filter(b,f)}return c.grep(a,function(e){return c.inArray(e,b)>=0===d})};c.fn.extend({find:function(a){for(var b=this.pushStack("","find",a),d=0,f=0,e=this.length;f<e;f++){d=b.length; +c.find(a,this[f],b);if(f>0)for(var j=d;j<b.length;j++)for(var i=0;i<d;i++)if(b[i]===b[j]){b.splice(j--,1);break}}return b},has:function(a){var b=c(a);return this.filter(function(){for(var d=0,f=b.length;d<f;d++)if(c.contains(this,b[d]))return true})},not:function(a){return this.pushStack(Ia(this,a,false),"not",a)},filter:function(a){return this.pushStack(Ia(this,a,true),"filter",a)},is:function(a){return!!a&&c.filter(a,this).length>0},closest:function(a,b){if(c.isArray(a)){var d=[],f=this[0],e,j= +{},i;if(f&&a.length){e=0;for(var o=a.length;e<o;e++){i=a[e];j[i]||(j[i]=c.expr.match.POS.test(i)?c(i,b||this.context):i)}for(;f&&f.ownerDocument&&f!==b;){for(i in j){e=j[i];if(e.jquery?e.index(f)>-1:c(f).is(e)){d.push({selector:i,elem:f});delete j[i]}}f=f.parentNode}}return d}var k=c.expr.match.POS.test(a)?c(a,b||this.context):null;return this.map(function(n,r){for(;r&&r.ownerDocument&&r!==b;){if(k?k.index(r)>-1:c(r).is(a))return r;r=r.parentNode}return null})},index:function(a){if(!a||typeof a=== +"string")return c.inArray(this[0],a?c(a):this.parent().children());return c.inArray(a.jquery?a[0]:a,this)},add:function(a,b){a=typeof a==="string"?c(a,b||this.context):c.makeArray(a);b=c.merge(this.get(),a);return this.pushStack(qa(a[0])||qa(b[0])?b:c.unique(b))},andSelf:function(){return this.add(this.prevObject)}});c.each({parent:function(a){return(a=a.parentNode)&&a.nodeType!==11?a:null},parents:function(a){return c.dir(a,"parentNode")},parentsUntil:function(a,b,d){return c.dir(a,"parentNode", +d)},next:function(a){return c.nth(a,2,"nextSibling")},prev:function(a){return c.nth(a,2,"previousSibling")},nextAll:function(a){return c.dir(a,"nextSibling")},prevAll:function(a){return c.dir(a,"previousSibling")},nextUntil:function(a,b,d){return c.dir(a,"nextSibling",d)},prevUntil:function(a,b,d){return c.dir(a,"previousSibling",d)},siblings:function(a){return c.sibling(a.parentNode.firstChild,a)},children:function(a){return c.sibling(a.firstChild)},contents:function(a){return c.nodeName(a,"iframe")? +a.contentDocument||a.contentWindow.document:c.makeArray(a.childNodes)}},function(a,b){c.fn[a]=function(d,f){var e=c.map(this,b,d);eb.test(a)||(f=d);if(f&&typeof f==="string")e=c.filter(f,e);e=this.length>1?c.unique(e):e;if((this.length>1||gb.test(f))&&fb.test(a))e=e.reverse();return this.pushStack(e,a,R.call(arguments).join(","))}});c.extend({filter:function(a,b,d){if(d)a=":not("+a+")";return c.find.matches(a,b)},dir:function(a,b,d){var f=[];for(a=a[b];a&&a.nodeType!==9&&(d===w||a.nodeType!==1||!c(a).is(d));){a.nodeType=== +1&&f.push(a);a=a[b]}return f},nth:function(a,b,d){b=b||1;for(var f=0;a;a=a[d])if(a.nodeType===1&&++f===b)break;return a},sibling:function(a,b){for(var d=[];a;a=a.nextSibling)a.nodeType===1&&a!==b&&d.push(a);return d}});var Ja=/ jQuery\d+="(?:\d+|null)"/g,V=/^\s+/,Ka=/(<([\w:]+)[^>]*?)\/>/g,hb=/^(?:area|br|col|embed|hr|img|input|link|meta|param)$/i,La=/<([\w:]+)/,ib=/<tbody/i,jb=/<|&#?\w+;/,ta=/<script|<object|<embed|<option|<style/i,ua=/checked\s*(?:[^=]|=\s*.checked.)/i,Ma=function(a,b,d){return hb.test(d)? +a:b+"></"+d+">"},F={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],area:[1,"<map>","</map>"],_default:[0,"",""]};F.optgroup=F.option;F.tbody=F.tfoot=F.colgroup=F.caption=F.thead;F.th=F.td;if(!c.support.htmlSerialize)F._default=[1,"div<div>","</div>"];c.fn.extend({text:function(a){if(c.isFunction(a))return this.each(function(b){var d= +c(this);d.text(a.call(this,b,d.text()))});if(typeof a!=="object"&&a!==w)return this.empty().append((this[0]&&this[0].ownerDocument||s).createTextNode(a));return c.text(this)},wrapAll:function(a){if(c.isFunction(a))return this.each(function(d){c(this).wrapAll(a.call(this,d))});if(this[0]){var b=c(a,this[0].ownerDocument).eq(0).clone(true);this[0].parentNode&&b.insertBefore(this[0]);b.map(function(){for(var d=this;d.firstChild&&d.firstChild.nodeType===1;)d=d.firstChild;return d}).append(this)}return this}, +wrapInner:function(a){if(c.isFunction(a))return this.each(function(b){c(this).wrapInner(a.call(this,b))});return this.each(function(){var b=c(this),d=b.contents();d.length?d.wrapAll(a):b.append(a)})},wrap:function(a){return this.each(function(){c(this).wrapAll(a)})},unwrap:function(){return this.parent().each(function(){c.nodeName(this,"body")||c(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,true,function(a){this.nodeType===1&&this.appendChild(a)})}, +prepend:function(){return this.domManip(arguments,true,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,false,function(b){this.parentNode.insertBefore(b,this)});else if(arguments.length){var a=c(arguments[0]);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,false,function(b){this.parentNode.insertBefore(b, +this.nextSibling)});else if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,c(arguments[0]).toArray());return a}},remove:function(a,b){for(var d=0,f;(f=this[d])!=null;d++)if(!a||c.filter(a,[f]).length){if(!b&&f.nodeType===1){c.cleanData(f.getElementsByTagName("*"));c.cleanData([f])}f.parentNode&&f.parentNode.removeChild(f)}return this},empty:function(){for(var a=0,b;(b=this[a])!=null;a++)for(b.nodeType===1&&c.cleanData(b.getElementsByTagName("*"));b.firstChild;)b.removeChild(b.firstChild); +return this},clone:function(a){var b=this.map(function(){if(!c.support.noCloneEvent&&!c.isXMLDoc(this)){var d=this.outerHTML,f=this.ownerDocument;if(!d){d=f.createElement("div");d.appendChild(this.cloneNode(true));d=d.innerHTML}return c.clean([d.replace(Ja,"").replace(/=([^="'>\s]+\/)>/g,'="$1">').replace(V,"")],f)[0]}else return this.cloneNode(true)});if(a===true){ra(this,b);ra(this.find("*"),b.find("*"))}return b},html:function(a){if(a===w)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(Ja, +""):null;else if(typeof a==="string"&&!ta.test(a)&&(c.support.leadingWhitespace||!V.test(a))&&!F[(La.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Ka,Ma);try{for(var b=0,d=this.length;b<d;b++)if(this[b].nodeType===1){c.cleanData(this[b].getElementsByTagName("*"));this[b].innerHTML=a}}catch(f){this.empty().append(a)}}else c.isFunction(a)?this.each(function(e){var j=c(this),i=j.html();j.empty().append(function(){return a.call(this,e,i)})}):this.empty().append(a);return this},replaceWith:function(a){if(this[0]&& +this[0].parentNode){if(c.isFunction(a))return this.each(function(b){var d=c(this),f=d.html();d.replaceWith(a.call(this,b,f))});if(typeof a!=="string")a=c(a).detach();return this.each(function(){var b=this.nextSibling,d=this.parentNode;c(this).remove();b?c(b).before(a):c(d).append(a)})}else return this.pushStack(c(c.isFunction(a)?a():a),"replaceWith",a)},detach:function(a){return this.remove(a,true)},domManip:function(a,b,d){function f(u){return c.nodeName(u,"table")?u.getElementsByTagName("tbody")[0]|| +u.appendChild(u.ownerDocument.createElement("tbody")):u}var e,j,i=a[0],o=[],k;if(!c.support.checkClone&&arguments.length===3&&typeof i==="string"&&ua.test(i))return this.each(function(){c(this).domManip(a,b,d,true)});if(c.isFunction(i))return this.each(function(u){var z=c(this);a[0]=i.call(this,u,b?z.html():w);z.domManip(a,b,d)});if(this[0]){e=i&&i.parentNode;e=c.support.parentNode&&e&&e.nodeType===11&&e.childNodes.length===this.length?{fragment:e}:sa(a,this,o);k=e.fragment;if(j=k.childNodes.length=== +1?(k=k.firstChild):k.firstChild){b=b&&c.nodeName(j,"tr");for(var n=0,r=this.length;n<r;n++)d.call(b?f(this[n],j):this[n],n>0||e.cacheable||this.length>1?k.cloneNode(true):k)}o.length&&c.each(o,Qa)}return this}});c.fragments={};c.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){c.fn[a]=function(d){var f=[];d=c(d);var e=this.length===1&&this[0].parentNode;if(e&&e.nodeType===11&&e.childNodes.length===1&&d.length===1){d[b](this[0]); +return this}else{e=0;for(var j=d.length;e<j;e++){var i=(e>0?this.clone(true):this).get();c.fn[b].apply(c(d[e]),i);f=f.concat(i)}return this.pushStack(f,a,d.selector)}}});c.extend({clean:function(a,b,d,f){b=b||s;if(typeof b.createElement==="undefined")b=b.ownerDocument||b[0]&&b[0].ownerDocument||s;for(var e=[],j=0,i;(i=a[j])!=null;j++){if(typeof i==="number")i+="";if(i){if(typeof i==="string"&&!jb.test(i))i=b.createTextNode(i);else if(typeof i==="string"){i=i.replace(Ka,Ma);var o=(La.exec(i)||["", +""])[1].toLowerCase(),k=F[o]||F._default,n=k[0],r=b.createElement("div");for(r.innerHTML=k[1]+i+k[2];n--;)r=r.lastChild;if(!c.support.tbody){n=ib.test(i);o=o==="table"&&!n?r.firstChild&&r.firstChild.childNodes:k[1]==="<table>"&&!n?r.childNodes:[];for(k=o.length-1;k>=0;--k)c.nodeName(o[k],"tbody")&&!o[k].childNodes.length&&o[k].parentNode.removeChild(o[k])}!c.support.leadingWhitespace&&V.test(i)&&r.insertBefore(b.createTextNode(V.exec(i)[0]),r.firstChild);i=r.childNodes}if(i.nodeType)e.push(i);else e= +c.merge(e,i)}}if(d)for(j=0;e[j];j++)if(f&&c.nodeName(e[j],"script")&&(!e[j].type||e[j].type.toLowerCase()==="text/javascript"))f.push(e[j].parentNode?e[j].parentNode.removeChild(e[j]):e[j]);else{e[j].nodeType===1&&e.splice.apply(e,[j+1,0].concat(c.makeArray(e[j].getElementsByTagName("script"))));d.appendChild(e[j])}return e},cleanData:function(a){for(var b,d,f=c.cache,e=c.event.special,j=c.support.deleteExpando,i=0,o;(o=a[i])!=null;i++)if(d=o[c.expando]){b=f[d];if(b.events)for(var k in b.events)e[k]? +c.event.remove(o,k):Ca(o,k,b.handle);if(j)delete o[c.expando];else o.removeAttribute&&o.removeAttribute(c.expando);delete f[d]}}});var kb=/z-?index|font-?weight|opacity|zoom|line-?height/i,Na=/alpha\([^)]*\)/,Oa=/opacity=([^)]*)/,ha=/float/i,ia=/-([a-z])/ig,lb=/([A-Z])/g,mb=/^-?\d+(?:px)?$/i,nb=/^-?\d/,ob={position:"absolute",visibility:"hidden",display:"block"},pb=["Left","Right"],qb=["Top","Bottom"],rb=s.defaultView&&s.defaultView.getComputedStyle,Pa=c.support.cssFloat?"cssFloat":"styleFloat",ja= +function(a,b){return b.toUpperCase()};c.fn.css=function(a,b){return X(this,a,b,true,function(d,f,e){if(e===w)return c.curCSS(d,f);if(typeof e==="number"&&!kb.test(f))e+="px";c.style(d,f,e)})};c.extend({style:function(a,b,d){if(!a||a.nodeType===3||a.nodeType===8)return w;if((b==="width"||b==="height")&&parseFloat(d)<0)d=w;var f=a.style||a,e=d!==w;if(!c.support.opacity&&b==="opacity"){if(e){f.zoom=1;b=parseInt(d,10)+""==="NaN"?"":"alpha(opacity="+d*100+")";a=f.filter||c.curCSS(a,"filter")||"";f.filter= +Na.test(a)?a.replace(Na,b):b}return f.filter&&f.filter.indexOf("opacity=")>=0?parseFloat(Oa.exec(f.filter)[1])/100+"":""}if(ha.test(b))b=Pa;b=b.replace(ia,ja);if(e)f[b]=d;return f[b]},css:function(a,b,d,f){if(b==="width"||b==="height"){var e,j=b==="width"?pb:qb;function i(){e=b==="width"?a.offsetWidth:a.offsetHeight;f!=="border"&&c.each(j,function(){f||(e-=parseFloat(c.curCSS(a,"padding"+this,true))||0);if(f==="margin")e+=parseFloat(c.curCSS(a,"margin"+this,true))||0;else e-=parseFloat(c.curCSS(a, +"border"+this+"Width",true))||0})}a.offsetWidth!==0?i():c.swap(a,ob,i);return Math.max(0,Math.round(e))}return c.curCSS(a,b,d)},curCSS:function(a,b,d){var f,e=a.style;if(!c.support.opacity&&b==="opacity"&&a.currentStyle){f=Oa.test(a.currentStyle.filter||"")?parseFloat(RegExp.$1)/100+"":"";return f===""?"1":f}if(ha.test(b))b=Pa;if(!d&&e&&e[b])f=e[b];else if(rb){if(ha.test(b))b="float";b=b.replace(lb,"-$1").toLowerCase();e=a.ownerDocument.defaultView;if(!e)return null;if(a=e.getComputedStyle(a,null))f= +a.getPropertyValue(b);if(b==="opacity"&&f==="")f="1"}else if(a.currentStyle){d=b.replace(ia,ja);f=a.currentStyle[b]||a.currentStyle[d];if(!mb.test(f)&&nb.test(f)){b=e.left;var j=a.runtimeStyle.left;a.runtimeStyle.left=a.currentStyle.left;e.left=d==="fontSize"?"1em":f||0;f=e.pixelLeft+"px";e.left=b;a.runtimeStyle.left=j}}return f},swap:function(a,b,d){var f={};for(var e in b){f[e]=a.style[e];a.style[e]=b[e]}d.call(a);for(e in b)a.style[e]=f[e]}});if(c.expr&&c.expr.filters){c.expr.filters.hidden=function(a){var b= +a.offsetWidth,d=a.offsetHeight,f=a.nodeName.toLowerCase()==="tr";return b===0&&d===0&&!f?true:b>0&&d>0&&!f?false:c.curCSS(a,"display")==="none"};c.expr.filters.visible=function(a){return!c.expr.filters.hidden(a)}}var sb=J(),tb=/<script(.|\s)*?\/script>/gi,ub=/select|textarea/i,vb=/color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week/i,N=/=\?(&|$)/,ka=/\?/,wb=/(\?|&)_=.*?(&|$)/,xb=/^(\w+:)?\/\/([^\/?#]+)/,yb=/%20/g,zb=c.fn.load;c.fn.extend({load:function(a,b,d){if(typeof a!== +"string")return zb.call(this,a);else if(!this.length)return this;var f=a.indexOf(" ");if(f>=0){var e=a.slice(f,a.length);a=a.slice(0,f)}f="GET";if(b)if(c.isFunction(b)){d=b;b=null}else if(typeof b==="object"){b=c.param(b,c.ajaxSettings.traditional);f="POST"}var j=this;c.ajax({url:a,type:f,dataType:"html",data:b,complete:function(i,o){if(o==="success"||o==="notmodified")j.html(e?c("<div />").append(i.responseText.replace(tb,"")).find(e):i.responseText);d&&j.each(d,[i.responseText,o,i])}});return this}, +serialize:function(){return c.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?c.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||ub.test(this.nodeName)||vb.test(this.type))}).map(function(a,b){a=c(this).val();return a==null?null:c.isArray(a)?c.map(a,function(d){return{name:b.name,value:d}}):{name:b.name,value:a}}).get()}});c.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "), +function(a,b){c.fn[b]=function(d){return this.bind(b,d)}});c.extend({get:function(a,b,d,f){if(c.isFunction(b)){f=f||d;d=b;b=null}return c.ajax({type:"GET",url:a,data:b,success:d,dataType:f})},getScript:function(a,b){return c.get(a,null,b,"script")},getJSON:function(a,b,d){return c.get(a,b,d,"json")},post:function(a,b,d,f){if(c.isFunction(b)){f=f||d;d=b;b={}}return c.ajax({type:"POST",url:a,data:b,success:d,dataType:f})},ajaxSetup:function(a){c.extend(c.ajaxSettings,a)},ajaxSettings:{url:location.href, +global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:A.XMLHttpRequest&&(A.location.protocol!=="file:"||!A.ActiveXObject)?function(){return new A.XMLHttpRequest}:function(){try{return new A.ActiveXObject("Microsoft.XMLHTTP")}catch(a){}},accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},etag:{},ajax:function(a){function b(){e.success&& +e.success.call(k,o,i,x);e.global&&f("ajaxSuccess",[x,e])}function d(){e.complete&&e.complete.call(k,x,i);e.global&&f("ajaxComplete",[x,e]);e.global&&!--c.active&&c.event.trigger("ajaxStop")}function f(q,p){(e.context?c(e.context):c.event).trigger(q,p)}var e=c.extend(true,{},c.ajaxSettings,a),j,i,o,k=a&&a.context||e,n=e.type.toUpperCase();if(e.data&&e.processData&&typeof e.data!=="string")e.data=c.param(e.data,e.traditional);if(e.dataType==="jsonp"){if(n==="GET")N.test(e.url)||(e.url+=(ka.test(e.url)? +"&":"?")+(e.jsonp||"callback")+"=?");else if(!e.data||!N.test(e.data))e.data=(e.data?e.data+"&":"")+(e.jsonp||"callback")+"=?";e.dataType="json"}if(e.dataType==="json"&&(e.data&&N.test(e.data)||N.test(e.url))){j=e.jsonpCallback||"jsonp"+sb++;if(e.data)e.data=(e.data+"").replace(N,"="+j+"$1");e.url=e.url.replace(N,"="+j+"$1");e.dataType="script";A[j]=A[j]||function(q){o=q;b();d();A[j]=w;try{delete A[j]}catch(p){}z&&z.removeChild(C)}}if(e.dataType==="script"&&e.cache===null)e.cache=false;if(e.cache=== +false&&n==="GET"){var r=J(),u=e.url.replace(wb,"$1_="+r+"$2");e.url=u+(u===e.url?(ka.test(e.url)?"&":"?")+"_="+r:"")}if(e.data&&n==="GET")e.url+=(ka.test(e.url)?"&":"?")+e.data;e.global&&!c.active++&&c.event.trigger("ajaxStart");r=(r=xb.exec(e.url))&&(r[1]&&r[1]!==location.protocol||r[2]!==location.host);if(e.dataType==="script"&&n==="GET"&&r){var z=s.getElementsByTagName("head")[0]||s.documentElement,C=s.createElement("script");C.src=e.url;if(e.scriptCharset)C.charset=e.scriptCharset;if(!j){var B= +false;C.onload=C.onreadystatechange=function(){if(!B&&(!this.readyState||this.readyState==="loaded"||this.readyState==="complete")){B=true;b();d();C.onload=C.onreadystatechange=null;z&&C.parentNode&&z.removeChild(C)}}}z.insertBefore(C,z.firstChild);return w}var E=false,x=e.xhr();if(x){e.username?x.open(n,e.url,e.async,e.username,e.password):x.open(n,e.url,e.async);try{if(e.data||a&&a.contentType)x.setRequestHeader("Content-Type",e.contentType);if(e.ifModified){c.lastModified[e.url]&&x.setRequestHeader("If-Modified-Since", +c.lastModified[e.url]);c.etag[e.url]&&x.setRequestHeader("If-None-Match",c.etag[e.url])}r||x.setRequestHeader("X-Requested-With","XMLHttpRequest");x.setRequestHeader("Accept",e.dataType&&e.accepts[e.dataType]?e.accepts[e.dataType]+", */*":e.accepts._default)}catch(ga){}if(e.beforeSend&&e.beforeSend.call(k,x,e)===false){e.global&&!--c.active&&c.event.trigger("ajaxStop");x.abort();return false}e.global&&f("ajaxSend",[x,e]);var g=x.onreadystatechange=function(q){if(!x||x.readyState===0||q==="abort"){E|| +d();E=true;if(x)x.onreadystatechange=c.noop}else if(!E&&x&&(x.readyState===4||q==="timeout")){E=true;x.onreadystatechange=c.noop;i=q==="timeout"?"timeout":!c.httpSuccess(x)?"error":e.ifModified&&c.httpNotModified(x,e.url)?"notmodified":"success";var p;if(i==="success")try{o=c.httpData(x,e.dataType,e)}catch(v){i="parsererror";p=v}if(i==="success"||i==="notmodified")j||b();else c.handleError(e,x,i,p);d();q==="timeout"&&x.abort();if(e.async)x=null}};try{var h=x.abort;x.abort=function(){x&&h.call(x); +g("abort")}}catch(l){}e.async&&e.timeout>0&&setTimeout(function(){x&&!E&&g("timeout")},e.timeout);try{x.send(n==="POST"||n==="PUT"||n==="DELETE"?e.data:null)}catch(m){c.handleError(e,x,null,m);d()}e.async||g();return x}},handleError:function(a,b,d,f){if(a.error)a.error.call(a.context||a,b,d,f);if(a.global)(a.context?c(a.context):c.event).trigger("ajaxError",[b,a,f])},active:0,httpSuccess:function(a){try{return!a.status&&location.protocol==="file:"||a.status>=200&&a.status<300||a.status===304||a.status=== +1223||a.status===0}catch(b){}return false},httpNotModified:function(a,b){var d=a.getResponseHeader("Last-Modified"),f=a.getResponseHeader("Etag");if(d)c.lastModified[b]=d;if(f)c.etag[b]=f;return a.status===304||a.status===0},httpData:function(a,b,d){var f=a.getResponseHeader("content-type")||"",e=b==="xml"||!b&&f.indexOf("xml")>=0;a=e?a.responseXML:a.responseText;e&&a.documentElement.nodeName==="parsererror"&&c.error("parsererror");if(d&&d.dataFilter)a=d.dataFilter(a,b);if(typeof a==="string")if(b=== +"json"||!b&&f.indexOf("json")>=0)a=c.parseJSON(a);else if(b==="script"||!b&&f.indexOf("javascript")>=0)c.globalEval(a);return a},param:function(a,b){function d(i,o){if(c.isArray(o))c.each(o,function(k,n){b||/\[\]$/.test(i)?f(i,n):d(i+"["+(typeof n==="object"||c.isArray(n)?k:"")+"]",n)});else!b&&o!=null&&typeof o==="object"?c.each(o,function(k,n){d(i+"["+k+"]",n)}):f(i,o)}function f(i,o){o=c.isFunction(o)?o():o;e[e.length]=encodeURIComponent(i)+"="+encodeURIComponent(o)}var e=[];if(b===w)b=c.ajaxSettings.traditional; +if(c.isArray(a)||a.jquery)c.each(a,function(){f(this.name,this.value)});else for(var j in a)d(j,a[j]);return e.join("&").replace(yb,"+")}});var la={},Ab=/toggle|show|hide/,Bb=/^([+-]=)?([\d+-.]+)(.*)$/,W,va=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];c.fn.extend({show:function(a,b){if(a||a===0)return this.animate(K("show",3),a,b);else{a=0;for(b=this.length;a<b;a++){var d=c.data(this[a],"olddisplay"); +this[a].style.display=d||"";if(c.css(this[a],"display")==="none"){d=this[a].nodeName;var f;if(la[d])f=la[d];else{var e=c("<"+d+" />").appendTo("body");f=e.css("display");if(f==="none")f="block";e.remove();la[d]=f}c.data(this[a],"olddisplay",f)}}a=0;for(b=this.length;a<b;a++)this[a].style.display=c.data(this[a],"olddisplay")||"";return this}},hide:function(a,b){if(a||a===0)return this.animate(K("hide",3),a,b);else{a=0;for(b=this.length;a<b;a++){var d=c.data(this[a],"olddisplay");!d&&d!=="none"&&c.data(this[a], +"olddisplay",c.css(this[a],"display"))}a=0;for(b=this.length;a<b;a++)this[a].style.display="none";return this}},_toggle:c.fn.toggle,toggle:function(a,b){var d=typeof a==="boolean";if(c.isFunction(a)&&c.isFunction(b))this._toggle.apply(this,arguments);else a==null||d?this.each(function(){var f=d?a:c(this).is(":hidden");c(this)[f?"show":"hide"]()}):this.animate(K("toggle",3),a,b);return this},fadeTo:function(a,b,d){return this.filter(":hidden").css("opacity",0).show().end().animate({opacity:b},a,d)}, +animate:function(a,b,d,f){var e=c.speed(b,d,f);if(c.isEmptyObject(a))return this.each(e.complete);return this[e.queue===false?"each":"queue"](function(){var j=c.extend({},e),i,o=this.nodeType===1&&c(this).is(":hidden"),k=this;for(i in a){var n=i.replace(ia,ja);if(i!==n){a[n]=a[i];delete a[i];i=n}if(a[i]==="hide"&&o||a[i]==="show"&&!o)return j.complete.call(this);if((i==="height"||i==="width")&&this.style){j.display=c.css(this,"display");j.overflow=this.style.overflow}if(c.isArray(a[i])){(j.specialEasing= +j.specialEasing||{})[i]=a[i][1];a[i]=a[i][0]}}if(j.overflow!=null)this.style.overflow="hidden";j.curAnim=c.extend({},a);c.each(a,function(r,u){var z=new c.fx(k,j,r);if(Ab.test(u))z[u==="toggle"?o?"show":"hide":u](a);else{var C=Bb.exec(u),B=z.cur(true)||0;if(C){u=parseFloat(C[2]);var E=C[3]||"px";if(E!=="px"){k.style[r]=(u||1)+E;B=(u||1)/z.cur(true)*B;k.style[r]=B+E}if(C[1])u=(C[1]==="-="?-1:1)*u+B;z.custom(B,u,E)}else z.custom(B,u,"")}});return true})},stop:function(a,b){var d=c.timers;a&&this.queue([]); +this.each(function(){for(var f=d.length-1;f>=0;f--)if(d[f].elem===this){b&&d[f](true);d.splice(f,1)}});b||this.dequeue();return this}});c.each({slideDown:K("show",1),slideUp:K("hide",1),slideToggle:K("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"}},function(a,b){c.fn[a]=function(d,f){return this.animate(b,d,f)}});c.extend({speed:function(a,b,d){var f=a&&typeof a==="object"?a:{complete:d||!d&&b||c.isFunction(a)&&a,duration:a,easing:d&&b||b&&!c.isFunction(b)&&b};f.duration=c.fx.off?0:typeof f.duration=== +"number"?f.duration:c.fx.speeds[f.duration]||c.fx.speeds._default;f.old=f.complete;f.complete=function(){f.queue!==false&&c(this).dequeue();c.isFunction(f.old)&&f.old.call(this)};return f},easing:{linear:function(a,b,d,f){return d+f*a},swing:function(a,b,d,f){return(-Math.cos(a*Math.PI)/2+0.5)*f+d}},timers:[],fx:function(a,b,d){this.options=b;this.elem=a;this.prop=d;if(!b.orig)b.orig={}}});c.fx.prototype={update:function(){this.options.step&&this.options.step.call(this.elem,this.now,this);(c.fx.step[this.prop]|| +c.fx.step._default)(this);if((this.prop==="height"||this.prop==="width")&&this.elem.style)this.elem.style.display="block"},cur:function(a){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null))return this.elem[this.prop];return(a=parseFloat(c.css(this.elem,this.prop,a)))&&a>-10000?a:parseFloat(c.curCSS(this.elem,this.prop))||0},custom:function(a,b,d){function f(j){return e.step(j)}this.startTime=J();this.start=a;this.end=b;this.unit=d||this.unit||"px";this.now=this.start; +this.pos=this.state=0;var e=this;f.elem=this.elem;if(f()&&c.timers.push(f)&&!W)W=setInterval(c.fx.tick,13)},show:function(){this.options.orig[this.prop]=c.style(this.elem,this.prop);this.options.show=true;this.custom(this.prop==="width"||this.prop==="height"?1:0,this.cur());c(this.elem).show()},hide:function(){this.options.orig[this.prop]=c.style(this.elem,this.prop);this.options.hide=true;this.custom(this.cur(),0)},step:function(a){var b=J(),d=true;if(a||b>=this.options.duration+this.startTime){this.now= +this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;for(var f in this.options.curAnim)if(this.options.curAnim[f]!==true)d=false;if(d){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;a=c.data(this.elem,"olddisplay");this.elem.style.display=a?a:this.options.display;if(c.css(this.elem,"display")==="none")this.elem.style.display="block"}this.options.hide&&c(this.elem).hide();if(this.options.hide||this.options.show)for(var e in this.options.curAnim)c.style(this.elem, +e,this.options.orig[e]);this.options.complete.call(this.elem)}return false}else{e=b-this.startTime;this.state=e/this.options.duration;a=this.options.easing||(c.easing.swing?"swing":"linear");this.pos=c.easing[this.options.specialEasing&&this.options.specialEasing[this.prop]||a](this.state,e,0,1,this.options.duration);this.now=this.start+(this.end-this.start)*this.pos;this.update()}return true}};c.extend(c.fx,{tick:function(){for(var a=c.timers,b=0;b<a.length;b++)a[b]()||a.splice(b--,1);a.length|| +c.fx.stop()},stop:function(){clearInterval(W);W=null},speeds:{slow:600,fast:200,_default:400},step:{opacity:function(a){c.style(a.elem,"opacity",a.now)},_default:function(a){if(a.elem.style&&a.elem.style[a.prop]!=null)a.elem.style[a.prop]=(a.prop==="width"||a.prop==="height"?Math.max(0,a.now):a.now)+a.unit;else a.elem[a.prop]=a.now}}});if(c.expr&&c.expr.filters)c.expr.filters.animated=function(a){return c.grep(c.timers,function(b){return a===b.elem}).length};c.fn.offset="getBoundingClientRect"in s.documentElement? +function(a){var b=this[0];if(a)return this.each(function(e){c.offset.setOffset(this,a,e)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return c.offset.bodyOffset(b);var d=b.getBoundingClientRect(),f=b.ownerDocument;b=f.body;f=f.documentElement;return{top:d.top+(self.pageYOffset||c.support.boxModel&&f.scrollTop||b.scrollTop)-(f.clientTop||b.clientTop||0),left:d.left+(self.pageXOffset||c.support.boxModel&&f.scrollLeft||b.scrollLeft)-(f.clientLeft||b.clientLeft||0)}}:function(a){var b= +this[0];if(a)return this.each(function(r){c.offset.setOffset(this,a,r)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return c.offset.bodyOffset(b);c.offset.initialize();var d=b.offsetParent,f=b,e=b.ownerDocument,j,i=e.documentElement,o=e.body;f=(e=e.defaultView)?e.getComputedStyle(b,null):b.currentStyle;for(var k=b.offsetTop,n=b.offsetLeft;(b=b.parentNode)&&b!==o&&b!==i;){if(c.offset.supportsFixedPosition&&f.position==="fixed")break;j=e?e.getComputedStyle(b,null):b.currentStyle; +k-=b.scrollTop;n-=b.scrollLeft;if(b===d){k+=b.offsetTop;n+=b.offsetLeft;if(c.offset.doesNotAddBorder&&!(c.offset.doesAddBorderForTableAndCells&&/^t(able|d|h)$/i.test(b.nodeName))){k+=parseFloat(j.borderTopWidth)||0;n+=parseFloat(j.borderLeftWidth)||0}f=d;d=b.offsetParent}if(c.offset.subtractsBorderForOverflowNotVisible&&j.overflow!=="visible"){k+=parseFloat(j.borderTopWidth)||0;n+=parseFloat(j.borderLeftWidth)||0}f=j}if(f.position==="relative"||f.position==="static"){k+=o.offsetTop;n+=o.offsetLeft}if(c.offset.supportsFixedPosition&& +f.position==="fixed"){k+=Math.max(i.scrollTop,o.scrollTop);n+=Math.max(i.scrollLeft,o.scrollLeft)}return{top:k,left:n}};c.offset={initialize:function(){var a=s.body,b=s.createElement("div"),d,f,e,j=parseFloat(c.curCSS(a,"marginTop",true))||0;c.extend(b.style,{position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"});b.innerHTML="<div style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;'><div></div></div><table style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;' cellpadding='0' cellspacing='0'><tr><td></td></tr></table>"; +a.insertBefore(b,a.firstChild);d=b.firstChild;f=d.firstChild;e=d.nextSibling.firstChild.firstChild;this.doesNotAddBorder=f.offsetTop!==5;this.doesAddBorderForTableAndCells=e.offsetTop===5;f.style.position="fixed";f.style.top="20px";this.supportsFixedPosition=f.offsetTop===20||f.offsetTop===15;f.style.position=f.style.top="";d.style.overflow="hidden";d.style.position="relative";this.subtractsBorderForOverflowNotVisible=f.offsetTop===-5;this.doesNotIncludeMarginInBodyOffset=a.offsetTop!==j;a.removeChild(b); +c.offset.initialize=c.noop},bodyOffset:function(a){var b=a.offsetTop,d=a.offsetLeft;c.offset.initialize();if(c.offset.doesNotIncludeMarginInBodyOffset){b+=parseFloat(c.curCSS(a,"marginTop",true))||0;d+=parseFloat(c.curCSS(a,"marginLeft",true))||0}return{top:b,left:d}},setOffset:function(a,b,d){if(/static/.test(c.curCSS(a,"position")))a.style.position="relative";var f=c(a),e=f.offset(),j=parseInt(c.curCSS(a,"top",true),10)||0,i=parseInt(c.curCSS(a,"left",true),10)||0;if(c.isFunction(b))b=b.call(a, +d,e);d={top:b.top-e.top+j,left:b.left-e.left+i};"using"in b?b.using.call(a,d):f.css(d)}};c.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),d=this.offset(),f=/^body|html$/i.test(b[0].nodeName)?{top:0,left:0}:b.offset();d.top-=parseFloat(c.curCSS(a,"marginTop",true))||0;d.left-=parseFloat(c.curCSS(a,"marginLeft",true))||0;f.top+=parseFloat(c.curCSS(b[0],"borderTopWidth",true))||0;f.left+=parseFloat(c.curCSS(b[0],"borderLeftWidth",true))||0;return{top:d.top- +f.top,left:d.left-f.left}},offsetParent:function(){return this.map(function(){for(var a=this.offsetParent||s.body;a&&!/^body|html$/i.test(a.nodeName)&&c.css(a,"position")==="static";)a=a.offsetParent;return a})}});c.each(["Left","Top"],function(a,b){var d="scroll"+b;c.fn[d]=function(f){var e=this[0],j;if(!e)return null;if(f!==w)return this.each(function(){if(j=wa(this))j.scrollTo(!a?f:c(j).scrollLeft(),a?f:c(j).scrollTop());else this[d]=f});else return(j=wa(e))?"pageXOffset"in j?j[a?"pageYOffset": +"pageXOffset"]:c.support.boxModel&&j.document.documentElement[d]||j.document.body[d]:e[d]}});c.each(["Height","Width"],function(a,b){var d=b.toLowerCase();c.fn["inner"+b]=function(){return this[0]?c.css(this[0],d,false,"padding"):null};c.fn["outer"+b]=function(f){return this[0]?c.css(this[0],d,false,f?"margin":"border"):null};c.fn[d]=function(f){var e=this[0];if(!e)return f==null?null:this;if(c.isFunction(f))return this.each(function(j){var i=c(this);i[d](f.call(this,j,i[d]()))});return"scrollTo"in +e&&e.document?e.document.compatMode==="CSS1Compat"&&e.document.documentElement["client"+b]||e.document.body["client"+b]:e.nodeType===9?Math.max(e.documentElement["client"+b],e.body["scroll"+b],e.documentElement["scroll"+b],e.body["offset"+b],e.documentElement["offset"+b]):f===w?c.css(e,d):this.css(d,typeof f==="string"?f:f+"px")}});A.jQuery=A.$=c})(window); diff --git a/distro/common/html/_static/minus.png b/distro/common/html/_static/minus.png Binary files differnew file mode 100644 index 0000000000..da1c5620d1 --- /dev/null +++ b/distro/common/html/_static/minus.png diff --git a/distro/common/html/_static/navigation.png b/distro/common/html/_static/navigation.png Binary files differnew file mode 100644 index 0000000000..1081dc1439 --- /dev/null +++ b/distro/common/html/_static/navigation.png diff --git a/distro/common/html/_static/plus.png b/distro/common/html/_static/plus.png Binary files differnew file mode 100644 index 0000000000..b3cb37425e --- /dev/null +++ b/distro/common/html/_static/plus.png diff --git a/distro/common/html/_static/pygments.css b/distro/common/html/_static/pygments.css new file mode 100644 index 0000000000..3965ee93a7 --- /dev/null +++ b/distro/common/html/_static/pygments.css @@ -0,0 +1,62 @@ +.highlight .hll { background-color: #ffffcc } +.highlight { background: #f8f8f8; } +.highlight .c { color: #008800; font-style: italic } /* Comment */ +.highlight .err { border: 1px solid #FF0000 } /* Error */ +.highlight .k { color: #AA22FF; font-weight: bold } /* Keyword */ +.highlight .o { color: #666666 } /* Operator */ +.highlight .cm { color: #008800; font-style: italic } /* Comment.Multiline */ +.highlight .cp { color: #008800 } /* Comment.Preproc */ +.highlight .c1 { color: #008800; font-style: italic } /* Comment.Single */ +.highlight .cs { color: #008800; font-weight: bold } /* Comment.Special */ +.highlight .gd { color: #A00000 } /* Generic.Deleted */ +.highlight .ge { font-style: italic } /* Generic.Emph */ +.highlight .gr { color: #FF0000 } /* Generic.Error */ +.highlight .gh { color: #000080; font-weight: bold } /* Generic.Heading */ +.highlight .gi { color: #00A000 } /* Generic.Inserted */ +.highlight .go { color: #808080 } /* Generic.Output */ +.highlight .gp { color: #000080; font-weight: bold } /* Generic.Prompt */ +.highlight .gs { font-weight: bold } /* Generic.Strong */ +.highlight .gu { color: #800080; font-weight: bold } /* Generic.Subheading */ +.highlight .gt { color: #0040D0 } /* Generic.Traceback */ +.highlight .kc { color: #AA22FF; font-weight: bold } /* Keyword.Constant */ +.highlight .kd { color: #AA22FF; font-weight: bold } /* Keyword.Declaration */ +.highlight .kn { color: #AA22FF; font-weight: bold } /* Keyword.Namespace */ +.highlight .kp { color: #AA22FF } /* Keyword.Pseudo */ +.highlight .kr { color: #AA22FF; font-weight: bold } /* Keyword.Reserved */ +.highlight .kt { color: #00BB00; font-weight: bold } /* Keyword.Type */ +.highlight .m { color: #666666 } /* Literal.Number */ +.highlight .s { color: #BB4444 } /* Literal.String */ +.highlight .na { color: #BB4444 } /* Name.Attribute */ +.highlight .nb { color: #AA22FF } /* Name.Builtin */ +.highlight .nc { color: #0000FF } /* Name.Class */ +.highlight .no { color: #880000 } /* Name.Constant */ +.highlight .nd { color: #AA22FF } /* Name.Decorator */ +.highlight .ni { color: #999999; font-weight: bold } /* Name.Entity */ +.highlight .ne { color: #D2413A; font-weight: bold } /* Name.Exception */ +.highlight .nf { color: #00A000 } /* Name.Function */ +.highlight .nl { color: #A0A000 } /* Name.Label */ +.highlight .nn { color: #0000FF; font-weight: bold } /* Name.Namespace */ +.highlight .nt { color: #008000; font-weight: bold } /* Name.Tag */ +.highlight .nv { color: #B8860B } /* Name.Variable */ +.highlight .ow { color: #AA22FF; font-weight: bold } /* Operator.Word */ +.highlight .w { color: #bbbbbb } /* Text.Whitespace */ +.highlight .mf { color: #666666 } /* Literal.Number.Float */ +.highlight .mh { color: #666666 } /* Literal.Number.Hex */ +.highlight .mi { color: #666666 } /* Literal.Number.Integer */ +.highlight .mo { color: #666666 } /* Literal.Number.Oct */ +.highlight .sb { color: #BB4444 } /* Literal.String.Backtick */ +.highlight .sc { color: #BB4444 } /* Literal.String.Char */ +.highlight .sd { color: #BB4444; font-style: italic } /* Literal.String.Doc */ +.highlight .s2 { color: #BB4444 } /* Literal.String.Double */ +.highlight .se { color: #BB6622; font-weight: bold } /* Literal.String.Escape */ +.highlight .sh { color: #BB4444 } /* Literal.String.Heredoc */ +.highlight .si { color: #BB6688; font-weight: bold } /* Literal.String.Interpol */ +.highlight .sx { color: #008000 } /* Literal.String.Other */ +.highlight .sr { color: #BB6688 } /* Literal.String.Regex */ +.highlight .s1 { color: #BB4444 } /* Literal.String.Single */ +.highlight .ss { color: #B8860B } /* Literal.String.Symbol */ +.highlight .bp { color: #AA22FF } /* Name.Builtin.Pseudo */ +.highlight .vc { color: #B8860B } /* Name.Variable.Class */ +.highlight .vg { color: #B8860B } /* Name.Variable.Global */ +.highlight .vi { color: #B8860B } /* Name.Variable.Instance */ +.highlight .il { color: #666666 } /* Literal.Number.Integer.Long */
\ No newline at end of file diff --git a/distro/common/html/_static/searchtools.js b/distro/common/html/_static/searchtools.js new file mode 100644 index 0000000000..663be4c909 --- /dev/null +++ b/distro/common/html/_static/searchtools.js @@ -0,0 +1,560 @@ +/* + * searchtools.js_t + * ~~~~~~~~~~~~~~~~ + * + * Sphinx JavaScript utilties for the full-text search. + * + * :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. + * :license: BSD, see LICENSE for details. + * + */ + +/** + * helper function to return a node containing the + * search summary for a given text. keywords is a list + * of stemmed words, hlwords is the list of normal, unstemmed + * words. the first one is used to find the occurance, the + * latter for highlighting it. + */ + +jQuery.makeSearchSummary = function(text, keywords, hlwords) { + var textLower = text.toLowerCase(); + var start = 0; + $.each(keywords, function() { + var i = textLower.indexOf(this.toLowerCase()); + if (i > -1) + start = i; + }); + start = Math.max(start - 120, 0); + var excerpt = ((start > 0) ? '...' : '') + + $.trim(text.substr(start, 240)) + + ((start + 240 - text.length) ? '...' : ''); + var rv = $('<div class="context"></div>').text(excerpt); + $.each(hlwords, function() { + rv = rv.highlightText(this, 'highlighted'); + }); + return rv; +} + + +/** + * Porter Stemmer + */ +var Stemmer = function() { + + var step2list = { + ational: 'ate', + tional: 'tion', + enci: 'ence', + anci: 'ance', + izer: 'ize', + bli: 'ble', + alli: 'al', + entli: 'ent', + eli: 'e', + ousli: 'ous', + ization: 'ize', + ation: 'ate', + ator: 'ate', + alism: 'al', + iveness: 'ive', + fulness: 'ful', + ousness: 'ous', + aliti: 'al', + iviti: 'ive', + biliti: 'ble', + logi: 'log' + }; + + var step3list = { + icate: 'ic', + ative: '', + alize: 'al', + iciti: 'ic', + ical: 'ic', + ful: '', + ness: '' + }; + + var c = "[^aeiou]"; // consonant + var v = "[aeiouy]"; // vowel + var C = c + "[^aeiouy]*"; // consonant sequence + var V = v + "[aeiou]*"; // vowel sequence + + var mgr0 = "^(" + C + ")?" + V + C; // [C]VC... is m>0 + var meq1 = "^(" + C + ")?" + V + C + "(" + V + ")?$"; // [C]VC[V] is m=1 + var mgr1 = "^(" + C + ")?" + V + C + V + C; // [C]VCVC... is m>1 + var s_v = "^(" + C + ")?" + v; // vowel in stem + + this.stemWord = function (w) { + var stem; + var suffix; + var firstch; + var origword = w; + + if (w.length < 3) + return w; + + var re; + var re2; + var re3; + var re4; + + firstch = w.substr(0,1); + if (firstch == "y") + w = firstch.toUpperCase() + w.substr(1); + + // Step 1a + re = /^(.+?)(ss|i)es$/; + re2 = /^(.+?)([^s])s$/; + + if (re.test(w)) + w = w.replace(re,"$1$2"); + else if (re2.test(w)) + w = w.replace(re2,"$1$2"); + + // Step 1b + re = /^(.+?)eed$/; + re2 = /^(.+?)(ed|ing)$/; + if (re.test(w)) { + var fp = re.exec(w); + re = new RegExp(mgr0); + if (re.test(fp[1])) { + re = /.$/; + w = w.replace(re,""); + } + } + else if (re2.test(w)) { + var fp = re2.exec(w); + stem = fp[1]; + re2 = new RegExp(s_v); + if (re2.test(stem)) { + w = stem; + re2 = /(at|bl|iz)$/; + re3 = new RegExp("([^aeiouylsz])\\1$"); + re4 = new RegExp("^" + C + v + "[^aeiouwxy]$"); + if (re2.test(w)) + w = w + "e"; + else if (re3.test(w)) { + re = /.$/; + w = w.replace(re,""); + } + else if (re4.test(w)) + w = w + "e"; + } + } + + // Step 1c + re = /^(.+?)y$/; + if (re.test(w)) { + var fp = re.exec(w); + stem = fp[1]; + re = new RegExp(s_v); + if (re.test(stem)) + w = stem + "i"; + } + + // Step 2 + re = /^(.+?)(ational|tional|enci|anci|izer|bli|alli|entli|eli|ousli|ization|ation|ator|alism|iveness|fulness|ousness|aliti|iviti|biliti|logi)$/; + if (re.test(w)) { + var fp = re.exec(w); + stem = fp[1]; + suffix = fp[2]; + re = new RegExp(mgr0); + if (re.test(stem)) + w = stem + step2list[suffix]; + } + + // Step 3 + re = /^(.+?)(icate|ative|alize|iciti|ical|ful|ness)$/; + if (re.test(w)) { + var fp = re.exec(w); + stem = fp[1]; + suffix = fp[2]; + re = new RegExp(mgr0); + if (re.test(stem)) + w = stem + step3list[suffix]; + } + + // Step 4 + re = /^(.+?)(al|ance|ence|er|ic|able|ible|ant|ement|ment|ent|ou|ism|ate|iti|ous|ive|ize)$/; + re2 = /^(.+?)(s|t)(ion)$/; + if (re.test(w)) { + var fp = re.exec(w); + stem = fp[1]; + re = new RegExp(mgr1); + if (re.test(stem)) + w = stem; + } + else if (re2.test(w)) { + var fp = re2.exec(w); + stem = fp[1] + fp[2]; + re2 = new RegExp(mgr1); + if (re2.test(stem)) + w = stem; + } + + // Step 5 + re = /^(.+?)e$/; + if (re.test(w)) { + var fp = re.exec(w); + stem = fp[1]; + re = new RegExp(mgr1); + re2 = new RegExp(meq1); + re3 = new RegExp("^" + C + v + "[^aeiouwxy]$"); + if (re.test(stem) || (re2.test(stem) && !(re3.test(stem)))) + w = stem; + } + re = /ll$/; + re2 = new RegExp(mgr1); + if (re.test(w) && re2.test(w)) { + re = /.$/; + w = w.replace(re,""); + } + + // and turn initial Y back to y + if (firstch == "y") + w = firstch.toLowerCase() + w.substr(1); + return w; + } +} + + +/** + * Search Module + */ +var Search = { + + _index : null, + _queued_query : null, + _pulse_status : -1, + + init : function() { + var params = $.getQueryParameters(); + if (params.q) { + var query = params.q[0]; + $('input[name="q"]')[0].value = query; + this.performSearch(query); + } + }, + + loadIndex : function(url) { + $.ajax({type: "GET", url: url, data: null, success: null, + dataType: "script", cache: true}); + }, + + setIndex : function(index) { + var q; + this._index = index; + if ((q = this._queued_query) !== null) { + this._queued_query = null; + Search.query(q); + } + }, + + hasIndex : function() { + return this._index !== null; + }, + + deferQuery : function(query) { + this._queued_query = query; + }, + + stopPulse : function() { + this._pulse_status = 0; + }, + + startPulse : function() { + if (this._pulse_status >= 0) + return; + function pulse() { + Search._pulse_status = (Search._pulse_status + 1) % 4; + var dotString = ''; + for (var i = 0; i < Search._pulse_status; i++) + dotString += '.'; + Search.dots.text(dotString); + if (Search._pulse_status > -1) + window.setTimeout(pulse, 500); + }; + pulse(); + }, + + /** + * perform a search for something + */ + performSearch : function(query) { + // create the required interface elements + this.out = $('#search-results'); + this.title = $('<h2>' + _('Searching') + '</h2>').appendTo(this.out); + this.dots = $('<span></span>').appendTo(this.title); + this.status = $('<p style="display: none"></p>').appendTo(this.out); + this.output = $('<ul class="search"/>').appendTo(this.out); + + $('#search-progress').text(_('Preparing search...')); + this.startPulse(); + + // index already loaded, the browser was quick! + if (this.hasIndex()) + this.query(query); + else + this.deferQuery(query); + }, + + query : function(query) { + var stopwords = ["and","then","into","it","as","are","in","if","for","no","there","their","was","is","be","to","that","but","they","not","such","with","by","a","on","these","of","will","this","near","the","or","at"]; + + // Stem the searchterms and add them to the correct list + var stemmer = new Stemmer(); + var searchterms = []; + var excluded = []; + var hlterms = []; + var tmp = query.split(/\s+/); + var objectterms = []; + for (var i = 0; i < tmp.length; i++) { + if (tmp[i] != "") { + objectterms.push(tmp[i].toLowerCase()); + } + + if ($u.indexOf(stopwords, tmp[i]) != -1 || tmp[i].match(/^\d+$/) || + tmp[i] == "") { + // skip this "word" + continue; + } + // stem the word + var word = stemmer.stemWord(tmp[i]).toLowerCase(); + // select the correct list + if (word[0] == '-') { + var toAppend = excluded; + word = word.substr(1); + } + else { + var toAppend = searchterms; + hlterms.push(tmp[i].toLowerCase()); + } + // only add if not already in the list + if (!$.contains(toAppend, word)) + toAppend.push(word); + }; + var highlightstring = '?highlight=' + $.urlencode(hlterms.join(" ")); + + // console.debug('SEARCH: searching for:'); + // console.info('required: ', searchterms); + // console.info('excluded: ', excluded); + + // prepare search + var filenames = this._index.filenames; + var titles = this._index.titles; + var terms = this._index.terms; + var fileMap = {}; + var files = null; + // different result priorities + var importantResults = []; + var objectResults = []; + var regularResults = []; + var unimportantResults = []; + $('#search-progress').empty(); + + // lookup as object + for (var i = 0; i < objectterms.length; i++) { + var others = [].concat(objectterms.slice(0,i), + objectterms.slice(i+1, objectterms.length)) + var results = this.performObjectSearch(objectterms[i], others); + // Assume first word is most likely to be the object, + // other words more likely to be in description. + // Therefore put matches for earlier words first. + // (Results are eventually used in reverse order). + objectResults = results[0].concat(objectResults); + importantResults = results[1].concat(importantResults); + unimportantResults = results[2].concat(unimportantResults); + } + + // perform the search on the required terms + for (var i = 0; i < searchterms.length; i++) { + var word = searchterms[i]; + // no match but word was a required one + if ((files = terms[word]) == null) + break; + if (files.length == undefined) { + files = [files]; + } + // create the mapping + for (var j = 0; j < files.length; j++) { + var file = files[j]; + if (file in fileMap) + fileMap[file].push(word); + else + fileMap[file] = [word]; + } + } + + // now check if the files don't contain excluded terms + for (var file in fileMap) { + var valid = true; + + // check if all requirements are matched + if (fileMap[file].length != searchterms.length) + continue; + + // ensure that none of the excluded terms is in the + // search result. + for (var i = 0; i < excluded.length; i++) { + if (terms[excluded[i]] == file || + $.contains(terms[excluded[i]] || [], file)) { + valid = false; + break; + } + } + + // if we have still a valid result we can add it + // to the result list + if (valid) + regularResults.push([filenames[file], titles[file], '', null]); + } + + // delete unused variables in order to not waste + // memory until list is retrieved completely + delete filenames, titles, terms; + + // now sort the regular results descending by title + regularResults.sort(function(a, b) { + var left = a[1].toLowerCase(); + var right = b[1].toLowerCase(); + return (left > right) ? -1 : ((left < right) ? 1 : 0); + }); + + // combine all results + var results = unimportantResults.concat(regularResults) + .concat(objectResults).concat(importantResults); + + // print the results + var resultCount = results.length; + function displayNextItem() { + // results left, load the summary and display it + if (results.length) { + var item = results.pop(); + var listItem = $('<li style="display:none"></li>'); + if (DOCUMENTATION_OPTIONS.FILE_SUFFIX == '') { + // dirhtml builder + var dirname = item[0] + '/'; + if (dirname.match(/\/index\/$/)) { + dirname = dirname.substring(0, dirname.length-6); + } else if (dirname == 'index/') { + dirname = ''; + } + listItem.append($('<a/>').attr('href', + DOCUMENTATION_OPTIONS.URL_ROOT + dirname + + highlightstring + item[2]).html(item[1])); + } else { + // normal html builders + listItem.append($('<a/>').attr('href', + item[0] + DOCUMENTATION_OPTIONS.FILE_SUFFIX + + highlightstring + item[2]).html(item[1])); + } + if (item[3]) { + listItem.append($('<span> (' + item[3] + ')</span>')); + Search.output.append(listItem); + listItem.slideDown(5, function() { + displayNextItem(); + }); + } else if (DOCUMENTATION_OPTIONS.HAS_SOURCE) { + $.get(DOCUMENTATION_OPTIONS.URL_ROOT + '_sources/' + + item[0] + '.txt', function(data) { + if (data != '') { + listItem.append($.makeSearchSummary(data, searchterms, hlterms)); + Search.output.append(listItem); + } + listItem.slideDown(5, function() { + displayNextItem(); + }); + }, "text"); + } else { + // no source available, just display title + Search.output.append(listItem); + listItem.slideDown(5, function() { + displayNextItem(); + }); + } + } + // search finished, update title and status message + else { + Search.stopPulse(); + Search.title.text(_('Search Results')); + if (!resultCount) + Search.status.text(_('Your search did not match any documents. Please make sure that all words are spelled correctly and that you\'ve selected enough categories.')); + else + Search.status.text(_('Search finished, found %s page(s) matching the search query.').replace('%s', resultCount)); + Search.status.fadeIn(500); + } + } + displayNextItem(); + }, + + performObjectSearch : function(object, otherterms) { + var filenames = this._index.filenames; + var objects = this._index.objects; + var objnames = this._index.objnames; + var titles = this._index.titles; + + var importantResults = []; + var objectResults = []; + var unimportantResults = []; + + for (var prefix in objects) { + for (var name in objects[prefix]) { + var fullname = (prefix ? prefix + '.' : '') + name; + if (fullname.toLowerCase().indexOf(object) > -1) { + var match = objects[prefix][name]; + var objname = objnames[match[1]][2]; + var title = titles[match[0]]; + // If more than one term searched for, we require other words to be + // found in the name/title/description + if (otherterms.length > 0) { + var haystack = (prefix + ' ' + name + ' ' + + objname + ' ' + title).toLowerCase(); + var allfound = true; + for (var i = 0; i < otherterms.length; i++) { + if (haystack.indexOf(otherterms[i]) == -1) { + allfound = false; + break; + } + } + if (!allfound) { + continue; + } + } + var descr = objname + _(', in ') + title; + anchor = match[3]; + if (anchor == '') + anchor = fullname; + else if (anchor == '-') + anchor = objnames[match[1]][1] + '-' + fullname; + result = [filenames[match[0]], fullname, '#'+anchor, descr]; + switch (match[2]) { + case 1: objectResults.push(result); break; + case 0: importantResults.push(result); break; + case 2: unimportantResults.push(result); break; + } + } + } + } + + // sort results descending + objectResults.sort(function(a, b) { + return (a[1] > b[1]) ? -1 : ((a[1] < b[1]) ? 1 : 0); + }); + + importantResults.sort(function(a, b) { + return (a[1] > b[1]) ? -1 : ((a[1] < b[1]) ? 1 : 0); + }); + + unimportantResults.sort(function(a, b) { + return (a[1] > b[1]) ? -1 : ((a[1] < b[1]) ? 1 : 0); + }); + + return [importantResults, objectResults, unimportantResults] + } +} + +$(document).ready(function() { + Search.init(); +});
\ No newline at end of file diff --git a/distro/common/html/_static/underscore.js b/distro/common/html/_static/underscore.js new file mode 100644 index 0000000000..5d89914340 --- /dev/null +++ b/distro/common/html/_static/underscore.js @@ -0,0 +1,23 @@ +// Underscore.js 0.5.5 +// (c) 2009 Jeremy Ashkenas, DocumentCloud Inc. +// Underscore is freely distributable under the terms of the MIT license. +// Portions of Underscore are inspired by or borrowed from Prototype.js, +// Oliver Steele's Functional, and John Resig's Micro-Templating. +// For all details and documentation: +// http://documentcloud.github.com/underscore/ +(function(){var j=this,n=j._,i=function(a){this._wrapped=a},m=typeof StopIteration!=="undefined"?StopIteration:"__break__",b=j._=function(a){return new i(a)};if(typeof exports!=="undefined")exports._=b;var k=Array.prototype.slice,o=Array.prototype.unshift,p=Object.prototype.toString,q=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable;b.VERSION="0.5.5";b.each=function(a,c,d){try{if(a.forEach)a.forEach(c,d);else if(b.isArray(a)||b.isArguments(a))for(var e=0,f=a.length;e<f;e++)c.call(d, +a[e],e,a);else{var g=b.keys(a);f=g.length;for(e=0;e<f;e++)c.call(d,a[g[e]],g[e],a)}}catch(h){if(h!=m)throw h;}return a};b.map=function(a,c,d){if(a&&b.isFunction(a.map))return a.map(c,d);var e=[];b.each(a,function(f,g,h){e.push(c.call(d,f,g,h))});return e};b.reduce=function(a,c,d,e){if(a&&b.isFunction(a.reduce))return a.reduce(b.bind(d,e),c);b.each(a,function(f,g,h){c=d.call(e,c,f,g,h)});return c};b.reduceRight=function(a,c,d,e){if(a&&b.isFunction(a.reduceRight))return a.reduceRight(b.bind(d,e),c); +var f=b.clone(b.toArray(a)).reverse();b.each(f,function(g,h){c=d.call(e,c,g,h,a)});return c};b.detect=function(a,c,d){var e;b.each(a,function(f,g,h){if(c.call(d,f,g,h)){e=f;b.breakLoop()}});return e};b.select=function(a,c,d){if(a&&b.isFunction(a.filter))return a.filter(c,d);var e=[];b.each(a,function(f,g,h){c.call(d,f,g,h)&&e.push(f)});return e};b.reject=function(a,c,d){var e=[];b.each(a,function(f,g,h){!c.call(d,f,g,h)&&e.push(f)});return e};b.all=function(a,c,d){c=c||b.identity;if(a&&b.isFunction(a.every))return a.every(c, +d);var e=true;b.each(a,function(f,g,h){(e=e&&c.call(d,f,g,h))||b.breakLoop()});return e};b.any=function(a,c,d){c=c||b.identity;if(a&&b.isFunction(a.some))return a.some(c,d);var e=false;b.each(a,function(f,g,h){if(e=c.call(d,f,g,h))b.breakLoop()});return e};b.include=function(a,c){if(b.isArray(a))return b.indexOf(a,c)!=-1;var d=false;b.each(a,function(e){if(d=e===c)b.breakLoop()});return d};b.invoke=function(a,c){var d=b.rest(arguments,2);return b.map(a,function(e){return(c?e[c]:e).apply(e,d)})};b.pluck= +function(a,c){return b.map(a,function(d){return d[c]})};b.max=function(a,c,d){if(!c&&b.isArray(a))return Math.max.apply(Math,a);var e={computed:-Infinity};b.each(a,function(f,g,h){g=c?c.call(d,f,g,h):f;g>=e.computed&&(e={value:f,computed:g})});return e.value};b.min=function(a,c,d){if(!c&&b.isArray(a))return Math.min.apply(Math,a);var e={computed:Infinity};b.each(a,function(f,g,h){g=c?c.call(d,f,g,h):f;g<e.computed&&(e={value:f,computed:g})});return e.value};b.sortBy=function(a,c,d){return b.pluck(b.map(a, +function(e,f,g){return{value:e,criteria:c.call(d,e,f,g)}}).sort(function(e,f){e=e.criteria;f=f.criteria;return e<f?-1:e>f?1:0}),"value")};b.sortedIndex=function(a,c,d){d=d||b.identity;for(var e=0,f=a.length;e<f;){var g=e+f>>1;d(a[g])<d(c)?(e=g+1):(f=g)}return e};b.toArray=function(a){if(!a)return[];if(a.toArray)return a.toArray();if(b.isArray(a))return a;if(b.isArguments(a))return k.call(a);return b.values(a)};b.size=function(a){return b.toArray(a).length};b.first=function(a,c,d){return c&&!d?k.call(a, +0,c):a[0]};b.rest=function(a,c,d){return k.call(a,b.isUndefined(c)||d?1:c)};b.last=function(a){return a[a.length-1]};b.compact=function(a){return b.select(a,function(c){return!!c})};b.flatten=function(a){return b.reduce(a,[],function(c,d){if(b.isArray(d))return c.concat(b.flatten(d));c.push(d);return c})};b.without=function(a){var c=b.rest(arguments);return b.select(a,function(d){return!b.include(c,d)})};b.uniq=function(a,c){return b.reduce(a,[],function(d,e,f){if(0==f||(c===true?b.last(d)!=e:!b.include(d, +e)))d.push(e);return d})};b.intersect=function(a){var c=b.rest(arguments);return b.select(b.uniq(a),function(d){return b.all(c,function(e){return b.indexOf(e,d)>=0})})};b.zip=function(){for(var a=b.toArray(arguments),c=b.max(b.pluck(a,"length")),d=new Array(c),e=0;e<c;e++)d[e]=b.pluck(a,String(e));return d};b.indexOf=function(a,c){if(a.indexOf)return a.indexOf(c);for(var d=0,e=a.length;d<e;d++)if(a[d]===c)return d;return-1};b.lastIndexOf=function(a,c){if(a.lastIndexOf)return a.lastIndexOf(c);for(var d= +a.length;d--;)if(a[d]===c)return d;return-1};b.range=function(a,c,d){var e=b.toArray(arguments),f=e.length<=1;a=f?0:e[0];c=f?e[0]:e[1];d=e[2]||1;e=Math.ceil((c-a)/d);if(e<=0)return[];e=new Array(e);f=a;for(var g=0;1;f+=d){if((d>0?f-c:c-f)>=0)return e;e[g++]=f}};b.bind=function(a,c){var d=b.rest(arguments,2);return function(){return a.apply(c||j,d.concat(b.toArray(arguments)))}};b.bindAll=function(a){var c=b.rest(arguments);if(c.length==0)c=b.functions(a);b.each(c,function(d){a[d]=b.bind(a[d],a)}); +return a};b.delay=function(a,c){var d=b.rest(arguments,2);return setTimeout(function(){return a.apply(a,d)},c)};b.defer=function(a){return b.delay.apply(b,[a,1].concat(b.rest(arguments)))};b.wrap=function(a,c){return function(){var d=[a].concat(b.toArray(arguments));return c.apply(c,d)}};b.compose=function(){var a=b.toArray(arguments);return function(){for(var c=b.toArray(arguments),d=a.length-1;d>=0;d--)c=[a[d].apply(this,c)];return c[0]}};b.keys=function(a){if(b.isArray(a))return b.range(0,a.length); +var c=[];for(var d in a)q.call(a,d)&&c.push(d);return c};b.values=function(a){return b.map(a,b.identity)};b.functions=function(a){return b.select(b.keys(a),function(c){return b.isFunction(a[c])}).sort()};b.extend=function(a,c){for(var d in c)a[d]=c[d];return a};b.clone=function(a){if(b.isArray(a))return a.slice(0);return b.extend({},a)};b.tap=function(a,c){c(a);return a};b.isEqual=function(a,c){if(a===c)return true;var d=typeof a;if(d!=typeof c)return false;if(a==c)return true;if(!a&&c||a&&!c)return false; +if(a.isEqual)return a.isEqual(c);if(b.isDate(a)&&b.isDate(c))return a.getTime()===c.getTime();if(b.isNaN(a)&&b.isNaN(c))return true;if(b.isRegExp(a)&&b.isRegExp(c))return a.source===c.source&&a.global===c.global&&a.ignoreCase===c.ignoreCase&&a.multiline===c.multiline;if(d!=="object")return false;if(a.length&&a.length!==c.length)return false;d=b.keys(a);var e=b.keys(c);if(d.length!=e.length)return false;for(var f in a)if(!b.isEqual(a[f],c[f]))return false;return true};b.isEmpty=function(a){return b.keys(a).length== +0};b.isElement=function(a){return!!(a&&a.nodeType==1)};b.isArray=function(a){return!!(a&&a.concat&&a.unshift)};b.isArguments=function(a){return a&&b.isNumber(a.length)&&!b.isArray(a)&&!r.call(a,"length")};b.isFunction=function(a){return!!(a&&a.constructor&&a.call&&a.apply)};b.isString=function(a){return!!(a===""||a&&a.charCodeAt&&a.substr)};b.isNumber=function(a){return p.call(a)==="[object Number]"};b.isDate=function(a){return!!(a&&a.getTimezoneOffset&&a.setUTCFullYear)};b.isRegExp=function(a){return!!(a&& +a.test&&a.exec&&(a.ignoreCase||a.ignoreCase===false))};b.isNaN=function(a){return b.isNumber(a)&&isNaN(a)};b.isNull=function(a){return a===null};b.isUndefined=function(a){return typeof a=="undefined"};b.noConflict=function(){j._=n;return this};b.identity=function(a){return a};b.breakLoop=function(){throw m;};var s=0;b.uniqueId=function(a){var c=s++;return a?a+c:c};b.template=function(a,c){a=new Function("obj","var p=[],print=function(){p.push.apply(p,arguments);};with(obj){p.push('"+a.replace(/[\r\t\n]/g, +" ").replace(/'(?=[^%]*%>)/g,"\t").split("'").join("\\'").split("\t").join("'").replace(/<%=(.+?)%>/g,"',$1,'").split("<%").join("');").split("%>").join("p.push('")+"');}return p.join('');");return c?a(c):a};b.forEach=b.each;b.foldl=b.inject=b.reduce;b.foldr=b.reduceRight;b.filter=b.select;b.every=b.all;b.some=b.any;b.head=b.first;b.tail=b.rest;b.methods=b.functions;var l=function(a,c){return c?b(a).chain():a};b.each(b.functions(b),function(a){var c=b[a];i.prototype[a]=function(){var d=b.toArray(arguments); +o.call(d,this._wrapped);return l(c.apply(b,d),this._chain)}});b.each(["pop","push","reverse","shift","sort","splice","unshift"],function(a){var c=Array.prototype[a];i.prototype[a]=function(){c.apply(this._wrapped,arguments);return l(this._wrapped,this._chain)}});b.each(["concat","join","slice"],function(a){var c=Array.prototype[a];i.prototype[a]=function(){return l(c.apply(this._wrapped,arguments),this._chain)}});i.prototype.chain=function(){this._chain=true;return this};i.prototype.value=function(){return this._wrapped}})(); diff --git a/distro/common/html/_static/up-pressed.png b/distro/common/html/_static/up-pressed.png Binary files differnew file mode 100644 index 0000000000..8bd587afee --- /dev/null +++ b/distro/common/html/_static/up-pressed.png diff --git a/distro/common/html/_static/up.png b/distro/common/html/_static/up.png Binary files differnew file mode 100644 index 0000000000..b94625680b --- /dev/null +++ b/distro/common/html/_static/up.png diff --git a/distro/common/html/_static/websupport.js b/distro/common/html/_static/websupport.js new file mode 100644 index 0000000000..e9bd1b851c --- /dev/null +++ b/distro/common/html/_static/websupport.js @@ -0,0 +1,808 @@ +/* + * websupport.js + * ~~~~~~~~~~~~~ + * + * sphinx.websupport utilties for all documentation. + * + * :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. + * :license: BSD, see LICENSE for details. + * + */ + +(function($) { + $.fn.autogrow = function() { + return this.each(function() { + var textarea = this; + + $.fn.autogrow.resize(textarea); + + $(textarea) + .focus(function() { + textarea.interval = setInterval(function() { + $.fn.autogrow.resize(textarea); + }, 500); + }) + .blur(function() { + clearInterval(textarea.interval); + }); + }); + }; + + $.fn.autogrow.resize = function(textarea) { + var lineHeight = parseInt($(textarea).css('line-height'), 10); + var lines = textarea.value.split('\n'); + var columns = textarea.cols; + var lineCount = 0; + $.each(lines, function() { + lineCount += Math.ceil(this.length / columns) || 1; + }); + var height = lineHeight * (lineCount + 1); + $(textarea).css('height', height); + }; +})(jQuery); + +(function($) { + var comp, by; + + function init() { + initEvents(); + initComparator(); + } + + function initEvents() { + $('a.comment-close').live("click", function(event) { + event.preventDefault(); + hide($(this).attr('id').substring(2)); + }); + $('a.vote').live("click", function(event) { + event.preventDefault(); + handleVote($(this)); + }); + $('a.reply').live("click", function(event) { + event.preventDefault(); + openReply($(this).attr('id').substring(2)); + }); + $('a.close-reply').live("click", function(event) { + event.preventDefault(); + closeReply($(this).attr('id').substring(2)); + }); + $('a.sort-option').live("click", function(event) { + event.preventDefault(); + handleReSort($(this)); + }); + $('a.show-proposal').live("click", function(event) { + event.preventDefault(); + showProposal($(this).attr('id').substring(2)); + }); + $('a.hide-proposal').live("click", function(event) { + event.preventDefault(); + hideProposal($(this).attr('id').substring(2)); + }); + $('a.show-propose-change').live("click", function(event) { + event.preventDefault(); + showProposeChange($(this).attr('id').substring(2)); + }); + $('a.hide-propose-change').live("click", function(event) { + event.preventDefault(); + hideProposeChange($(this).attr('id').substring(2)); + }); + $('a.accept-comment').live("click", function(event) { + event.preventDefault(); + acceptComment($(this).attr('id').substring(2)); + }); + $('a.delete-comment').live("click", function(event) { + event.preventDefault(); + deleteComment($(this).attr('id').substring(2)); + }); + $('a.comment-markup').live("click", function(event) { + event.preventDefault(); + toggleCommentMarkupBox($(this).attr('id').substring(2)); + }); + } + + /** + * Set comp, which is a comparator function used for sorting and + * inserting comments into the list. + */ + function setComparator() { + // If the first three letters are "asc", sort in ascending order + // and remove the prefix. + if (by.substring(0,3) == 'asc') { + var i = by.substring(3); + comp = function(a, b) { return a[i] - b[i]; }; + } else { + // Otherwise sort in descending order. + comp = function(a, b) { return b[by] - a[by]; }; + } + + // Reset link styles and format the selected sort option. + $('a.sel').attr('href', '#').removeClass('sel'); + $('a.by' + by).removeAttr('href').addClass('sel'); + } + + /** + * Create a comp function. If the user has preferences stored in + * the sortBy cookie, use those, otherwise use the default. + */ + function initComparator() { + by = 'rating'; // Default to sort by rating. + // If the sortBy cookie is set, use that instead. + if (document.cookie.length > 0) { + var start = document.cookie.indexOf('sortBy='); + if (start != -1) { + start = start + 7; + var end = document.cookie.indexOf(";", start); + if (end == -1) { + end = document.cookie.length; + by = unescape(document.cookie.substring(start, end)); + } + } + } + setComparator(); + } + + /** + * Show a comment div. + */ + function show(id) { + $('#ao' + id).hide(); + $('#ah' + id).show(); + var context = $.extend({id: id}, opts); + var popup = $(renderTemplate(popupTemplate, context)).hide(); + popup.find('textarea[name="proposal"]').hide(); + popup.find('a.by' + by).addClass('sel'); + var form = popup.find('#cf' + id); + form.submit(function(event) { + event.preventDefault(); + addComment(form); + }); + $('#s' + id).after(popup); + popup.slideDown('fast', function() { + getComments(id); + }); + } + + /** + * Hide a comment div. + */ + function hide(id) { + $('#ah' + id).hide(); + $('#ao' + id).show(); + var div = $('#sc' + id); + div.slideUp('fast', function() { + div.remove(); + }); + } + + /** + * Perform an ajax request to get comments for a node + * and insert the comments into the comments tree. + */ + function getComments(id) { + $.ajax({ + type: 'GET', + url: opts.getCommentsURL, + data: {node: id}, + success: function(data, textStatus, request) { + var ul = $('#cl' + id); + var speed = 100; + $('#cf' + id) + .find('textarea[name="proposal"]') + .data('source', data.source); + + if (data.comments.length === 0) { + ul.html('<li>No comments yet.</li>'); + ul.data('empty', true); + } else { + // If there are comments, sort them and put them in the list. + var comments = sortComments(data.comments); + speed = data.comments.length * 100; + appendComments(comments, ul); + ul.data('empty', false); + } + $('#cn' + id).slideUp(speed + 200); + ul.slideDown(speed); + }, + error: function(request, textStatus, error) { + showError('Oops, there was a problem retrieving the comments.'); + }, + dataType: 'json' + }); + } + + /** + * Add a comment via ajax and insert the comment into the comment tree. + */ + function addComment(form) { + var node_id = form.find('input[name="node"]').val(); + var parent_id = form.find('input[name="parent"]').val(); + var text = form.find('textarea[name="comment"]').val(); + var proposal = form.find('textarea[name="proposal"]').val(); + + if (text == '') { + showError('Please enter a comment.'); + return; + } + + // Disable the form that is being submitted. + form.find('textarea,input').attr('disabled', 'disabled'); + + // Send the comment to the server. + $.ajax({ + type: "POST", + url: opts.addCommentURL, + dataType: 'json', + data: { + node: node_id, + parent: parent_id, + text: text, + proposal: proposal + }, + success: function(data, textStatus, error) { + // Reset the form. + if (node_id) { + hideProposeChange(node_id); + } + form.find('textarea') + .val('') + .add(form.find('input')) + .removeAttr('disabled'); + var ul = $('#cl' + (node_id || parent_id)); + if (ul.data('empty')) { + $(ul).empty(); + ul.data('empty', false); + } + insertComment(data.comment); + var ao = $('#ao' + node_id); + ao.find('img').attr({'src': opts.commentBrightImage}); + if (node_id) { + // if this was a "root" comment, remove the commenting box + // (the user can get it back by reopening the comment popup) + $('#ca' + node_id).slideUp(); + } + }, + error: function(request, textStatus, error) { + form.find('textarea,input').removeAttr('disabled'); + showError('Oops, there was a problem adding the comment.'); + } + }); + } + + /** + * Recursively append comments to the main comment list and children + * lists, creating the comment tree. + */ + function appendComments(comments, ul) { + $.each(comments, function() { + var div = createCommentDiv(this); + ul.append($(document.createElement('li')).html(div)); + appendComments(this.children, div.find('ul.comment-children')); + // To avoid stagnating data, don't store the comments children in data. + this.children = null; + div.data('comment', this); + }); + } + + /** + * After adding a new comment, it must be inserted in the correct + * location in the comment tree. + */ + function insertComment(comment) { + var div = createCommentDiv(comment); + + // To avoid stagnating data, don't store the comments children in data. + comment.children = null; + div.data('comment', comment); + + var ul = $('#cl' + (comment.node || comment.parent)); + var siblings = getChildren(ul); + + var li = $(document.createElement('li')); + li.hide(); + + // Determine where in the parents children list to insert this comment. + for(i=0; i < siblings.length; i++) { + if (comp(comment, siblings[i]) <= 0) { + $('#cd' + siblings[i].id) + .parent() + .before(li.html(div)); + li.slideDown('fast'); + return; + } + } + + // If we get here, this comment rates lower than all the others, + // or it is the only comment in the list. + ul.append(li.html(div)); + li.slideDown('fast'); + } + + function acceptComment(id) { + $.ajax({ + type: 'POST', + url: opts.acceptCommentURL, + data: {id: id}, + success: function(data, textStatus, request) { + $('#cm' + id).fadeOut('fast'); + $('#cd' + id).removeClass('moderate'); + }, + error: function(request, textStatus, error) { + showError('Oops, there was a problem accepting the comment.'); + } + }); + } + + function deleteComment(id) { + $.ajax({ + type: 'POST', + url: opts.deleteCommentURL, + data: {id: id}, + success: function(data, textStatus, request) { + var div = $('#cd' + id); + if (data == 'delete') { + // Moderator mode: remove the comment and all children immediately + div.slideUp('fast', function() { + div.remove(); + }); + return; + } + // User mode: only mark the comment as deleted + div + .find('span.user-id:first') + .text('[deleted]').end() + .find('div.comment-text:first') + .text('[deleted]').end() + .find('#cm' + id + ', #dc' + id + ', #ac' + id + ', #rc' + id + + ', #sp' + id + ', #hp' + id + ', #cr' + id + ', #rl' + id) + .remove(); + var comment = div.data('comment'); + comment.username = '[deleted]'; + comment.text = '[deleted]'; + div.data('comment', comment); + }, + error: function(request, textStatus, error) { + showError('Oops, there was a problem deleting the comment.'); + } + }); + } + + function showProposal(id) { + $('#sp' + id).hide(); + $('#hp' + id).show(); + $('#pr' + id).slideDown('fast'); + } + + function hideProposal(id) { + $('#hp' + id).hide(); + $('#sp' + id).show(); + $('#pr' + id).slideUp('fast'); + } + + function showProposeChange(id) { + $('#pc' + id).hide(); + $('#hc' + id).show(); + var textarea = $('#pt' + id); + textarea.val(textarea.data('source')); + $.fn.autogrow.resize(textarea[0]); + textarea.slideDown('fast'); + } + + function hideProposeChange(id) { + $('#hc' + id).hide(); + $('#pc' + id).show(); + var textarea = $('#pt' + id); + textarea.val('').removeAttr('disabled'); + textarea.slideUp('fast'); + } + + function toggleCommentMarkupBox(id) { + $('#mb' + id).toggle(); + } + + /** Handle when the user clicks on a sort by link. */ + function handleReSort(link) { + var classes = link.attr('class').split(/\s+/); + for (var i=0; i<classes.length; i++) { + if (classes[i] != 'sort-option') { + by = classes[i].substring(2); + } + } + setComparator(); + // Save/update the sortBy cookie. + var expiration = new Date(); + expiration.setDate(expiration.getDate() + 365); + document.cookie= 'sortBy=' + escape(by) + + ';expires=' + expiration.toUTCString(); + $('ul.comment-ul').each(function(index, ul) { + var comments = getChildren($(ul), true); + comments = sortComments(comments); + appendComments(comments, $(ul).empty()); + }); + } + + /** + * Function to process a vote when a user clicks an arrow. + */ + function handleVote(link) { + if (!opts.voting) { + showError("You'll need to login to vote."); + return; + } + + var id = link.attr('id'); + if (!id) { + // Didn't click on one of the voting arrows. + return; + } + // If it is an unvote, the new vote value is 0, + // Otherwise it's 1 for an upvote, or -1 for a downvote. + var value = 0; + if (id.charAt(1) != 'u') { + value = id.charAt(0) == 'u' ? 1 : -1; + } + // The data to be sent to the server. + var d = { + comment_id: id.substring(2), + value: value + }; + + // Swap the vote and unvote links. + link.hide(); + $('#' + id.charAt(0) + (id.charAt(1) == 'u' ? 'v' : 'u') + d.comment_id) + .show(); + + // The div the comment is displayed in. + var div = $('div#cd' + d.comment_id); + var data = div.data('comment'); + + // If this is not an unvote, and the other vote arrow has + // already been pressed, unpress it. + if ((d.value !== 0) && (data.vote === d.value * -1)) { + $('#' + (d.value == 1 ? 'd' : 'u') + 'u' + d.comment_id).hide(); + $('#' + (d.value == 1 ? 'd' : 'u') + 'v' + d.comment_id).show(); + } + + // Update the comments rating in the local data. + data.rating += (data.vote === 0) ? d.value : (d.value - data.vote); + data.vote = d.value; + div.data('comment', data); + + // Change the rating text. + div.find('.rating:first') + .text(data.rating + ' point' + (data.rating == 1 ? '' : 's')); + + // Send the vote information to the server. + $.ajax({ + type: "POST", + url: opts.processVoteURL, + data: d, + error: function(request, textStatus, error) { + showError('Oops, there was a problem casting that vote.'); + } + }); + } + + /** + * Open a reply form used to reply to an existing comment. + */ + function openReply(id) { + // Swap out the reply link for the hide link + $('#rl' + id).hide(); + $('#cr' + id).show(); + + // Add the reply li to the children ul. + var div = $(renderTemplate(replyTemplate, {id: id})).hide(); + $('#cl' + id) + .prepend(div) + // Setup the submit handler for the reply form. + .find('#rf' + id) + .submit(function(event) { + event.preventDefault(); + addComment($('#rf' + id)); + closeReply(id); + }) + .find('input[type=button]') + .click(function() { + closeReply(id); + }); + div.slideDown('fast', function() { + $('#rf' + id).find('textarea').focus(); + }); + } + + /** + * Close the reply form opened with openReply. + */ + function closeReply(id) { + // Remove the reply div from the DOM. + $('#rd' + id).slideUp('fast', function() { + $(this).remove(); + }); + + // Swap out the hide link for the reply link + $('#cr' + id).hide(); + $('#rl' + id).show(); + } + + /** + * Recursively sort a tree of comments using the comp comparator. + */ + function sortComments(comments) { + comments.sort(comp); + $.each(comments, function() { + this.children = sortComments(this.children); + }); + return comments; + } + + /** + * Get the children comments from a ul. If recursive is true, + * recursively include childrens' children. + */ + function getChildren(ul, recursive) { + var children = []; + ul.children().children("[id^='cd']") + .each(function() { + var comment = $(this).data('comment'); + if (recursive) + comment.children = getChildren($(this).find('#cl' + comment.id), true); + children.push(comment); + }); + return children; + } + + /** Create a div to display a comment in. */ + function createCommentDiv(comment) { + if (!comment.displayed && !opts.moderator) { + return $('<div class="moderate">Thank you! Your comment will show up ' + + 'once it is has been approved by a moderator.</div>'); + } + // Prettify the comment rating. + comment.pretty_rating = comment.rating + ' point' + + (comment.rating == 1 ? '' : 's'); + // Make a class (for displaying not yet moderated comments differently) + comment.css_class = comment.displayed ? '' : ' moderate'; + // Create a div for this comment. + var context = $.extend({}, opts, comment); + var div = $(renderTemplate(commentTemplate, context)); + + // If the user has voted on this comment, highlight the correct arrow. + if (comment.vote) { + var direction = (comment.vote == 1) ? 'u' : 'd'; + div.find('#' + direction + 'v' + comment.id).hide(); + div.find('#' + direction + 'u' + comment.id).show(); + } + + if (opts.moderator || comment.text != '[deleted]') { + div.find('a.reply').show(); + if (comment.proposal_diff) + div.find('#sp' + comment.id).show(); + if (opts.moderator && !comment.displayed) + div.find('#cm' + comment.id).show(); + if (opts.moderator || (opts.username == comment.username)) + div.find('#dc' + comment.id).show(); + } + return div; + } + + /** + * A simple template renderer. Placeholders such as <%id%> are replaced + * by context['id'] with items being escaped. Placeholders such as <#id#> + * are not escaped. + */ + function renderTemplate(template, context) { + var esc = $(document.createElement('div')); + + function handle(ph, escape) { + var cur = context; + $.each(ph.split('.'), function() { + cur = cur[this]; + }); + return escape ? esc.text(cur || "").html() : cur; + } + + return template.replace(/<([%#])([\w\.]*)\1>/g, function() { + return handle(arguments[2], arguments[1] == '%' ? true : false); + }); + } + + /** Flash an error message briefly. */ + function showError(message) { + $(document.createElement('div')).attr({'class': 'popup-error'}) + .append($(document.createElement('div')) + .attr({'class': 'error-message'}).text(message)) + .appendTo('body') + .fadeIn("slow") + .delay(2000) + .fadeOut("slow"); + } + + /** Add a link the user uses to open the comments popup. */ + $.fn.comment = function() { + return this.each(function() { + var id = $(this).attr('id').substring(1); + var count = COMMENT_METADATA[id]; + var title = count + ' comment' + (count == 1 ? '' : 's'); + var image = count > 0 ? opts.commentBrightImage : opts.commentImage; + var addcls = count == 0 ? ' nocomment' : ''; + $(this) + .append( + $(document.createElement('a')).attr({ + href: '#', + 'class': 'sphinx-comment-open' + addcls, + id: 'ao' + id + }) + .append($(document.createElement('img')).attr({ + src: image, + alt: 'comment', + title: title + })) + .click(function(event) { + event.preventDefault(); + show($(this).attr('id').substring(2)); + }) + ) + .append( + $(document.createElement('a')).attr({ + href: '#', + 'class': 'sphinx-comment-close hidden', + id: 'ah' + id + }) + .append($(document.createElement('img')).attr({ + src: opts.closeCommentImage, + alt: 'close', + title: 'close' + })) + .click(function(event) { + event.preventDefault(); + hide($(this).attr('id').substring(2)); + }) + ); + }); + }; + + var opts = { + processVoteURL: '/_process_vote', + addCommentURL: '/_add_comment', + getCommentsURL: '/_get_comments', + acceptCommentURL: '/_accept_comment', + deleteCommentURL: '/_delete_comment', + commentImage: '/static/_static/comment.png', + closeCommentImage: '/static/_static/comment-close.png', + loadingImage: '/static/_static/ajax-loader.gif', + commentBrightImage: '/static/_static/comment-bright.png', + upArrow: '/static/_static/up.png', + downArrow: '/static/_static/down.png', + upArrowPressed: '/static/_static/up-pressed.png', + downArrowPressed: '/static/_static/down-pressed.png', + voting: false, + moderator: false + }; + + if (typeof COMMENT_OPTIONS != "undefined") { + opts = jQuery.extend(opts, COMMENT_OPTIONS); + } + + var popupTemplate = '\ + <div class="sphinx-comments" id="sc<%id%>">\ + <p class="sort-options">\ + Sort by:\ + <a href="#" class="sort-option byrating">best rated</a>\ + <a href="#" class="sort-option byascage">newest</a>\ + <a href="#" class="sort-option byage">oldest</a>\ + </p>\ + <div class="comment-header">Comments</div>\ + <div class="comment-loading" id="cn<%id%>">\ + loading comments... <img src="<%loadingImage%>" alt="" /></div>\ + <ul id="cl<%id%>" class="comment-ul"></ul>\ + <div id="ca<%id%>">\ + <p class="add-a-comment">Add a comment\ + (<a href="#" class="comment-markup" id="ab<%id%>">markup</a>):</p>\ + <div class="comment-markup-box" id="mb<%id%>">\ + reStructured text markup: <i>*emph*</i>, <b>**strong**</b>, \ + <tt>``code``</tt>, \ + code blocks: <tt>::</tt> and an indented block after blank line</div>\ + <form method="post" id="cf<%id%>" class="comment-form" action="">\ + <textarea name="comment" cols="80"></textarea>\ + <p class="propose-button">\ + <a href="#" id="pc<%id%>" class="show-propose-change">\ + Propose a change ▹\ + </a>\ + <a href="#" id="hc<%id%>" class="hide-propose-change">\ + Propose a change ▿\ + </a>\ + </p>\ + <textarea name="proposal" id="pt<%id%>" cols="80"\ + spellcheck="false"></textarea>\ + <input type="submit" value="Add comment" />\ + <input type="hidden" name="node" value="<%id%>" />\ + <input type="hidden" name="parent" value="" />\ + </form>\ + </div>\ + </div>'; + + var commentTemplate = '\ + <div id="cd<%id%>" class="sphinx-comment<%css_class%>">\ + <div class="vote">\ + <div class="arrow">\ + <a href="#" id="uv<%id%>" class="vote" title="vote up">\ + <img src="<%upArrow%>" />\ + </a>\ + <a href="#" id="uu<%id%>" class="un vote" title="vote up">\ + <img src="<%upArrowPressed%>" />\ + </a>\ + </div>\ + <div class="arrow">\ + <a href="#" id="dv<%id%>" class="vote" title="vote down">\ + <img src="<%downArrow%>" id="da<%id%>" />\ + </a>\ + <a href="#" id="du<%id%>" class="un vote" title="vote down">\ + <img src="<%downArrowPressed%>" />\ + </a>\ + </div>\ + </div>\ + <div class="comment-content">\ + <p class="tagline comment">\ + <span class="user-id"><%username%></span>\ + <span class="rating"><%pretty_rating%></span>\ + <span class="delta"><%time.delta%></span>\ + </p>\ + <div class="comment-text comment"><#text#></div>\ + <p class="comment-opts comment">\ + <a href="#" class="reply hidden" id="rl<%id%>">reply ▹</a>\ + <a href="#" class="close-reply" id="cr<%id%>">reply ▿</a>\ + <a href="#" id="sp<%id%>" class="show-proposal">proposal ▹</a>\ + <a href="#" id="hp<%id%>" class="hide-proposal">proposal ▿</a>\ + <a href="#" id="dc<%id%>" class="delete-comment hidden">delete</a>\ + <span id="cm<%id%>" class="moderation hidden">\ + <a href="#" id="ac<%id%>" class="accept-comment">accept</a>\ + </span>\ + </p>\ + <pre class="proposal" id="pr<%id%>">\ +<#proposal_diff#>\ + </pre>\ + <ul class="comment-children" id="cl<%id%>"></ul>\ + </div>\ + <div class="clearleft"></div>\ + </div>\ + </div>'; + + var replyTemplate = '\ + <li>\ + <div class="reply-div" id="rd<%id%>">\ + <form id="rf<%id%>">\ + <textarea name="comment" cols="80"></textarea>\ + <input type="submit" value="Add reply" />\ + <input type="button" value="Cancel" />\ + <input type="hidden" name="parent" value="<%id%>" />\ + <input type="hidden" name="node" value="" />\ + </form>\ + </div>\ + </li>'; + + $(document).ready(function() { + init(); + }); +})(jQuery); + +$(document).ready(function() { + // add comment anchors for all paragraphs that are commentable + $('.sphinx-has-comment').comment(); + + // highlight search words in search results + $("div.context").each(function() { + var params = $.getQueryParameters(); + var terms = (params.q) ? params.q[0].split(/\s+/) : []; + var result = $(this); + $.each(terms, function() { + result.highlightText(this.toLowerCase(), 'highlighted'); + }); + }); + + // directly open comment window if requested + var anchor = document.location.hash; + if (anchor.substring(0, 9) == '#comment-') { + $('#ao' + anchor.substring(9)).click(); + document.location.hash = '#s' + anchor.substring(9); + } +}); diff --git a/distro/common/html/chef-client.8.html b/distro/common/html/chef-client.8.html deleted file mode 100644 index abb9b8313c..0000000000 --- a/distro/common/html/chef-client.8.html +++ /dev/null @@ -1,145 +0,0 @@ -<!DOCTYPE html> -<html> -<head> - <meta http-equiv='content-type' value='text/html;charset=utf8'> - <meta name='generator' value='Ronn/v0.7.3 (http://github.com/rtomayko/ronn/tree/0.7.3)'> - <title>chef-client(8) - Runs a client node connecting to a chef-server.</title> - <style type='text/css' media='all'> - /* style: man */ - body#manpage {margin:0} - .mp {max-width:100ex;padding:0 9ex 1ex 4ex} - .mp p,.mp pre,.mp ul,.mp ol,.mp dl {margin:0 0 20px 0} - .mp h2 {margin:10px 0 0 0} - .mp > p,.mp > pre,.mp > ul,.mp > ol,.mp > dl {margin-left:8ex} - .mp h3 {margin:0 0 0 4ex} - .mp dt {margin:0;clear:left} - .mp dt.flush {float:left;width:8ex} - .mp dd {margin:0 0 0 9ex} - .mp h1,.mp h2,.mp h3,.mp h4 {clear:left} - .mp pre {margin-bottom:20px} - .mp pre+h2,.mp pre+h3 {margin-top:22px} - .mp h2+pre,.mp h3+pre {margin-top:5px} - .mp img {display:block;margin:auto} - .mp h1.man-title {display:none} - .mp,.mp code,.mp pre,.mp tt,.mp kbd,.mp samp,.mp h3,.mp h4 {font-family:monospace;font-size:14px;line-height:1.42857142857143} - .mp h2 {font-size:16px;line-height:1.25} - .mp h1 {font-size:20px;line-height:2} - .mp {text-align:justify;background:#fff} - .mp,.mp code,.mp pre,.mp pre code,.mp tt,.mp kbd,.mp samp {color:#131211} - .mp h1,.mp h2,.mp h3,.mp h4 {color:#030201} - .mp u {text-decoration:underline} - .mp code,.mp strong,.mp b {font-weight:bold;color:#131211} - .mp em,.mp var {font-style:italic;color:#232221;text-decoration:none} - .mp a,.mp a:link,.mp a:hover,.mp a code,.mp a pre,.mp a tt,.mp a kbd,.mp a samp {color:#0000ff} - .mp b.man-ref {font-weight:normal;color:#434241} - .mp pre {padding:0 4ex} - .mp pre code {font-weight:normal;color:#434241} - .mp h2+pre,h3+pre {padding-left:0} - ol.man-decor,ol.man-decor li {margin:3px 0 10px 0;padding:0;float:left;width:33%;list-style-type:none;text-transform:uppercase;color:#999;letter-spacing:1px} - ol.man-decor {width:100%} - ol.man-decor li.tl {text-align:left} - ol.man-decor li.tc {text-align:center;letter-spacing:4px} - ol.man-decor li.tr {text-align:right;float:right} - </style> - <style type='text/css' media='all'> - /* style: toc */ - .man-navigation {display:block !important;position:fixed;top:0;left:113ex;height:100%;width:100%;padding:48px 0 0 0;border-left:1px solid #dbdbdb;background:#eee} - .man-navigation a,.man-navigation a:hover,.man-navigation a:link,.man-navigation a:visited {display:block;margin:0;padding:5px 2px 5px 30px;color:#999;text-decoration:none} - .man-navigation a:hover {color:#111;text-decoration:underline} - </style> -</head> -<!-- - The following styles are deprecated and will be removed at some point: - div#man, div#man ol.man, div#man ol.head, div#man ol.man. - - The .man-page, .man-decor, .man-head, .man-foot, .man-title, and - .man-navigation should be used instead. ---> -<body id='manpage'> - <div class='mp' id='man'> - - <div class='man-navigation' style='display:none'> - <a href="#NAME">NAME</a> - <a href="#SYNOPSIS">SYNOPSIS</a> - <a href="#DESCRIPTION">DESCRIPTION</a> - <a href="#SEE-ALSO">SEE ALSO</a> - <a href="#AUTHOR">AUTHOR</a> - </div> - - <ol class='man-decor man-head man head'> - <li class='tl'>chef-client(8)</li> - <li class='tc'>Chef Manual</li> - <li class='tr'>chef-client(8)</li> - </ol> - - <h2 id="NAME">NAME</h2> -<p class="man-name"> - <code>chef-client</code> - <span class="man-whatis">Runs a client node connecting to a chef-server.</span> -</p> - -<h2 id="SYNOPSIS">SYNOPSIS</h2> - -<p><strong>chef-client</strong> <em>(options)</em></p> - -<dl> -<dt><code>-S</code>, <code>--server CHEFSERVERURL</code></dt><dd>The chef server URL</dd> -<dt><code>-c</code>, <code>--config CONFIG</code></dt><dd>The configuration file to use</dd> -<dt><code>-d</code>, <code>--daemonize</code></dt><dd>Daemonize the process</dd> -<dt><code>-g</code>, <code>--group GROUP</code></dt><dd>Group to set privilege to</dd> -<dt><code>-i</code>, <code>--interval SECONDS</code></dt><dd>Run chef-client periodically, in seconds</dd> -<dt><code>-j</code>, <code>--json-attributes JSON_ATTRIBS</code></dt><dd>Load attributes from a JSON file or URL</dd> -<dt><code>-E</code>, <code>--environment ENVIRONMENT</code></dt><dd>Set the Chef Environment on the node</dd> -<dt><code>-l</code>, <code>--log_level LEVEL</code></dt><dd>Set the log level (debug, info, warn, error, fatal)</dd> -<dt><code>-L</code>, <code>--logfile LOGLOCATION</code></dt><dd>Set the log file location, defaults to STDOUT - recommended for -daemonizing</dd> -<dt><code>-N</code>, <code>--node-name NODE_NAME</code></dt><dd>The node name for this client</dd> -<dt><code>-o</code>, <code>--override-runlist</code></dt><dd>Replace current run list with specified items</dd> -<dt><code>-K</code>, <code>--validation_key KEY_FILE</code></dt><dd>Set the validation key file location, used for registering new clients</dd> -<dt><code>-k</code>, <code>--client_key KEY_FILE</code></dt><dd>Set the client key file location</dd> -<dt><code>-s</code>, <code>--splay SECONDS</code></dt><dd>The splay time for running at intervals, in seconds</dd> -<dt><code>-u</code>, <code>--user USER</code></dt><dd>User to set privilege to</dd> -<dt><code>-P</code>, <code>--pid PIDFILE</code></dt><dd>Set the PID file location, defaults to /tmp/chef-client.pid</dd> -<dt class="flush"><code>--once</code></dt><dd>Cancel any interval or splay options, run chef once and exit</dd> -<dt><code>-v</code>, <code>--version</code></dt><dd>Show chef version</dd> -<dt><code>-h</code>, <code>--help</code></dt><dd>Show this message</dd> -</dl> - - -<h2 id="DESCRIPTION">DESCRIPTION</h2> - -<p>The Chef Client is where almost all of the work in Chef is done. It -communicates with the Chef Server via REST, authenticates via Signed -Header Authentication, and compiles and executes Cookbooks.</p> - -<p>A Chef Client does work on behalf of a Node. A single Chef Client can -run recipes for multiple Nodes.</p> - -<p>Clients are where all the action happens - the Chef Server and Chef Expander -are largely services that exist only to provide the Client with information.</p> - -<h2 id="SEE-ALSO">SEE ALSO</h2> - -<p>Full documentation for Chef and chef-client is located on the Chef -wiki, http://wiki.opscode.com/display/chef/Home.</p> - -<h2 id="AUTHOR">AUTHOR</h2> - -<p>Chef was written by Adam Jacob <a href="mailto:adam@ospcode.com" data-bare-link="true">adam@ospcode.com</a> of Opscode -(http://www.opscode.com), with contributions from the community. This -manual page was written by Joshua Timberman <a href="mailto:joshua@opscode.com" data-bare-link="true">joshua@opscode.com</a> with -help2man. Permission is granted to copy, distribute and / or modify -this document under the terms of the Apache 2.0 License.</p> - -<p>On Debian systems, the complete text of the Apache 2.0 License can be -found in /usr/share/common-licenses/Apache-2.0.</p> - - - <ol class='man-decor man-foot man foot'> - <li class='tl'>Chef 11.8.0</li> - <li class='tc'>October 2013</li> - <li class='tr'>chef-client(8)</li> - </ol> - - </div> -</body> -</html> diff --git a/distro/common/html/chef-expander.8.html b/distro/common/html/chef-expander.8.html deleted file mode 100644 index ac7c0dac2c..0000000000 --- a/distro/common/html/chef-expander.8.html +++ /dev/null @@ -1,164 +0,0 @@ -<!DOCTYPE html> -<html> -<head> - <meta http-equiv='content-type' value='text/html;charset=utf8'> - <meta name='generator' value='Ronn/v0.7.3 (http://github.com/rtomayko/ronn/tree/0.7.3)'> - <title>chef-expander(8) - fetches messages from RabbitMQ, processes, and loads into chef-solr</title> - <style type='text/css' media='all'> - /* style: man */ - body#manpage {margin:0} - .mp {max-width:100ex;padding:0 9ex 1ex 4ex} - .mp p,.mp pre,.mp ul,.mp ol,.mp dl {margin:0 0 20px 0} - .mp h2 {margin:10px 0 0 0} - .mp > p,.mp > pre,.mp > ul,.mp > ol,.mp > dl {margin-left:8ex} - .mp h3 {margin:0 0 0 4ex} - .mp dt {margin:0;clear:left} - .mp dt.flush {float:left;width:8ex} - .mp dd {margin:0 0 0 9ex} - .mp h1,.mp h2,.mp h3,.mp h4 {clear:left} - .mp pre {margin-bottom:20px} - .mp pre+h2,.mp pre+h3 {margin-top:22px} - .mp h2+pre,.mp h3+pre {margin-top:5px} - .mp img {display:block;margin:auto} - .mp h1.man-title {display:none} - .mp,.mp code,.mp pre,.mp tt,.mp kbd,.mp samp,.mp h3,.mp h4 {font-family:monospace;font-size:14px;line-height:1.42857142857143} - .mp h2 {font-size:16px;line-height:1.25} - .mp h1 {font-size:20px;line-height:2} - .mp {text-align:justify;background:#fff} - .mp,.mp code,.mp pre,.mp pre code,.mp tt,.mp kbd,.mp samp {color:#131211} - .mp h1,.mp h2,.mp h3,.mp h4 {color:#030201} - .mp u {text-decoration:underline} - .mp code,.mp strong,.mp b {font-weight:bold;color:#131211} - .mp em,.mp var {font-style:italic;color:#232221;text-decoration:none} - .mp a,.mp a:link,.mp a:hover,.mp a code,.mp a pre,.mp a tt,.mp a kbd,.mp a samp {color:#0000ff} - .mp b.man-ref {font-weight:normal;color:#434241} - .mp pre {padding:0 4ex} - .mp pre code {font-weight:normal;color:#434241} - .mp h2+pre,h3+pre {padding-left:0} - ol.man-decor,ol.man-decor li {margin:3px 0 10px 0;padding:0;float:left;width:33%;list-style-type:none;text-transform:uppercase;color:#999;letter-spacing:1px} - ol.man-decor {width:100%} - ol.man-decor li.tl {text-align:left} - ol.man-decor li.tc {text-align:center;letter-spacing:4px} - ol.man-decor li.tr {text-align:right;float:right} - </style> - <style type='text/css' media='all'> - /* style: toc */ - .man-navigation {display:block !important;position:fixed;top:0;left:113ex;height:100%;width:100%;padding:48px 0 0 0;border-left:1px solid #dbdbdb;background:#eee} - .man-navigation a,.man-navigation a:hover,.man-navigation a:link,.man-navigation a:visited {display:block;margin:0;padding:5px 2px 5px 30px;color:#999;text-decoration:none} - .man-navigation a:hover {color:#111;text-decoration:underline} - </style> -</head> -<!-- - The following styles are deprecated and will be removed at some point: - div#man, div#man ol.man, div#man ol.head, div#man ol.man. - - The .man-page, .man-decor, .man-head, .man-foot, .man-title, and - .man-navigation should be used instead. ---> -<body id='manpage'> - <div class='mp' id='man'> - - <div class='man-navigation' style='display:none'> - <a href="#NAME">NAME</a> - <a href="#SYNOPSIS">SYNOPSIS</a> - <a href="#DESCRIPTION">DESCRIPTION</a> - <a href="#SEE-ALSO">SEE ALSO</a> - <a href="#AUTHOR">AUTHOR</a> - </div> - - <ol class='man-decor man-head man head'> - <li class='tl'>chef-expander(8)</li> - <li class='tc'>Chef Manual</li> - <li class='tr'>chef-expander(8)</li> - </ol> - - <h2 id="NAME">NAME</h2> -<p class="man-name"> - <code>chef-expander</code> - <span class="man-whatis">fetches messages from RabbitMQ, processes, and loads into chef-solr</span> -</p> - -<h2 id="SYNOPSIS">SYNOPSIS</h2> - -<p><strong>chef-expander</strong> <em>(options)</em></p> - -<dl> -<dt><code>-c</code>, <code>--config CONFIG_FILE</code></dt><dd>a configuration file to use</dd> -<dt><code>-i</code>, <code>--index INDEX</code></dt><dd>the slot this node will occupy in the ring</dd> -<dt><code>-n</code>, <code>--node-count NUMBER</code></dt><dd>the number of nodes in the ring</dd> -<dt><code>-l</code>, <code>--log-level LOG_LEVEL</code></dt><dd>set the log level</dd> -<dt><code>-L</code>, <code>--logfile LOG_LOCATION</code></dt><dd>Logfile to use</dd> -<dt><code>-d</code>, <code>--daemonize</code></dt><dd>fork into the background</dd> -<dt><code>-P</code>, <code>--pid PIDFILE</code></dt><dd>PID file</dd> -<dt><code>-h</code>, <code>--help</code></dt><dd>show help message</dd> -<dt><code>-v</code>, <code>--version</code></dt><dd>show the version and exit</dd> -</dl> - - -<h2 id="DESCRIPTION">DESCRIPTION</h2> - -<p>Chef Expander fetches messages from RabbitMQ, processes them into the -correct format to be loaded into Solr and loads them into Solr.</p> - -<p><strong>Running Chef Expander</strong></p> - -<p>Chef Expander is designed for clustered operation, though small -installations will only need one worker process. To run Chef -Expander with one worker process, run chef-expander -n 1. -You will then have a master and worker process, which looks like -this in ps:</p> - -<pre><code>your-shell> ps aux|grep expander -you 52110 0.1 0.7 2515476 62748 s003 S+ 3:49PM 0:00.80 chef-expander worker #1 (vnodes 0-1023) -you 52108 0.1 0.5 2492880 41696 s003 S+ 3:49PM 0:00.91 ruby bin/chef-expander -n 1 -</code></pre> - -<p>Workers are single threaded and therefore cannot use more than 100% -of a single CPU. If you find that your queues are getting backlogged, -increase the number of workers</p> - -<p><strong>Design</strong></p> - -<p>Chef Expander uses 1024 queues (called vnodes in some places) to allow -you to scale the number of Chef Expander workers to meet the needs of -your infrastructure. When objects are saved in the API server, they are -added to queues based on their database IDs. These queues can be assigned -to different Chef Expander workers to distribute the load of processing -the index updates.</p> - -<p><strong>Chef Expander Operation and Troubleshooting</strong></p> - -<p>Chef Expander includes chef-expanderctl, a management program that allows -you to get status information or change the logging verbosity (without -restarting).</p> - -<p>See <strong>chef-expanderctl</strong>(8) for details.</p> - -<h2 id="SEE-ALSO">SEE ALSO</h2> - -<p><strong>chef-expanderctl</strong>(8) -<strong>chef-solr</strong>(8)</p> - -<p>Full documentation for Chef and chef-server is located on the Chef -wiki, http://wiki.opscode.com/display/chef/Home.</p> - -<h2 id="AUTHOR">AUTHOR</h2> - -<p>Chef was written by Adam Jacob <a href="mailto:adam@ospcode.com" data-bare-link="true">adam@ospcode.com</a> of Opscode -(http://www.opscode.com), with contributions from the community. This -manual page was created by Nuo Yan <a href="mailto:nuo@opscode.com" data-bare-link="true">nuo@opscode.com</a>. Permission is -granted to copy, distribute and / or modify this document under the -terms of the Apache 2.0 License.</p> - -<p>On Debian systems, the complete text of the Apache 2.0 License can be -found in /usr/share/common-licenses/Apache-2.0.</p> - - - <ol class='man-decor man-foot man foot'> - <li class='tl'>Chef 11.8.0</li> - <li class='tc'>October 2013</li> - <li class='tr'>chef-expander(8)</li> - </ol> - - </div> -</body> -</html> diff --git a/distro/common/html/chef-expanderctl.8.html b/distro/common/html/chef-expanderctl.8.html deleted file mode 100644 index 3fbcf1e898..0000000000 --- a/distro/common/html/chef-expanderctl.8.html +++ /dev/null @@ -1,146 +0,0 @@ -<!DOCTYPE html> -<html> -<head> - <meta http-equiv='content-type' value='text/html;charset=utf8'> - <meta name='generator' value='Ronn/v0.7.3 (http://github.com/rtomayko/ronn/tree/0.7.3)'> - <title>chef-expanderctl(8) - management program for chef-expander</title> - <style type='text/css' media='all'> - /* style: man */ - body#manpage {margin:0} - .mp {max-width:100ex;padding:0 9ex 1ex 4ex} - .mp p,.mp pre,.mp ul,.mp ol,.mp dl {margin:0 0 20px 0} - .mp h2 {margin:10px 0 0 0} - .mp > p,.mp > pre,.mp > ul,.mp > ol,.mp > dl {margin-left:8ex} - .mp h3 {margin:0 0 0 4ex} - .mp dt {margin:0;clear:left} - .mp dt.flush {float:left;width:8ex} - .mp dd {margin:0 0 0 9ex} - .mp h1,.mp h2,.mp h3,.mp h4 {clear:left} - .mp pre {margin-bottom:20px} - .mp pre+h2,.mp pre+h3 {margin-top:22px} - .mp h2+pre,.mp h3+pre {margin-top:5px} - .mp img {display:block;margin:auto} - .mp h1.man-title {display:none} - .mp,.mp code,.mp pre,.mp tt,.mp kbd,.mp samp,.mp h3,.mp h4 {font-family:monospace;font-size:14px;line-height:1.42857142857143} - .mp h2 {font-size:16px;line-height:1.25} - .mp h1 {font-size:20px;line-height:2} - .mp {text-align:justify;background:#fff} - .mp,.mp code,.mp pre,.mp pre code,.mp tt,.mp kbd,.mp samp {color:#131211} - .mp h1,.mp h2,.mp h3,.mp h4 {color:#030201} - .mp u {text-decoration:underline} - .mp code,.mp strong,.mp b {font-weight:bold;color:#131211} - .mp em,.mp var {font-style:italic;color:#232221;text-decoration:none} - .mp a,.mp a:link,.mp a:hover,.mp a code,.mp a pre,.mp a tt,.mp a kbd,.mp a samp {color:#0000ff} - .mp b.man-ref {font-weight:normal;color:#434241} - .mp pre {padding:0 4ex} - .mp pre code {font-weight:normal;color:#434241} - .mp h2+pre,h3+pre {padding-left:0} - ol.man-decor,ol.man-decor li {margin:3px 0 10px 0;padding:0;float:left;width:33%;list-style-type:none;text-transform:uppercase;color:#999;letter-spacing:1px} - ol.man-decor {width:100%} - ol.man-decor li.tl {text-align:left} - ol.man-decor li.tc {text-align:center;letter-spacing:4px} - ol.man-decor li.tr {text-align:right;float:right} - </style> - <style type='text/css' media='all'> - /* style: toc */ - .man-navigation {display:block !important;position:fixed;top:0;left:113ex;height:100%;width:100%;padding:48px 0 0 0;border-left:1px solid #dbdbdb;background:#eee} - .man-navigation a,.man-navigation a:hover,.man-navigation a:link,.man-navigation a:visited {display:block;margin:0;padding:5px 2px 5px 30px;color:#999;text-decoration:none} - .man-navigation a:hover {color:#111;text-decoration:underline} - </style> -</head> -<!-- - The following styles are deprecated and will be removed at some point: - div#man, div#man ol.man, div#man ol.head, div#man ol.man. - - The .man-page, .man-decor, .man-head, .man-foot, .man-title, and - .man-navigation should be used instead. ---> -<body id='manpage'> - <div class='mp' id='man'> - - <div class='man-navigation' style='display:none'> - <a href="#NAME">NAME</a> - <a href="#SYNOPSIS">SYNOPSIS</a> - <a href="#DESCRIPTION">DESCRIPTION</a> - <a href="#SEE-ALSO">SEE ALSO</a> - <a href="#AUTHOR">AUTHOR</a> - </div> - - <ol class='man-decor man-head man head'> - <li class='tl'>chef-expanderctl(8)</li> - <li class='tc'>Chef Manual</li> - <li class='tr'>chef-expanderctl(8)</li> - </ol> - - <h2 id="NAME">NAME</h2> -<p class="man-name"> - <code>chef-expanderctl</code> - <span class="man-whatis">management program for chef-expander</span> -</p> - -<h2 id="SYNOPSIS">SYNOPSIS</h2> - -<p><strong>chef-expanderctl</strong> <em>COMMAND</em></p> - -<p><strong>Commands:</strong></p> - -<dl> -<dt class="flush"><code>help</code></dt><dd>Show help message</dd> -<dt><code>queue-depth</code></dt><dd>display the aggregate queue backlog</dd> -<dt><code>queue-status</code></dt><dd>show the backlog and consumer count for each vnode queue</dd> -<dt><code>node-status</code></dt><dd>show the status of the nodes in the cluster</dd> -<dt><code>log-level</code></dt><dd>sets the log level of all nodes in the cluster</dd> -</dl> - - -<h2 id="DESCRIPTION">DESCRIPTION</h2> - -<p>Chef-expanderctl is a management program that allows -you to get status information or change the logging -verbosity (without restarting). chef-expanderctl has -the following commands:</p> - -<ul> -<li><strong>chef-expanderctl help</strong> -prints usage.</li> -<li><strong>chef-expanderctl queue-depth</strong> -Shows the total number of messages in the queues.</li> -<li><strong>chef-expanderctl queue-status</strong> -Show the number of messages in each queue. This is mainly of use when -debugging a Chef Expander cluster.</li> -<li><strong>chef-expanderctl log-level LEVEL</strong> -Sets the log level on a running Chef Expander or cluster. -If you suspect that a worker process is stuck, as long as you are using -clustered operation, you can simply kill the worker process and it will -be restarted by the master process.</li> -</ul> - - -<h2 id="SEE-ALSO">SEE ALSO</h2> - -<p><strong>chef-expander-cluster</strong>(8) -<strong>chef-solr</strong>(8)</p> - -<p>Full documentation for Chef and chef-server is located on the Chef -wiki, http://wiki.opscode.com/display/chef/Home.</p> - -<h2 id="AUTHOR">AUTHOR</h2> - -<p>Chef was written by Adam Jacob <a href="mailto:adam@ospcode.com" data-bare-link="true">adam@ospcode.com</a> of Opscode -(http://www.opscode.com), with contributions from the community. This -manual page was created by Nuo Yan <a href="mailto:nuo@opscode.com" data-bare-link="true">nuo@opscode.com</a>. Permission is -granted to copy, distribute and / or modify this document under the -terms of the Apache 2.0 License.</p> - -<p>On Debian systems, the complete text of the Apache 2.0 License can be -found in /usr/share/common-licenses/Apache-2.0.</p> - - - <ol class='man-decor man-foot man foot'> - <li class='tl'>Chef 11.8.0</li> - <li class='tc'>October 2013</li> - <li class='tr'>chef-expanderctl(8)</li> - </ol> - - </div> -</body> -</html> diff --git a/distro/common/html/chef-server-webui.8.html b/distro/common/html/chef-server-webui.8.html deleted file mode 100644 index 9b85f9869e..0000000000 --- a/distro/common/html/chef-server-webui.8.html +++ /dev/null @@ -1,185 +0,0 @@ -<!DOCTYPE html> -<html> -<head> - <meta http-equiv='content-type' value='text/html;charset=utf8'> - <meta name='generator' value='Ronn/v0.7.3 (http://github.com/rtomayko/ronn/tree/0.7.3)'> - <title>chef-server-webui(8) - Start the Chef Server merb application slice providing Web User Interface (Management Console).</title> - <style type='text/css' media='all'> - /* style: man */ - body#manpage {margin:0} - .mp {max-width:100ex;padding:0 9ex 1ex 4ex} - .mp p,.mp pre,.mp ul,.mp ol,.mp dl {margin:0 0 20px 0} - .mp h2 {margin:10px 0 0 0} - .mp > p,.mp > pre,.mp > ul,.mp > ol,.mp > dl {margin-left:8ex} - .mp h3 {margin:0 0 0 4ex} - .mp dt {margin:0;clear:left} - .mp dt.flush {float:left;width:8ex} - .mp dd {margin:0 0 0 9ex} - .mp h1,.mp h2,.mp h3,.mp h4 {clear:left} - .mp pre {margin-bottom:20px} - .mp pre+h2,.mp pre+h3 {margin-top:22px} - .mp h2+pre,.mp h3+pre {margin-top:5px} - .mp img {display:block;margin:auto} - .mp h1.man-title {display:none} - .mp,.mp code,.mp pre,.mp tt,.mp kbd,.mp samp,.mp h3,.mp h4 {font-family:monospace;font-size:14px;line-height:1.42857142857143} - .mp h2 {font-size:16px;line-height:1.25} - .mp h1 {font-size:20px;line-height:2} - .mp {text-align:justify;background:#fff} - .mp,.mp code,.mp pre,.mp pre code,.mp tt,.mp kbd,.mp samp {color:#131211} - .mp h1,.mp h2,.mp h3,.mp h4 {color:#030201} - .mp u {text-decoration:underline} - .mp code,.mp strong,.mp b {font-weight:bold;color:#131211} - .mp em,.mp var {font-style:italic;color:#232221;text-decoration:none} - .mp a,.mp a:link,.mp a:hover,.mp a code,.mp a pre,.mp a tt,.mp a kbd,.mp a samp {color:#0000ff} - .mp b.man-ref {font-weight:normal;color:#434241} - .mp pre {padding:0 4ex} - .mp pre code {font-weight:normal;color:#434241} - .mp h2+pre,h3+pre {padding-left:0} - ol.man-decor,ol.man-decor li {margin:3px 0 10px 0;padding:0;float:left;width:33%;list-style-type:none;text-transform:uppercase;color:#999;letter-spacing:1px} - ol.man-decor {width:100%} - ol.man-decor li.tl {text-align:left} - ol.man-decor li.tc {text-align:center;letter-spacing:4px} - ol.man-decor li.tr {text-align:right;float:right} - </style> - <style type='text/css' media='all'> - /* style: toc */ - .man-navigation {display:block !important;position:fixed;top:0;left:113ex;height:100%;width:100%;padding:48px 0 0 0;border-left:1px solid #dbdbdb;background:#eee} - .man-navigation a,.man-navigation a:hover,.man-navigation a:link,.man-navigation a:visited {display:block;margin:0;padding:5px 2px 5px 30px;color:#999;text-decoration:none} - .man-navigation a:hover {color:#111;text-decoration:underline} - </style> -</head> -<!-- - The following styles are deprecated and will be removed at some point: - div#man, div#man ol.man, div#man ol.head, div#man ol.man. - - The .man-page, .man-decor, .man-head, .man-foot, .man-title, and - .man-navigation should be used instead. ---> -<body id='manpage'> - <div class='mp' id='man'> - - <div class='man-navigation' style='display:none'> - <a href="#NAME">NAME</a> - <a href="#SYNOPSIS">SYNOPSIS</a> - <a href="#DESCRIPTION">DESCRIPTION</a> - <a href="#SEE-ALSO">SEE ALSO</a> - <a href="#AUTHOR">AUTHOR</a> - </div> - - <ol class='man-decor man-head man head'> - <li class='tl'>chef-server-webui(8)</li> - <li class='tc'>Chef Manual</li> - <li class='tr'>chef-server-webui(8)</li> - </ol> - - <h2 id="NAME">NAME</h2> -<p class="man-name"> - <code>chef-server-webui</code> - <span class="man-whatis">Start the Chef Server merb application slice providing Web User Interface (Management Console).</span> -</p> - -<h2 id="SYNOPSIS">SYNOPSIS</h2> - -<p><strong>chef-server-webui</strong> <em>(options)</em></p> - -<dl> -<dt><code>-u</code>, <code>--user USER</code></dt><dd>This flag is for having chef-server-webui run as a user other than the -one currently logged in. Note: if you set this you must also provide a ---group option for it to take effect.</dd> -<dt><code>-G</code>, <code>--group GROUP</code></dt><dd>This flag is for having chef-server-webui run as a group other than the -one currently logged in. Note: if you set this you must also provide a ---user option for it to take effect.</dd> -<dt><code>-d</code>, <code>--daemonize</code></dt><dd>This will run a single chef-server-webui in the background.</dd> -<dt><code>-N</code>, <code>--no-daemonize</code></dt><dd>This will allow you to run a cluster in console mode.</dd> -<dt><code>-c</code>, <code>--cluster-nodes NUM_MERBS</code></dt><dd>Number of merb daemons to run for chef-server-webui.</dd> -<dt><code>-I</code>, <code>--init-file FILE</code></dt><dd>File to use for initialization on load, defaults to config/init.rb.</dd> -<dt><code>-p</code>, <code>--port PORTNUM</code></dt><dd>Port to run chef-server-webui on, defaults to 4040. Additional nodes (-c) -listen on incrementing port numbers.</dd> -<dt><code>-o</code>, <code>--socket-file FILE</code></dt><dd>Socket file to run chef-server-webui on, defaults to -[Merb.root]/log/merb.sock. This is for web servers, like thin, that use -sockets. Specify this <em>only</em> if you <em>must</em>.</dd> -<dt><code>-s</code>, <code>--socket SOCKNUM</code></dt><dd>Socket number to run chef-server-webui on, defaults to 0.</dd> -<dt><code>-n</code>, <code>--name NAME</code></dt><dd>Set the name of the application. This is used in the process title and -log file names.</dd> -<dt><code>-P</code>, <code>--pid PIDFILE</code></dt><dd>PID file, defaults to [Merb.root]/log/merb.main.pid for the master -process and[Merb.root]/log/merb.[port number].pid for worker processes. -For clusters, use %s to specify where in the file chef-server-webui -should place the port number. For instance: -P myapp.%s.pid.</dd> -<dt><code>-h</code>, <code>--host HOSTNAME</code></dt><dd>Host to bind to (default is 0.0.0.0).</dd> -<dt><code>-m</code>, <code>--merb-root PATH_TO_APP_ROOT</code></dt><dd>The path to the Merb.root for the app you want to run -(default is current working directory).</dd> -<dt><code>-a</code>, <code>--adapter ADAPTER</code></dt><dd>The rack adapter to use to run chef-server-webui (default is mongrel) -[mongrel, emongrel, thin, ebb, fastcgi, webrick].</dd> -<dt><code>-R</code>, <code>--rackup FILE</code></dt><dd>Load an alternate Rack config file (default is config/rack.rb).</dd> -<dt><code>-i</code>, <code>--irb-console</code></dt><dd>This flag will start chef-server-webui in irb console mode. All your models -and other classes will be available for you in an irb session.</dd> -<dt><code>-S</code>, <code>--sandbox</code></dt><dd>This flag will enable a sandboxed irb console. If your ORM supports -transactions, all edits will be rolled back on exit.</dd> -<dt><code>-l</code>, <code>--log-level LEVEL</code></dt><dd>Log levels can be set to any of these options: -debug < info < warn < error < fatal (default is info).</dd> -<dt><code>-L</code>, <code>--log LOGFILE</code></dt><dd>A string representing the logfile to use. Defaults to -[Merb.root]/log/merb.[main].log for the master process and -[Merb.root]/log/merb[port number].logfor worker processes.</dd> -<dt><code>-e</code>, <code>--environment STRING</code></dt><dd>Environment to run Merb under [development, production, testing] -(default is development).</dd> -<dt><code>-r</code>, <code>--script-runner ['RUBY CODE'| FULL_SCRIPT_PATH]</code></dt><dd>Command-line option to run scripts and/or code in the chef-server-webui -app.</dd> -<dt><code>-K</code>, <code>-graceful PORT or all</code></dt><dd>Gracefully kill chef-server-webui proceses by port number. -Use chef-server -K all to gracefully kill all merbs.</dd> -<dt><code>-k</code>, <code>--kill PORT</code></dt><dd>Force kill one merb worker by port number. This will cause the worker -to be respawned.</dd> -<dt><code>--fast-deploy</code></dt><dd>Reload the code, but not yourinit.rb or gems.</dd> -<dt><code>-X</code>, <code>--mutex on/off</code></dt><dd>This flag is for turning the mutex lock on and off.</dd> -<dt><code>-D</code>, <code>--debugger</code></dt><dd>Run chef-server-webui using rDebug.</dd> -<dt><code>-V</code>, <code>--verbose</code></dt><dd>Print extra information.</dd> -<dt><code>-C</code>, <code>--console-trap</code></dt><dd>Enter an irb console on ^C.</dd> -<dt><code>-?</code>, <code>-H</code>, <code>--help</code></dt><dd>Show this help message.</dd> -</dl> - - -<h2 id="DESCRIPTION">DESCRIPTION</h2> - -<p>The Chef Server WebUI (Management Console) is a Merb application slice. -The default listen port is 4040.</p> - -<p>The Management Console is Chef Server's web interface. Nodes, roles, -cookbooks, data bags, and API clients can be managed through the Management -Console. Search can also be done on the console.</p> - -<p>In order to start using the Management Console, you need to first create -a user or change the default password on the "admin" user.</p> - -<p>The default credentials are:</p> - -<ul> -<li><code>Username</code>: admin</li> -<li><code>Password</code>: p@ssw0rd1</li> -</ul> - - -<h2 id="SEE-ALSO">SEE ALSO</h2> - -<p>Full documentation for Chef and chef-server-webui (Management Console) -is located on the Chef wiki, http://wiki.opscode.com/display/chef/Home.</p> - -<h2 id="AUTHOR">AUTHOR</h2> - -<p>Chef was written by Adam Jacob <a href="mailto:adam@ospcode.com" data-bare-link="true">adam@ospcode.com</a> of Opscode -(http://www.opscode.com), with contributions from the community. This -manual page was written by Joshua Timberman <a href="mailto:joshua@opscode.com" data-bare-link="true">joshua@opscode.com</a> with -help2man for the Debian project (but may be used by others). Permission -is granted to copy, distribute and / or modify this document under the -terms of the Apache 2.0 License.</p> - -<p>On Debian systems, the complete text of the Apache 2.0 License can be -found in /usr/share/common-licenses/Apache-2.0.</p> - - - <ol class='man-decor man-foot man foot'> - <li class='tl'>Chef 11.8.0</li> - <li class='tc'>October 2013</li> - <li class='tr'>chef-server-webui(8)</li> - </ol> - - </div> -</body> -</html> diff --git a/distro/common/html/chef-server.8.html b/distro/common/html/chef-server.8.html deleted file mode 100644 index 63c3eaf7db..0000000000 --- a/distro/common/html/chef-server.8.html +++ /dev/null @@ -1,182 +0,0 @@ -<!DOCTYPE html> -<html> -<head> - <meta http-equiv='content-type' value='text/html;charset=utf8'> - <meta name='generator' value='Ronn/v0.7.3 (http://github.com/rtomayko/ronn/tree/0.7.3)'> - <title>chef-server(8) - Start the Chef Server merb application slice.</title> - <style type='text/css' media='all'> - /* style: man */ - body#manpage {margin:0} - .mp {max-width:100ex;padding:0 9ex 1ex 4ex} - .mp p,.mp pre,.mp ul,.mp ol,.mp dl {margin:0 0 20px 0} - .mp h2 {margin:10px 0 0 0} - .mp > p,.mp > pre,.mp > ul,.mp > ol,.mp > dl {margin-left:8ex} - .mp h3 {margin:0 0 0 4ex} - .mp dt {margin:0;clear:left} - .mp dt.flush {float:left;width:8ex} - .mp dd {margin:0 0 0 9ex} - .mp h1,.mp h2,.mp h3,.mp h4 {clear:left} - .mp pre {margin-bottom:20px} - .mp pre+h2,.mp pre+h3 {margin-top:22px} - .mp h2+pre,.mp h3+pre {margin-top:5px} - .mp img {display:block;margin:auto} - .mp h1.man-title {display:none} - .mp,.mp code,.mp pre,.mp tt,.mp kbd,.mp samp,.mp h3,.mp h4 {font-family:monospace;font-size:14px;line-height:1.42857142857143} - .mp h2 {font-size:16px;line-height:1.25} - .mp h1 {font-size:20px;line-height:2} - .mp {text-align:justify;background:#fff} - .mp,.mp code,.mp pre,.mp pre code,.mp tt,.mp kbd,.mp samp {color:#131211} - .mp h1,.mp h2,.mp h3,.mp h4 {color:#030201} - .mp u {text-decoration:underline} - .mp code,.mp strong,.mp b {font-weight:bold;color:#131211} - .mp em,.mp var {font-style:italic;color:#232221;text-decoration:none} - .mp a,.mp a:link,.mp a:hover,.mp a code,.mp a pre,.mp a tt,.mp a kbd,.mp a samp {color:#0000ff} - .mp b.man-ref {font-weight:normal;color:#434241} - .mp pre {padding:0 4ex} - .mp pre code {font-weight:normal;color:#434241} - .mp h2+pre,h3+pre {padding-left:0} - ol.man-decor,ol.man-decor li {margin:3px 0 10px 0;padding:0;float:left;width:33%;list-style-type:none;text-transform:uppercase;color:#999;letter-spacing:1px} - ol.man-decor {width:100%} - ol.man-decor li.tl {text-align:left} - ol.man-decor li.tc {text-align:center;letter-spacing:4px} - ol.man-decor li.tr {text-align:right;float:right} - </style> - <style type='text/css' media='all'> - /* style: toc */ - .man-navigation {display:block !important;position:fixed;top:0;left:113ex;height:100%;width:100%;padding:48px 0 0 0;border-left:1px solid #dbdbdb;background:#eee} - .man-navigation a,.man-navigation a:hover,.man-navigation a:link,.man-navigation a:visited {display:block;margin:0;padding:5px 2px 5px 30px;color:#999;text-decoration:none} - .man-navigation a:hover {color:#111;text-decoration:underline} - </style> -</head> -<!-- - The following styles are deprecated and will be removed at some point: - div#man, div#man ol.man, div#man ol.head, div#man ol.man. - - The .man-page, .man-decor, .man-head, .man-foot, .man-title, and - .man-navigation should be used instead. ---> -<body id='manpage'> - <div class='mp' id='man'> - - <div class='man-navigation' style='display:none'> - <a href="#NAME">NAME</a> - <a href="#SYNOPSIS">SYNOPSIS</a> - <a href="#DESCRIPTION">DESCRIPTION</a> - <a href="#SEE-ALSO">SEE ALSO</a> - <a href="#AUTHOR">AUTHOR</a> - </div> - - <ol class='man-decor man-head man head'> - <li class='tl'>chef-server(8)</li> - <li class='tc'>Chef Manual</li> - <li class='tr'>chef-server(8)</li> - </ol> - - <h2 id="NAME">NAME</h2> -<p class="man-name"> - <code>chef-server</code> - <span class="man-whatis">Start the Chef Server merb application slice.</span> -</p> - -<h2 id="SYNOPSIS">SYNOPSIS</h2> - -<p><strong>chef-server</strong> <em>(options)</em></p> - -<dl> -<dt><code>-u</code>, <code>--user USER</code></dt><dd>This flag is for having chef-server-webui run as a user other than the -one currently logged in. Note: if you set this you must also provide a ---group option for it to take effect.</dd> -<dt><code>-G</code>, <code>--group GROUP</code></dt><dd>This flag is for having chef-server-webui run as a group other than the -one currently logged in. Note: if you set this you must also provide a ---user option for it to take effect.</dd> -<dt><code>-d</code>, <code>--daemonize</code></dt><dd>This will run a single chef-server-webui in the background.</dd> -<dt><code>-N</code>, <code>--no-daemonize</code></dt><dd>This will allow you to run a cluster in console mode.</dd> -<dt><code>-c</code>, <code>--cluster-nodes NUM_MERBS</code></dt><dd>Number of merb daemons to run for chef-server-webui.</dd> -<dt><code>-I</code>, <code>--init-file FILE</code></dt><dd>File to use for initialization on load, defaults to config/init.rb.</dd> -<dt><code>-p</code>, <code>--port PORTNUM</code></dt><dd>Port to run chef-server-webui on, defaults to 4040. Additional nodes (-c) -listen on incrementing port numbers.</dd> -<dt><code>-o</code>, <code>--socket-file FILE</code></dt><dd>Socket file to run chef-server-webui on, defaults to -[Merb.root]/log/merb.sock. This is for web servers, like thin, that use -sockets. Specify this <em>only</em> if you <em>must</em>.</dd> -<dt><code>-s</code>, <code>--socket SOCKNUM</code></dt><dd>Socket number to run chef-server-webui on, defaults to 0.</dd> -<dt><code>-n</code>, <code>--name NAME</code></dt><dd>Set the name of the application. This is used in the process title and -log file names.</dd> -<dt><code>-P</code>, <code>--pid PIDFILE</code></dt><dd>PID file, defaults to [Merb.root]/log/merb.main.pid for the master -process and[Merb.root]/log/merb.[port number].pid for worker processes. -For clusters, use %s to specify where in the file chef-server-webui -should place the port number. For instance: -P myapp.%s.pid.</dd> -<dt><code>-h</code>, <code>--host HOSTNAME</code></dt><dd>Host to bind to (default is 0.0.0.0).</dd> -<dt><code>-m</code>, <code>--merb-root PATH_TO_APP_ROOT</code></dt><dd>The path to the Merb.root for the app you want to run -(default is current working directory).</dd> -<dt><code>-a</code>, <code>--adapter ADAPTER</code></dt><dd>The rack adapter to use to run chef-server-webui (default is mongrel) -[mongrel, emongrel, thin, ebb, fastcgi, webrick].</dd> -<dt><code>-R</code>, <code>--rackup FILE</code></dt><dd>Load an alternate Rack config file (default is config/rack.rb).</dd> -<dt><code>-i</code>, <code>--irb-console</code></dt><dd>This flag will start chef-server-webui in irb console mode. All your models -and other classes will be available for you in an irb session.</dd> -<dt><code>-S</code>, <code>--sandbox</code></dt><dd>This flag will enable a sandboxed irb console. If your ORM supports -transactions, all edits will be rolled back on exit.</dd> -<dt><code>-l</code>, <code>--log-level LEVEL</code></dt><dd>Log levels can be set to any of these options: -debug < info < warn < error < fatal (default is info).</dd> -<dt><code>-L</code>, <code>--log LOGFILE</code></dt><dd>A string representing the logfile to use. Defaults to -[Merb.root]/log/merb.[main].log for the master process and -[Merb.root]/log/merb[port number].logfor worker processes.</dd> -<dt><code>-e</code>, <code>--environment STRING</code></dt><dd>Environment to run Merb under [development, production, testing] -(default is development).</dd> -<dt><code>-r</code>, <code>--script-runner ['RUBY CODE'| FULL_SCRIPT_PATH]</code></dt><dd>Command-line option to run scripts and/or code in the chef-server-webui -app.</dd> -<dt><code>-K</code>, <code>-graceful PORT or all</code></dt><dd>Gracefully kill chef-server-webui proceses by port number. -Use chef-server -K all to gracefully kill all merbs.</dd> -<dt><code>-k</code>, <code>--kill PORT</code></dt><dd>Force kill one merb worker by port number. This will cause the worker -to be respawned.</dd> -<dt><code>--fast-deploy</code></dt><dd>Reload the code, but not yourinit.rb or gems.</dd> -<dt><code>-X</code>, <code>--mutex on/off</code></dt><dd>This flag is for turning the mutex lock on and off.</dd> -<dt><code>-D</code>, <code>--debugger</code></dt><dd>Run chef-server-webui using rDebug.</dd> -<dt><code>-V</code>, <code>--verbose</code></dt><dd>Print extra information.</dd> -<dt><code>-C</code>, <code>--console-trap</code></dt><dd>Enter an irb console on ^C.</dd> -<dt><code>-?</code>, <code>-H</code>, <code>--help</code></dt><dd>Show this help message.</dd> -</dl> - - -<h2 id="DESCRIPTION">DESCRIPTION</h2> - -<p>The Chef Server provides a central point for the distribution of Cookbooks, -management and authentication of Nodes, and the use of Search. It provides -a REST API.</p> - -<p>The API service is what clients use to interact with the server to manage -node configuration in Chef. By default, the service is started on port 4000 -as a Merb application slice running with the thin server adapter.</p> - -<p>The two methods of interaction with the API for humans are the command-line -tool Knife and the Management Console. The Chef Client library is used for -interacting with the API for client nodes.</p> - -<h2 id="SEE-ALSO">SEE ALSO</h2> - -<p><strong>chef-client</strong>(8) -<strong>chef-server-webui</strong>(8) -<strong>knife</strong>(1)</p> - -<p>Full documentation for Chef and chef-server is located on the Chef -wiki, http://wiki.opscode.com/display/chef/Home.</p> - -<h2 id="AUTHOR">AUTHOR</h2> - -<p>Chef was written by Adam Jacob <a href="mailto:adam@ospcode.com" data-bare-link="true">adam@ospcode.com</a> of Opscode -(http://www.opscode.com), with contributions from the community. This -manual page was written by Joshua Timberman <a href="mailto:joshua@opscode.com" data-bare-link="true">joshua@opscode.com</a> with -help2man. Permission is granted to copy, distribute and / or modify -this document under the terms of the Apache 2.0 License.</p> - -<p>On Debian systems, the complete text of the Apache 2.0 License can be -found in /usr/share/common-licenses/Apache-2.0.</p> - - - <ol class='man-decor man-foot man foot'> - <li class='tl'>Chef 11.8.0</li> - <li class='tc'>October 2013</li> - <li class='tr'>chef-server(8)</li> - </ol> - - </div> -</body> -</html> diff --git a/distro/common/html/chef-shell.1.html b/distro/common/html/chef-shell.1.html deleted file mode 100644 index f80172667a..0000000000 --- a/distro/common/html/chef-shell.1.html +++ /dev/null @@ -1,286 +0,0 @@ -<!DOCTYPE html> -<html> -<head> - <meta http-equiv='content-type' value='text/html;charset=utf8'> - <meta name='generator' value='Ronn/v0.7.3 (http://github.com/rtomayko/ronn/tree/0.7.3)'> - <title>chef-shell(1) - Interactive Chef Console</title> - <style type='text/css' media='all'> - /* style: man */ - body#manpage {margin:0} - .mp {max-width:100ex;padding:0 9ex 1ex 4ex} - .mp p,.mp pre,.mp ul,.mp ol,.mp dl {margin:0 0 20px 0} - .mp h2 {margin:10px 0 0 0} - .mp > p,.mp > pre,.mp > ul,.mp > ol,.mp > dl {margin-left:8ex} - .mp h3 {margin:0 0 0 4ex} - .mp dt {margin:0;clear:left} - .mp dt.flush {float:left;width:8ex} - .mp dd {margin:0 0 0 9ex} - .mp h1,.mp h2,.mp h3,.mp h4 {clear:left} - .mp pre {margin-bottom:20px} - .mp pre+h2,.mp pre+h3 {margin-top:22px} - .mp h2+pre,.mp h3+pre {margin-top:5px} - .mp img {display:block;margin:auto} - .mp h1.man-title {display:none} - .mp,.mp code,.mp pre,.mp tt,.mp kbd,.mp samp,.mp h3,.mp h4 {font-family:monospace;font-size:14px;line-height:1.42857142857143} - .mp h2 {font-size:16px;line-height:1.25} - .mp h1 {font-size:20px;line-height:2} - .mp {text-align:justify;background:#fff} - .mp,.mp code,.mp pre,.mp pre code,.mp tt,.mp kbd,.mp samp {color:#131211} - .mp h1,.mp h2,.mp h3,.mp h4 {color:#030201} - .mp u {text-decoration:underline} - .mp code,.mp strong,.mp b {font-weight:bold;color:#131211} - .mp em,.mp var {font-style:italic;color:#232221;text-decoration:none} - .mp a,.mp a:link,.mp a:hover,.mp a code,.mp a pre,.mp a tt,.mp a kbd,.mp a samp {color:#0000ff} - .mp b.man-ref {font-weight:normal;color:#434241} - .mp pre {padding:0 4ex} - .mp pre code {font-weight:normal;color:#434241} - .mp h2+pre,h3+pre {padding-left:0} - ol.man-decor,ol.man-decor li {margin:3px 0 10px 0;padding:0;float:left;width:33%;list-style-type:none;text-transform:uppercase;color:#999;letter-spacing:1px} - ol.man-decor {width:100%} - ol.man-decor li.tl {text-align:left} - ol.man-decor li.tc {text-align:center;letter-spacing:4px} - ol.man-decor li.tr {text-align:right;float:right} - </style> - <style type='text/css' media='all'> - /* style: toc */ - .man-navigation {display:block !important;position:fixed;top:0;left:113ex;height:100%;width:100%;padding:48px 0 0 0;border-left:1px solid #dbdbdb;background:#eee} - .man-navigation a,.man-navigation a:hover,.man-navigation a:link,.man-navigation a:visited {display:block;margin:0;padding:5px 2px 5px 30px;color:#999;text-decoration:none} - .man-navigation a:hover {color:#111;text-decoration:underline} - </style> -</head> -<!-- - The following styles are deprecated and will be removed at some point: - div#man, div#man ol.man, div#man ol.head, div#man ol.man. - - The .man-page, .man-decor, .man-head, .man-foot, .man-title, and - .man-navigation should be used instead. ---> -<body id='manpage'> - <div class='mp' id='man'> - - <div class='man-navigation' style='display:none'> - <a href="#NAME">NAME</a> - <a href="#SYNOPSIS">SYNOPSIS</a> - <a href="#DESCRIPTION">DESCRIPTION</a> - <a href="#SYNTAX">SYNTAX</a> - <a href="#PRIMARY-MODE">PRIMARY MODE</a> - <a href="#RECIPE-MODE">RECIPE MODE</a> - <a href="#EXAMPLES">EXAMPLES</a> - <a href="#BUGS">BUGS</a> - <a href="#SEE-ALSO">SEE ALSO</a> - <a href="#AUTHOR">AUTHOR</a> - <a href="#DOCUMENTATION">DOCUMENTATION</a> - <a href="#CHEF">CHEF</a> - </div> - - <ol class='man-decor man-head man head'> - <li class='tl'>chef-shell(1)</li> - <li class='tc'>Chef Manual</li> - <li class='tr'>chef-shell(1)</li> - </ol> - - <h2 id="NAME">NAME</h2> -<p class="man-name"> - <code>chef-shell</code> - <span class="man-whatis">Interactive Chef Console</span> -</p> - -<h2 id="SYNOPSIS">SYNOPSIS</h2> - -<p><strong>chef-shell</strong> [<em>named configuration</em>] <em>(options)</em></p> - -<dl> -<dt><code>-S</code>, <code>--server CHEF_SERVER_URL</code></dt><dd>The chef server URL</dd> -<dt><code>-z</code>, <code>--client</code></dt><dd>chef-client mode</dd> -<dt><code>-c</code>, <code>--config CONFIG</code></dt><dd>The configuration file to use</dd> -<dt><code>-j</code>, <code>--json-attributes JSON_ATTRIBS</code></dt><dd>Load attributes from a JSON file or URL</dd> -<dt><code>-l</code>, <code>--log-level LOG_LEVEL</code></dt><dd>Set the logging level</dd> -<dt><code>-s</code>, <code>--solo</code></dt><dd>chef-solo session</dd> -<dt><code>-a</code>, <code>--standalone</code></dt><dd>standalone session</dd> -<dt><code>-v</code>, <code>--version</code></dt><dd>Show chef version</dd> -<dt><code>-h</code>, <code>--help</code></dt><dd>Show command options</dd> -</dl> - - -<p>When no --config option is specified, chef-shell attempts to load a -default configuration file:</p> - -<ul> -<li>If a <em>named configuration</em> is given, chef-shell will load ~/.chef/<em>named -configuration</em>/chef_shell.rb</li> -<li>If no <em>named configuration</em> is given chef-shell will load -~/.chef/chef_shell.rb if it exists</li> -<li>chef-shell falls back to loading /etc/chef/client.rb or -/etc/chef/solo.rb if -z or -s options are given and no chef_shell.rb -can be found.</li> -<li>The --config option takes precedence over implicit configuration -paths.</li> -</ul> - - -<h2 id="DESCRIPTION">DESCRIPTION</h2> - -<p><code>chef-shell</code> is an <span class="man-ref">irb<span class="s">(1)</span></span> (interactive ruby) session customized for Chef. -<code>chef-shell</code> serves two primary functions: it provides a means to -interact with a Chef Server interactively using a convenient DSL; it -allows you to define and run Chef recipes interactively.</p> - -<h2 id="SYNTAX">SYNTAX</h2> - -<p>chef-shell uses irb's subsession feature to provide multiple modes of -interaction. In addition to the primary mode which is entered on start, -<code>recipe</code> and <code>attributes</code> modes are available.</p> - -<h2 id="PRIMARY-MODE">PRIMARY MODE</h2> - -<p>The following commands are available in the primary -session:</p> - -<dl> -<dt class="flush"><code>help</code></dt><dd>Prints a list of available commands</dd> -<dt class="flush"><code>version</code></dt><dd>Prints the Chef version</dd> -<dt class="flush"><code>recipe</code></dt><dd>Switches to <code>recipe</code> mode</dd> -<dt><code>attributes</code></dt><dd>Switches to <code>attributes</code> mode</dd> -<dt><code>run_chef</code></dt><dd>Initiates a chef run</dd> -<dt class="flush"><code>reset</code></dt><dd>reinitializes chef-shell session</dd> -<dt><code>echo :on|:off</code></dt><dd>Turns irb's echo function on or off. Echo is <em>on</em> by default.</dd> -<dt><code>tracing :on|:off</code></dt><dd>Turns irb's function tracing feature on or off. Tracing is extremely -verbose and expected to be of interest primarily to developers.</dd> -<dt class="flush"><code>node</code></dt><dd>Returns the <em>node</em> object for the current host. See <span class="man-ref">knife-node<span class="s">(1)</span></span> -for more information about nodes.</dd> -<dt class="flush"><code>ohai</code></dt><dd>Prints the attributes of <em>node</em></dd> -</dl> - - -<p>In addition to these commands, chef-shell provides a DSL for accessing -data on the Chef Server. When working with remote data in chef-shell, you -chain method calls in the form <em>object type</em>.<em>operation</em>, where -<em>object type</em> is in plural form. The following object types are -available:</p> - -<ul> -<li><code>nodes</code></li> -<li><code>roles</code></li> -<li><code>data_bags</code></li> -<li><code>clients</code></li> -<li><code>cookbooks</code></li> -</ul> - - -<p>For each <em>object type</em> the following operations are available:</p> - -<dl> -<dt><em>object type</em>.all(<em>&block</em>)</dt><dd>Loads all items from the server. If the optional code <em>block</em> is -given, each item will be passed to the block and the results -returned, similar to ruby's <code>Enumerable#map</code> method.</dd> -<dt><em>object type</em>.show(<em>object name</em>)</dt><dd><p>Aliased as <em>object type</em>.load</p> - -<p>Loads the singular item identified by <em>object name</em>.</p></dd> -<dt><em>object type</em>.search(<em>query</em>, <em>&block</em>)</dt><dd><p>Aliased as <em>object type</em>.find</p> - -<p>Runs a search against the server and returns the matching items. If -the optional code <em>block</em> is given each item will be passed to the -block and the results returned.</p> - -<p>The <em>query</em> may be a Solr/Lucene format query given as a String, or -a Hash of conditions. If a Hash is given, the options will be ANDed -together. To join conditions with OR, use negative queries, or any -advanced search syntax, you must provide give the query in String -form.</p></dd> -<dt><em>object type</em>.transform(:all|<em>query</em>, <em>&block</em>)</dt><dd><p>Aliased as <em>object type</em>.bulk_edit</p> - -<p>Bulk edit objects by processing them with the (required) code <em>block</em>. -You can edit all objects of the given type by passing the Symbol -<code>:all</code> as the argument, or only a subset by passing a <em>query</em> as the -argument. The <em>query</em> is evaluated in the same way as with -<strong>search</strong>.</p> - -<p>The return value of the code <em>block</em> is used to alter the behavior -of <code>transform</code>. If the value returned from the block is <code>nil</code> or -<code>false</code>, the object will not be saved. Otherwise, the object is -saved after being passed to the block. This behavior can be -exploited to create a dry run to test a data transformation.</p></dd> -</dl> - - -<h2 id="RECIPE-MODE">RECIPE MODE</h2> - -<p>Recipe mode implements Chef's recipe DSL. Exhaustively documenting this -DSL is outside the scope of this document. See the following pages in -the Chef documentation for more information:</p> - -<ul> -<li><a href="http://wiki.opscode.com/display/chef/Resources" data-bare-link="true">http://wiki.opscode.com/display/chef/Resources</a></li> -<li><a href="http://wiki.opscode.com/display/chef/Recipes" data-bare-link="true">http://wiki.opscode.com/display/chef/Recipes</a></li> -</ul> - - -<p>Once you have defined resources in the recipe, you can trigger a -convergence run via <code>run_chef</code></p> - -<h2 id="EXAMPLES">EXAMPLES</h2> - -<ul> -<li><p>A "Hello World" interactive recipe</p> - -<p>chef > recipe -chef:recipe > echo :off -chef:recipe > file "/tmp/hello_world" -chef:recipe > run_chef -[Sat, 09 Apr 2011 08:56:56 -0700] INFO: Processing file[/tmp/hello_world] action create ((irb#1) line 2) -[Sat, 09 Apr 2011 08:56:56 -0700] INFO: file[/tmp/hello_world] created file /tmp/hello_world -chef:recipe > pp ls '/tmp' -[".", -"..", -"hello_world"]</p></li> -<li><p>Search for <em>nodes</em> by role, and print their IP addresses</p> - -<p>chef > nodes.find(:roles => 'monitoring-server') {|n| n[:ipaddress] } -=> ["10.254.199.5"]</p></li> -<li><p>Remove the role <em>obsolete</em> from every node in the system</p> - -<p>chef > nodes.transform(:all) {|n| n.run_list.delete('role[obsolete]') } - => [node[chef098b2.opschef.com], node[ree-woot], node[graphite-dev], node[fluke.localdomain], node[ghost.local], node[kallistec]]</p></li> -</ul> - - -<h2 id="BUGS">BUGS</h2> - -<p><code>chef-shell</code> often does not perfectly replicate the context in which -<span class="man-ref">chef-client<span class="s">(8)</span></span> configures a host, which may lead to discrepancies in -observed behavior.</p> - -<p><code>chef-shell</code> has to duplicate much code from chef-client's internal -libraries and may become out of sync with the behavior of those -libraries.</p> - -<h2 id="SEE-ALSO">SEE ALSO</h2> - -<p> <span class="man-ref">chef-client<span class="s">(8)</span></span> <span class="man-ref">knife<span class="s">(1)</span></span> - <a href="http://wiki.opscode.com/display/chef/Chef+Shell" data-bare-link="true">http://wiki.opscode.com/display/chef/Chef+Shell</a></p> - -<h2 id="AUTHOR">AUTHOR</h2> - -<p> Chef was written by Adam Jacob <a href="mailto:adam@opscode.com" data-bare-link="true">adam@opscode.com</a> with many - contributions from the community. chef-shell was written by Daniel - DeLeo.</p> - -<h2 id="DOCUMENTATION">DOCUMENTATION</h2> - -<p> This manual page was written by Daniel DeLeo <a href="mailto:dan@opscode.com" data-bare-link="true">dan@opscode.com</a>. - Permission is granted to copy, distribute and / or modify this - document under the terms of the Apache 2.0 License.</p> - -<h2 id="CHEF">CHEF</h2> - -<p> chef-shell is distributed with Chef. <a href="http://wiki.opscode.com/display/chef/Home" data-bare-link="true">http://wiki.opscode.com/display/chef/Home</a></p> - - - <ol class='man-decor man-foot man foot'> - <li class='tl'>Chef 11.8.0</li> - <li class='tc'>October 2013</li> - <li class='tr'>chef-shell(1)</li> - </ol> - - </div> -</body> -</html> diff --git a/distro/common/html/chef-solo.8.html b/distro/common/html/chef-solo.8.html deleted file mode 100644 index 1543e2fa07..0000000000 --- a/distro/common/html/chef-solo.8.html +++ /dev/null @@ -1,185 +0,0 @@ -<!DOCTYPE html> -<html> -<head> - <meta http-equiv='content-type' value='text/html;charset=utf8'> - <meta name='generator' value='Ronn/v0.7.3 (http://github.com/rtomayko/ronn/tree/0.7.3)'> - <title>chef-solo(8) - Runs chef in solo mode against a specified cookbook location.</title> - <style type='text/css' media='all'> - /* style: man */ - body#manpage {margin:0} - .mp {max-width:100ex;padding:0 9ex 1ex 4ex} - .mp p,.mp pre,.mp ul,.mp ol,.mp dl {margin:0 0 20px 0} - .mp h2 {margin:10px 0 0 0} - .mp > p,.mp > pre,.mp > ul,.mp > ol,.mp > dl {margin-left:8ex} - .mp h3 {margin:0 0 0 4ex} - .mp dt {margin:0;clear:left} - .mp dt.flush {float:left;width:8ex} - .mp dd {margin:0 0 0 9ex} - .mp h1,.mp h2,.mp h3,.mp h4 {clear:left} - .mp pre {margin-bottom:20px} - .mp pre+h2,.mp pre+h3 {margin-top:22px} - .mp h2+pre,.mp h3+pre {margin-top:5px} - .mp img {display:block;margin:auto} - .mp h1.man-title {display:none} - .mp,.mp code,.mp pre,.mp tt,.mp kbd,.mp samp,.mp h3,.mp h4 {font-family:monospace;font-size:14px;line-height:1.42857142857143} - .mp h2 {font-size:16px;line-height:1.25} - .mp h1 {font-size:20px;line-height:2} - .mp {text-align:justify;background:#fff} - .mp,.mp code,.mp pre,.mp pre code,.mp tt,.mp kbd,.mp samp {color:#131211} - .mp h1,.mp h2,.mp h3,.mp h4 {color:#030201} - .mp u {text-decoration:underline} - .mp code,.mp strong,.mp b {font-weight:bold;color:#131211} - .mp em,.mp var {font-style:italic;color:#232221;text-decoration:none} - .mp a,.mp a:link,.mp a:hover,.mp a code,.mp a pre,.mp a tt,.mp a kbd,.mp a samp {color:#0000ff} - .mp b.man-ref {font-weight:normal;color:#434241} - .mp pre {padding:0 4ex} - .mp pre code {font-weight:normal;color:#434241} - .mp h2+pre,h3+pre {padding-left:0} - ol.man-decor,ol.man-decor li {margin:3px 0 10px 0;padding:0;float:left;width:33%;list-style-type:none;text-transform:uppercase;color:#999;letter-spacing:1px} - ol.man-decor {width:100%} - ol.man-decor li.tl {text-align:left} - ol.man-decor li.tc {text-align:center;letter-spacing:4px} - ol.man-decor li.tr {text-align:right;float:right} - </style> - <style type='text/css' media='all'> - /* style: toc */ - .man-navigation {display:block !important;position:fixed;top:0;left:113ex;height:100%;width:100%;padding:48px 0 0 0;border-left:1px solid #dbdbdb;background:#eee} - .man-navigation a,.man-navigation a:hover,.man-navigation a:link,.man-navigation a:visited {display:block;margin:0;padding:5px 2px 5px 30px;color:#999;text-decoration:none} - .man-navigation a:hover {color:#111;text-decoration:underline} - </style> -</head> -<!-- - The following styles are deprecated and will be removed at some point: - div#man, div#man ol.man, div#man ol.head, div#man ol.man. - - The .man-page, .man-decor, .man-head, .man-foot, .man-title, and - .man-navigation should be used instead. ---> -<body id='manpage'> - <div class='mp' id='man'> - - <div class='man-navigation' style='display:none'> - <a href="#NAME">NAME</a> - <a href="#SYNOPSIS">SYNOPSIS</a> - <a href="#DESCRIPTION">DESCRIPTION</a> - <a href="#SEE-ALSO">SEE ALSO</a> - <a href="#AUTHOR">AUTHOR</a> - </div> - - <ol class='man-decor man-head man head'> - <li class='tl'>chef-solo(8)</li> - <li class='tc'>Chef Manual</li> - <li class='tr'>chef-solo(8)</li> - </ol> - - <h2 id="NAME">NAME</h2> -<p class="man-name"> - <code>chef-solo</code> - <span class="man-whatis">Runs chef in solo mode against a specified cookbook location.</span> -</p> - -<h2 id="SYNOPSIS">SYNOPSIS</h2> - -<p><strong>chef-solo</strong> <em>(options)</em></p> - -<dl> -<dt><code>-c</code>, <code>--config CONFIG</code></dt><dd>The configuration file to use</dd> -<dt><code>-d</code>, <code>--daemonize</code></dt><dd>Daemonize the process</dd> -<dt><code>-g</code>, <code>--group GROUP</code></dt><dd>Group to set privilege to</dd> -<dt><code>-i</code>, <code>--interval SECONDS</code></dt><dd>Run chef-client periodically, in seconds</dd> -<dt><code>-j</code>, <code>--json-attributes JSON_ATTRIBS</code></dt><dd>Load attributes from a JSON file or URL</dd> -<dt><code>-l</code>, <code>--log_level LEVEL</code></dt><dd>Set the log level (debug, info, warn, error, fatal)</dd> -<dt><code>-L</code>, <code>--logfile LOGLOCATION</code></dt><dd>Set the log file location, defaults to STDOUT - recommended for -daemonizing</dd> -<dt><code>-N</code>, <code>--node-name NODE_NAME</code></dt><dd>The node name for this client</dd> -<dt><code>-r</code>, <code>--recipe-url RECIPE_URL</code></dt><dd>Pull down a remote gzipped tarball of recipes and untar it to the -cookbook cache.</dd> -<dt><code>-s</code>, <code>--splay SECONDS</code></dt><dd>The splay time for running at intervals, in seconds</dd> -<dt><code>-u</code>, <code>--user USER</code></dt><dd>User to set privilege to</dd> -<dt><code>-v</code>, <code>--version</code></dt><dd>Show chef version</dd> -<dt><code>-h</code>, <code>--help</code></dt><dd>Show this message</dd> -</dl> - - -<h2 id="DESCRIPTION">DESCRIPTION</h2> - -<p>Chef Solo allows you to run Chef Cookbooks in the absence of a Chef Server. -To do this, the complete cookbook needs to be present on disk.</p> - -<p>By default Chef Solo will look in /etc/chef/solo.rb for its configuration. -This configuration file has two required variables: file_cache_path and -cookbook_path.</p> - -<p>For example: - file_cache_path "/var/chef-solo" - cookbook_path "/var/chef-solo/cookbooks"</p> - -<p>For your own systems, you can change this to reflect any directory you like, -but you'll need to specify absolute paths and the cookbook_path directory -should be a subdirectory of the file_cache_path.</p> - -<p>You can also specify cookbook_path as an array, passing multiple locations -to search for cookbooks.</p> - -<p>For example: - file_cache_path "/var/chef-solo" - cookbook_path ["/var/chef-solo/cookbooks", "/var/chef-solo/site-cookbooks"]</p> - -<p>Note that earlier entries are now overridden by later ones.</p> - -<p>Since chef-solo doesn't have any interaction with a Chef Server, you'll need -to specify node-specifc attributes in a JSON file. This can be located on the -target system itself, or it can be stored on a remote server such as S3, or a -web server on your network.</p> - -<p>Within the JSON file, you'll also specify the recipes that Chef should run in -the "run_list". An example JSON file, which sets a resolv.conf:</p> - -<pre><code>{ - "resolver": { - "nameservers": [ "10.0.0.1" ], - "search":"int.example.com" - }, - "run_list": [ "recipe[resolver]" ] -} -</code></pre> - -<p>Then you can run chef-solo with -j to specify the JSON file. It will look for -cookbooks in the cookbook_path configured in the configuration file, and apply -attributes and use the run_list from the JSON file specified.</p> - -<p>You can use -c to specify the path to the configuration file (if you don't want -chef-solo to use the default). You can also specify -r for a cookbook tarball.</p> - -<p>For example: - chef-solo -c ~/solo.rb -j ~/node.json -r http://www.example.com/chef-solo.tar.gz</p> - -<p>In the above case, chef-solo would extract the tarball to your specified -cookbook_path, use ~/solo.rb as the configuration file, and apply attributes -and use the run_list from ~/node.json.</p> - -<h2 id="SEE-ALSO">SEE ALSO</h2> - -<p>Full documentation for Chef and chef-solo is located on the Chef wiki, -http://wiki.opscode.com/display/chef/Home.</p> - -<h2 id="AUTHOR">AUTHOR</h2> - -<p>Chef was written by Adam Jacob <a href="mailto:adam@ospcode.com" data-bare-link="true">adam@ospcode.com</a> of Opscode -(http://www.opscode.com), with contributions from the community. This -manual page was written by Joshua Timberman <a href="mailto:joshua@opscode.com" data-bare-link="true">joshua@opscode.com</a> with -help2man. Permission is granted to copy, distribute and / or modify -this document under the terms of the Apache 2.0 License.</p> - -<p>On Debian systems, the complete text of the Apache 2.0 License can be -found in /usr/share/common-licenses/Apache-2.0.</p> - - - <ol class='man-decor man-foot man foot'> - <li class='tl'>Chef 11.8.0</li> - <li class='tc'>October 2013</li> - <li class='tr'>chef-solo(8)</li> - </ol> - - </div> -</body> -</html> diff --git a/distro/common/html/chef-solr.8.html b/distro/common/html/chef-solr.8.html deleted file mode 100644 index c3153d8f76..0000000000 --- a/distro/common/html/chef-solr.8.html +++ /dev/null @@ -1,165 +0,0 @@ -<!DOCTYPE html> -<html> -<head> - <meta http-equiv='content-type' value='text/html;charset=utf8'> - <meta name='generator' value='Ronn/v0.7.3 (http://github.com/rtomayko/ronn/tree/0.7.3)'> - <title>chef-solr(8) - Runs as Chef's search server</title> - <style type='text/css' media='all'> - /* style: man */ - body#manpage {margin:0} - .mp {max-width:100ex;padding:0 9ex 1ex 4ex} - .mp p,.mp pre,.mp ul,.mp ol,.mp dl {margin:0 0 20px 0} - .mp h2 {margin:10px 0 0 0} - .mp > p,.mp > pre,.mp > ul,.mp > ol,.mp > dl {margin-left:8ex} - .mp h3 {margin:0 0 0 4ex} - .mp dt {margin:0;clear:left} - .mp dt.flush {float:left;width:8ex} - .mp dd {margin:0 0 0 9ex} - .mp h1,.mp h2,.mp h3,.mp h4 {clear:left} - .mp pre {margin-bottom:20px} - .mp pre+h2,.mp pre+h3 {margin-top:22px} - .mp h2+pre,.mp h3+pre {margin-top:5px} - .mp img {display:block;margin:auto} - .mp h1.man-title {display:none} - .mp,.mp code,.mp pre,.mp tt,.mp kbd,.mp samp,.mp h3,.mp h4 {font-family:monospace;font-size:14px;line-height:1.42857142857143} - .mp h2 {font-size:16px;line-height:1.25} - .mp h1 {font-size:20px;line-height:2} - .mp {text-align:justify;background:#fff} - .mp,.mp code,.mp pre,.mp pre code,.mp tt,.mp kbd,.mp samp {color:#131211} - .mp h1,.mp h2,.mp h3,.mp h4 {color:#030201} - .mp u {text-decoration:underline} - .mp code,.mp strong,.mp b {font-weight:bold;color:#131211} - .mp em,.mp var {font-style:italic;color:#232221;text-decoration:none} - .mp a,.mp a:link,.mp a:hover,.mp a code,.mp a pre,.mp a tt,.mp a kbd,.mp a samp {color:#0000ff} - .mp b.man-ref {font-weight:normal;color:#434241} - .mp pre {padding:0 4ex} - .mp pre code {font-weight:normal;color:#434241} - .mp h2+pre,h3+pre {padding-left:0} - ol.man-decor,ol.man-decor li {margin:3px 0 10px 0;padding:0;float:left;width:33%;list-style-type:none;text-transform:uppercase;color:#999;letter-spacing:1px} - ol.man-decor {width:100%} - ol.man-decor li.tl {text-align:left} - ol.man-decor li.tc {text-align:center;letter-spacing:4px} - ol.man-decor li.tr {text-align:right;float:right} - </style> - <style type='text/css' media='all'> - /* style: toc */ - .man-navigation {display:block !important;position:fixed;top:0;left:113ex;height:100%;width:100%;padding:48px 0 0 0;border-left:1px solid #dbdbdb;background:#eee} - .man-navigation a,.man-navigation a:hover,.man-navigation a:link,.man-navigation a:visited {display:block;margin:0;padding:5px 2px 5px 30px;color:#999;text-decoration:none} - .man-navigation a:hover {color:#111;text-decoration:underline} - </style> -</head> -<!-- - The following styles are deprecated and will be removed at some point: - div#man, div#man ol.man, div#man ol.head, div#man ol.man. - - The .man-page, .man-decor, .man-head, .man-foot, .man-title, and - .man-navigation should be used instead. ---> -<body id='manpage'> - <div class='mp' id='man'> - - <div class='man-navigation' style='display:none'> - <a href="#NAME">NAME</a> - <a href="#SYNOPSIS">SYNOPSIS</a> - <a href="#DESCRIPTION">DESCRIPTION</a> - <a href="#SEE-ALSO">SEE ALSO</a> - <a href="#AUTHOR">AUTHOR</a> - </div> - - <ol class='man-decor man-head man head'> - <li class='tl'>chef-solr(8)</li> - <li class='tc'>Chef Manual</li> - <li class='tr'>chef-solr(8)</li> - </ol> - - <h2 id="NAME">NAME</h2> -<p class="man-name"> - <code>chef-solr</code> - <span class="man-whatis">Runs as Chef's search server</span> -</p> - -<h2 id="SYNOPSIS">SYNOPSIS</h2> - -<p><strong>chef-solr</strong> <em>(options)</em></p> - -<dl> -<dt><code>-c</code>, <code>--config CONFIG</code></dt><dd>The configuration file to use</dd> -<dt><code>-d</code>, <code>--daemonize</code></dt><dd>Daemonize the process</dd> -<dt><code>-g</code>, <code>--group GROUP</code></dt><dd>Group to set privilege to</dd> -<dt><code>-l</code>, <code>--log_level LEVEL</code></dt><dd>Set the log level (debug, info, warn, error, fatal)</dd> -<dt><code>-L</code>, <code>--logfile LOGLOCATION</code></dt><dd>Set the log file location, defaults to STDOUT - recommended for daemonizing</dd> -<dt><code>-P</code>, <code>--pid PIDFILE</code></dt><dd>Set the PID file location, defaults to /tmp/chef-solr.pid</dd> -<dt><code>-D</code>, <code>--solr-data-dir PATH</code></dt><dd>Where the Solr data lives</dd> -<dt><code>-x</code>, <code>--solor-heap-size SIZE</code></dt><dd>Set the size of the Java Heap</dd> -<dt><code>-H</code>, <code>--solr-home-dir PATH</code></dt><dd>Solr home directory</dd> -<dt><code>-j</code>, <code>--java-opts OPTS</code></dt><dd>Raw options passed to Java</dd> -<dt><code>-x</code>, <code>--solor-heap-size</code></dt><dd>Set the size of the Java Heap</dd> -<dt><code>-W</code>, <code>--solr-jetty-dir PATH</code></dt><dd>Where to place the Solr Jetty instance</dd> -<dt><code>-u</code>, <code>--user USER</code></dt><dd>User to set privilege to</dd> -<dt><code>-v</code>, <code>--version</code></dt><dd>Show chef-solr version</dd> -<dt><code>-h</code>, <code>--help</code></dt><dd>Show this message</dd> -</dl> - - -<h2 id="DESCRIPTION">DESCRIPTION</h2> - -<p>Chef-solr provides search service for Chef. You need to have both -chef-solr and chef-expander-cluster running in order for search to work.</p> - -<p><strong>Installation</strong></p> - -<p>Make sure you backed up your data if you are upgrading from a previous version. -Run chef-solr-installer to upgrade your Chef Solr installation. Answer "yes" -when prompted for confirmation. The process should look like this:</p> - -<pre><code>yourshell> chef-solr-installer -Configuration setting solr_heap_size is unknown and will be ignored - -Chef Solr is already installed in /var/chef/solr -Do you want to overwrite the current install? All existing Solr data will be lost. [y/n] y -Removing the existing Chef Solr installation - rm -rf /var/chef/solr - rm -rf /var/chef/solr-jetty - rm -rf /var/chef/solr/data -Creating Solr Home Directory - mkdir -p /var/chef/solr - entering /var/chef/solr - tar zxvf /Users/ddeleo/opscode/chef/chef-solr/solr/solr-home.tar.gz -Creating Solr Data Directory - mkdir -p /var/chef/solr/data -Unpacking Solr Jetty - mkdir -p /var/chef/solr-jetty - entering /var/chef/solr-jetty - tar zxvf /Users/ddeleo/opscode/chef/chef-solr/solr/solr-jetty.tar.gz - -Successfully installed Chef Solr. -You can restore your search index using `knife index rebuild` -</code></pre> - -<h2 id="SEE-ALSO">SEE ALSO</h2> - -<p><strong>chef-expander-cluster</strong>(8)</p> - -<p>Full documentation for Chef and chef-server is located on the Chef -wiki, http://wiki.opscode.com/display/chef/Home.</p> - -<h2 id="AUTHOR">AUTHOR</h2> - -<p>Chef was written by Adam Jacob <a href="mailto:adam@ospcode.com" data-bare-link="true">adam@ospcode.com</a> of Opscode -(http://www.opscode.com), with contributions from the community. This -manual page was written by Joshua Timberman <a href="mailto:joshua@opscode.com" data-bare-link="true">joshua@opscode.com</a> with -help2man. Permission is granted to copy, distribute and / or modify -this document under the terms of the Apache 2.0 License.</p> - -<p>On Debian systems, the complete text of the Apache 2.0 License can be -found in /usr/share/common-licenses/Apache-2.0.</p> - - - <ol class='man-decor man-foot man foot'> - <li class='tl'>Chef 11.8.0</li> - <li class='tc'>October 2013</li> - <li class='tr'>chef-solr(8)</li> - </ol> - - </div> -</body> -</html> diff --git a/distro/common/html/ctl_chef_client.html b/distro/common/html/ctl_chef_client.html new file mode 100644 index 0000000000..454437bccf --- /dev/null +++ b/distro/common/html/ctl_chef_client.html @@ -0,0 +1,219 @@ + +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> + + +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> + + <title>chef-client — chef-client Man Pages</title> + + <link rel="stylesheet" href="_static/guide.css" type="text/css" /> + <link rel="stylesheet" href="_static/pygments.css" type="text/css" /> + + <script type="text/javascript"> + var DOCUMENTATION_OPTIONS = { + URL_ROOT: '', + VERSION: '', + COLLAPSE_INDEX: false, + FILE_SUFFIX: '.html', + HAS_SOURCE: true + }; + </script> + <script type="text/javascript" src="_static/jquery.js"></script> + <script type="text/javascript" src="_static/underscore.js"></script> + <script type="text/javascript" src="_static/doctools.js"></script> + <link rel="shortcut icon" href="_static/chef.ico"/> + + + </head> + <body> +<div style="background-color: #212c35; text-align: left; padding: 0px 0px 0px 0px"> +<a href="http://docs.opscode.com/"><img src="_static/chef_html_logo.png" border="0" alt="Chef"/></a> +</div> + + + + + <div class="document"> + <div class="documentwrapper"> + + <div class="body"> + + <div class="section" id="chef-client"> +<h1>chef-client<a class="headerlink" href="#chef-client" title="Permalink to this headline">¶</a></h1> +<p>A chef-client is an agent that runs locally on every node that is registered with the server. When a chef-client is run, it will perform all of the steps that are required to bring the node into the expected state, including:</p> +<ul class="simple"> +<li>Registering and authenticating the node with the server</li> +<li>Building the node object</li> +<li>Synchronizing cookbooks</li> +<li>Compiling the resource collection by loading each of the required cookbooks, including recipes, attributes, and all other dependencies</li> +<li>Taking the appropriate and required actions to configure the node</li> +<li>Looking for exceptions and notifications, handling each as required</li> +</ul> +<p>The chef-client executable can be run as a command-line tool.</p> +<div class="admonition note"> +<p class="first admonition-title">Note</p> +<p class="last">A client.rb file is used to specify the configuration details for the chef-client. This file is the default configuration file and is loaded every time the chef-client executable is run. The chef-client executable can be run as a daemon. On UNIX- and Linux-based machines, the configuration file is located at: <tt class="docutils literal"><span class="pre">/etc/chef/client.rb</span></tt>. On Microsoft Windows machines, the configuration file is located at <tt class="docutils literal"><span class="pre">C:\chef\client.rb</span></tt>.</p> +</div> +<div class="section" id="options"> +<h2>Options<a class="headerlink" href="#options" title="Permalink to this headline">¶</a></h2> +<p>This command has the following syntax:</p> +<div class="highlight-python"><pre>chef-client OPTION VALUE OPTION VALUE ...</pre> +</div> +<p>This command has the following options:</p> +<dl class="docutils"> +<dt><tt class="docutils literal"><span class="pre">-A</span></tt>, <tt class="docutils literal"><span class="pre">--fatal-windows-admin-check</span></tt></dt> +<dd>Indicates that a chef-client run should fail if the chef-client does not have administrator privileges in Microsoft Windows.</dd> +<dt><tt class="docutils literal"><span class="pre">--chef-zero-port</span> <span class="pre">PORT</span></tt></dt> +<dd>The port on which chef-zero will listen.</dd> +<dt><tt class="docutils literal"><span class="pre">-F</span> <span class="pre">FORMAT</span></tt>, <tt class="docutils literal"><span class="pre">--format</span> <span class="pre">FORMAT</span></tt></dt> +<dd><p class="first">The output format: <tt class="docutils literal"><span class="pre">doc</span></tt> (default) or <tt class="docutils literal"><span class="pre">min</span></tt>.</p> +<p>Use <tt class="docutils literal"><span class="pre">doc</span></tt> to print the progress of the chef-client run using full strings that display a summary of updates as they occur.</p> +<p>Use <tt class="docutils literal"><span class="pre">min</span></tt> to print the progress of the chef-client run using single characters. A summary of updates is printed at the end of the chef-client run. A dot (<tt class="docutils literal"><span class="pre">.</span></tt>) is printed for events that do not have meaningful status information, such as loading a file or synchronizing a cookbook. For resources, a dot (<tt class="docutils literal"><span class="pre">.</span></tt>) is printed when the resource is up to date, an <tt class="docutils literal"><span class="pre">S</span></tt> is printed when the resource is skipped by <tt class="docutils literal"><span class="pre">not_if</span></tt> or <tt class="docutils literal"><span class="pre">only_if</span></tt>, and a <tt class="docutils literal"><span class="pre">U</span></tt> is printed when the resource is updated.</p> +<p class="last">Other formatting options are available when those formatters are configured in the client.rb file using the <tt class="docutils literal"><span class="pre">add_formatter</span></tt> option.</p> +</dd> +<dt><tt class="docutils literal"><span class="pre">--force-formatter</span></tt></dt> +<dd>Indicates that formatter output will be used instead of logger output.</dd> +<dt><tt class="docutils literal"><span class="pre">--force-logger</span></tt></dt> +<dd>Indicates that logger output will be used instead of formatter output.</dd> +<dt><tt class="docutils literal"><span class="pre">-g</span> <span class="pre">GROUP</span></tt>, <tt class="docutils literal"><span class="pre">--group</span> <span class="pre">GROUP</span></tt></dt> +<dd>The name of the group that owns a process. This is required when starting any executable as a daemon.</dd> +<dt><tt class="docutils literal"><span class="pre">-h</span></tt>, <tt class="docutils literal"><span class="pre">--help</span></tt></dt> +<dd>Shows help for the command.</dd> +<dt><tt class="docutils literal"><span class="pre">-i</span> <span class="pre">SECONDS</span></tt>, <tt class="docutils literal"><span class="pre">--interval</span> <span class="pre">SECONDS</span></tt></dt> +<dd>The frequency (in seconds) at which the chef-client runs. Default value: <tt class="docutils literal"><span class="pre">1800</span></tt>.</dd> +<dt><tt class="docutils literal"><span class="pre">-j</span> <span class="pre">PATH</span></tt>, <tt class="docutils literal"><span class="pre">--json-attributes</span> <span class="pre">PATH</span></tt></dt> +<dd>The path to a file that contains JSON data.</dd> +<dt><tt class="docutils literal"><span class="pre">-k</span> <span class="pre">KEY_FILE</span></tt>, <tt class="docutils literal"><span class="pre">--client_key</span> <span class="pre">KEY_FILE</span></tt></dt> +<dd>The location of the file which contains the client key. Default value: <tt class="docutils literal"><span class="pre">/etc/chef/client.pem</span></tt>.</dd> +<dt><tt class="docutils literal"><span class="pre">-K</span> <span class="pre">KEY_FILE</span></tt>, <tt class="docutils literal"><span class="pre">--validation_key</span> <span class="pre">KEY_FILE</span></tt></dt> +<dd>The location of the file which contains the key used when a chef-client is registered with a server. A validation key is signed using the <tt class="docutils literal"><span class="pre">validation_client_name</span></tt> for authentication. Default value: <tt class="docutils literal"><span class="pre">/etc/chef/validation.pem</span></tt>.</dd> +<dt><tt class="docutils literal"><span class="pre">-l</span> <span class="pre">LEVEL</span></tt>, <tt class="docutils literal"><span class="pre">--log_level</span> <span class="pre">LEVEL</span></tt></dt> +<dd>The level of logging that will be stored in a log file.</dd> +<dt><tt class="docutils literal"><span class="pre">-L</span> <span class="pre">LOGLOCATION</span></tt>, <tt class="docutils literal"><span class="pre">--logfile</span> <span class="pre">c</span></tt></dt> +<dd>The location in which log file output files will be saved. If this location is set to something other than <tt class="docutils literal"><span class="pre">STDOUT</span></tt>, standard output logging will still be performed (otherwise there would be no output other than to a file). This is recommended when starting any executable as a daemon. Default value: <tt class="docutils literal"><span class="pre">STDOUT</span></tt>.</dd> +<dt><tt class="docutils literal"><span class="pre">--[no-]color</span></tt></dt> +<dd>Indicates whether colored output will be used. Default setting: <tt class="docutils literal"><span class="pre">--color</span></tt>.</dd> +<dt><tt class="docutils literal"><span class="pre">-N</span> <span class="pre">NODE_NAME</span></tt>, <tt class="docutils literal"><span class="pre">--node-name</span> <span class="pre">NODE_NAME</span></tt></dt> +<dd>The name of the node.</dd> +<dt><tt class="docutils literal"><span class="pre">-o</span> <span class="pre">RUN_LIST_ITEM</span></tt>, <tt class="docutils literal"><span class="pre">--override-runlist</span> <span class="pre">RUN_LIST_ITEM</span></tt></dt> +<dd>Replace the current run list with the specified items.</dd> +<dt><tt class="docutils literal"><span class="pre">--once</span></tt></dt> +<dd>Indicates that the chef-client is run once and that interval and splay options are cancelled.</dd> +<dt><tt class="docutils literal"><span class="pre">-P</span> <span class="pre">PID_FILE</span></tt>, <tt class="docutils literal"><span class="pre">--pid</span> <span class="pre">PID_FILE</span></tt></dt> +<dd>The location in which a process identification number (pid) is saved. An executable, when started as a daemon, will write the pid to the specified file. Default value: <tt class="docutils literal"><span class="pre">/tmp/name-of-executable.pid</span></tt>.</dd> +<dt><tt class="docutils literal"><span class="pre">-R</span></tt>, <tt class="docutils literal"><span class="pre">--enable-reporting</span></tt></dt> +<dd>Indicates that data collection reporting is enabled during a chef-client run.</dd> +<dt><tt class="docutils literal"><span class="pre">-s</span> <span class="pre">SECONDS</span></tt>, <tt class="docutils literal"><span class="pre">--splay</span> <span class="pre">SECONDS</span></tt></dt> +<dd>A number (in seconds) to add to the <tt class="docutils literal"><span class="pre">interval</span></tt> that is used to determine the frequency of chef-client runs. This number can help prevent server load when there are many clients running at the same time.</dd> +<dt><tt class="docutils literal"><span class="pre">-S</span> <span class="pre">CHEF_SERVER_URL</span></tt>, <tt class="docutils literal"><span class="pre">--server</span> <span class="pre">CHEF_SERVER_URL</span></tt></dt> +<dd>The URL for the server.</dd> +<dt><tt class="docutils literal"><span class="pre">-u</span> <span class="pre">USER</span></tt>, <tt class="docutils literal"><span class="pre">--user</span> <span class="pre">USER</span></tt></dt> +<dd>The user that owns a process. This is required when starting any executable as a daemon.</dd> +<dt><tt class="docutils literal"><span class="pre">-v</span></tt>, <tt class="docutils literal"><span class="pre">--version</span></tt></dt> +<dd>The version of the chef-client.</dd> +<dt><tt class="docutils literal"><span class="pre">-W</span></tt>, <tt class="docutils literal"><span class="pre">--why-run</span></tt></dt> +<dd>Indicates that the executable will be run in why-run mode, which is a type of chef-client run that does everything except modify the system. Use why-run mode to understand why the chef-client makes the decisions that it makes and to learn more about the current and proposed state of the system.</dd> +<dt><tt class="docutils literal"><span class="pre">-z</span></tt>, <tt class="docutils literal"><span class="pre">--local-mode</span></tt></dt> +<dd>Indicates that the chef-client will be run in local mode, which allows all commands that work against the server to also work against the local chef-repo.</dd> +</dl> +</div> +<div class="section" id="run-with-elevated-privileges"> +<h2>Run with Elevated Privileges<a class="headerlink" href="#run-with-elevated-privileges" title="Permalink to this headline">¶</a></h2> +<p>The chef-client may need to be run with elevated privileges in order to get a recipe to converge correctly. On UNIX and UNIX-like operating systems this can be done by running the command as root. On Microsoft Windows this can be done by running the command prompt as an administrator.</p> +<div class="section" id="linux"> +<h3>Linux<a class="headerlink" href="#linux" title="Permalink to this headline">¶</a></h3> +<p>On Linux, the following error sometimes occurs when the permissions used to run the chef-client are incorrect:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>chef-client +<span class="o">[</span>Tue, 29 Nov 2011 19:46:17 -0800<span class="o">]</span> INFO: *** Chef 10.X.X *** +<span class="o">[</span>Tue, 29 Nov 2011 19:46:18 -0800<span class="o">]</span> WARN: Failed to <span class="nb">read </span>the private key /etc/chef/client.pem: <span class="c">#<Errno::EACCES: Permission denied - /etc/chef/client.pem></span> +</pre></div> +</div> +<p>This can be resolved by running the command as root. There are a few ways this can be done:</p> +<ul> +<li><p class="first">Log in as root and then run the chef-client</p> +</li> +<li><p class="first">Use <tt class="docutils literal"><span class="pre">su</span></tt> to become the root user, and then run the chef-client. For example:</p> +<blockquote> +<div><div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>su +</pre></div> +</div> +</div></blockquote> +</li> +</ul> +<p>and then:</p> +<blockquote> +<div><div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>chef-client +</pre></div> +</div> +</div></blockquote> +<ul> +<li><p class="first">Use the sudo utility</p> +<blockquote> +<div><div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>sudo chef-client +</pre></div> +</div> +</div></blockquote> +</li> +<li><p class="first">Give a user access to read <tt class="docutils literal"><span class="pre">/etc/chef</span></tt> and also the files accessed by the chef-client. This requires super user privileges and, as such, is not a recommended approach</p> +</li> +</ul> +</div> +<div class="section" id="windows"> +<h3>Windows<a class="headerlink" href="#windows" title="Permalink to this headline">¶</a></h3> +<p>On Microsoft Windows, running without elevated privileges (when they are necessary) is an issue that fails silently. It will appear that the chef-client completed its run successfully, but the changes will not have been made. When this occurs, do one of the following to run the chef-client as the administrator:</p> +<ul> +<li><p class="first">Log in to the administrator account. (This is not the same as an account in the administrator’s security group.)</p> +</li> +<li><p class="first">Run the chef-client process from the administrator account while being logged into another account. Run the following command:</p> +<blockquote> +<div><div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>runas /user:Administrator <span class="s2">"cmd /C chef-client"</span> +</pre></div> +</div> +<p>This will prompt for the administrator account password.</p> +</div></blockquote> +</li> +<li><p class="first">Open a command prompt by right-clicking on the command prompt application, and then selecting <strong>Run as administrator</strong>. After the command window opens, the chef-client can be run as the administrator</p> +</li> +</ul> +</div> +</div> +<div class="section" id="examples"> +<h2>Examples<a class="headerlink" href="#examples" title="Permalink to this headline">¶</a></h2> +<p><strong>Start a Chef run when the chef-client is running as a daemon</strong></p> +<p>A chef-client that is running as a daemon can be woken up and started by sending the process a <tt class="docutils literal"><span class="pre">SIGUSR1</span></tt>. For example, to trigger a chef-client run on a machine running Linux:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>sudo killall -USR1 chef-client +</pre></div> +</div> +<p><strong>Start a Chef run manually</strong></p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>ps auxw|grep chef-client +</pre></div> +</div> +<p>to return something like:</p> +<div class="highlight-bash"><div class="highlight"><pre>root 66066 0.9 0.0 2488880 264 s001 S+ 10:26AM 0:03.05 +/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby /usr/bin/chef-client -i 3600 -s 20 +</pre></div> +</div> +<p>and then enter:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>sudo <span class="nb">kill</span> -USR1 66066 +</pre></div> +</div> +</div> +</div> + + + </div> + + </div> + + + <div class="clearer"></div> + </div> + + + + + </body> +</html>
\ No newline at end of file diff --git a/distro/common/html/ctl_chef_server.html b/distro/common/html/ctl_chef_server.html new file mode 100644 index 0000000000..8fc86496cd --- /dev/null +++ b/distro/common/html/ctl_chef_server.html @@ -0,0 +1,111 @@ + +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> + + +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> + + <title>chef-server-ctl — chef-client Man Pages</title> + + <link rel="stylesheet" href="_static/guide.css" type="text/css" /> + <link rel="stylesheet" href="_static/pygments.css" type="text/css" /> + + <script type="text/javascript"> + var DOCUMENTATION_OPTIONS = { + URL_ROOT: '', + VERSION: '', + COLLAPSE_INDEX: false, + FILE_SUFFIX: '.html', + HAS_SOURCE: true + }; + </script> + <script type="text/javascript" src="_static/jquery.js"></script> + <script type="text/javascript" src="_static/underscore.js"></script> + <script type="text/javascript" src="_static/doctools.js"></script> + <link rel="shortcut icon" href="_static/chef.ico"/> + + + </head> + <body> +<div style="background-color: #212c35; text-align: left; padding: 0px 0px 0px 0px"> +<a href="http://docs.opscode.com/"><img src="_static/chef_html_logo.png" border="0" alt="Chef"/></a> +</div> + + + + + <div class="document"> + <div class="documentwrapper"> + + <div class="body"> + + <div class="section" id="chef-server-ctl"> +<h1>chef-server-ctl<a class="headerlink" href="#chef-server-ctl" title="Permalink to this headline">¶</a></h1> +<p>The open source server includes a command-line utility named chef-server-ctl, which is used to start and stop individual services, reconfigure the server, and tail server log files.</p> +<div class="section" id="options"> +<h2>Options<a class="headerlink" href="#options" title="Permalink to this headline">¶</a></h2> +<p>This command has the following syntax:</p> +<div class="highlight-python"><pre>chef-server-ctl OPTION</pre> +</div> +<p>This command has the following options:</p> +<dl class="docutils"> +<dt><tt class="docutils literal"><span class="pre">help</span></tt></dt> +<dd>Shows help for the command.</dd> +<dt><tt class="docutils literal"><span class="pre">reconfigure</span></tt></dt> +<dd>Use to reconfigure the server. This option will read from the <tt class="docutils literal"><span class="pre">/etc/chef-server/chef-server.rb</span></tt> file and apply that configuration to the server. Any time changes are made to the chef-server.rb file, the chef-server-ctl command should be run with this option.</dd> +<dt><tt class="docutils literal"><span class="pre">restart</span> <span class="pre">[SERVICE_NAME]</span></tt></dt> +<dd>Use to restart all enabled services or to restart a single service.</dd> +<dt><tt class="docutils literal"><span class="pre">start</span> <span class="pre">[SERVICE_NAME]</span></tt></dt> +<dd>Use to start all enabled services or to start a single service.</dd> +<dt><tt class="docutils literal"><span class="pre">status</span> <span class="pre">[SERVICE_NAME]</span></tt></dt> +<dd>Use to view the status of all services or to view the status of a single service.</dd> +<dt><tt class="docutils literal"><span class="pre">stop</span> <span class="pre">[SERVICE_NAME]</span></tt></dt> +<dd>Use to stop all enabled services or to stop a single service.</dd> +<dt><tt class="docutils literal"><span class="pre">tail</span> <span class="pre">[SERVICE_NAME]</span></tt></dt> +<dd>Use to follow the server logs for all services or for a single service.</dd> +<dt><tt class="docutils literal"><span class="pre">test</span> <span class="pre">--all</span></tt></dt> +<dd>Use to execute chef-pedant, an integration test suite for the server installation. By default, only a subset of the available test are run. Add the <tt class="docutils literal"><span class="pre">--all</span></tt> flag to run the full test suite.</dd> +</dl> +</div> +<div class="section" id="examples"> +<h2>Examples<a class="headerlink" href="#examples" title="Permalink to this headline">¶</a></h2> +<p>The following examples show how to use chef-server-ctl to manage services.</p> +<p><strong>View the status of a service</strong></p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>ctl-chef-server status name_of_service +</pre></div> +</div> +<p>For example, to view the status for a service named <tt class="docutils literal"><span class="pre">erchef</span></tt>, enter:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>ctl-chef-server status erchef +</pre></div> +</div> +<p><strong>Restart a service</strong></p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>ctl-chef-server restart name_of_service +</pre></div> +</div> +<p>For example, to restart a service named <tt class="docutils literal"><span class="pre">erchef</span></tt>, enter:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>ctl-chef-server restart erchef +</pre></div> +</div> +<p><strong>Restart all services</strong></p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>ctl-chef-server restart +</pre></div> +</div> +</div> +</div> + + + </div> + + </div> + + + <div class="clearer"></div> + </div> + + + + + </body> +</html>
\ No newline at end of file diff --git a/distro/common/html/ctl_chef_shell.html b/distro/common/html/ctl_chef_shell.html new file mode 100644 index 0000000000..7aa3ef0eac --- /dev/null +++ b/distro/common/html/ctl_chef_shell.html @@ -0,0 +1,120 @@ + +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> + + +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> + + <title>chef-shell — chef-client Man Pages</title> + + <link rel="stylesheet" href="_static/guide.css" type="text/css" /> + <link rel="stylesheet" href="_static/pygments.css" type="text/css" /> + + <script type="text/javascript"> + var DOCUMENTATION_OPTIONS = { + URL_ROOT: '', + VERSION: '', + COLLAPSE_INDEX: false, + FILE_SUFFIX: '.html', + HAS_SOURCE: true + }; + </script> + <script type="text/javascript" src="_static/jquery.js"></script> + <script type="text/javascript" src="_static/underscore.js"></script> + <script type="text/javascript" src="_static/doctools.js"></script> + <link rel="shortcut icon" href="_static/chef.ico"/> + + + </head> + <body> +<div style="background-color: #212c35; text-align: left; padding: 0px 0px 0px 0px"> +<a href="http://docs.opscode.com/"><img src="_static/chef_html_logo.png" border="0" alt="Chef"/></a> +</div> + + + + + <div class="document"> + <div class="documentwrapper"> + + <div class="body"> + + <div class="section" id="chef-shell"> +<h1>chef-shell<a class="headerlink" href="#chef-shell" title="Permalink to this headline">¶</a></h1> +<p>chef-shell is a recipe debugging tool that allows the use of breakpoints within recipes. chef-shell runs as an Interactive Ruby (IRb) session. chef-shell supports both recipe and attribute file syntax, as well as interactive debugging features.</p> +<div class="admonition note"> +<p class="first admonition-title">Note</p> +<p class="last">chef-shell is the new name for Shef as of Chef 11.x. chef-shell is backwards compatible and aside from the name change, has the same set of functionality as with previous releases.</p> +</div> +<p>The chef-shell executable can be run as a command-line tool.</p> +<div class="section" id="modes"> +<h2>Modes<a class="headerlink" href="#modes" title="Permalink to this headline">¶</a></h2> +<p>chef-shell is tool that allows Knife to be run using an Interactive Ruby (IRb) session. chef-shell currently supports recipe and attribute file syntax, as well as interactive debugging features. chef-shell has three run modes:</p> +<table border="1" class="docutils"> +<colgroup> +<col width="40%" /> +<col width="60%" /> +</colgroup> +<thead valign="bottom"> +<tr class="row-odd"><th class="head">Mode</th> +<th class="head">Description</th> +</tr> +</thead> +<tbody valign="top"> +<tr class="row-even"><td>Standalone</td> +<td>No cookbooks are loaded, and the run list is empty. This mode is the default.</td> +</tr> +<tr class="row-odd"><td>Solo</td> +<td>chef-shell acts as a chef-solo client. It attempts to load the chef-solo configuration file and JSON attributes. If the JSON attributes set a run list, it will be honored. Cookbooks will be loaded in the same way that chef-solo loads them. chef-solo mode is activated with the <tt class="docutils literal"><span class="pre">-s</span></tt> or <tt class="docutils literal"><span class="pre">--solo</span></tt> command line option, and JSON attributes are specified in the same way as for chef-solo, with <tt class="docutils literal"><span class="pre">-j</span> <span class="pre">/path/to/chef-solo.json</span></tt>.</td> +</tr> +<tr class="row-even"><td>Client</td> +<td>chef-shell acts as a chef-client. During startup, it reads the chef-client configuration file and contacts the server to get attributes and cookbooks. The run list will be set in the same way as normal chef-client runs. chef-client mode is activated with the <tt class="docutils literal"><span class="pre">-z</span></tt> or <tt class="docutils literal"><span class="pre">--client</span></tt> options. You can also specify the configuration file with <tt class="docutils literal"><span class="pre">-c</span> <span class="pre">CONFIG</span></tt> and the server URL with <tt class="docutils literal"><span class="pre">-S</span> <span class="pre">SERVER_URL</span></tt>.</td> +</tr> +</tbody> +</table> +</div> +<div class="section" id="options"> +<h2>Options<a class="headerlink" href="#options" title="Permalink to this headline">¶</a></h2> +<p>This command has the following syntax:</p> +<div class="highlight-python"><pre>chef-shell OPTION VALUE OPTION VALUE ...</pre> +</div> +<p>This command has the following options:</p> +<dl class="docutils"> +<dt><tt class="docutils literal"><span class="pre">-a</span></tt>, <tt class="docutils literal"><span class="pre">--standalone</span></tt></dt> +<dd>Indicates that chef-shell will be run in standalone mode.</dd> +<dt><tt class="docutils literal"><span class="pre">-c</span> <span class="pre">CONFIG</span></tt>, <tt class="docutils literal"><span class="pre">--config</span> <span class="pre">CONFIG</span></tt></dt> +<dd>The configuration file to use.</dd> +<dt><tt class="docutils literal"><span class="pre">-h</span></tt>, <tt class="docutils literal"><span class="pre">--help</span></tt></dt> +<dd>Shows help for the command.</dd> +<dt><tt class="docutils literal"><span class="pre">-j</span> <span class="pre">PATH</span></tt>, <tt class="docutils literal"><span class="pre">--json-attributes</span> <span class="pre">PATH</span></tt></dt> +<dd>The path to a file that contains JSON data.</dd> +<dt><tt class="docutils literal"><span class="pre">-l</span> <span class="pre">LEVEL</span></tt>, <tt class="docutils literal"><span class="pre">--log-level</span> <span class="pre">LEVEL</span></tt></dt> +<dd>The level of logging that will be stored in a log file.</dd> +<dt><tt class="docutils literal"><span class="pre">-s</span></tt>, <tt class="docutils literal"><span class="pre">--solo</span></tt></dt> +<dd>Indicates that chef-shell will be run in chef-solo mode.</dd> +<dt><tt class="docutils literal"><span class="pre">-S</span> <span class="pre">CHEF_SERVER_URL</span></tt>, <tt class="docutils literal"><span class="pre">--server</span> <span class="pre">CHEF_SERVER_URL</span></tt></dt> +<dd>The URL for the server.</dd> +<dt><tt class="docutils literal"><span class="pre">-v</span></tt>, <tt class="docutils literal"><span class="pre">--version</span></tt></dt> +<dd>The version of the chef-client.</dd> +<dt><tt class="docutils literal"><span class="pre">-z</span></tt>, <tt class="docutils literal"><span class="pre">--client</span></tt></dt> +<dd>Indicates that chef-shell will be run in chef-client mode.</dd> +</dl> +</div> +</div> + + + </div> + + </div> + + + <div class="clearer"></div> + </div> + + + + + </body> +</html>
\ No newline at end of file diff --git a/distro/common/html/ctl_chef_solo.html b/distro/common/html/ctl_chef_solo.html new file mode 100644 index 0000000000..cc20bfb940 --- /dev/null +++ b/distro/common/html/ctl_chef_solo.html @@ -0,0 +1,144 @@ + +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> + + +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> + + <title>chef-solo — chef-client Man Pages</title> + + <link rel="stylesheet" href="_static/guide.css" type="text/css" /> + <link rel="stylesheet" href="_static/pygments.css" type="text/css" /> + + <script type="text/javascript"> + var DOCUMENTATION_OPTIONS = { + URL_ROOT: '', + VERSION: '', + COLLAPSE_INDEX: false, + FILE_SUFFIX: '.html', + HAS_SOURCE: true + }; + </script> + <script type="text/javascript" src="_static/jquery.js"></script> + <script type="text/javascript" src="_static/underscore.js"></script> + <script type="text/javascript" src="_static/doctools.js"></script> + <link rel="shortcut icon" href="_static/chef.ico"/> + + + </head> + <body> +<div style="background-color: #212c35; text-align: left; padding: 0px 0px 0px 0px"> +<a href="http://docs.opscode.com/"><img src="_static/chef_html_logo.png" border="0" alt="Chef"/></a> +</div> + + + + + <div class="document"> + <div class="documentwrapper"> + + <div class="body"> + + <div class="section" id="chef-solo"> +<h1>chef-solo<a class="headerlink" href="#chef-solo" title="Permalink to this headline">¶</a></h1> +<p>chef-solo is an open source version of the chef-client that allows using cookbooks with nodes without requiring access to a server. chef-solo runs locally and requires that a cookbook (and any of its dependencies) be on the same physical disk as the node. chef-solo is a limited-functionality version of the chef-client and <strong>does not support</strong> the following:</p> +<ul class="simple"> +<li>Node data storage</li> +<li>Search indexes</li> +<li>Centralized distribution of cookbooks</li> +<li>A centralized API that interacts with and integrates infrastructure components</li> +<li>Authentication or authorization</li> +<li>Persistent attributes</li> +</ul> +<p>The chef-solo executable can be run as a command-line tool.</p> +<div class="section" id="options"> +<h2>Options<a class="headerlink" href="#options" title="Permalink to this headline">¶</a></h2> +<p>This command has the following syntax:</p> +<div class="highlight-python"><pre>chef-solo OPTION VALUE OPTION VALUE ...</pre> +</div> +<p>This command has the following options:</p> +<dl class="docutils"> +<dt><tt class="docutils literal"><span class="pre">-c</span> <span class="pre">CONFIG</span></tt>, <tt class="docutils literal"><span class="pre">--config</span> <span class="pre">CONFIG</span></tt></dt> +<dd>The configuration file to use.</dd> +<dt><tt class="docutils literal"><span class="pre">-d</span></tt>, <tt class="docutils literal"><span class="pre">--daemonize</span></tt></dt> +<dd>Indicates that the executable will be run as a daemon. This option is only available on machines that run in UNIX or Linux environments. For machines that are running Microsoft Windows that require similar functionality, use the <tt class="docutils literal"><span class="pre">chef-client::service</span></tt> recipe in the <tt class="docutils literal"><span class="pre">chef-client</span></tt> cookbook: <a class="reference external" href="http://community.opscode.com/cookbooks/chef-client">http://community.opscode.com/cookbooks/chef-client</a>. This will install a chef-client service under Microsoft Windows using the Windows Service Wrapper.</dd> +<dt><tt class="docutils literal"><span class="pre">-E</span> <span class="pre">ENVIRONMENT_NAME</span></tt>, <tt class="docutils literal"><span class="pre">--environment</span> <span class="pre">ENVIRONMENT_NAME</span></tt></dt> +<dd>The name of the environment.</dd> +<dt><tt class="docutils literal"><span class="pre">-f</span></tt>, <tt class="docutils literal"><span class="pre">--[no-]fork</span></tt></dt> +<dd>Indicates that a chef-client run will be contained in a secondary process with dedicated RAM. When the chef-client run is complete the RAM will be returned to the master process. This option helps ensure that a chef-client will use a steady amount of RAM over time because the master process will not run recipes. This option will also help prevent memory leaks (such as those that can be introduced by the code contained within a poorly designed cookbook). Use <tt class="docutils literal"><span class="pre">--no-fork</span></tt> to disable running the chef-client in fork node. Default value: <tt class="docutils literal"><span class="pre">--fork</span></tt>.</dd> +<dt><tt class="docutils literal"><span class="pre">-F</span> <span class="pre">FORMAT</span></tt>, <tt class="docutils literal"><span class="pre">--format</span> <span class="pre">FORMAT</span></tt></dt> +<dd><p class="first">The output format: <tt class="docutils literal"><span class="pre">doc</span></tt> (default) or <tt class="docutils literal"><span class="pre">min</span></tt>.</p> +<p>Use <tt class="docutils literal"><span class="pre">doc</span></tt> to print the progress of the chef-client run using full strings that display a summary of updates as they occur.</p> +<p>Use <tt class="docutils literal"><span class="pre">min</span></tt> to print the progress of the chef-client run using single characters. A summary of updates is printed at the end of the chef-client run. A dot (<tt class="docutils literal"><span class="pre">.</span></tt>) is printed for events that do not have meaningful status information, such as loading a file or synchronizing a cookbook. For resources, a dot (<tt class="docutils literal"><span class="pre">.</span></tt>) is printed when the resource is up to date, an <tt class="docutils literal"><span class="pre">S</span></tt> is printed when the resource is skipped by <tt class="docutils literal"><span class="pre">not_if</span></tt> or <tt class="docutils literal"><span class="pre">only_if</span></tt>, and a <tt class="docutils literal"><span class="pre">U</span></tt> is printed when the resource is updated.</p> +<p class="last">Other formatting options are available when those formatters are configured in the client.rb file using the <tt class="docutils literal"><span class="pre">add_formatter</span></tt> option.</p> +</dd> +<dt><tt class="docutils literal"><span class="pre">--force-formatter</span></tt></dt> +<dd>Indicates that formatter output will be used instead of logger output.</dd> +<dt><tt class="docutils literal"><span class="pre">--force-logger</span></tt></dt> +<dd>Indicates that logger output will be used instead of formatter output.</dd> +<dt><tt class="docutils literal"><span class="pre">-g</span> <span class="pre">GROUP</span></tt>, <tt class="docutils literal"><span class="pre">--group</span> <span class="pre">GROUP</span></tt></dt> +<dd>The name of the group that owns a process. This is required when starting any executable as a daemon.</dd> +<dt><tt class="docutils literal"><span class="pre">-h</span></tt>, <tt class="docutils literal"><span class="pre">--help</span></tt></dt> +<dd>Shows help for the command.</dd> +<dt><tt class="docutils literal"><span class="pre">-i</span> <span class="pre">SECONDS</span></tt>, <tt class="docutils literal"><span class="pre">--interval</span> <span class="pre">SECONDS</span></tt></dt> +<dd>The frequency (in seconds) at which the chef-client runs.</dd> +<dt><tt class="docutils literal"><span class="pre">-j</span> <span class="pre">PATH</span></tt>, <tt class="docutils literal"><span class="pre">--json-attributes</span> <span class="pre">PATH</span></tt></dt> +<dd>The path to a file that contains JSON data. Use this option to override <tt class="docutils literal"><span class="pre">normal</span></tt> attributes set elsewhere.</dd> +<dt><tt class="docutils literal"><span class="pre">-l</span> <span class="pre">LEVEL</span></tt>, <tt class="docutils literal"><span class="pre">--log_level</span> <span class="pre">LEVEL</span></tt></dt> +<dd>The level of logging that will be stored in a log file.</dd> +<dt><tt class="docutils literal"><span class="pre">-L</span> <span class="pre">LOGLOCATION</span></tt>, <tt class="docutils literal"><span class="pre">--logfile</span> <span class="pre">c</span></tt></dt> +<dd>The location in which log file output files will be saved. If this location is set to something other than <tt class="docutils literal"><span class="pre">STDOUT</span></tt>, standard output logging will still be performed (otherwise there would be no output other than to a file). This is recommended when starting any executable as a daemon.</dd> +<dt><tt class="docutils literal"><span class="pre">--[no-]color</span></tt></dt> +<dd>Indicates whether colored output will be used. Default setting: <tt class="docutils literal"><span class="pre">--color</span></tt>.</dd> +<dt><tt class="docutils literal"><span class="pre">-N</span> <span class="pre">NODE_NAME</span></tt>, <tt class="docutils literal"><span class="pre">--node-name</span> <span class="pre">NODE_NAME</span></tt></dt> +<dd>The name of the node.</dd> +<dt><tt class="docutils literal"><span class="pre">-o</span> <span class="pre">RUN_LIST_ITEM</span></tt>, <tt class="docutils literal"><span class="pre">--override-runlist</span> <span class="pre">RUN_LIST_ITEM</span></tt></dt> +<dd>Replace the current run list with the specified items.</dd> +<dt><tt class="docutils literal"><span class="pre">-r</span> <span class="pre">RECIPE_URL</span></tt>, <tt class="docutils literal"><span class="pre">--recipe-url</span> <span class="pre">RECIPE_URL</span></tt></dt> +<dd>The URL location from which a remote cookbook tar.gz will be downloaded.</dd> +<dt><tt class="docutils literal"><span class="pre">-s</span> <span class="pre">SECONDS</span></tt>, <tt class="docutils literal"><span class="pre">--splay</span> <span class="pre">SECONDS</span></tt></dt> +<dd>A number (in seconds) to add to the <tt class="docutils literal"><span class="pre">interval</span></tt> that is used to determine the frequency of chef-client runs. This number can help prevent server load when there are many clients running at the same time.</dd> +<dt><tt class="docutils literal"><span class="pre">-u</span> <span class="pre">USER</span></tt>, <tt class="docutils literal"><span class="pre">--user</span> <span class="pre">USER</span></tt></dt> +<dd>The user that owns a process. This is required when starting any executable as a daemon.</dd> +<dt><tt class="docutils literal"><span class="pre">-v</span></tt>, <tt class="docutils literal"><span class="pre">--version</span></tt></dt> +<dd>The version of the chef-client.</dd> +<dt><tt class="docutils literal"><span class="pre">-W</span></tt>, <tt class="docutils literal"><span class="pre">--why-run</span></tt></dt> +<dd>Indicates that the executable will be run in why-run mode, which is a type of chef-client run that does everything except modify the system. Use why-run mode to understand why the chef-client makes the decisions that it makes and to learn more about the current and proposed state of the system.</dd> +</dl> +</div> +<div class="section" id="examples"> +<h2>Examples<a class="headerlink" href="#examples" title="Permalink to this headline">¶</a></h2> +<p><strong>Use a URL</strong></p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>chef-solo -c ~/solo.rb -j ~/node.json -r http://www.example.com/chef-solo.tar.gz +</pre></div> +</div> +<p>where <tt class="docutils literal"><span class="pre">-r</span></tt> uses the <strong>remote_file</strong> resource to retrieve the tar.gz archive into the <tt class="docutils literal"><span class="pre">file_cache_path</span></tt>, and then extract it to <tt class="docutils literal"><span class="pre">cookbooks_path</span></tt>.</p> +<p><strong>Use a directory</strong></p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>chef-solo -c ~/solo.rb -j ~/node.json +</pre></div> +</div> +<p>where the <tt class="docutils literal"><span class="pre">-r</span> <span class="pre">URL</span></tt> option is not used. chef-solo will look in the solo.rb file to determine the directory in which cookbooks are located.</p> +<p><strong>Use a URL for cookbook and JSON data</strong></p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>chef-solo -c ~/solo.rb -j http://www.example.com/node.json -r http://www.example.com/chef-solo.tar.gz +</pre></div> +</div> +<p>where <tt class="docutils literal"><span class="pre">-r</span></tt> corresponds to <tt class="docutils literal"><span class="pre">recipe_url</span></tt> and <tt class="docutils literal"><span class="pre">-j</span></tt> corresponds to <tt class="docutils literal"><span class="pre">json_attribs</span></tt>, both of which are configuration options in solo.rb.</p> +</div> +</div> + + + </div> + + </div> + + + <div class="clearer"></div> + </div> + + + + + </body> +</html>
\ No newline at end of file diff --git a/distro/common/html/index.html b/distro/common/html/index.html new file mode 100644 index 0000000000..b26dd0c476 --- /dev/null +++ b/distro/common/html/index.html @@ -0,0 +1,185 @@ + +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> + + +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> + + <title>chef-client Man Pages — chef-client Man Pages</title> + + <link rel="stylesheet" href="_static/guide.css" type="text/css" /> + <link rel="stylesheet" href="_static/pygments.css" type="text/css" /> + + <script type="text/javascript"> + var DOCUMENTATION_OPTIONS = { + URL_ROOT: '', + VERSION: '', + COLLAPSE_INDEX: false, + FILE_SUFFIX: '.html', + HAS_SOURCE: true + }; + </script> + <script type="text/javascript" src="_static/jquery.js"></script> + <script type="text/javascript" src="_static/underscore.js"></script> + <script type="text/javascript" src="_static/doctools.js"></script> + <link rel="shortcut icon" href="_static/chef.ico"/> + + + </head> + <body> +<div style="background-color: #212c35; text-align: left; padding: 0px 0px 0px 0px"> +<a href="http://docs.opscode.com/"><img src="_static/chef_html_logo.png" border="0" alt="Chef"/></a> +</div> + + + + + <div class="document"> + <div class="documentwrapper"> + + <div class="body"> + + <div class="section" id="chef-client-man-pages"> +<h1>chef-client Man Pages<a class="headerlink" href="#chef-client-man-pages" title="Permalink to this headline">¶</a></h1> +<p>The following command line interfaces are available in the chef-client:</p> +<ul class="simple"> +<li><a class="reference internal" href="ctl_chef_client.html"><em>chef-client</em></a></li> +<li><a class="reference internal" href="ctl_chef_server.html"><em>chef-server-ctl</em></a></li> +<li><a class="reference internal" href="ctl_chef_shell.html"><em>chef-shell</em></a></li> +<li><a class="reference internal" href="ctl_chef_solo.html"><em>chef-solo</em></a></li> +<li><a class="reference internal" href="knife.html"><em>knife</em></a></li> +</ul> +<div class="section" id="knife"> +<h2>knife<a class="headerlink" href="#knife" title="Permalink to this headline">¶</a></h2> +<p>Knife is a command-line tool that provides an interface between a local chef-repo and the server. Knife helps users to manage:</p> +<ul class="simple"> +<li>Nodes</li> +<li>Cookbooks and recipes</li> +<li>Roles</li> +<li>Stores of JSON data (data bags), including encrypted data</li> +<li>Environments</li> +<li>Cloud resources, including provisioning</li> +<li>The installation of the chef-client on management workstations</li> +<li>Searching of indexed data on the server</li> +</ul> +<p>The following sections describe functionality common to all Knife subcommands:</p> +<ul class="simple"> +<li><a class="reference internal" href="knife_using.html"><em>Working with Knife</em></a></li> +<li><a class="reference internal" href="knife_common_options.html"><em>Common Options</em></a></li> +</ul> +<p>Knife includes the following sub-commands:</p> +<table border="1" class="docutils"> +<colgroup> +<col width="25%" /> +<col width="75%" /> +</colgroup> +<thead valign="bottom"> +<tr class="row-odd"><th class="head">Sub-command</th> +<th class="head">Description</th> +</tr> +</thead> +<tbody valign="top"> +<tr class="row-even"><td><a class="reference internal" href="knife_bootstrap.html"><em>knife bootstrap</em></a></td> +<td>The <strong>knife bootstrap</strong> subcommand is used to run a bootstrap operation that installs the chef-client on the target system. The bootstrap operation must specify the IP address or FQDN of the target system.</td> +</tr> +<tr class="row-odd"><td><a class="reference internal" href="knife_client.html"><em>knife client</em></a></td> +<td>The <strong>knife client</strong> subcommand is used to manage an API client list and their associated RSA public key-pairs. This allows authentication requests to be made to the server by any entity that uses the Chef Server API, such as the chef-client and Knife.</td> +</tr> +<tr class="row-even"><td><a class="reference internal" href="knife_configure.html"><em>knife configure</em></a></td> +<td>The <strong>knife configure</strong> subcommand is used to create the knife.rb and client.rb files so that they can be distributed to workstations and nodes.</td> +</tr> +<tr class="row-odd"><td><a class="reference internal" href="knife_cookbook.html"><em>knife cookbook</em></a></td> +<td>The <strong>knife cookbook</strong> subcommand is used to interact with cookbooks that are located on the server or the local chef-repo.</td> +</tr> +<tr class="row-even"><td><a class="reference internal" href="knife_cookbook_site.html"><em>knife cookbook site</em></a></td> +<td>The <strong>knife cookbook site</strong> subcommand is used to interact with cookbooks that are located at <a class="reference external" href="https://cookbooks.opscode.com">https://cookbooks.opscode.com</a>. A user account is required for any community actions that write data to this site. The following arguments do not require a user account: <tt class="docutils literal"><span class="pre">download</span></tt>, <tt class="docutils literal"><span class="pre">search</span></tt>, <tt class="docutils literal"><span class="pre">install</span></tt>, and <tt class="docutils literal"><span class="pre">list</span></tt>.</td> +</tr> +<tr class="row-odd"><td><a class="reference internal" href="knife_data_bag.html"><em>knife data bag</em></a></td> +<td>The <strong>knife data bag</strong> subcommand is used to manage arbitrary stores of globally available JSON data.</td> +</tr> +<tr class="row-even"><td><a class="reference internal" href="knife_delete.html"><em>knife delete</em></a></td> +<td>The <strong>knife delete</strong> subcommand is used to delete an object from a server. This subcommand works similar to <tt class="docutils literal"><span class="pre">knife</span> <span class="pre">cookbook</span> <span class="pre">delete</span></tt>, <tt class="docutils literal"><span class="pre">knife</span> <span class="pre">data</span> <span class="pre">bag</span> <span class="pre">delete</span></tt>, <tt class="docutils literal"><span class="pre">knife</span> <span class="pre">environment</span> <span class="pre">delete</span></tt>, <tt class="docutils literal"><span class="pre">knife</span> <span class="pre">node</span> <span class="pre">delete</span></tt>, and <tt class="docutils literal"><span class="pre">knife</span> <span class="pre">role</span> <span class="pre">delete</span></tt>, but with a single verb (and a single action).</td> +</tr> +<tr class="row-odd"><td><a class="reference internal" href="knife_deps.html"><em>knife deps</em></a></td> +<td>The <strong>knife deps</strong> subcommand is used to identify dependencies for a node, role, or cookbook.</td> +</tr> +<tr class="row-even"><td><a class="reference internal" href="knife_diff.html"><em>knife diff</em></a></td> +<td>The <strong>knife diff</strong> subcommand is used to compare the differences between files and directories on the server and in the chef-repo. For example, to compare files on the server prior to an uploading or downloading files using the <tt class="docutils literal"><span class="pre">knife</span> <span class="pre">download</span></tt> and <tt class="docutils literal"><span class="pre">knife</span> <span class="pre">upload</span></tt> subcommands, or to ensure that certain files in multiple production environments are the same. This subcommand is similar to the <tt class="docutils literal"><span class="pre">git</span> <span class="pre">diff</span></tt> command that can be used to diff what is in the chef-repo with what is synced to a git repository.</td> +</tr> +<tr class="row-odd"><td><a class="reference internal" href="knife_download.html"><em>knife download</em></a></td> +<td>The <strong>knife download</strong> subcommand is used to download roles, cookbooks, environments, nodes, and data bags from the server to the current working directory. It can be used to back up data on the server, inspect the state of one or more files, or to extract out-of-process changes users may have made to files on the server, such as if a user made a change that bypassed version source control. This subcommand is often used in conjunction with <tt class="docutils literal"><span class="pre">knife</span> <span class="pre">diff</span></tt>, which can be used to see exactly what changes will be downloaded, and then <tt class="docutils literal"><span class="pre">knife</span> <span class="pre">upload</span></tt>, which does the opposite of <tt class="docutils literal"><span class="pre">knife</span> <span class="pre">download</span></tt>.</td> +</tr> +<tr class="row-even"><td><a class="reference internal" href="knife_edit.html"><em>knife edit</em></a></td> +<td>The <strong>knife edit</strong> subcommand is used to edit objects on the server. This subcommand works similar to <tt class="docutils literal"><span class="pre">knife</span> <span class="pre">cookbook</span> <span class="pre">edit</span></tt>, <tt class="docutils literal"><span class="pre">knife</span> <span class="pre">data</span> <span class="pre">bag</span> <span class="pre">edit</span></tt>, <tt class="docutils literal"><span class="pre">knife</span> <span class="pre">environment</span> <span class="pre">edit</span></tt>, <tt class="docutils literal"><span class="pre">knife</span> <span class="pre">node</span> <span class="pre">edit</span></tt>, and <tt class="docutils literal"><span class="pre">knife</span> <span class="pre">role</span> <span class="pre">edit</span></tt>, but with a single verb (and a single action).</td> +</tr> +<tr class="row-odd"><td><a class="reference internal" href="knife_environment.html"><em>knife environment</em></a></td> +<td>The <strong>knife environment</strong> subcommand is used to manage environments within a single organization on the server.</td> +</tr> +<tr class="row-even"><td><a class="reference internal" href="knife_exec.html"><em>knife exec</em></a></td> +<td>The <strong>knife exec</strong> subcommand uses the Knife configuration file to execute Ruby scripts in the context of a fully configured chef-client. This subcommand is most often used to run scripts that will only access server one time (or otherwise very infrequently). Use this subcommand any time that an operation does not warrant full usage of the Knife subcommand library.</td> +</tr> +<tr class="row-odd"><td><a class="reference internal" href="knife_index_rebuild.html"><em>knife index rebuild</em></a></td> +<td>The <strong>knife index rebuild</strong> subcommand is used to rebuild the search indexes for the open source server. This operation is destructive and may take some time.</td> +</tr> +<tr class="row-even"><td><a class="reference internal" href="knife_list.html"><em>knife list</em></a></td> +<td>The <strong>knife list</strong> subcommand is used to view a list of objects on the server. This subcommand works similar to <tt class="docutils literal"><span class="pre">knife</span> <span class="pre">cookbook</span> <span class="pre">list</span></tt>, <tt class="docutils literal"><span class="pre">knife</span> <span class="pre">data</span> <span class="pre">bag</span> <span class="pre">list</span></tt>, <tt class="docutils literal"><span class="pre">knife</span> <span class="pre">environment</span> <span class="pre">list</span></tt>, <tt class="docutils literal"><span class="pre">knife</span> <span class="pre">node</span> <span class="pre">list</span></tt>, and <tt class="docutils literal"><span class="pre">knife</span> <span class="pre">role</span> <span class="pre">list</span></tt>, but with a single verb (and a single action).</td> +</tr> +<tr class="row-odd"><td><a class="reference internal" href="knife_node.html"><em>knife node</em></a></td> +<td>The <strong>knife node</strong> subcommand is used to manage the nodes that exist on a server.</td> +</tr> +<tr class="row-even"><td><a class="reference internal" href="knife_raw.html"><em>knife raw</em></a></td> +<td>The <strong>knife raw</strong> subcommand is used to send a REST request to a specified path using the Chef Server API.</td> +</tr> +<tr class="row-odd"><td><a class="reference internal" href="knife_recipe_list.html"><em>knife recipe list</em></a></td> +<td>The <strong>knife recipe list</strong> subcommand is used to view all of the recipes that are on a server. A regular expression can be used to limit the results to recipes that match a specific pattern. The regular expression must be within quotes and not be surrounded by forward slashes (/).</td> +</tr> +<tr class="row-even"><td><a class="reference internal" href="knife_role.html"><em>knife role</em></a></td> +<td>The <strong>knife role</strong> subcommand is used to manage the roles that are associated with one or more nodes on a server.</td> +</tr> +<tr class="row-odd"><td><a class="reference internal" href="knife_search.html"><em>knife search</em></a></td> +<td>The <strong>knife search</strong> subcommand is used run a search query for information that is indexed on a server.</td> +</tr> +<tr class="row-even"><td><a class="reference internal" href="knife_show.html"><em>knife show</em></a></td> +<td>The <strong>knife show</strong> subcommand is used to view the details of one (or more) objects on the server. This subcommand works similar to <tt class="docutils literal"><span class="pre">knife</span> <span class="pre">cookbook</span> <span class="pre">show</span></tt>, <tt class="docutils literal"><span class="pre">knife</span> <span class="pre">data</span> <span class="pre">bag</span> <span class="pre">show</span></tt>, <tt class="docutils literal"><span class="pre">knife</span> <span class="pre">environment</span> <span class="pre">show</span></tt>, <tt class="docutils literal"><span class="pre">knife</span> <span class="pre">node</span> <span class="pre">show</span></tt>, and <tt class="docutils literal"><span class="pre">knife</span> <span class="pre">role</span> <span class="pre">show</span></tt>, but with a single verb (and a single action).</td> +</tr> +<tr class="row-odd"><td><a class="reference internal" href="knife_ssh.html"><em>knife ssh</em></a></td> +<td>The <strong>knife ssh</strong> subcommand is used to invoke SSH commands (in parallel) on a subset of nodes within an organization, based on the results of a search query.</td> +</tr> +<tr class="row-even"><td><a class="reference internal" href="knife_status.html"><em>knife status</em></a></td> +<td>The <strong>knife status</strong> subcommand is used to display a brief summary of the nodes on a server, including the time of the most recent successful chef-client run.</td> +</tr> +<tr class="row-odd"><td><a class="reference internal" href="knife_tag.html"><em>knife tag</em></a></td> +<td>The <strong>knife tag</strong> subcommand is used to apply tags to nodes on a server.</td> +</tr> +<tr class="row-even"><td><a class="reference internal" href="knife_upload.html"><em>knife upload</em></a></td> +<td>The <strong>knife upload</strong> subcommand is used to upload roles, cookbooks, environments, and data bags to the server from the current working directory in the chef-repo. This subcommand is often used in conjunction with <tt class="docutils literal"><span class="pre">knife</span> <span class="pre">diff</span></tt>, which can be used to see exactly what changes will be uploaded, and then <tt class="docutils literal"><span class="pre">knife</span> <span class="pre">download</span></tt>, which does the opposite of <tt class="docutils literal"><span class="pre">knife</span> <span class="pre">upload</span></tt>.</td> +</tr> +<tr class="row-odd"><td><a class="reference internal" href="knife_user.html"><em>knife user</em></a></td> +<td>The <strong>knife user</strong> subcommand is used to manage the list of users and their associated RSA public key-pairs.</td> +</tr> +<tr class="row-even"><td><a class="reference internal" href="knife_xargs.html"><em>knife xargs</em></a></td> +<td>The <strong>knife xargs</strong> subcommand is used to build and execute command lines against objects on a server using standard input.</td> +</tr> +</tbody> +</table> +<div class="toctree-wrapper compound"> +</div> +</div> +</div> + + + </div> + + </div> + + + <div class="clearer"></div> + </div> + + + + + </body> +</html>
\ No newline at end of file diff --git a/distro/common/html/knife-bootstrap.1.html b/distro/common/html/knife-bootstrap.1.html deleted file mode 100644 index 3fc53eb2f8..0000000000 --- a/distro/common/html/knife-bootstrap.1.html +++ /dev/null @@ -1,241 +0,0 @@ -<!DOCTYPE html> -<html> -<head> - <meta http-equiv='content-type' value='text/html;charset=utf8'> - <meta name='generator' value='Ronn/v0.7.3 (http://github.com/rtomayko/ronn/tree/0.7.3)'> - <title>knife-bootstrap(1) - Install Chef Client on a remote host</title> - <style type='text/css' media='all'> - /* style: man */ - body#manpage {margin:0} - .mp {max-width:100ex;padding:0 9ex 1ex 4ex} - .mp p,.mp pre,.mp ul,.mp ol,.mp dl {margin:0 0 20px 0} - .mp h2 {margin:10px 0 0 0} - .mp > p,.mp > pre,.mp > ul,.mp > ol,.mp > dl {margin-left:8ex} - .mp h3 {margin:0 0 0 4ex} - .mp dt {margin:0;clear:left} - .mp dt.flush {float:left;width:8ex} - .mp dd {margin:0 0 0 9ex} - .mp h1,.mp h2,.mp h3,.mp h4 {clear:left} - .mp pre {margin-bottom:20px} - .mp pre+h2,.mp pre+h3 {margin-top:22px} - .mp h2+pre,.mp h3+pre {margin-top:5px} - .mp img {display:block;margin:auto} - .mp h1.man-title {display:none} - .mp,.mp code,.mp pre,.mp tt,.mp kbd,.mp samp,.mp h3,.mp h4 {font-family:monospace;font-size:14px;line-height:1.42857142857143} - .mp h2 {font-size:16px;line-height:1.25} - .mp h1 {font-size:20px;line-height:2} - .mp {text-align:justify;background:#fff} - .mp,.mp code,.mp pre,.mp pre code,.mp tt,.mp kbd,.mp samp {color:#131211} - .mp h1,.mp h2,.mp h3,.mp h4 {color:#030201} - .mp u {text-decoration:underline} - .mp code,.mp strong,.mp b {font-weight:bold;color:#131211} - .mp em,.mp var {font-style:italic;color:#232221;text-decoration:none} - .mp a,.mp a:link,.mp a:hover,.mp a code,.mp a pre,.mp a tt,.mp a kbd,.mp a samp {color:#0000ff} - .mp b.man-ref {font-weight:normal;color:#434241} - .mp pre {padding:0 4ex} - .mp pre code {font-weight:normal;color:#434241} - .mp h2+pre,h3+pre {padding-left:0} - ol.man-decor,ol.man-decor li {margin:3px 0 10px 0;padding:0;float:left;width:33%;list-style-type:none;text-transform:uppercase;color:#999;letter-spacing:1px} - ol.man-decor {width:100%} - ol.man-decor li.tl {text-align:left} - ol.man-decor li.tc {text-align:center;letter-spacing:4px} - ol.man-decor li.tr {text-align:right;float:right} - </style> - <style type='text/css' media='all'> - /* style: toc */ - .man-navigation {display:block !important;position:fixed;top:0;left:113ex;height:100%;width:100%;padding:48px 0 0 0;border-left:1px solid #dbdbdb;background:#eee} - .man-navigation a,.man-navigation a:hover,.man-navigation a:link,.man-navigation a:visited {display:block;margin:0;padding:5px 2px 5px 30px;color:#999;text-decoration:none} - .man-navigation a:hover {color:#111;text-decoration:underline} - </style> -</head> -<!-- - The following styles are deprecated and will be removed at some point: - div#man, div#man ol.man, div#man ol.head, div#man ol.man. - - The .man-page, .man-decor, .man-head, .man-foot, .man-title, and - .man-navigation should be used instead. ---> -<body id='manpage'> - <div class='mp' id='man'> - - <div class='man-navigation' style='display:none'> - <a href="#NAME">NAME</a> - <a href="#SYNOPSIS">SYNOPSIS</a> - <a href="#DESCRIPTION">DESCRIPTION</a> - <a href="#EXAMPLES">EXAMPLES</a> - <a href="#BUGS">BUGS</a> - <a href="#SEE-ALSO">SEE ALSO</a> - <a href="#AUTHOR">AUTHOR</a> - <a href="#DOCUMENTATION">DOCUMENTATION</a> - <a href="#CHEF">CHEF</a> - </div> - - <ol class='man-decor man-head man head'> - <li class='tl'>knife-bootstrap(1)</li> - <li class='tc'>Chef Manual</li> - <li class='tr'>knife-bootstrap(1)</li> - </ol> - - <h2 id="NAME">NAME</h2> -<p class="man-name"> - <code>knife-bootstrap</code> - <span class="man-whatis">Install Chef Client on a remote host</span> -</p> - -<h2 id="SYNOPSIS">SYNOPSIS</h2> - -<p><strong>knife</strong> <strong>bootstrap</strong> <em>(options)</em></p> - -<dl> -<dt><code>-i</code>, <code>--identity-file IDENTITY_FILE</code></dt><dd>The SSH identity file used for authentication</dd> -<dt><code>-N</code>, <code>--node-name NAME</code></dt><dd>The Chef node name for your new node</dd> -<dt><code>-P</code>, <code>--ssh-password PASSWORD</code></dt><dd>The ssh password</dd> -<dt><code>-x</code>, <code>--ssh-user USERNAME</code></dt><dd>The ssh username</dd> -<dt><code>-p</code>, <code>--ssh-port PORT</code></dt><dd>The ssh port</dd> -<dt><code>--bootstrap-version VERSION</code></dt><dd>The version of Chef to install</dd> -<dt><code>--bootstrap-proxy PROXY_URL</code></dt><dd><code>The proxy server for the node being bootstrapped</code></dd> -<dt><code>--prerelease</code></dt><dd>Install pre-release Chef gems</dd> -<dt><code>-r</code>, <code>--run-list RUN_LIST</code></dt><dd>Comma separated list of roles/recipes to apply</dd> -<dt><code>--template-file TEMPLATE</code></dt><dd>Full path to location of template to use</dd> -<dt class="flush"><code>--sudo</code></dt><dd>Execute the bootstrap via sudo</dd> -<dt><code>-d</code>, <code>--distro DISTRO</code></dt><dd>Bootstrap a distro using a template</dd> -<dt><code>--[no-]host-key-verify</code></dt><dd>Enable host key verification, which is the default behavior.</dd> -<dt><code>--hint HINT_NAME[=HINT_FILE]</code></dt><dd>Provide the name of a hint (with option JSON file) to set for use by -Ohai plugins.</dd> -</dl> - - -<h2 id="DESCRIPTION">DESCRIPTION</h2> - -<p>Performs a Chef Bootstrap on the target node. The goal of the bootstrap -is to get Chef installed on the target system so it can run Chef Client -with a Chef Server. The main assumption is a baseline OS installation -exists. This sub-command is used internally by some cloud computing -plugins.</p> - -<p>The bootstrap sub-command supports supplying a template to perform the -bootstrap steps. If the distro is not specified (via <code>-d</code> or <code>--distro</code> -option), an Ubuntu 10.04 host bootstrapped with RubyGems is assumed. The -<strong>DISTRO</strong> value corresponds to the base filename of the template, in -other words <code>DISTRO</code>.erb. A template file can be specified with the -<code>--template-file</code> option in which case the <strong>DISTRO</strong> is not used. The -sub-command looks in the following locations for the template to use:</p> - -<ul> -<li><code>bootstrap</code> directory in the installed Chef Knife library.</li> -<li><code>bootstrap</code> directory in the <code>$PWD/.chef</code>.</li> -<li><code>bootstrap</code> directory in the users <code>$HOME/.chef</code>.</li> -</ul> - - -<p>The default bootstrap templates are scripts that get copied to the -target node (FQDN). The following distros are supported:</p> - -<ul> -<li>centos5-gems</li> -<li>fedora13-gems</li> -<li>ubuntu10.04-gems</li> -<li>ubuntu10.04-apt</li> -</ul> - - -<p>The gems installations will use RubyGems 1.3.6 and Chef installed as a -gem. The apt installation will use the Opscode APT repository.</p> - -<p>In addition to handling the software installation, these bootstrap -templates do the following:</p> - -<ul> -<li>Write the validation.pem per the local knife configuration.</li> -<li>Write a default config file for Chef (<code>/etc/chef/client.rb</code>) using values from the <code>knife.rb</code>.</li> -<li>Create a JSON attributes file containing the specified run list and run Chef.</li> -</ul> - - -<p>In the case of the RubyGems, the <code>client.rb</code> will be written from -scratch with a minimal set of values; see <strong>EXAMPLES</strong>. In the case of -APT Package installation, <code>client.rb</code> will have the -<code>validation_client_name</code> appended if it is not set to <code>chef-validator</code> -(default config value), and the <code>node_name</code> will be added if -<code>chef_node_name</code> option is specified.</p> - -<p>When this is complete, the bootstrapped node will have:</p> - -<ul> -<li>Latest Chef version installed from RubyGems or APT Packages from Opscode. This may be a later version than the local system.</li> -<li>Be validated with the configured Chef Server.</li> -<li>Have run Chef with its default run list if one is specfied.</li> -</ul> - - -<p>Additional custom bootstrap templates can be created and stored in -<code>.chef/bootstrap/DISTRO.erb</code>, replacing <strong>DISTRO</strong> with the value passed -with the <code>-d</code> or <code>--distro</code> option. See <strong>EXAMPLES</strong> for more -information.</p> - -<h2 id="EXAMPLES">EXAMPLES</h2> - -<p>Setting up a custom bootstrap is fairly straightforward. Create a -<code>.chef/bootstrap</code> directory in your Chef Repository or in -<code>$HOME/.chef/bootstrap</code>. Then create the ERB template file.</p> - -<pre><code>mkdir ~/.chef/bootstrap -vi ~/.chef/bootstrap/debian5.0-apt.erb -</code></pre> - -<p>For example, to create a new bootstrap template that should be used when -setting up a new Debian node. Edit the template to run the commands, set -up the validation certificate and the client configuration file, and -finally to run chef-client on completion. The bootstrap template can be -called with:</p> - -<pre><code>knife bootstrap mynode.example.com --template-file ~/.chef/bootstrap/debian5.0-apt.erb -</code></pre> - -<p>Or,</p> - -<pre><code>knife bootstrap mynode.example.com --distro debian5.0-apt -</code></pre> - -<p>The <code>--distro</code> parameter will automatically look in the -<code>~/.chef/bootstrap</code> directory for a file named <code>debian5.0-apt.erb</code>.</p> - -<p>Templates provided by the Chef installation are located in -<code>BASEDIR/lib/chef/knife/bootstrap/*.erb</code>, where <em>BASEDIR</em> is the -location where the package or Gem installed the Chef client libraries.</p> - -<h2 id="BUGS">BUGS</h2> - -<p><code>knife bootstrap</code> is not capable of bootstrapping multiple hosts in -parallel.</p> - -<p>The bootstrap script is passed as an argument to <span class="man-ref">sh<span class="s">(1)</span></span> on the remote -system, so sensitive information contained in the script will be visible -to other users via the process list using tools such as <span class="man-ref">ps<span class="s">(1)</span></span>.</p> - -<h2 id="SEE-ALSO">SEE ALSO</h2> - -<p> <strong>knife-ssh</strong>(1)</p> - -<h2 id="AUTHOR">AUTHOR</h2> - -<p> Chef was written by Adam Jacob <a href="mailto:adam@opscode.com" data-bare-link="true">adam@opscode.com</a> with many contributions from the community.</p> - -<h2 id="DOCUMENTATION">DOCUMENTATION</h2> - -<p> This manual page was written by Joshua Timberman <a href="mailto:joshua@opscode.com" data-bare-link="true">joshua@opscode.com</a>. - Permission is granted to copy, distribute and / or modify this document under the terms of the Apache 2.0 License.</p> - -<h2 id="CHEF">CHEF</h2> - -<p> Knife is distributed with Chef. <a href="http://wiki.opscode.com/display/chef/Home" data-bare-link="true">http://wiki.opscode.com/display/chef/Home</a></p> - - - <ol class='man-decor man-foot man foot'> - <li class='tl'>Chef 11.8.0</li> - <li class='tc'>October 2013</li> - <li class='tr'>knife-bootstrap(1)</li> - </ol> - - </div> -</body> -</html> diff --git a/distro/common/html/knife-client.1.html b/distro/common/html/knife-client.1.html deleted file mode 100644 index bcf03cb884..0000000000 --- a/distro/common/html/knife-client.1.html +++ /dev/null @@ -1,219 +0,0 @@ -<!DOCTYPE html> -<html> -<head> - <meta http-equiv='content-type' value='text/html;charset=utf8'> - <meta name='generator' value='Ronn/v0.7.3 (http://github.com/rtomayko/ronn/tree/0.7.3)'> - <title>knife-client(1) - Manage Chef API Clients</title> - <style type='text/css' media='all'> - /* style: man */ - body#manpage {margin:0} - .mp {max-width:100ex;padding:0 9ex 1ex 4ex} - .mp p,.mp pre,.mp ul,.mp ol,.mp dl {margin:0 0 20px 0} - .mp h2 {margin:10px 0 0 0} - .mp > p,.mp > pre,.mp > ul,.mp > ol,.mp > dl {margin-left:8ex} - .mp h3 {margin:0 0 0 4ex} - .mp dt {margin:0;clear:left} - .mp dt.flush {float:left;width:8ex} - .mp dd {margin:0 0 0 9ex} - .mp h1,.mp h2,.mp h3,.mp h4 {clear:left} - .mp pre {margin-bottom:20px} - .mp pre+h2,.mp pre+h3 {margin-top:22px} - .mp h2+pre,.mp h3+pre {margin-top:5px} - .mp img {display:block;margin:auto} - .mp h1.man-title {display:none} - .mp,.mp code,.mp pre,.mp tt,.mp kbd,.mp samp,.mp h3,.mp h4 {font-family:monospace;font-size:14px;line-height:1.42857142857143} - .mp h2 {font-size:16px;line-height:1.25} - .mp h1 {font-size:20px;line-height:2} - .mp {text-align:justify;background:#fff} - .mp,.mp code,.mp pre,.mp pre code,.mp tt,.mp kbd,.mp samp {color:#131211} - .mp h1,.mp h2,.mp h3,.mp h4 {color:#030201} - .mp u {text-decoration:underline} - .mp code,.mp strong,.mp b {font-weight:bold;color:#131211} - .mp em,.mp var {font-style:italic;color:#232221;text-decoration:none} - .mp a,.mp a:link,.mp a:hover,.mp a code,.mp a pre,.mp a tt,.mp a kbd,.mp a samp {color:#0000ff} - .mp b.man-ref {font-weight:normal;color:#434241} - .mp pre {padding:0 4ex} - .mp pre code {font-weight:normal;color:#434241} - .mp h2+pre,h3+pre {padding-left:0} - ol.man-decor,ol.man-decor li {margin:3px 0 10px 0;padding:0;float:left;width:33%;list-style-type:none;text-transform:uppercase;color:#999;letter-spacing:1px} - ol.man-decor {width:100%} - ol.man-decor li.tl {text-align:left} - ol.man-decor li.tc {text-align:center;letter-spacing:4px} - ol.man-decor li.tr {text-align:right;float:right} - </style> - <style type='text/css' media='all'> - /* style: toc */ - .man-navigation {display:block !important;position:fixed;top:0;left:113ex;height:100%;width:100%;padding:48px 0 0 0;border-left:1px solid #dbdbdb;background:#eee} - .man-navigation a,.man-navigation a:hover,.man-navigation a:link,.man-navigation a:visited {display:block;margin:0;padding:5px 2px 5px 30px;color:#999;text-decoration:none} - .man-navigation a:hover {color:#111;text-decoration:underline} - </style> -</head> -<!-- - The following styles are deprecated and will be removed at some point: - div#man, div#man ol.man, div#man ol.head, div#man ol.man. - - The .man-page, .man-decor, .man-head, .man-foot, .man-title, and - .man-navigation should be used instead. ---> -<body id='manpage'> - <div class='mp' id='man'> - - <div class='man-navigation' style='display:none'> - <a href="#NAME">NAME</a> - <a href="#SYNOPSIS">SYNOPSIS</a> - <a href="#SUB-COMMANDS">SUB-COMMANDS</a> - <a href="#BULK-DELETE">BULK DELETE</a> - <a href="#CREATE">CREATE</a> - <a href="#DELETE">DELETE</a> - <a href="#EDIT">EDIT</a> - <a href="#LIST">LIST</a> - <a href="#REREGISTER">REREGISTER</a> - <a href="#SHOW">SHOW</a> - <a href="#DESCRIPTION">DESCRIPTION</a> - <a href="#SEE-ALSO">SEE ALSO</a> - <a href="#AUTHOR">AUTHOR</a> - <a href="#DOCUMENTATION">DOCUMENTATION</a> - <a href="#CHEF">CHEF</a> - </div> - - <ol class='man-decor man-head man head'> - <li class='tl'>knife-client(1)</li> - <li class='tc'>Chef Manual</li> - <li class='tr'>knife-client(1)</li> - </ol> - - <h2 id="NAME">NAME</h2> -<p class="man-name"> - <code>knife-client</code> - <span class="man-whatis">Manage Chef API Clients</span> -</p> - -<h2 id="SYNOPSIS">SYNOPSIS</h2> - -<p><strong>knife</strong> <strong>client</strong> <em>sub-command</em> <em>(options)</em></p> - -<h2 id="SUB-COMMANDS">SUB-COMMANDS</h2> - -<p>Client subcommands follow a basic create, read, update, delete (CRUD) -pattern. The Following subcommands are available:</p> - -<h2 id="BULK-DELETE">BULK DELETE</h2> - -<p><strong>knife client bulk delete</strong> <em>regex</em> <em>(options)</em></p> - -<p>Delete clients where the client name matches the regular expression -<em>regex</em> on the Chef Server. The regular expression should be given as a -quoted string, and not surrounded by forward slashes.</p> - -<h2 id="CREATE">CREATE</h2> - -<p><strong>knife client create</strong> <em>client name</em> <em>(options)</em></p> - -<dl> -<dt><code>-a</code>, <code>--admin </code></dt><dd>Create the client as an admin</dd> -<dt><code>-f</code>, <code>--file FILE</code></dt><dd>Write the key to a file</dd> -</dl> - - -<p>Create a new client. This generates an RSA keypair. The private key will -be displayed on <em>STDOUT</em> or written to the named file. The public half -will be stored on the Server. For <em>chef-client</em> systems, the private key -should be copied to the system as <code>/etc/chef/client.pem</code>.</p> - -<p>Admin clients should be created for users that will use <em>knife</em> to -access the API as an administrator. The private key will generally be -copied to <code>~/.chef/client\_name.pem</code> and referenced in the <code>knife.rb</code> -configuration file.</p> - -<h2 id="DELETE">DELETE</h2> - -<p><strong>knife client delete</strong> <em>client name</em> <em>(options)</em></p> - -<p>Deletes a registered client.</p> - -<h2 id="EDIT">EDIT</h2> - -<p><strong>client edit</strong> <em>client name</em> <em>(options)</em></p> - -<p>Edit a registered client.</p> - -<h2 id="LIST">LIST</h2> - -<p><strong>client list</strong> <em>(options)</em></p> - -<dl> -<dt><code>-w</code>, <code>--with-uri</code></dt><dd> Show corresponding URIs</dd> -</dl> - - -<p>List all registered clients.</p> - -<h2 id="REREGISTER">REREGISTER</h2> - -<p><strong>client reregister</strong> <em>client name</em> <em>(options)</em></p> - -<dl> -<dt><code>-f</code>, <code>--file FILE</code></dt><dd>Write the key to a file</dd> -</dl> - - -<p>Regenerate the RSA keypair for a client. The public half will be stored -on the server and the private key displayed on <em>STDOUT</em> or written to -the named file. This operation will invalidate the previous keypair used -by the client, preventing it from authenticating with the Chef Server. -Use care when reregistering the validator client.</p> - -<h2 id="SHOW">SHOW</h2> - -<p><strong>client show</strong> <em>client name</em> <em>(options)</em></p> - -<dl> -<dt><code>-a</code>, <code>--attribute ATTR</code></dt><dd>Show only one attribute</dd> -</dl> - - -<p>Show a client. Output format is determined by the --format option.</p> - -<h2 id="DESCRIPTION">DESCRIPTION</h2> - -<p>Clients are identities used for communication with the Chef Server API, -roughly equivalent to user accounts on the Chef Server, except that -clients only communicate with the Chef Server API and are authenticated -via request signatures.</p> - -<p>In the typical case, there will be one client object on the server for -each node, and the corresponding client and node will have identical -names.</p> - -<p>In the Chef authorization model, there is one special client, the -"validator", which is authorized to create new non-administrative -clients but has minimal privileges otherwise. This identity is used as a -sort of "guest account" to create a client identity when initially -setting up a host for management with Chef.</p> - -<h2 id="SEE-ALSO">SEE ALSO</h2> - -<p> <strong>knife-node</strong>(1)</p> - -<h2 id="AUTHOR">AUTHOR</h2> - -<p> Chef was written by Adam Jacob <a href="mailto:adam@opscode.com" data-bare-link="true">adam@opscode.com</a> with many contributions from the community.</p> - -<h2 id="DOCUMENTATION">DOCUMENTATION</h2> - -<p> This manual page was written by Joshua Timberman <a href="mailto:joshua@opscode.com" data-bare-link="true">joshua@opscode.com</a>. - Permission is granted to copy, distribute and / or modify this document under the terms of the Apache 2.0 License.</p> - -<h2 id="CHEF">CHEF</h2> - -<p> Knife is distributed with Chef. <a href="http://wiki.opscode.com/display/chef/Home" data-bare-link="true">http://wiki.opscode.com/display/chef/Home</a></p> - - - <ol class='man-decor man-foot man foot'> - <li class='tl'>Chef 11.8.0</li> - <li class='tc'>October 2013</li> - <li class='tr'>knife-client(1)</li> - </ol> - - </div> -</body> -</html> diff --git a/distro/common/html/knife-configure.1.html b/distro/common/html/knife-configure.1.html deleted file mode 100644 index 91b20628ca..0000000000 --- a/distro/common/html/knife-configure.1.html +++ /dev/null @@ -1,170 +0,0 @@ -<!DOCTYPE html> -<html> -<head> - <meta http-equiv='content-type' value='text/html;charset=utf8'> - <meta name='generator' value='Ronn/v0.7.3 (http://github.com/rtomayko/ronn/tree/0.7.3)'> - <title>knife-configure(1) - Generate configuration files for knife or Chef Client</title> - <style type='text/css' media='all'> - /* style: man */ - body#manpage {margin:0} - .mp {max-width:100ex;padding:0 9ex 1ex 4ex} - .mp p,.mp pre,.mp ul,.mp ol,.mp dl {margin:0 0 20px 0} - .mp h2 {margin:10px 0 0 0} - .mp > p,.mp > pre,.mp > ul,.mp > ol,.mp > dl {margin-left:8ex} - .mp h3 {margin:0 0 0 4ex} - .mp dt {margin:0;clear:left} - .mp dt.flush {float:left;width:8ex} - .mp dd {margin:0 0 0 9ex} - .mp h1,.mp h2,.mp h3,.mp h4 {clear:left} - .mp pre {margin-bottom:20px} - .mp pre+h2,.mp pre+h3 {margin-top:22px} - .mp h2+pre,.mp h3+pre {margin-top:5px} - .mp img {display:block;margin:auto} - .mp h1.man-title {display:none} - .mp,.mp code,.mp pre,.mp tt,.mp kbd,.mp samp,.mp h3,.mp h4 {font-family:monospace;font-size:14px;line-height:1.42857142857143} - .mp h2 {font-size:16px;line-height:1.25} - .mp h1 {font-size:20px;line-height:2} - .mp {text-align:justify;background:#fff} - .mp,.mp code,.mp pre,.mp pre code,.mp tt,.mp kbd,.mp samp {color:#131211} - .mp h1,.mp h2,.mp h3,.mp h4 {color:#030201} - .mp u {text-decoration:underline} - .mp code,.mp strong,.mp b {font-weight:bold;color:#131211} - .mp em,.mp var {font-style:italic;color:#232221;text-decoration:none} - .mp a,.mp a:link,.mp a:hover,.mp a code,.mp a pre,.mp a tt,.mp a kbd,.mp a samp {color:#0000ff} - .mp b.man-ref {font-weight:normal;color:#434241} - .mp pre {padding:0 4ex} - .mp pre code {font-weight:normal;color:#434241} - .mp h2+pre,h3+pre {padding-left:0} - ol.man-decor,ol.man-decor li {margin:3px 0 10px 0;padding:0;float:left;width:33%;list-style-type:none;text-transform:uppercase;color:#999;letter-spacing:1px} - ol.man-decor {width:100%} - ol.man-decor li.tl {text-align:left} - ol.man-decor li.tc {text-align:center;letter-spacing:4px} - ol.man-decor li.tr {text-align:right;float:right} - </style> - <style type='text/css' media='all'> - /* style: toc */ - .man-navigation {display:block !important;position:fixed;top:0;left:113ex;height:100%;width:100%;padding:48px 0 0 0;border-left:1px solid #dbdbdb;background:#eee} - .man-navigation a,.man-navigation a:hover,.man-navigation a:link,.man-navigation a:visited {display:block;margin:0;padding:5px 2px 5px 30px;color:#999;text-decoration:none} - .man-navigation a:hover {color:#111;text-decoration:underline} - </style> -</head> -<!-- - The following styles are deprecated and will be removed at some point: - div#man, div#man ol.man, div#man ol.head, div#man ol.man. - - The .man-page, .man-decor, .man-head, .man-foot, .man-title, and - .man-navigation should be used instead. ---> -<body id='manpage'> - <div class='mp' id='man'> - - <div class='man-navigation' style='display:none'> - <a href="#NAME">NAME</a> - <a href="#SYNOPSIS">SYNOPSIS</a> - <a href="#DESCRIPTION">DESCRIPTION</a> - <a href="#CONFIGURE-SUBCOMMANDS">CONFIGURE SUBCOMMANDS</a> - <a href="#EXAMPLES">EXAMPLES</a> - <a href="#SEE-ALSO">SEE ALSO</a> - <a href="#AUTHOR">AUTHOR</a> - <a href="#DOCUMENTATION">DOCUMENTATION</a> - <a href="#CHEF">CHEF</a> - </div> - - <ol class='man-decor man-head man head'> - <li class='tl'>knife-configure(1)</li> - <li class='tc'>Chef Manual</li> - <li class='tr'>knife-configure(1)</li> - </ol> - - <h2 id="NAME">NAME</h2> -<p class="man-name"> - <code>knife-configure</code> - <span class="man-whatis">Generate configuration files for knife or Chef Client</span> -</p> - -<h2 id="SYNOPSIS">SYNOPSIS</h2> - -<p><strong>knife</strong> <strong>configure</strong> [client] <em>(options)</em></p> - -<h2 id="DESCRIPTION">DESCRIPTION</h2> - -<p>Generates a knife.rb configuration file interactively. When given the ---initial option, also creates a new administrative user.</p> - -<h2 id="CONFIGURE-SUBCOMMANDS">CONFIGURE SUBCOMMANDS</h2> - -<p><strong>knife configure</strong> <em>(options)</em></p> - -<dl> -<dt><code>-i</code>, <code>--initial</code></dt><dd>Create an initial API Client</dd> -<dt><code>-r</code>, <code>--repository REPO</code></dt><dd>The path to your chef-repo</dd> -</dl> - - -<p>Create a configuration file for knife. This will prompt for values to -enter into the file. Default values are listed in square brackets if no -other entry is typed. See <strong>knife</strong>(1) for a description of -configuration options.</p> - -<p><strong>knife configure client</strong> <em>directory</em></p> - -<p>Read the <em>knife.rb</em> config file and generate a config file suitable for -use in <em>/etc/chef/client.rb</em> and copy the validation certificate into -the specified <em>directory</em>.</p> - -<h2 id="EXAMPLES">EXAMPLES</h2> - -<ul> -<li><p>On a freshly installed Chef Server, use <em>knife configure -i</em> to -create an administrator and knife configuration file. Leave the -field blank to accept the default value. On most systems, the -default values are acceptable.</p> - -<p>user@host$ knife configure -i -Please enter the chef server URL: [http://localhost:4000] -Please enter a clientname for the new client: [username] -Please enter the existing admin clientname: [chef-webui] -Please enter the location of the existing admin client's private key: [/etc/chef/webui.pem] -Please enter the validation clientname: [chef-validator] -Please enter the location of the validation key: [/etc/chef/validation.pem] -Please enter the path to a chef repository (or leave blank): -Creating initial API user... -Created (or updated) client[username] -Configuration file written to /home/username/.chef/knife.rb</p> - -<p>This creates a new administrator client named <em>username</em>, writes -a configuration file to <em>/home/username/.chef/knife.rb</em>, and the -private key to <em>/home/username/.chef/username.pem</em>. The -configuration file and private key may be copied to another system -to facilitate administration of the Chef Server from a remote -system. Depending on the value given for the Chef Server URL, you -may need to modify that setting after copying to a remote host.</p></li> -</ul> - - -<h2 id="SEE-ALSO">SEE ALSO</h2> - -<p> <strong>knife</strong>(1) <strong>knife-client</strong>(1)</p> - -<h2 id="AUTHOR">AUTHOR</h2> - -<p> Chef was written by Adam Jacob <a href="mailto:adam@opscode.com" data-bare-link="true">adam@opscode.com</a> with many contributions from the community.</p> - -<h2 id="DOCUMENTATION">DOCUMENTATION</h2> - -<p> This manual page was written by Joshua Timberman <a href="mailto:joshua@opscode.com" data-bare-link="true">joshua@opscode.com</a>. - Permission is granted to copy, distribute and / or modify this document under the terms of the Apache 2.0 License.</p> - -<h2 id="CHEF">CHEF</h2> - -<p> Knife is distributed with Chef. <a href="http://wiki.opscode.com/display/chef/Home" data-bare-link="true">http://wiki.opscode.com/display/chef/Home</a></p> - - - <ol class='man-decor man-foot man foot'> - <li class='tl'>Chef 11.8.0</li> - <li class='tc'>October 2013</li> - <li class='tr'>knife-configure(1)</li> - </ol> - - </div> -</body> -</html> diff --git a/distro/common/html/knife-cookbook-site.1.html b/distro/common/html/knife-cookbook-site.1.html deleted file mode 100644 index 7750843314..0000000000 --- a/distro/common/html/knife-cookbook-site.1.html +++ /dev/null @@ -1,241 +0,0 @@ -<!DOCTYPE html> -<html> -<head> - <meta http-equiv='content-type' value='text/html;charset=utf8'> - <meta name='generator' value='Ronn/v0.7.3 (http://github.com/rtomayko/ronn/tree/0.7.3)'> - <title>knife-cookbook-site(1) - Install and update open source cookbooks</title> - <style type='text/css' media='all'> - /* style: man */ - body#manpage {margin:0} - .mp {max-width:100ex;padding:0 9ex 1ex 4ex} - .mp p,.mp pre,.mp ul,.mp ol,.mp dl {margin:0 0 20px 0} - .mp h2 {margin:10px 0 0 0} - .mp > p,.mp > pre,.mp > ul,.mp > ol,.mp > dl {margin-left:8ex} - .mp h3 {margin:0 0 0 4ex} - .mp dt {margin:0;clear:left} - .mp dt.flush {float:left;width:8ex} - .mp dd {margin:0 0 0 9ex} - .mp h1,.mp h2,.mp h3,.mp h4 {clear:left} - .mp pre {margin-bottom:20px} - .mp pre+h2,.mp pre+h3 {margin-top:22px} - .mp h2+pre,.mp h3+pre {margin-top:5px} - .mp img {display:block;margin:auto} - .mp h1.man-title {display:none} - .mp,.mp code,.mp pre,.mp tt,.mp kbd,.mp samp,.mp h3,.mp h4 {font-family:monospace;font-size:14px;line-height:1.42857142857143} - .mp h2 {font-size:16px;line-height:1.25} - .mp h1 {font-size:20px;line-height:2} - .mp {text-align:justify;background:#fff} - .mp,.mp code,.mp pre,.mp pre code,.mp tt,.mp kbd,.mp samp {color:#131211} - .mp h1,.mp h2,.mp h3,.mp h4 {color:#030201} - .mp u {text-decoration:underline} - .mp code,.mp strong,.mp b {font-weight:bold;color:#131211} - .mp em,.mp var {font-style:italic;color:#232221;text-decoration:none} - .mp a,.mp a:link,.mp a:hover,.mp a code,.mp a pre,.mp a tt,.mp a kbd,.mp a samp {color:#0000ff} - .mp b.man-ref {font-weight:normal;color:#434241} - .mp pre {padding:0 4ex} - .mp pre code {font-weight:normal;color:#434241} - .mp h2+pre,h3+pre {padding-left:0} - ol.man-decor,ol.man-decor li {margin:3px 0 10px 0;padding:0;float:left;width:33%;list-style-type:none;text-transform:uppercase;color:#999;letter-spacing:1px} - ol.man-decor {width:100%} - ol.man-decor li.tl {text-align:left} - ol.man-decor li.tc {text-align:center;letter-spacing:4px} - ol.man-decor li.tr {text-align:right;float:right} - </style> - <style type='text/css' media='all'> - /* style: toc */ - .man-navigation {display:block !important;position:fixed;top:0;left:113ex;height:100%;width:100%;padding:48px 0 0 0;border-left:1px solid #dbdbdb;background:#eee} - .man-navigation a,.man-navigation a:hover,.man-navigation a:link,.man-navigation a:visited {display:block;margin:0;padding:5px 2px 5px 30px;color:#999;text-decoration:none} - .man-navigation a:hover {color:#111;text-decoration:underline} - </style> -</head> -<!-- - The following styles are deprecated and will be removed at some point: - div#man, div#man ol.man, div#man ol.head, div#man ol.man. - - The .man-page, .man-decor, .man-head, .man-foot, .man-title, and - .man-navigation should be used instead. ---> -<body id='manpage'> - <div class='mp' id='man'> - - <div class='man-navigation' style='display:none'> - <a href="#NAME">NAME</a> - <a href="#SYNOPSIS">SYNOPSIS</a> - <a href="#COOKBOOK-SITE-SUB-COMMANDS">COOKBOOK SITE SUB-COMMANDS</a> - <a href="#INSTALL">INSTALL</a> - <a href="#DOWNLOAD">DOWNLOAD</a> - <a href="#LIST">LIST</a> - <a href="#SEARCH">SEARCH</a> - <a href="#SHARE">SHARE</a> - <a href="#UNSHARE">UNSHARE</a> - <a href="#SHOW">SHOW</a> - <a href="#DESCRIPTION">DESCRIPTION</a> - <a href="#EXAMPLES">EXAMPLES</a> - <a href="#SEE-ALSO">SEE ALSO</a> - <a href="#AUTHOR">AUTHOR</a> - <a href="#DOCUMENTATION">DOCUMENTATION</a> - <a href="#CHEF">CHEF</a> - </div> - - <ol class='man-decor man-head man head'> - <li class='tl'>knife-cookbook-site(1)</li> - <li class='tc'>Chef Manual</li> - <li class='tr'>knife-cookbook-site(1)</li> - </ol> - - <h2 id="NAME">NAME</h2> -<p class="man-name"> - <code>knife-cookbook-site</code> - <span class="man-whatis">Install and update open source cookbooks</span> -</p> - -<h2 id="SYNOPSIS">SYNOPSIS</h2> - -<p><strong>knife</strong> <strong>cookbook site</strong> <em>sub-command</em> <em>(options)</em></p> - -<h2 id="COOKBOOK-SITE-SUB-COMMANDS">COOKBOOK SITE SUB-COMMANDS</h2> - -<p><code>knife cookbook site</code> provides the following subcommands:</p> - -<h2 id="INSTALL">INSTALL</h2> - -<p><strong>cookbook site install COOKBOOK [VERSION]</strong> <em>(options)</em></p> - -<dl> -<dt><code>-D</code>, <code>--skip-dependencies</code></dt><dd>Skip automatic installation of dependencies.</dd> -<dt><code>-o</code>, <code>--cookbook-path PATH</code></dt><dd>Install cookbooks to PATH</dd> -<dt><code>-B</code>, <code>--branch BRANCH</code></dt><dd>Default branch to work with [defaults to master]</dd> -</dl> - - -<p>Uses <span class="man-ref">git<span class="s">(1)</span></span> version control in conjunction with the cookbook site to -install community contributed cookbooks to your local cookbook -repository. Running <code>knife cookbook site install</code> does the following:</p> - -<ol> -<li>A new "pristine copy" branch is created in git for tracking the -upstream;</li> -<li>All existing cookbooks are removed from the branch;</li> -<li>The cookbook is downloaded from the cookbook site in tarball form;</li> -<li>The downloaded cookbook is untarred, and its contents commited via git;</li> -<li>The pristine copy branch is merged into the master branch.</li> -</ol> - - -<p>By installing cookbook with this process, you can locally modify the -upstream cookbook in your master branch and let git maintain your -changes as a separate patch. When an updated upstream version becomes -available, you will be able to merge the upstream changes while -maintaining your local modifications.</p> - -<p>Unless <em>--skip-dependencies</em> is specified, the process is applied recursively to all the -cookbooks <em>COOKBOOK</em> depends on (via metadata <em>dependencies</em>).</p> - -<h2 id="DOWNLOAD">DOWNLOAD</h2> - -<p><strong>knife cookbook site download COOKBOOK [VERSION]</strong> <em>(options)</em></p> - -<dl> -<dt><code>-f</code>, <code>--file FILE</code></dt><dd>The filename to write to</dd> -<dt class="flush"><code>--force</code></dt><dd>Force download deprecated cookbook</dd> -</dl> - - -<p>Downloads a specific cookbook from the Community site, optionally -specifying a certain version.</p> - -<h2 id="LIST">LIST</h2> - -<p><strong>knife cookbook site list</strong> <em>(options)</em></p> - -<dl> -<dt><code>-w</code>, <code>--with-uri</code></dt><dd>Show corresponding URIs</dd> -</dl> - - -<p>Lists available cookbooks from the Community site.</p> - -<h2 id="SEARCH">SEARCH</h2> - -<p><strong>knife cookbook site search QUERY</strong> <em>(options)</em></p> - -<p>Searches for available cookbooks matching the specified query.</p> - -<h2 id="SHARE">SHARE</h2> - -<p><strong>knife cookbook site share COOKBOOK CATEGORY</strong> <em>(options)</em></p> - -<dl> -<dt><code>-k</code>, <code>--key KEY</code></dt><dd>API Client Key</dd> -<dt><code>-u</code>, <code>--user USER</code></dt><dd>API Client Username</dd> -<dt><code>-o</code>, <code>--cookbook-path PATH:PATH</code></dt><dd>A colon-separated path to look for cookbooks in</dd> -</dl> - - -<p>Uploads the specified cookbook using the given category to the Opscode -cookbooks site. Requires a login user and certificate for the Opscode -Cookbooks site. By default, knife will use the username and API key -you've configured in your configuration file; otherwise you must -explicitly set these values on the command line or use an alternate -configuration file.</p> - -<h2 id="UNSHARE">UNSHARE</h2> - -<p><strong>knife cookbook site unshare COOKBOOK</strong></p> - -<p>Stops sharing the specified cookbook on the Opscode cookbooks site.</p> - -<h2 id="SHOW">SHOW</h2> - -<p><strong>knife cookbook site show COOKBOOK [VERSION]</strong> <em>(options)</em></p> - -<p>Shows information from the site about a particular cookbook.</p> - -<h2 id="DESCRIPTION">DESCRIPTION</h2> - -<p>The cookbook site, <a href="http://community.opscode.com/" data-bare-link="true">http://community.opscode.com/</a>, is a cookbook -distribution service operated by Opscode. This service provides users -with a central location to publish cookbooks for sharing with other -community members.</p> - -<p><code>knife cookbook site</code> commands provide an interface to the cookbook -site's HTTP API. For commands that read data from the API, no account is -required. In order to upload cookbooks using the <code>knife cookbook site -share</code> command, you must create an account on the cookbook site and -configure your credentials via command line option or in your knife -configuration file.</p> - -<h2 id="EXAMPLES">EXAMPLES</h2> - -<p>Uploading cookbooks to the Opscode cookbooks site:</p> - -<pre><code>knife cookbook site share example Other -k ~/.chef/USERNAME.pem -u USERNAME -</code></pre> - -<h2 id="SEE-ALSO">SEE ALSO</h2> - -<p> <strong><span class="man-ref">knife-cookbook<span class="s">(1)</span></span></strong> - <a href="http://community.opscode.com/cookbooks" data-bare-link="true">http://community.opscode.com/cookbooks</a></p> - -<h2 id="AUTHOR">AUTHOR</h2> - -<p> Chef was written by Adam Jacob <a href="mailto:adam@opscode.com" data-bare-link="true">adam@opscode.com</a> with many contributions from the community.</p> - -<h2 id="DOCUMENTATION">DOCUMENTATION</h2> - -<p> This manual page was written by Joshua Timberman <a href="mailto:joshua@opscode.com" data-bare-link="true">joshua@opscode.com</a>. - Permission is granted to copy, distribute and / or modify this document under the terms of the Apache 2.0 License.</p> - -<h2 id="CHEF">CHEF</h2> - -<p> Knife is distributed with Chef. <a href="http://wiki.opscode.com/display/chef/Home" data-bare-link="true">http://wiki.opscode.com/display/chef/Home</a></p> - - - <ol class='man-decor man-foot man foot'> - <li class='tl'>Chef 11.8.0</li> - <li class='tc'>October 2013</li> - <li class='tr'>knife-cookbook-site(1)</li> - </ol> - - </div> -</body> -</html> diff --git a/distro/common/html/knife-cookbook.1.html b/distro/common/html/knife-cookbook.1.html deleted file mode 100644 index 3dbf299226..0000000000 --- a/distro/common/html/knife-cookbook.1.html +++ /dev/null @@ -1,381 +0,0 @@ -<!DOCTYPE html> -<html> -<head> - <meta http-equiv='content-type' value='text/html;charset=utf8'> - <meta name='generator' value='Ronn/v0.7.3 (http://github.com/rtomayko/ronn/tree/0.7.3)'> - <title>knife-cookbook(1) - upload and manage chef cookbooks</title> - <style type='text/css' media='all'> - /* style: man */ - body#manpage {margin:0} - .mp {max-width:100ex;padding:0 9ex 1ex 4ex} - .mp p,.mp pre,.mp ul,.mp ol,.mp dl {margin:0 0 20px 0} - .mp h2 {margin:10px 0 0 0} - .mp > p,.mp > pre,.mp > ul,.mp > ol,.mp > dl {margin-left:8ex} - .mp h3 {margin:0 0 0 4ex} - .mp dt {margin:0;clear:left} - .mp dt.flush {float:left;width:8ex} - .mp dd {margin:0 0 0 9ex} - .mp h1,.mp h2,.mp h3,.mp h4 {clear:left} - .mp pre {margin-bottom:20px} - .mp pre+h2,.mp pre+h3 {margin-top:22px} - .mp h2+pre,.mp h3+pre {margin-top:5px} - .mp img {display:block;margin:auto} - .mp h1.man-title {display:none} - .mp,.mp code,.mp pre,.mp tt,.mp kbd,.mp samp,.mp h3,.mp h4 {font-family:monospace;font-size:14px;line-height:1.42857142857143} - .mp h2 {font-size:16px;line-height:1.25} - .mp h1 {font-size:20px;line-height:2} - .mp {text-align:justify;background:#fff} - .mp,.mp code,.mp pre,.mp pre code,.mp tt,.mp kbd,.mp samp {color:#131211} - .mp h1,.mp h2,.mp h3,.mp h4 {color:#030201} - .mp u {text-decoration:underline} - .mp code,.mp strong,.mp b {font-weight:bold;color:#131211} - .mp em,.mp var {font-style:italic;color:#232221;text-decoration:none} - .mp a,.mp a:link,.mp a:hover,.mp a code,.mp a pre,.mp a tt,.mp a kbd,.mp a samp {color:#0000ff} - .mp b.man-ref {font-weight:normal;color:#434241} - .mp pre {padding:0 4ex} - .mp pre code {font-weight:normal;color:#434241} - .mp h2+pre,h3+pre {padding-left:0} - ol.man-decor,ol.man-decor li {margin:3px 0 10px 0;padding:0;float:left;width:33%;list-style-type:none;text-transform:uppercase;color:#999;letter-spacing:1px} - ol.man-decor {width:100%} - ol.man-decor li.tl {text-align:left} - ol.man-decor li.tc {text-align:center;letter-spacing:4px} - ol.man-decor li.tr {text-align:right;float:right} - </style> - <style type='text/css' media='all'> - /* style: toc */ - .man-navigation {display:block !important;position:fixed;top:0;left:113ex;height:100%;width:100%;padding:48px 0 0 0;border-left:1px solid #dbdbdb;background:#eee} - .man-navigation a,.man-navigation a:hover,.man-navigation a:link,.man-navigation a:visited {display:block;margin:0;padding:5px 2px 5px 30px;color:#999;text-decoration:none} - .man-navigation a:hover {color:#111;text-decoration:underline} - </style> -</head> -<!-- - The following styles are deprecated and will be removed at some point: - div#man, div#man ol.man, div#man ol.head, div#man ol.man. - - The .man-page, .man-decor, .man-head, .man-foot, .man-title, and - .man-navigation should be used instead. ---> -<body id='manpage'> - <div class='mp' id='man'> - - <div class='man-navigation' style='display:none'> - <a href="#NAME">NAME</a> - <a href="#SYNOPSIS">SYNOPSIS</a> - <a href="#SUB-COMMANDS">SUB-COMMANDS</a> - <a href="#LIST">LIST</a> - <a href="#SHOW">SHOW</a> - <a href="#UPLOAD">UPLOAD</a> - <a href="#DOWNLOAD">DOWNLOAD</a> - <a href="#DELETE">DELETE</a> - <a href="#BULK-DELETE">BULK DELETE</a> - <a href="#COOKBOOK-CREATE">COOKBOOK CREATE</a> - <a href="#METADATA">METADATA</a> - <a href="#METADATA-FROM-FILE">METADATA FROM FILE</a> - <a href="#TEST">TEST</a> - <a href="#RECIPE-LIST">RECIPE LIST</a> - <a href="#DESCRIPTION">DESCRIPTION</a> - <a href="#SEE-ALSO">SEE ALSO</a> - <a href="#AUTHOR">AUTHOR</a> - <a href="#DOCUMENTATION">DOCUMENTATION</a> - <a href="#CHEF">CHEF</a> - </div> - - <ol class='man-decor man-head man head'> - <li class='tl'>knife-cookbook(1)</li> - <li class='tc'>Chef Manual</li> - <li class='tr'>knife-cookbook(1)</li> - </ol> - - <h2 id="NAME">NAME</h2> -<p class="man-name"> - <code>knife-cookbook</code> - <span class="man-whatis">upload and manage chef cookbooks</span> -</p> - -<h2 id="SYNOPSIS">SYNOPSIS</h2> - -<p><strong>knife</strong> <strong>cookbook</strong> <em>sub-command</em> <em>(options)</em></p> - -<h2 id="SUB-COMMANDS">SUB-COMMANDS</h2> - -<p><code>knife cookbook</code> supports the following sub commands:</p> - -<h2 id="LIST">LIST</h2> - -<p><strong>knife cookbook list</strong> <em>(options)</em></p> - -<dl> -<dt><code>-a</code>, <code>--all</code></dt><dd>show all versions of a cookbook instead of just the most recent</dd> -<dt><code>-w</code>, <code>--with-uri</code></dt><dd>show corresponding uris</dd> -</dl> - - -<p>Lists the cookbooks available on the Chef server.</p> - -<h2 id="SHOW">SHOW</h2> - -<p><strong>knife cookbook show cookbook [version] [part] [filename]</strong> <em>(options)</em></p> - -<dl> -<dt><code>-f</code>, <code>--fqdn fqdn </code></dt><dd>the fqdn of the host to see the file for</dd> -<dt><code>-p</code>, <code>--platform platform </code></dt><dd>the platform to see the file for</dd> -<dt><code>-v</code>, <code>--platform-version version</code></dt><dd>the platform version to see the file for</dd> -<dt><code>-w</code>, <code>--with-uri</code></dt><dd>Show corresponding URIs</dd> -</dl> - - -<p>show a particular part of a <em>cookbook</em> for the specified <em>version</em>. <em>part</em> can be one of:</p> - -<ul> -<li><em>attributes</em></li> -<li><em>definitions</em></li> -<li><em>files</em></li> -<li><em>libraries</em></li> -<li><em>providers</em></li> -<li><em>recipes</em></li> -<li><em>resources</em></li> -<li><em>templates</em></li> -</ul> - - -<h2 id="UPLOAD">UPLOAD</h2> - -<p><strong>knife cookbook upload [cookbooks...]</strong> <em>(options)</em></p> - -<dl> -<dt><code>-a</code>, <code>--all</code></dt><dd>upload all cookbooks, rather than just a single cookbook</dd> -<dt><code>-o</code>, <code>--cookbook-path path:path</code></dt><dd>a colon-separated path to look for cookbooks in</dd> -<dt><code>-d</code>, <code>--upload-dependencies</code></dt><dd>Uploads additional cookbooks that this cookbook lists in as -dependencies in its metadata.</dd> -<dt><code>-E</code>, <code>--environment ENVIRONMENT</code></dt><dd>An <em>ENVIRONMENT</em> to apply the uploaded cookbooks to. Specifying this -option will cause knife to edit the <em>ENVIRONMENT</em> to place a strict -version constraint on the cookbook version(s) uploaded.</dd> -<dt><code>--freeze</code></dt><dd>Sets the frozen flag on the uploaded cookbook(s) Any future attempt -to modify the cookbook without changing the version number will -return an error unless --force is specified.</dd> -<dt class="flush"><code>--force</code></dt><dd>Overrides the frozen flag on a cookbook, allowing you to overwrite a -cookbook version that has previously been uploaded with the --freeze -option.</dd> -</dl> - - -<p>Uploads one or more cookbooks from your local cookbook repository(ies) -to the Chef Server. Only files that don't yet exist on the server will -be uploaded.</p> - -<p>As the command parses the name args as 1..n cookbook names: - <code>knife cookbook upload COOKBOOK COOKBOOK ...</code> -works for one to many cookbooks.</p> - -<h2 id="DOWNLOAD">DOWNLOAD</h2> - -<p><strong>knife cookbook download cookbook [version]</strong> <em>(options)</em></p> - -<dl> -<dt><code>-d</code>, <code>--dir download_directory</code></dt><dd>the directory to download the cookbook into</dd> -<dt><code>-f</code>, <code>--force</code></dt><dd>overwrite an existing directory with the download</dd> -<dt><code>-n</code>, <code>--latest</code></dt><dd>download the latest version of the cookbook</dd> -</dl> - - -<p>download a cookbook from the chef server. if no version is specified and -only one version exists on the server, that version will be downloaded. -if no version is specified and multiple versions are available on the -server, you will be prompted for a version to download.</p> - -<h2 id="DELETE">DELETE</h2> - -<p><strong>knife cookbook delete cookbook [version]</strong> <em>(options)</em></p> - -<dl> -<dt><code>-a</code>, <code>--all</code></dt><dd>delete all versions</dd> -<dt><code>-p</code>, <code>--purge</code></dt><dd>purge files from backing store. this will disable any cookbook that contains any of the same files as the cookbook being purged.</dd> -</dl> - - -<p>delete the specified <em>version</em> of the named <em>cookbook</em>. if no version is -specified, and only one version exists on the server, that version will -be deleted. if multiple versions are available on the server, you will -be prompted for a version to delete.</p> - -<h2 id="BULK-DELETE">BULK DELETE</h2> - -<p><strong>knife cookbook bulk delete regex</strong> <em>(options)</em></p> - -<dl> -<dt><code>-p</code>, <code>--purge</code></dt><dd>purge files from backing store. this will disable any cookbook that -contains any of the same files as the cookbook being purged.</dd> -</dl> - - -<p>delete cookbooks on the chef server based on a regular expression. the -regular expression (<em>regex</em>) should be in quotes, not in //'s.</p> - -<h2 id="COOKBOOK-CREATE">COOKBOOK CREATE</h2> - -<p><strong>knife cookbook create cookbook</strong> <em>(options)</em></p> - -<dl> -<dt><code>-o</code>, <code>--cookbook-path path</code></dt><dd>the directory where the cookbook will be created</dd> -<dt><code>-r</code>, <code>--readme-format format</code></dt><dd>format of the readme file md, mkd, txt, rdoc</dd> -<dt><code>-C</code>, <code>--copyright copyright</code></dt><dd>name of copyright holder</dd> -<dt><code>-i</code>, <code>--license license</code></dt><dd>license for cookbook, apachev2 or none</dd> -<dt><code>-m</code>, <code>--email email</code></dt><dd>email address of cookbook maintainer</dd> -</dl> - - -<p>this is a helper command that creates a new cookbook directory in the -<code>cookbook_path</code>. the following directories and files are created for the -named cookbook.</p> - -<ul> -<li>cookbook/attributes</li> -<li>cookbook/definitions</li> -<li>cookbook/files/default</li> -<li>cookbook/libraries</li> -<li>cookbook/metadata.rb</li> -<li>cookbook/providers</li> -<li>cookbook/readme.md</li> -<li>cookbook/recipes/default.rb</li> -<li>cookbook/resources</li> -<li>cookbook/templates/default</li> -</ul> - - -<p>supported readme formats are 'md' (default), 'mkd', 'txt', 'rdoc'. the -readme file will be written with the specified extension and a set of -helpful starting headers.</p> - -<p>specify <code>-C</code> or <code>--copyright</code> with the name of the copyright holder as -your name or your company/organization name in a quoted string. if this -value is not specified an all-caps string <code>your_company_name</code> is used -which can be easily changed with find/replace.</p> - -<p>specify <code>-i</code> or <code>--license</code> with the license that the cookbook is -distributed under for sharing with other people or posting to the -opscode cookbooks site. be aware of the licenses of files you put inside -the cookbook and follow any restrictions they describe. when using -<code>none</code> (default) or <code>apachev2</code>, comment header text and metadata file -are pre-filled. the <code>none</code> license will be treated as -non-redistributable.</p> - -<p>specify <code>-m</code> or <code>--email</code> with the email address of the cookbook's -maintainer. if this value is not specified, an all-caps string -<code>your_email</code> is used which can easily be changed with find/replace.</p> - -<p>the cookbook copyright, license, email and readme_format settings can be filled in the -<code>knife.rb</code>, for example with default values:</p> - -<pre><code>cookbook_copyright "your_company_name" -cookbook_license "none" -cookbook_email "your_email" -readme_format "md" -</code></pre> - -<h2 id="METADATA">METADATA</h2> - -<p><strong>knife cookbook metadata cookbook</strong> <em>(options)</em></p> - -<dl> -<dt><code>-a</code>, <code>--all</code></dt><dd>generate metadata for all cookbooks, rather than just a single cookbook</dd> -<dt><code>-o</code>, <code>--cookbook-path path:path</code></dt><dd>a colon-separated path to look for cookbooks in</dd> -</dl> - - -<p>generate cookbook metadata for the named <em>cookbook</em>. the <em>path</em> used here specifies where the cookbooks directory is located and corresponds to the <code>cookbook_path</code> configuration option.</p> - -<h2 id="METADATA-FROM-FILE">METADATA FROM FILE</h2> - -<p><strong>knife cookbook metadata from file</strong> <em>(options)</em></p> - -<p>load the cookbook metadata from a specified file.</p> - -<h2 id="TEST">TEST</h2> - -<p><strong>knife cookbook test [cookbooks...]</strong> <em>(options)</em></p> - -<dl> -<dt><code>-a</code>, <code>--all</code></dt><dd>test all cookbooks, rather than just a single cookbook</dd> -<dt><code>-o</code>, <code>--cookbook-path path:path</code></dt><dd>a colon-separated path to look for cookbooks in</dd> -</dl> - - -<p>test the specified cookbooks for syntax errors. this uses the built-in -ruby syntax checking option for files in the cookbook ending in <code>.rb</code>, -and the erb syntax check for files ending in <code>.erb</code> (templates).</p> - -<h2 id="RECIPE-LIST">RECIPE LIST</h2> - -<p><strong>knife recipe list [PATTERN]</strong></p> - -<p>List available recipes from the server. Specify <em>PATTERN</em> as a regular -expression to limit the results.</p> - -<h2 id="DESCRIPTION">DESCRIPTION</h2> - -<p>Cookbooks are the fundamental unit of distribution in Chef. They -encapsulate all recipes of resources and assets used to configure a -particular aspect of the infrastructure. The following sub-commands can -be used to manipulate the cookbooks stored on the Chef Server.</p> - -<p>On disk, cookbooks are directories with a defined structure. The -following directories may appear within a cookbook:</p> - -<dl> -<dt>COOKBOOK/attributes/</dt><dd>Ruby files that define default parameters to be used in recipes</dd> -<dt>COOKBOOK/definitions/</dt><dd>Ruby files that contain <em>resource definitions</em></dd> -<dt>COOKBOOK/files/SPECIFICITY</dt><dd>Files of arbitrary type. These files may be downloaded by -<span class="man-ref">chef-client<span class="s">(8)</span></span> when configuring a host.</dd> -<dt>COOKBOOK/libraries/</dt><dd>Ruby files that contain library code needed for recipes</dd> -<dt>COOKBOOK/providers/</dt><dd>Ruby files that contain Lightweight Provider definitions</dd> -<dt>COOKBOOK/recipes/</dt><dd>Ruby files that use Chef's recipe DSL to describe the desired -configuration of a system</dd> -<dt>COOKBOOK/resources/</dt><dd>Ruby files that contain Lightweight Resource definitions</dd> -<dt>COOKBOOK/templates/SPECIFICITY</dt><dd>ERuby (ERb) template files. These are referenced by <em>recipes</em> and -evaluated to dynamically generate configuration files.</dd> -</dl> - - -<p><strong>SPECIFICITY</strong> is a feature of <em>files</em> and <em>templates</em> that allow you -to specify alternate files to be used on a specific OS platform or host. -The default specificity setting is <em>default</em>, that is files in -<code>COOKBOOK/files/default</code> will be used when a more specific copy is not -available. Further documentation for this feature is available on the -Chef wiki: <a href="http://wiki.opscode.com/display/chef/File+Distribution#FileDistribution-FileSpecificity" data-bare-link="true">http://wiki.opscode.com/display/chef/File+Distribution#FileDistribution-FileSpecificity</a></p> - -<p>Cookbooks also contain a metadata file that defines various properties -of the cookbook. The most important of these are the <em>version</em> and the -<em>dependencies</em>. The <em>version</em> is used in combination with environments -to select which copy of a given cookbook is distributed to a node. The -<em>dependencies</em> are used by the server to determine which additional -cookbooks must be distributed to a given host when it requires a -cookbook.</p> - -<h2 id="SEE-ALSO">SEE ALSO</h2> - -<p> <strong><span class="man-ref">knife-environment<span class="s">(1)</span></span></strong> <strong><span class="man-ref">knife-cookbook-site<span class="s">(1)</span></span></strong> - <a href="http://wiki.opscode.com/display/chef/Cookbooks" data-bare-link="true">http://wiki.opscode.com/display/chef/Cookbooks</a> - <a href="http://wiki.opscode.com/display/chef/Metadata" data-bare-link="true">http://wiki.opscode.com/display/chef/Metadata</a></p> - -<h2 id="AUTHOR">AUTHOR</h2> - -<p> Chef was written by Adam Jacob <a href="mailto:adam@opscode.com" data-bare-link="true">adam@opscode.com</a> with many contributions from the community.</p> - -<h2 id="DOCUMENTATION">DOCUMENTATION</h2> - -<p> This manual page was written by Joshua Timberman <a href="mailto:joshua@opscode.com" data-bare-link="true">joshua@opscode.com</a>. - Permission is granted to copy, distribute and / or modify this document under the terms of the Apache 2.0 License.</p> - -<h2 id="CHEF">CHEF</h2> - -<p> Knife is distributed with Chef. <a href="http://wiki.opscode.com/display/chef/Home" data-bare-link="true">http://wiki.opscode.com/display/chef/Home</a></p> - - - <ol class='man-decor man-foot man foot'> - <li class='tl'>Chef 11.8.0</li> - <li class='tc'>October 2013</li> - <li class='tr'>knife-cookbook(1)</li> - </ol> - - </div> -</body> -</html> diff --git a/distro/common/html/knife-data-bag.1.html b/distro/common/html/knife-data-bag.1.html deleted file mode 100644 index 10edd68c45..0000000000 --- a/distro/common/html/knife-data-bag.1.html +++ /dev/null @@ -1,235 +0,0 @@ -<!DOCTYPE html> -<html> -<head> - <meta http-equiv='content-type' value='text/html;charset=utf8'> - <meta name='generator' value='Ronn/v0.7.3 (http://github.com/rtomayko/ronn/tree/0.7.3)'> - <title>knife-data-bag(1) - Store arbitrary data on a Chef Server</title> - <style type='text/css' media='all'> - /* style: man */ - body#manpage {margin:0} - .mp {max-width:100ex;padding:0 9ex 1ex 4ex} - .mp p,.mp pre,.mp ul,.mp ol,.mp dl {margin:0 0 20px 0} - .mp h2 {margin:10px 0 0 0} - .mp > p,.mp > pre,.mp > ul,.mp > ol,.mp > dl {margin-left:8ex} - .mp h3 {margin:0 0 0 4ex} - .mp dt {margin:0;clear:left} - .mp dt.flush {float:left;width:8ex} - .mp dd {margin:0 0 0 9ex} - .mp h1,.mp h2,.mp h3,.mp h4 {clear:left} - .mp pre {margin-bottom:20px} - .mp pre+h2,.mp pre+h3 {margin-top:22px} - .mp h2+pre,.mp h3+pre {margin-top:5px} - .mp img {display:block;margin:auto} - .mp h1.man-title {display:none} - .mp,.mp code,.mp pre,.mp tt,.mp kbd,.mp samp,.mp h3,.mp h4 {font-family:monospace;font-size:14px;line-height:1.42857142857143} - .mp h2 {font-size:16px;line-height:1.25} - .mp h1 {font-size:20px;line-height:2} - .mp {text-align:justify;background:#fff} - .mp,.mp code,.mp pre,.mp pre code,.mp tt,.mp kbd,.mp samp {color:#131211} - .mp h1,.mp h2,.mp h3,.mp h4 {color:#030201} - .mp u {text-decoration:underline} - .mp code,.mp strong,.mp b {font-weight:bold;color:#131211} - .mp em,.mp var {font-style:italic;color:#232221;text-decoration:none} - .mp a,.mp a:link,.mp a:hover,.mp a code,.mp a pre,.mp a tt,.mp a kbd,.mp a samp {color:#0000ff} - .mp b.man-ref {font-weight:normal;color:#434241} - .mp pre {padding:0 4ex} - .mp pre code {font-weight:normal;color:#434241} - .mp h2+pre,h3+pre {padding-left:0} - ol.man-decor,ol.man-decor li {margin:3px 0 10px 0;padding:0;float:left;width:33%;list-style-type:none;text-transform:uppercase;color:#999;letter-spacing:1px} - ol.man-decor {width:100%} - ol.man-decor li.tl {text-align:left} - ol.man-decor li.tc {text-align:center;letter-spacing:4px} - ol.man-decor li.tr {text-align:right;float:right} - </style> - <style type='text/css' media='all'> - /* style: toc */ - .man-navigation {display:block !important;position:fixed;top:0;left:113ex;height:100%;width:100%;padding:48px 0 0 0;border-left:1px solid #dbdbdb;background:#eee} - .man-navigation a,.man-navigation a:hover,.man-navigation a:link,.man-navigation a:visited {display:block;margin:0;padding:5px 2px 5px 30px;color:#999;text-decoration:none} - .man-navigation a:hover {color:#111;text-decoration:underline} - </style> -</head> -<!-- - The following styles are deprecated and will be removed at some point: - div#man, div#man ol.man, div#man ol.head, div#man ol.man. - - The .man-page, .man-decor, .man-head, .man-foot, .man-title, and - .man-navigation should be used instead. ---> -<body id='manpage'> - <div class='mp' id='man'> - - <div class='man-navigation' style='display:none'> - <a href="#NAME">NAME</a> - <a href="#SYNOPSIS">SYNOPSIS</a> - <a href="#DESCRIPTION">DESCRIPTION</a> - <a href="#DATA-BAG-SUB-COMMANDS">DATA BAG SUB-COMMANDS</a> - <a href="#CREATE">CREATE</a> - <a href="#DELETE">DELETE</a> - <a href="#EDIT">EDIT</a> - <a href="#FROM-FILE">FROM FILE</a> - <a href="#LIST">LIST</a> - <a href="#SHOW">SHOW</a> - <a href="#ENCRYPTION-SUPPORT">ENCRYPTION SUPPORT</a> - <a href="#SEE-ALSO">SEE ALSO</a> - <a href="#AUTHOR">AUTHOR</a> - <a href="#DOCUMENTATION">DOCUMENTATION</a> - <a href="#CHEF">CHEF</a> - </div> - - <ol class='man-decor man-head man head'> - <li class='tl'>knife-data-bag(1)</li> - <li class='tc'>Chef Manual</li> - <li class='tr'>knife-data-bag(1)</li> - </ol> - - <h2 id="NAME">NAME</h2> -<p class="man-name"> - <code>knife-data-bag</code> - <span class="man-whatis">Store arbitrary data on a Chef Server</span> -</p> - -<h2 id="SYNOPSIS">SYNOPSIS</h2> - -<p><strong>knife</strong> <strong>data bag</strong> <em>sub-command</em> <em>(options)</em></p> - -<h2 id="DESCRIPTION">DESCRIPTION</h2> - -<p>Data bags are stores of arbitrary JSON data. Each data bag is a -collection that may contain many items. Data Bag Items are indexed by -the Chef Server and can be searched via <strong>knife-search</strong>(1).</p> - -<p>Data bags are available to all nodes configured by <strong>chef-client</strong>(8), -and are therefore a convenient mechanism to store global information, -such as lists of administrative accounts that should be configured on -all hosts.</p> - -<h2 id="DATA-BAG-SUB-COMMANDS">DATA BAG SUB-COMMANDS</h2> - -<h2 id="CREATE">CREATE</h2> - -<p><strong>knife data bag create</strong> <em>bag name</em> [item id] <em>(options)</em></p> - -<dl> -<dt><code>-s</code>, <code>--secret SECRET</code></dt><dd>A secret key used to encrypt the data bag item. See <strong>encryption support</strong> below.</dd> -<dt><code>--secret-file SECRET_FILE</code></dt><dd>The path to a file containing the secret key to be used to encrypt -the data bag item.</dd> -</dl> - - -<p>If <em>item id</em> is given, creates a new, empty data bag item and opens it for -editing in your editor. The data bag will be created if it does not -exist.</p> - -<p>If <em>item id</em> is not given, the data bag will be created.</p> - -<h2 id="DELETE">DELETE</h2> - -<p><strong>knife data bag delete</strong> <em>bag name</em> [item id] <em>(options)</em></p> - -<p>Delete a data bag, or an item from a data bag.</p> - -<h2 id="EDIT">EDIT</h2> - -<p><strong>knife data bag edit</strong> <em>bag name</em> <em>item id</em> <em>(options)</em></p> - -<dl> -<dt><code>-s</code>, <code>--secret SECRET</code></dt><dd>A secret key used to encrypt the data bag item. See <strong>encryption support</strong> below.</dd> -<dt><code>--secret-file SECRET_FILE</code></dt><dd>The path to a file containing the secret key to be used to encrypt -the data bag item.</dd> -</dl> - - -<p>Edit an item in a data bag.</p> - -<h2 id="FROM-FILE">FROM FILE</h2> - -<p><strong>knife data bag from file</strong> <em>bag name</em> <em>file</em> <em>(options)</em></p> - -<p><strong>knife data bag from file</strong> <em>bag name</em> <em>file1</em> <em>file2</em> <em>file3</em> <em>(options)</em></p> - -<p><strong>knife data bag from file</strong> <em>bag name</em> <em>folder</em> <em>(options)</em></p> - -<dl> -<dt><code>-s</code>, <code>--secret SECRET</code></dt><dd>A secret key used to encrypt the data bag item. See <strong>encryption support</strong> below.</dd> -<dt><code>--secret-file SECRET_FILE</code></dt><dd>The path to a file containing the secret key to be used to encrypt -the data bag item.</dd> -</dl> - - -<p>Load a data bag item from a JSON file. If <em>file</em> is a relative or -absolute path to the file, that file will be used. Otherwise, the <em>file</em> -parameter is treated as the base name of a data bag file in a Chef -repository, and <code>knife</code> will search for the file in -<code>./data_bags/bag_name/file</code>. For example <code>knife data bag from file users -dan.json</code> would attempt to load the file <code>./data_bags/users/dan.json</code>.</p> - -<h2 id="LIST">LIST</h2> - -<p><strong>knife data bag list</strong> <em>(options)</em></p> - -<dl> -<dt><code>-w</code>, <code>--with-uri</code></dt><dd>Show corresponding URIs</dd> -</dl> - - -<p>Lists the data bags that exist on the Chef Server.</p> - -<h2 id="SHOW">SHOW</h2> - -<p><strong>knife data bag show BAG [ITEM]</strong> <em>(options)</em></p> - -<dl> -<dt><code>-s</code>, <code>--secret SECRET</code></dt><dd>A secret key used to encrypt the data bag item. See <strong>encryption support</strong> below.</dd> -<dt><code>--secret-file SECRET_FILE</code></dt><dd>The path to a file containing the secret key to be used to encrypt -the data bag item.</dd> -</dl> - - -<p>Show a specific data bag or an item in a data bag. The output will be -formatted according to the --format option.</p> - -<h2 id="ENCRYPTION-SUPPORT">ENCRYPTION SUPPORT</h2> - -<p>Data Bag Items may be encrypted to keep their contents secret. This may -be desireable when storing sensitive information such as database -passwords, API keys, etc.</p> - -<p>Data Bag Item encryption uses the AES-256 CBC symmetric key algorithm.</p> - -<p><strong>CAVEATS:</strong> Keys are not encrypted; only values are encrypted. The "id" -of a Data Bag Item is not encrypted, since it is used by Chef Server to -store the item in its database. For example, given the following data bag item: - {"id": "important_passwords", "secret_password": "opensesame"} -The key "secret_password" will be visible to an evesdropper, but the -value "opensesame" will be protected. Both the key "id" and its value -"important_passwords" will be visible to an evesdropper.</p> - -<p>Chef Server does not provide a secure mechanism for distributing -encryption keys.</p> - -<h2 id="SEE-ALSO">SEE ALSO</h2> - -<p> <strong>knife-search</strong>(1)</p> - -<h2 id="AUTHOR">AUTHOR</h2> - -<p> Chef was written by Adam Jacob <a href="mailto:adam@opscode.com" data-bare-link="true">adam@opscode.com</a> with many contributions from the community.</p> - -<h2 id="DOCUMENTATION">DOCUMENTATION</h2> - -<p> This manual page was written by Joshua Timberman <a href="mailto:joshua@opscode.com" data-bare-link="true">joshua@opscode.com</a>. - Permission is granted to copy, distribute and / or modify this document under the terms of the Apache 2.0 License.</p> - -<h2 id="CHEF">CHEF</h2> - -<p> Knife is distributed with Chef. http://wiki.opscode.com/display/chef/Home</p> - - - <ol class='man-decor man-foot man foot'> - <li class='tl'>Chef 11.8.0</li> - <li class='tc'>October 2013</li> - <li class='tr'>knife-data-bag(1)</li> - </ol> - - </div> -</body> -</html> diff --git a/distro/common/html/knife-environment.1.html b/distro/common/html/knife-environment.1.html deleted file mode 100644 index b0465b29b6..0000000000 --- a/distro/common/html/knife-environment.1.html +++ /dev/null @@ -1,265 +0,0 @@ -<!DOCTYPE html> -<html> -<head> - <meta http-equiv='content-type' value='text/html;charset=utf8'> - <meta name='generator' value='Ronn/v0.7.3 (http://github.com/rtomayko/ronn/tree/0.7.3)'> - <title>knife-environment(1) - Define cookbook policies for the environments in your infrastructure</title> - <style type='text/css' media='all'> - /* style: man */ - body#manpage {margin:0} - .mp {max-width:100ex;padding:0 9ex 1ex 4ex} - .mp p,.mp pre,.mp ul,.mp ol,.mp dl {margin:0 0 20px 0} - .mp h2 {margin:10px 0 0 0} - .mp > p,.mp > pre,.mp > ul,.mp > ol,.mp > dl {margin-left:8ex} - .mp h3 {margin:0 0 0 4ex} - .mp dt {margin:0;clear:left} - .mp dt.flush {float:left;width:8ex} - .mp dd {margin:0 0 0 9ex} - .mp h1,.mp h2,.mp h3,.mp h4 {clear:left} - .mp pre {margin-bottom:20px} - .mp pre+h2,.mp pre+h3 {margin-top:22px} - .mp h2+pre,.mp h3+pre {margin-top:5px} - .mp img {display:block;margin:auto} - .mp h1.man-title {display:none} - .mp,.mp code,.mp pre,.mp tt,.mp kbd,.mp samp,.mp h3,.mp h4 {font-family:monospace;font-size:14px;line-height:1.42857142857143} - .mp h2 {font-size:16px;line-height:1.25} - .mp h1 {font-size:20px;line-height:2} - .mp {text-align:justify;background:#fff} - .mp,.mp code,.mp pre,.mp pre code,.mp tt,.mp kbd,.mp samp {color:#131211} - .mp h1,.mp h2,.mp h3,.mp h4 {color:#030201} - .mp u {text-decoration:underline} - .mp code,.mp strong,.mp b {font-weight:bold;color:#131211} - .mp em,.mp var {font-style:italic;color:#232221;text-decoration:none} - .mp a,.mp a:link,.mp a:hover,.mp a code,.mp a pre,.mp a tt,.mp a kbd,.mp a samp {color:#0000ff} - .mp b.man-ref {font-weight:normal;color:#434241} - .mp pre {padding:0 4ex} - .mp pre code {font-weight:normal;color:#434241} - .mp h2+pre,h3+pre {padding-left:0} - ol.man-decor,ol.man-decor li {margin:3px 0 10px 0;padding:0;float:left;width:33%;list-style-type:none;text-transform:uppercase;color:#999;letter-spacing:1px} - ol.man-decor {width:100%} - ol.man-decor li.tl {text-align:left} - ol.man-decor li.tc {text-align:center;letter-spacing:4px} - ol.man-decor li.tr {text-align:right;float:right} - </style> - <style type='text/css' media='all'> - /* style: toc */ - .man-navigation {display:block !important;position:fixed;top:0;left:113ex;height:100%;width:100%;padding:48px 0 0 0;border-left:1px solid #dbdbdb;background:#eee} - .man-navigation a,.man-navigation a:hover,.man-navigation a:link,.man-navigation a:visited {display:block;margin:0;padding:5px 2px 5px 30px;color:#999;text-decoration:none} - .man-navigation a:hover {color:#111;text-decoration:underline} - </style> -</head> -<!-- - The following styles are deprecated and will be removed at some point: - div#man, div#man ol.man, div#man ol.head, div#man ol.man. - - The .man-page, .man-decor, .man-head, .man-foot, .man-title, and - .man-navigation should be used instead. ---> -<body id='manpage'> - <div class='mp' id='man'> - - <div class='man-navigation' style='display:none'> - <a href="#NAME">NAME</a> - <a href="#SYNOPSIS">SYNOPSIS</a> - <a href="#SUBCOMMANDS">SUBCOMMANDS</a> - <a href="#CREATE">CREATE</a> - <a href="#DELETE">DELETE</a> - <a href="#EDIT">EDIT</a> - <a href="#FROM-FILE">FROM FILE</a> - <a href="#LIST">LIST</a> - <a href="#SHOW">SHOW</a> - <a href="#DESCRIPTION">DESCRIPTION</a> - <a href="#SYNTAX">SYNTAX</a> - <a href="#FORMAT">FORMAT</a> - <a href="#SEE-ALSO">SEE ALSO</a> - <a href="#AUTHOR">AUTHOR</a> - <a href="#DOCUMENTATION">DOCUMENTATION</a> - <a href="#CHEF">CHEF</a> - </div> - - <ol class='man-decor man-head man head'> - <li class='tl'>knife-environment(1)</li> - <li class='tc'>Chef Manual</li> - <li class='tr'>knife-environment(1)</li> - </ol> - - <h2 id="NAME">NAME</h2> -<p class="man-name"> - <code>knife-environment</code> - <span class="man-whatis">Define cookbook policies for the environments in your infrastructure</span> -</p> - -<h2 id="SYNOPSIS">SYNOPSIS</h2> - -<p><strong>knife</strong> <strong>environment</strong> <em>sub-command</em> <em>(options)</em></p> - -<h2 id="SUBCOMMANDS">SUBCOMMANDS</h2> - -<p>Environment subcommands follow a basic create, read, update, delete -(CRUD) pattern. The following subcommands are available:</p> - -<h2 id="CREATE">CREATE</h2> - -<p><strong>knife environment create</strong> <em>environment</em> <em>(options)</em></p> - -<dl> -<dt><code>-d</code>, <code>--description DESCRIPTION</code></dt><dd>The value of the description field.</dd> -</dl> - - -<p>Create a new environment object on the Chef Server. The envrionment will -be opened in the text editor for editing prior to creation if the -n -option is not present.</p> - -<h2 id="DELETE">DELETE</h2> - -<p><strong>knife environment delete</strong> <em>environment</em> <em>(options)</em></p> - -<p>Destroy an environment on the Chef Server. A prompt for confirmation -will be displayed if the -y options is not given.</p> - -<h2 id="EDIT">EDIT</h2> - -<p><strong>knife environment edit</strong> <em>environment</em> <em>(options)</em></p> - -<p>Fetch <em>environment</em> and display it in the text editor for editing. The -environment will be saved to the Chef Server when the editing session -exits.</p> - -<h2 id="FROM-FILE">FROM FILE</h2> - -<p><strong>knife environment from file</strong> <em>file</em> <em>(options)</em></p> - -<p>Create or update an environment from the JSON or Ruby format <em>file</em>. See -<strong>format</strong> for the proper format of this file.</p> - -<h2 id="LIST">LIST</h2> - -<p><strong>knife environment list</strong> <em>(options)</em> - * <code>-w</code>, <code>--with-uri</code>: - Show the resource URI for each environment</p> - -<h2 id="SHOW">SHOW</h2> - -<p><strong>knife environment show</strong> <em>environment</em> <em>(options)</em></p> - -<h2 id="DESCRIPTION">DESCRIPTION</h2> - -<p>Environments provide a means to apply policies to hosts in your -infrastructure based on business function. For example, you may have a -separate copy of your infrastructure called "dev" that runs the latest -version of your application and should use the newest versions of your -cookbooks when configuring systems, and a production instance of your -infrastructure where you wish to update code and cookbooks in a more -controlled fashion. In Chef, this function is implemented with -<em>environments</em>.</p> - -<p>Environments contain two major components: a set of cookbook version -constraints and environment attributes.</p> - -<h2 id="SYNTAX">SYNTAX</h2> - -<p>A cookbook version constraint is comprised of a <em>cookbook name</em> and a -<em>version constraint</em>. The <em>cookbook name</em> is the name of a cookbook in -your system, and the <em>version constraint</em> is a String describing the -version(s) of that cookbook allowed in the environment. Only one -<em>version constraint</em> is supported for a given <em>cookbook name</em>.</p> - -<p>The exact syntax used to define a cookbook version constraint varies -depending on whether you use the JSON format or the Ruby format. In the -JSON format, the cookbook version constraints for an environment are -represented as a single JSON object, like this:</p> - -<pre><code>{"apache2": ">= 1.5.0"} -</code></pre> - -<p>In the Ruby format, the cookbook version contraints for an environment -are represented as a Ruby Hash, like this:</p> - -<pre><code>{"apache2" => ">= 1.5.0"} -</code></pre> - -<p>A <em>version number</em> is a String comprised of two or three digits -separated by a dot (.) character, or in other words, strings of the form -"major.minor" or "major.minor.patch". "1.2" and "1.2.3" are examples of -valid version numbers. Version numbers containing more than three digits -or alphabetic characters are not supported.</p> - -<p>A <em>version constraint</em> String is composed of an <em>operator</em> and a -<em>version number</em>. The following operators are available:</p> - -<dl> -<dt><code>= VERSION</code></dt><dd>Equality. Only the exact version specified may be used.</dd> -<dt><code>> VERSION</code></dt><dd>Greater than. Only versions greater than <code>VERSION</code> may be used.</dd> -<dt><code>>= VERSION</code></dt><dd>Greater than or equal to. Only versions equal to VERSION or greater -may be used.</dd> -<dt><code>< VERSION</code></dt><dd>Less than. Only versions less than VERSION may be used.</dd> -<dt><code><= VERSION</code></dt><dd>Less than or equal to. Only versions lesser or equal to VERSION may -be used.</dd> -<dt><code>~> VERSION</code></dt><dd>Pessimistic greater than. Depending on the number of components in -the given VERSION, the constraint will be optimistic about future -minor or patch revisions only. For example, <code>~> 1.1</code> will match any -version less than <code>2.0</code> and greater than or equal to <code>1.1.0</code>, -whereas <code>~> 2.0.5</code> will match any version less than <code>2.1.0</code> and -greater than or equal to <code>2.0.5</code>.</dd> -</dl> - - -<h2 id="FORMAT">FORMAT</h2> - -<p>The JSON format of an envioronment is as follows:</p> - -<pre><code>{ - "name": "dev", - "description": "The development environment", - "cookbook_versions": { - "couchdb": "= 11.0.0" - }, - "json_class": "Chef::Environment", - "chef_type": "environment", - "default_attributes": { - "apache2": { "listen_ports": [ "80", "443" ] } - }, - "override_attributes": { - "aws_s3_bucket": "production" - } -} -</code></pre> - -<p>The Ruby format of an environment is as follows:</p> - -<pre><code>name "dev" -description "The development environment" -cookbook_versions "couchdb" => "= 11.0.0" -default_attributes "apache2" => { "listen_ports" => [ "80", "443" ] } -override_attributes "aws_s3_bucket" => "production" -</code></pre> - -<h2 id="SEE-ALSO">SEE ALSO</h2> - -<p> <strong><span class="man-ref">knife-node<span class="s">(1)</span></span></strong> <strong><span class="man-ref">knife-cookbook<span class="s">(1)</span></span></strong> <strong><span class="man-ref">knife-role<span class="s">(1)</span></span></strong> - <a href="http://wiki.opscode.com/display/chef/Environments" data-bare-link="true">http://wiki.opscode.com/display/chef/Environments</a> - <a href="http://wiki.opscode.com/display/chef/Version+Constraints" data-bare-link="true">http://wiki.opscode.com/display/chef/Version+Constraints</a></p> - -<h2 id="AUTHOR">AUTHOR</h2> - -<p> Chef was written by Adam Jacob <a href="mailto:adam@opscode.com" data-bare-link="true">adam@opscode.com</a> with many contributions from the community.</p> - -<h2 id="DOCUMENTATION">DOCUMENTATION</h2> - -<p> This manual page was written by Daniel DeLeo <a href="mailto:dan@opscode.com" data-bare-link="true">dan@opscode.com</a>. - Permission is granted to copy, distribute and / or modify this document under the terms of the Apache 2.0 License.</p> - -<h2 id="CHEF">CHEF</h2> - -<p> Knife is distributed with Chef. <a href="http://wiki.opscode.com/display/chef/Home" data-bare-link="true">http://wiki.opscode.com/display/chef/Home</a></p> - - - <ol class='man-decor man-foot man foot'> - <li class='tl'>Chef 11.8.0</li> - <li class='tc'>October 2013</li> - <li class='tr'>knife-environment(1)</li> - </ol> - - </div> -</body> -</html> diff --git a/distro/common/html/knife-exec.1.html b/distro/common/html/knife-exec.1.html deleted file mode 100644 index 0ce454fc27..0000000000 --- a/distro/common/html/knife-exec.1.html +++ /dev/null @@ -1,134 +0,0 @@ -<!DOCTYPE html> -<html> -<head> - <meta http-equiv='content-type' value='text/html;charset=utf8'> - <meta name='generator' value='Ronn/v0.7.3 (http://github.com/rtomayko/ronn/tree/0.7.3)'> - <title>knife-exec(1) - Run user scripts using the Chef API DSL</title> - <style type='text/css' media='all'> - /* style: man */ - body#manpage {margin:0} - .mp {max-width:100ex;padding:0 9ex 1ex 4ex} - .mp p,.mp pre,.mp ul,.mp ol,.mp dl {margin:0 0 20px 0} - .mp h2 {margin:10px 0 0 0} - .mp > p,.mp > pre,.mp > ul,.mp > ol,.mp > dl {margin-left:8ex} - .mp h3 {margin:0 0 0 4ex} - .mp dt {margin:0;clear:left} - .mp dt.flush {float:left;width:8ex} - .mp dd {margin:0 0 0 9ex} - .mp h1,.mp h2,.mp h3,.mp h4 {clear:left} - .mp pre {margin-bottom:20px} - .mp pre+h2,.mp pre+h3 {margin-top:22px} - .mp h2+pre,.mp h3+pre {margin-top:5px} - .mp img {display:block;margin:auto} - .mp h1.man-title {display:none} - .mp,.mp code,.mp pre,.mp tt,.mp kbd,.mp samp,.mp h3,.mp h4 {font-family:monospace;font-size:14px;line-height:1.42857142857143} - .mp h2 {font-size:16px;line-height:1.25} - .mp h1 {font-size:20px;line-height:2} - .mp {text-align:justify;background:#fff} - .mp,.mp code,.mp pre,.mp pre code,.mp tt,.mp kbd,.mp samp {color:#131211} - .mp h1,.mp h2,.mp h3,.mp h4 {color:#030201} - .mp u {text-decoration:underline} - .mp code,.mp strong,.mp b {font-weight:bold;color:#131211} - .mp em,.mp var {font-style:italic;color:#232221;text-decoration:none} - .mp a,.mp a:link,.mp a:hover,.mp a code,.mp a pre,.mp a tt,.mp a kbd,.mp a samp {color:#0000ff} - .mp b.man-ref {font-weight:normal;color:#434241} - .mp pre {padding:0 4ex} - .mp pre code {font-weight:normal;color:#434241} - .mp h2+pre,h3+pre {padding-left:0} - ol.man-decor,ol.man-decor li {margin:3px 0 10px 0;padding:0;float:left;width:33%;list-style-type:none;text-transform:uppercase;color:#999;letter-spacing:1px} - ol.man-decor {width:100%} - ol.man-decor li.tl {text-align:left} - ol.man-decor li.tc {text-align:center;letter-spacing:4px} - ol.man-decor li.tr {text-align:right;float:right} - </style> - <style type='text/css' media='all'> - /* style: toc */ - .man-navigation {display:block !important;position:fixed;top:0;left:113ex;height:100%;width:100%;padding:48px 0 0 0;border-left:1px solid #dbdbdb;background:#eee} - .man-navigation a,.man-navigation a:hover,.man-navigation a:link,.man-navigation a:visited {display:block;margin:0;padding:5px 2px 5px 30px;color:#999;text-decoration:none} - .man-navigation a:hover {color:#111;text-decoration:underline} - </style> -</head> -<!-- - The following styles are deprecated and will be removed at some point: - div#man, div#man ol.man, div#man ol.head, div#man ol.man. - - The .man-page, .man-decor, .man-head, .man-foot, .man-title, and - .man-navigation should be used instead. ---> -<body id='manpage'> - <div class='mp' id='man'> - - <div class='man-navigation' style='display:none'> - <a href="#NAME">NAME</a> - <a href="#SYNOPSIS">SYNOPSIS</a> - <a href="#DESCRIPTION">DESCRIPTION</a> - <a href="#EXAMPLES">EXAMPLES</a> - <a href="#SEE-ALSO">SEE ALSO</a> - <a href="#AUTHOR">AUTHOR</a> - <a href="#DOCUMENTATION">DOCUMENTATION</a> - <a href="#CHEF">CHEF</a> - </div> - - <ol class='man-decor man-head man head'> - <li class='tl'>knife-exec(1)</li> - <li class='tc'>Chef Manual</li> - <li class='tr'>knife-exec(1)</li> - </ol> - - <h2 id="NAME">NAME</h2> -<p class="man-name"> - <code>knife-exec</code> - <span class="man-whatis">Run user scripts using the Chef API DSL</span> -</p> - -<h2 id="SYNOPSIS">SYNOPSIS</h2> - -<p><strong>knife</strong> <strong>exec</strong> <em>(options)</em></p> - -<dl> -<dt><code>-E</code>, <code>--exec CODE</code></dt><dd>Provide a snippet of code to evaluate on the command line</dd> -</dl> - - -<h2 id="DESCRIPTION">DESCRIPTION</h2> - -<p><code>knife exec</code> runs arbitrary ruby scripts in a context similar to that -of the <span class="man-ref">chef-shell<span class="s">(1)</span></span> DSL. See the chef-shell documentation for a -description of the commands available.</p> - -<h2 id="EXAMPLES">EXAMPLES</h2> - -<dl> -<dt>Make an API call against an arbitrary endpoint</dt><dd>knife exec -E 'api.get("nodes/fluke.localdomain/cookbooks")' -=> list of cookbooks for the node <em>fluke.localdomain</em></dd> -<dt>Remove the role <em>obsolete</em> from all nodes</dt><dd>knife exec -E 'nodes.transform(:all){|n| n.run_list.delete("role[obsolete]")}'</dd> -<dt>Generate the expanded run list for hosts in the <code>webserver</code> role</dt><dd>knife exec -E 'nodes.find(:roles => "webserver") {|n| n.expand!; n[:recipes]}'</dd> -</dl> - - -<h2 id="SEE-ALSO">SEE ALSO</h2> - -<p> <strong><span class="man-ref">chef-shell<span class="s">(1)</span></span></strong></p> - -<h2 id="AUTHOR">AUTHOR</h2> - -<p> Chef was written by Adam Jacob <a href="mailto:adam@opscode.com" data-bare-link="true">adam@opscode.com</a> with many contributions from the community.</p> - -<h2 id="DOCUMENTATION">DOCUMENTATION</h2> - -<p> This manual page was written by Joshua Timberman <a href="mailto:joshua@opscode.com" data-bare-link="true">joshua@opscode.com</a>. - Permission is granted to copy, distribute and / or modify this document under the terms of the Apache 2.0 License.</p> - -<h2 id="CHEF">CHEF</h2> - -<p> Knife is distributed with Chef. <a href="http://wiki.opscode.com/display/chef/Home" data-bare-link="true">http://wiki.opscode.com/display/chef/Home</a></p> - - - <ol class='man-decor man-foot man foot'> - <li class='tl'>Chef 11.8.0</li> - <li class='tc'>October 2013</li> - <li class='tr'>knife-exec(1)</li> - </ol> - - </div> -</body> -</html> diff --git a/distro/common/html/knife-index.1.html b/distro/common/html/knife-index.1.html deleted file mode 100644 index a691980101..0000000000 --- a/distro/common/html/knife-index.1.html +++ /dev/null @@ -1,125 +0,0 @@ -<!DOCTYPE html> -<html> -<head> - <meta http-equiv='content-type' value='text/html;charset=utf8'> - <meta name='generator' value='Ronn/v0.7.3 (http://github.com/rtomayko/ronn/tree/0.7.3)'> - <title>knife-index(1) - Rebuild the search index on a Chef Server</title> - <style type='text/css' media='all'> - /* style: man */ - body#manpage {margin:0} - .mp {max-width:100ex;padding:0 9ex 1ex 4ex} - .mp p,.mp pre,.mp ul,.mp ol,.mp dl {margin:0 0 20px 0} - .mp h2 {margin:10px 0 0 0} - .mp > p,.mp > pre,.mp > ul,.mp > ol,.mp > dl {margin-left:8ex} - .mp h3 {margin:0 0 0 4ex} - .mp dt {margin:0;clear:left} - .mp dt.flush {float:left;width:8ex} - .mp dd {margin:0 0 0 9ex} - .mp h1,.mp h2,.mp h3,.mp h4 {clear:left} - .mp pre {margin-bottom:20px} - .mp pre+h2,.mp pre+h3 {margin-top:22px} - .mp h2+pre,.mp h3+pre {margin-top:5px} - .mp img {display:block;margin:auto} - .mp h1.man-title {display:none} - .mp,.mp code,.mp pre,.mp tt,.mp kbd,.mp samp,.mp h3,.mp h4 {font-family:monospace;font-size:14px;line-height:1.42857142857143} - .mp h2 {font-size:16px;line-height:1.25} - .mp h1 {font-size:20px;line-height:2} - .mp {text-align:justify;background:#fff} - .mp,.mp code,.mp pre,.mp pre code,.mp tt,.mp kbd,.mp samp {color:#131211} - .mp h1,.mp h2,.mp h3,.mp h4 {color:#030201} - .mp u {text-decoration:underline} - .mp code,.mp strong,.mp b {font-weight:bold;color:#131211} - .mp em,.mp var {font-style:italic;color:#232221;text-decoration:none} - .mp a,.mp a:link,.mp a:hover,.mp a code,.mp a pre,.mp a tt,.mp a kbd,.mp a samp {color:#0000ff} - .mp b.man-ref {font-weight:normal;color:#434241} - .mp pre {padding:0 4ex} - .mp pre code {font-weight:normal;color:#434241} - .mp h2+pre,h3+pre {padding-left:0} - ol.man-decor,ol.man-decor li {margin:3px 0 10px 0;padding:0;float:left;width:33%;list-style-type:none;text-transform:uppercase;color:#999;letter-spacing:1px} - ol.man-decor {width:100%} - ol.man-decor li.tl {text-align:left} - ol.man-decor li.tc {text-align:center;letter-spacing:4px} - ol.man-decor li.tr {text-align:right;float:right} - </style> - <style type='text/css' media='all'> - /* style: toc */ - .man-navigation {display:block !important;position:fixed;top:0;left:113ex;height:100%;width:100%;padding:48px 0 0 0;border-left:1px solid #dbdbdb;background:#eee} - .man-navigation a,.man-navigation a:hover,.man-navigation a:link,.man-navigation a:visited {display:block;margin:0;padding:5px 2px 5px 30px;color:#999;text-decoration:none} - .man-navigation a:hover {color:#111;text-decoration:underline} - </style> -</head> -<!-- - The following styles are deprecated and will be removed at some point: - div#man, div#man ol.man, div#man ol.head, div#man ol.man. - - The .man-page, .man-decor, .man-head, .man-foot, .man-title, and - .man-navigation should be used instead. ---> -<body id='manpage'> - <div class='mp' id='man'> - - <div class='man-navigation' style='display:none'> - <a href="#NAME">NAME</a> - <a href="#SYNOPSIS">SYNOPSIS</a> - <a href="#DESCRIPTION">DESCRIPTION</a> - <a href="#SEE-ALSO">SEE ALSO</a> - <a href="#AUTHOR">AUTHOR</a> - <a href="#DOCUMENTATION">DOCUMENTATION</a> - <a href="#CHEF">CHEF</a> - </div> - - <ol class='man-decor man-head man head'> - <li class='tl'>knife-index(1)</li> - <li class='tc'>Chef Manual</li> - <li class='tr'>knife-index(1)</li> - </ol> - - <h2 id="NAME">NAME</h2> -<p class="man-name"> - <code>knife-index</code> - <span class="man-whatis">Rebuild the search index on a Chef Server</span> -</p> - -<h2 id="SYNOPSIS">SYNOPSIS</h2> - -<p><strong>knife</strong> <strong>index rebuild</strong> <em>(options)</em></p> - -<dl> -<dt><code>-y</code>, <code>--yes</code></dt><dd>don't bother to ask if I'm sure</dd> -</dl> - - -<h2 id="DESCRIPTION">DESCRIPTION</h2> - -<p>Rebuilds all the search indexes on the server. This is accomplished by -deleting all objects from the search index, and then forwarding each -item in the database to <strong>chef-expander</strong>(8) via <strong>rabbitmq-server</strong>(1). -Depending on the number of objects in the database, it may take some -time for all objects to be indexed and available for search.</p> - -<h2 id="SEE-ALSO">SEE ALSO</h2> - -<p> <strong>knife-search</strong>(1)</p> - -<h2 id="AUTHOR">AUTHOR</h2> - -<p> Chef was written by Adam Jacob <a href="mailto:adam@opscode.com" data-bare-link="true">adam@opscode.com</a> with many contributions from the community.</p> - -<h2 id="DOCUMENTATION">DOCUMENTATION</h2> - -<p> This manual page was written by Joshua Timberman <a href="mailto:joshua@opscode.com" data-bare-link="true">joshua@opscode.com</a>. - Permission is granted to copy, distribute and / or modify this document under the terms of the Apache 2.0 License.</p> - -<h2 id="CHEF">CHEF</h2> - -<p> Knife is distributed with Chef. <a href="http://wiki.opscode.com/display/chef/Home" data-bare-link="true">http://wiki.opscode.com/display/chef/Home</a></p> - - - <ol class='man-decor man-foot man foot'> - <li class='tl'>Chef 11.8.0</li> - <li class='tc'>October 2013</li> - <li class='tr'>knife-index(1)</li> - </ol> - - </div> -</body> -</html> diff --git a/distro/common/html/knife-node.1.html b/distro/common/html/knife-node.1.html deleted file mode 100644 index 6a399c96de..0000000000 --- a/distro/common/html/knife-node.1.html +++ /dev/null @@ -1,250 +0,0 @@ -<!DOCTYPE html> -<html> -<head> - <meta http-equiv='content-type' value='text/html;charset=utf8'> - <meta name='generator' value='Ronn/v0.7.3 (http://github.com/rtomayko/ronn/tree/0.7.3)'> - <title>knife-node(1) - Manage the hosts in your infrastructure</title> - <style type='text/css' media='all'> - /* style: man */ - body#manpage {margin:0} - .mp {max-width:100ex;padding:0 9ex 1ex 4ex} - .mp p,.mp pre,.mp ul,.mp ol,.mp dl {margin:0 0 20px 0} - .mp h2 {margin:10px 0 0 0} - .mp > p,.mp > pre,.mp > ul,.mp > ol,.mp > dl {margin-left:8ex} - .mp h3 {margin:0 0 0 4ex} - .mp dt {margin:0;clear:left} - .mp dt.flush {float:left;width:8ex} - .mp dd {margin:0 0 0 9ex} - .mp h1,.mp h2,.mp h3,.mp h4 {clear:left} - .mp pre {margin-bottom:20px} - .mp pre+h2,.mp pre+h3 {margin-top:22px} - .mp h2+pre,.mp h3+pre {margin-top:5px} - .mp img {display:block;margin:auto} - .mp h1.man-title {display:none} - .mp,.mp code,.mp pre,.mp tt,.mp kbd,.mp samp,.mp h3,.mp h4 {font-family:monospace;font-size:14px;line-height:1.42857142857143} - .mp h2 {font-size:16px;line-height:1.25} - .mp h1 {font-size:20px;line-height:2} - .mp {text-align:justify;background:#fff} - .mp,.mp code,.mp pre,.mp pre code,.mp tt,.mp kbd,.mp samp {color:#131211} - .mp h1,.mp h2,.mp h3,.mp h4 {color:#030201} - .mp u {text-decoration:underline} - .mp code,.mp strong,.mp b {font-weight:bold;color:#131211} - .mp em,.mp var {font-style:italic;color:#232221;text-decoration:none} - .mp a,.mp a:link,.mp a:hover,.mp a code,.mp a pre,.mp a tt,.mp a kbd,.mp a samp {color:#0000ff} - .mp b.man-ref {font-weight:normal;color:#434241} - .mp pre {padding:0 4ex} - .mp pre code {font-weight:normal;color:#434241} - .mp h2+pre,h3+pre {padding-left:0} - ol.man-decor,ol.man-decor li {margin:3px 0 10px 0;padding:0;float:left;width:33%;list-style-type:none;text-transform:uppercase;color:#999;letter-spacing:1px} - ol.man-decor {width:100%} - ol.man-decor li.tl {text-align:left} - ol.man-decor li.tc {text-align:center;letter-spacing:4px} - ol.man-decor li.tr {text-align:right;float:right} - </style> - <style type='text/css' media='all'> - /* style: toc */ - .man-navigation {display:block !important;position:fixed;top:0;left:113ex;height:100%;width:100%;padding:48px 0 0 0;border-left:1px solid #dbdbdb;background:#eee} - .man-navigation a,.man-navigation a:hover,.man-navigation a:link,.man-navigation a:visited {display:block;margin:0;padding:5px 2px 5px 30px;color:#999;text-decoration:none} - .man-navigation a:hover {color:#111;text-decoration:underline} - </style> -</head> -<!-- - The following styles are deprecated and will be removed at some point: - div#man, div#man ol.man, div#man ol.head, div#man ol.man. - - The .man-page, .man-decor, .man-head, .man-foot, .man-title, and - .man-navigation should be used instead. ---> -<body id='manpage'> - <div class='mp' id='man'> - - <div class='man-navigation' style='display:none'> - <a href="#NAME">NAME</a> - <a href="#SYNOPSIS">SYNOPSIS</a> - <a href="#DESCRIPTION">DESCRIPTION</a> - <a href="#NODE-SUB-COMMANDS">NODE SUB-COMMANDS</a> - <a href="#BULK-DELETE">BULK DELETE</a> - <a href="#CREATE">CREATE</a> - <a href="#DELETE">DELETE</a> - <a href="#EDIT">EDIT</a> - <a href="#FROM-FILE">FROM FILE</a> - <a href="#LIST">LIST</a> - <a href="#RUN_LIST-ADD">RUN_LIST ADD</a> - <a href="#RUN_LIST-REMOVE">RUN_LIST REMOVE</a> - <a href="#SHOW">SHOW</a> - <a href="#RUN-LIST-ITEM-FORMAT">RUN LIST ITEM FORMAT</a> - <a href="#SEE-ALSO">SEE ALSO</a> - <a href="#AUTHOR">AUTHOR</a> - <a href="#DOCUMENTATION">DOCUMENTATION</a> - <a href="#CHEF">CHEF</a> - </div> - - <ol class='man-decor man-head man head'> - <li class='tl'>knife-node(1)</li> - <li class='tc'>Chef Manual</li> - <li class='tr'>knife-node(1)</li> - </ol> - - <h2 id="NAME">NAME</h2> -<p class="man-name"> - <code>knife-node</code> - <span class="man-whatis">Manage the hosts in your infrastructure</span> -</p> - -<h2 id="SYNOPSIS">SYNOPSIS</h2> - -<p><strong>knife</strong> <strong>node</strong> <em>sub-command</em> <em>(options)</em></p> - -<h2 id="DESCRIPTION">DESCRIPTION</h2> - -<p>Nodes are data structures that represent hosts configured with Chef. -Nodes have a <strong>name</strong>, a String that uniquely identifies the node, -<strong>attributes</strong>, a nested Hash of properties that describe how the host -should be configured, a <strong>chef_environment</strong>, a String representing the -environment to which the node belongs, and a <strong>run_list</strong>, an ordered -list of <strong>recipes</strong> or <strong>roles</strong> that chef-client should apply when -configuring a host.</p> - -<p>When a host communicates with a Chef Server, it authenticates using its -<strong>node_name</strong> for identification and signs its reqests with a private -key. The Server validates the request by looking up a <strong>client</strong> object -with a name identical to the <strong>node_name</strong> submitted with the request -and verifes the signature using the public key for that <strong>client</strong> -object. <strong>NOTE</strong> that the <strong>client</strong> is a different object in the -system. It is associated with a node by virtue of having a matching -name.</p> - -<p>By default <strong>chef-client</strong>(8) will create a node using the FQDN of the -host for the node name, though this may be overridden by configuration -settings.</p> - -<h2 id="NODE-SUB-COMMANDS">NODE SUB-COMMANDS</h2> - -<p>The following <code>node</code> subcommands are available:</p> - -<h2 id="BULK-DELETE">BULK DELETE</h2> - -<p><strong>knife node bulk delete</strong> <em>regex</em> <em>(options)</em></p> - -<p>Deletes nodes for which the name matches the regular expression <em>regex</em> -on the Chef Server. The regular expression should be given in quotes, -and should not be surrounded with forward slashes (as is typical of -regular expression literals in scripting languages).</p> - -<h2 id="CREATE">CREATE</h2> - -<p><strong>knife node create</strong> <em>name</em> <em>(options)</em></p> - -<p>Create a new node. Unless the --disable-editing option is given, an empty node -object will be created and displayed in your text editor. If the editor -exits with a successful exit status, the node data will be posted to the -Chef Server to create the node.</p> - -<h2 id="DELETE">DELETE</h2> - -<p><strong>knife node delete</strong> <em>name</em> <em>(options)</em></p> - -<p>Deletes the node identified by <em>name</em> on the Chef Server.</p> - -<h2 id="EDIT">EDIT</h2> - -<p><strong>knife node edit</strong> <em>name</em> <em>(options)</em></p> - -<dl> -<dt><code>-a</code>, <code>--all</code></dt><dd>Display all node data in the editor. By default, default, override, -and automatic attributes are not shown.</dd> -</dl> - - -<p>Edit the node identified by <em>name</em>. Like <strong>knife node create</strong>, the node -will be displayed in your text editor unless the -n option is present.</p> - -<h2 id="FROM-FILE">FROM FILE</h2> - -<p><strong>knife node from file</strong> <em>file</em> <em>(options)</em></p> - -<p>Create a node from a JSON format <em>file</em>.</p> - -<h2 id="LIST">LIST</h2> - -<p><strong>knife node list</strong> <em>(options)</em></p> - -<dl> -<dt><code>-w</code>, <code>--with-uri</code></dt><dd>Show corresponding URIs</dd> -</dl> - - -<p>List all nodes.</p> - -<h2 id="RUN_LIST-ADD">RUN_LIST ADD</h2> - -<p><strong>knife node run_list add</strong> <em>name</em> <em>run list item</em> <em>(options)</em></p> - -<dl> -<dt><code>-a</code>, <code>--after ITEM</code></dt><dd>Place the ENTRY in the run list after ITEM</dd> -</dl> - - -<p>Add the <em>run list item</em> to the node's <code>run_list</code>. See Run list</p> - -<h2 id="RUN_LIST-REMOVE">RUN_LIST REMOVE</h2> - -<p><strong>knife node run_list remove</strong> <em>node name</em> <em>run list item</em> <em>(options)</em></p> - -<p>Remove the <em>run list item</em> from the node's <code>run_list</code>.</p> - -<h2 id="SHOW">SHOW</h2> - -<p><strong>knife node show</strong> <em>node name</em> <em>(options)</em></p> - -<dl> -<dt><code>-a</code>, <code>--attribute [ATTR]</code></dt><dd>Show only one attribute</dd> -<dt><code>-r</code>, <code>--run-list </code></dt><dd>Show only the run list</dd> -<dt><code>-F</code>, <code>--format FORMAT</code></dt><dd>Display the node in a different format.</dd> -<dt><code>-m</code>, <code>--medium</code></dt><dd>Display more, but not all, of the node's data when using the default -<em>summary</em> format</dd> -</dl> - - -<p>Displays the node identified by <em>node name</em> on stdout.</p> - -<h2 id="RUN-LIST-ITEM-FORMAT">RUN LIST ITEM FORMAT</h2> - -<p>Run list items may be either roles or recipes. When adding a role to a -run list, the correct syntax is "role[ROLE_NAME]"</p> - -<p>When adding a recipe to a run list, there are several valid formats:</p> - -<dl> -<dt>Fully Qualified Format</dt><dd>"recipe[COOKBOOK::RECIPE_NAME]", for example, "recipe[chef::client]"</dd> -<dt>Cookbook Recipe Format</dt><dd>For brevity, the recipe part of the fully qualified format may be omitted, and recipes specified as "COOKBOOK::RECIPE_NAME", e.g., "chef::client"</dd> -<dt>Default Recipe Format</dt><dd>When adding the default recipe of a cookbook to a run list, the recipe name may be omitted as well, e.g., "chef::default" may be written as just "chef"</dd> -</dl> - - -<h2 id="SEE-ALSO">SEE ALSO</h2> - -<p> <strong>knife-client</strong>(1) <strong>knife-search</strong>(1) <strong>knife-role</strong>(1)</p> - -<h2 id="AUTHOR">AUTHOR</h2> - -<p> Chef was written by Adam Jacob <a href="mailto:adam@opscode.com" data-bare-link="true">adam@opscode.com</a> with many contributions from the community.</p> - -<h2 id="DOCUMENTATION">DOCUMENTATION</h2> - -<p> This manual page was written by Joshua Timberman <a href="mailto:joshua@opscode.com" data-bare-link="true">joshua@opscode.com</a>. - Permission is granted to copy, distribute and / or modify this document under the terms of the Apache 2.0 License.</p> - -<h2 id="CHEF">CHEF</h2> - -<p> Knife is distributed with Chef. <a href="http://wiki.opscode.com/display/chef/Home" data-bare-link="true">http://wiki.opscode.com/display/chef/Home</a></p> - - - <ol class='man-decor man-foot man foot'> - <li class='tl'>Chef 11.8.0</li> - <li class='tc'>October 2013</li> - <li class='tr'>knife-node(1)</li> - </ol> - - </div> -</body> -</html> diff --git a/distro/common/html/knife-role.1.html b/distro/common/html/knife-role.1.html deleted file mode 100644 index 62a6b4abf4..0000000000 --- a/distro/common/html/knife-role.1.html +++ /dev/null @@ -1,200 +0,0 @@ -<!DOCTYPE html> -<html> -<head> - <meta http-equiv='content-type' value='text/html;charset=utf8'> - <meta name='generator' value='Ronn/v0.7.3 (http://github.com/rtomayko/ronn/tree/0.7.3)'> - <title>knife-role(1) - Group common configuration settings</title> - <style type='text/css' media='all'> - /* style: man */ - body#manpage {margin:0} - .mp {max-width:100ex;padding:0 9ex 1ex 4ex} - .mp p,.mp pre,.mp ul,.mp ol,.mp dl {margin:0 0 20px 0} - .mp h2 {margin:10px 0 0 0} - .mp > p,.mp > pre,.mp > ul,.mp > ol,.mp > dl {margin-left:8ex} - .mp h3 {margin:0 0 0 4ex} - .mp dt {margin:0;clear:left} - .mp dt.flush {float:left;width:8ex} - .mp dd {margin:0 0 0 9ex} - .mp h1,.mp h2,.mp h3,.mp h4 {clear:left} - .mp pre {margin-bottom:20px} - .mp pre+h2,.mp pre+h3 {margin-top:22px} - .mp h2+pre,.mp h3+pre {margin-top:5px} - .mp img {display:block;margin:auto} - .mp h1.man-title {display:none} - .mp,.mp code,.mp pre,.mp tt,.mp kbd,.mp samp,.mp h3,.mp h4 {font-family:monospace;font-size:14px;line-height:1.42857142857143} - .mp h2 {font-size:16px;line-height:1.25} - .mp h1 {font-size:20px;line-height:2} - .mp {text-align:justify;background:#fff} - .mp,.mp code,.mp pre,.mp pre code,.mp tt,.mp kbd,.mp samp {color:#131211} - .mp h1,.mp h2,.mp h3,.mp h4 {color:#030201} - .mp u {text-decoration:underline} - .mp code,.mp strong,.mp b {font-weight:bold;color:#131211} - .mp em,.mp var {font-style:italic;color:#232221;text-decoration:none} - .mp a,.mp a:link,.mp a:hover,.mp a code,.mp a pre,.mp a tt,.mp a kbd,.mp a samp {color:#0000ff} - .mp b.man-ref {font-weight:normal;color:#434241} - .mp pre {padding:0 4ex} - .mp pre code {font-weight:normal;color:#434241} - .mp h2+pre,h3+pre {padding-left:0} - ol.man-decor,ol.man-decor li {margin:3px 0 10px 0;padding:0;float:left;width:33%;list-style-type:none;text-transform:uppercase;color:#999;letter-spacing:1px} - ol.man-decor {width:100%} - ol.man-decor li.tl {text-align:left} - ol.man-decor li.tc {text-align:center;letter-spacing:4px} - ol.man-decor li.tr {text-align:right;float:right} - </style> - <style type='text/css' media='all'> - /* style: toc */ - .man-navigation {display:block !important;position:fixed;top:0;left:113ex;height:100%;width:100%;padding:48px 0 0 0;border-left:1px solid #dbdbdb;background:#eee} - .man-navigation a,.man-navigation a:hover,.man-navigation a:link,.man-navigation a:visited {display:block;margin:0;padding:5px 2px 5px 30px;color:#999;text-decoration:none} - .man-navigation a:hover {color:#111;text-decoration:underline} - </style> -</head> -<!-- - The following styles are deprecated and will be removed at some point: - div#man, div#man ol.man, div#man ol.head, div#man ol.man. - - The .man-page, .man-decor, .man-head, .man-foot, .man-title, and - .man-navigation should be used instead. ---> -<body id='manpage'> - <div class='mp' id='man'> - - <div class='man-navigation' style='display:none'> - <a href="#NAME">NAME</a> - <a href="#SYNOPSIS">SYNOPSIS</a> - <a href="#ROLE-SUB-COMMANDS">ROLE SUB-COMMANDS</a> - <a href="#LIST">LIST</a> - <a href="#SHOW">SHOW</a> - <a href="#CREATE">CREATE</a> - <a href="#EDIT">EDIT</a> - <a href="#FROM-FILE">FROM FILE</a> - <a href="#DELETE">DELETE</a> - <a href="#BULK-DELETE">BULK DELETE</a> - <a href="#DESCRIPTION">DESCRIPTION</a> - <a href="#SEE-ALSO">SEE ALSO</a> - <a href="#AUTHOR">AUTHOR</a> - <a href="#DOCUMENTATION">DOCUMENTATION</a> - <a href="#CHEF">CHEF</a> - </div> - - <ol class='man-decor man-head man head'> - <li class='tl'>knife-role(1)</li> - <li class='tc'>Chef Manual</li> - <li class='tr'>knife-role(1)</li> - </ol> - - <h2 id="NAME">NAME</h2> -<p class="man-name"> - <code>knife-role</code> - <span class="man-whatis">Group common configuration settings</span> -</p> - -<h2 id="SYNOPSIS">SYNOPSIS</h2> - -<p><strong>knife</strong> <strong>role</strong> <em>sub-command</em> <em>(options)</em></p> - -<h2 id="ROLE-SUB-COMMANDS">ROLE SUB-COMMANDS</h2> - -<p>The following <code>role</code> subcommands are available:</p> - -<h2 id="LIST">LIST</h2> - -<p><strong>knife role list</strong> <em>(options)</em></p> - -<dl> -<dt><code>-w</code>, <code>--with-uri</code></dt><dd>Show corresponding URIs</dd> -</dl> - - -<p>List roles.</p> - -<h2 id="SHOW">SHOW</h2> - -<p><strong>knife role show ROLE</strong> <em>(options)</em></p> - -<dl> -<dt><code>-a</code>, <code>--attribute ATTR</code></dt><dd>Show only one attribute</dd> -</dl> - - -<p>Show a specific role.</p> - -<h2 id="CREATE">CREATE</h2> - -<p><strong>knife role create ROLE</strong> <em>(options)</em></p> - -<dl> -<dt><code>-d</code>, <code>--description</code></dt><dd>The role description</dd> -</dl> - - -<p>Create a new role.</p> - -<h2 id="EDIT">EDIT</h2> - -<p><strong>knife role edit ROLE</strong> <em>(options)</em></p> - -<p>Edit a role.</p> - -<h2 id="FROM-FILE">FROM FILE</h2> - -<p><strong>knife role from file FILE</strong> <em>(options)</em></p> - -<p>Create or update a role from a role Ruby DSL (<code>.rb</code>) or JSON file.</p> - -<h2 id="DELETE">DELETE</h2> - -<p><strong>knife role delete ROLE</strong> <em>(options)</em></p> - -<p>Delete a role.</p> - -<h2 id="BULK-DELETE">BULK DELETE</h2> - -<p><strong>knife role bulk delete REGEX</strong> <em>(options)</em></p> - -<p>Delete roles on the Chef Server based on a regular expression. The regular expression (<em>REGEX</em>) should be in quotes, not in //'s.</p> - -<h2 id="DESCRIPTION">DESCRIPTION</h2> - -<p>Roles provide a mechanism to group repeated configuration settings. -Roles are data structures that contain <strong>default_attributes</strong>, and -<strong>override_attributes</strong>, which are nested hashes of configuration -settings, and a <strong>run_list</strong>, which is an ordered list of recipes and -roles that should be applied to a host by chef-client.</p> - -<p><strong>default_attributes</strong> will be overridden if they conflict with a value -on a node that includes the role. Conversely, <strong>override_attributes</strong> -will override any values set on nodes that apply them.</p> - -<p>When <strong>chef-client</strong>(8) configures a host, it will "expand" the -<strong>run_list</strong> included in that host's node data. The expansion process -will recursively replace any roles in the run_list with that role's -run_list.</p> - -<h2 id="SEE-ALSO">SEE ALSO</h2> - -<p> <strong><span class="man-ref">knife-node<span class="s">(1)</span></span></strong> <strong><span class="man-ref">knife-environment<span class="s">(1)</span></span></strong> - <a href="http://wiki.opscode.com/display/chef/Roles" data-bare-link="true">http://wiki.opscode.com/display/chef/Roles</a> - <a href="http://wiki.opscode.com/display/chef/Attributes" data-bare-link="true">http://wiki.opscode.com/display/chef/Attributes</a></p> - -<h2 id="AUTHOR">AUTHOR</h2> - -<p> Chef was written by Adam Jacob <a href="mailto:adam@opscode.com" data-bare-link="true">adam@opscode.com</a> with many contributions from the community.</p> - -<h2 id="DOCUMENTATION">DOCUMENTATION</h2> - -<p> This manual page was written by Joshua Timberman <a href="mailto:joshua@opscode.com" data-bare-link="true">joshua@opscode.com</a>. - Permission is granted to copy, distribute and / or modify this document under the terms of the Apache 2.0 License.</p> - -<h2 id="CHEF">CHEF</h2> - -<p> Knife is distributed with Chef. <a href="http://wiki.opscode.com/display/chef/Home" data-bare-link="true">http://wiki.opscode.com/display/chef/Home</a></p> - - - <ol class='man-decor man-foot man foot'> - <li class='tl'>Chef 11.8.0</li> - <li class='tc'>October 2013</li> - <li class='tr'>knife-role(1)</li> - </ol> - - </div> -</body> -</html> diff --git a/distro/common/html/knife-search.1.html b/distro/common/html/knife-search.1.html deleted file mode 100644 index 3626259f9b..0000000000 --- a/distro/common/html/knife-search.1.html +++ /dev/null @@ -1,288 +0,0 @@ -<!DOCTYPE html> -<html> -<head> - <meta http-equiv='content-type' value='text/html;charset=utf8'> - <meta name='generator' value='Ronn/v0.7.3 (http://github.com/rtomayko/ronn/tree/0.7.3)'> - <title>knife-search(1) - Find objects on a Chef Server by query</title> - <style type='text/css' media='all'> - /* style: man */ - body#manpage {margin:0} - .mp {max-width:100ex;padding:0 9ex 1ex 4ex} - .mp p,.mp pre,.mp ul,.mp ol,.mp dl {margin:0 0 20px 0} - .mp h2 {margin:10px 0 0 0} - .mp > p,.mp > pre,.mp > ul,.mp > ol,.mp > dl {margin-left:8ex} - .mp h3 {margin:0 0 0 4ex} - .mp dt {margin:0;clear:left} - .mp dt.flush {float:left;width:8ex} - .mp dd {margin:0 0 0 9ex} - .mp h1,.mp h2,.mp h3,.mp h4 {clear:left} - .mp pre {margin-bottom:20px} - .mp pre+h2,.mp pre+h3 {margin-top:22px} - .mp h2+pre,.mp h3+pre {margin-top:5px} - .mp img {display:block;margin:auto} - .mp h1.man-title {display:none} - .mp,.mp code,.mp pre,.mp tt,.mp kbd,.mp samp,.mp h3,.mp h4 {font-family:monospace;font-size:14px;line-height:1.42857142857143} - .mp h2 {font-size:16px;line-height:1.25} - .mp h1 {font-size:20px;line-height:2} - .mp {text-align:justify;background:#fff} - .mp,.mp code,.mp pre,.mp pre code,.mp tt,.mp kbd,.mp samp {color:#131211} - .mp h1,.mp h2,.mp h3,.mp h4 {color:#030201} - .mp u {text-decoration:underline} - .mp code,.mp strong,.mp b {font-weight:bold;color:#131211} - .mp em,.mp var {font-style:italic;color:#232221;text-decoration:none} - .mp a,.mp a:link,.mp a:hover,.mp a code,.mp a pre,.mp a tt,.mp a kbd,.mp a samp {color:#0000ff} - .mp b.man-ref {font-weight:normal;color:#434241} - .mp pre {padding:0 4ex} - .mp pre code {font-weight:normal;color:#434241} - .mp h2+pre,h3+pre {padding-left:0} - ol.man-decor,ol.man-decor li {margin:3px 0 10px 0;padding:0;float:left;width:33%;list-style-type:none;text-transform:uppercase;color:#999;letter-spacing:1px} - ol.man-decor {width:100%} - ol.man-decor li.tl {text-align:left} - ol.man-decor li.tc {text-align:center;letter-spacing:4px} - ol.man-decor li.tr {text-align:right;float:right} - </style> - <style type='text/css' media='all'> - /* style: toc */ - .man-navigation {display:block !important;position:fixed;top:0;left:113ex;height:100%;width:100%;padding:48px 0 0 0;border-left:1px solid #dbdbdb;background:#eee} - .man-navigation a,.man-navigation a:hover,.man-navigation a:link,.man-navigation a:visited {display:block;margin:0;padding:5px 2px 5px 30px;color:#999;text-decoration:none} - .man-navigation a:hover {color:#111;text-decoration:underline} - </style> -</head> -<!-- - The following styles are deprecated and will be removed at some point: - div#man, div#man ol.man, div#man ol.head, div#man ol.man. - - The .man-page, .man-decor, .man-head, .man-foot, .man-title, and - .man-navigation should be used instead. ---> -<body id='manpage'> - <div class='mp' id='man'> - - <div class='man-navigation' style='display:none'> - <a href="#NAME">NAME</a> - <a href="#SYNOPSIS">SYNOPSIS</a> - <a href="#DESCRIPTION">DESCRIPTION</a> - <a href="#INDEXES">INDEXES</a> - <a href="#QUERY-SYNTAX">QUERY SYNTAX</a> - <a href="#EXAMPLES">EXAMPLES</a> - <a href="#KNOWN-BUGS">KNOWN BUGS</a> - <a href="#SEE-ALSO">SEE ALSO</a> - <a href="#AUTHOR">AUTHOR</a> - <a href="#DOCUMENTATION">DOCUMENTATION</a> - <a href="#CHEF">CHEF</a> - </div> - - <ol class='man-decor man-head man head'> - <li class='tl'>knife-search(1)</li> - <li class='tc'>Chef Manual</li> - <li class='tr'>knife-search(1)</li> - </ol> - - <h2 id="NAME">NAME</h2> -<p class="man-name"> - <code>knife-search</code> - <span class="man-whatis">Find objects on a Chef Server by query</span> -</p> - -<h2 id="SYNOPSIS">SYNOPSIS</h2> - -<p><strong>knife</strong> <strong>search INDEX QUERY</strong> <em>(options)</em></p> - -<dl> -<dt><code>-a</code>, <code>--attribute ATTR</code></dt><dd>Show only one attribute</dd> -<dt><code>-i</code>, <code>--id-only</code></dt><dd>Show only the ID of matching objects</dd> -<dt><code>-q</code>, <code>--query QUERY</code></dt><dd>The search query; useful to protect queries starting with -</dd> -<dt><code>-R</code>, <code>--rows INT</code></dt><dd>The number of rows to return</dd> -<dt><code>-r</code>, <code>--run-list</code></dt><dd>Show only the run list</dd> -<dt><code>-o</code>, <code>--sort SORT</code></dt><dd>The order to sort the results in</dd> -<dt><code>-b</code>, <code>--start ROW</code></dt><dd>The row to start returning results at</dd> -<dt><code>-m</code>, <code>--medium</code></dt><dd>Display medium sized output when searching nodes using the default -summary format</dd> -<dt><code>-l</code>, <code>--long</code></dt><dd>Display long output when searching nodes using the default summary -format</dd> -</dl> - - -<h2 id="DESCRIPTION">DESCRIPTION</h2> - -<p>Search is a feature of the Chef Server that allows you to use a -full-text search engine to query information about your infrastructure -and applications. You can utilize this service via search calls in a -recipe or the knife search command. The search syntax is based on -Lucene.</p> - -<h2 id="INDEXES">INDEXES</h2> - -<p>Search indexes are a feature of the Chef Server and the search -sub-command allows querying any of the available indexes using SOLR -query syntax. The following data types are indexed for search:</p> - -<ul> -<li><em>node</em></li> -<li><em>role</em></li> -<li><em>environment</em></li> -<li><em>clients</em></li> -<li><em>data bag</em></li> -</ul> - - -<p>Data bags are indexed by the data bag's name. For example, to search a -data bag named "admins":</p> - -<pre><code>knife search admins "field:search_pattern" -</code></pre> - -<h2 id="QUERY-SYNTAX">QUERY SYNTAX</h2> - -<p>Queries have the form <code>field:search_pattern</code> where <code>field</code> is a key in -the JSON description of the relevant objects (nodes, roles, -environments, or data bags). Both <code>field</code> and <code>search_pattern</code> are -case-sensitive. <code>search_pattern</code> can be an exact, wildcard, -range, or fuzzy match (see below). The <code>field</code> supports exact -matching and limited wildcard matching.</p> - -<p>Searches will return the relevant objects (nodes, roles, environments, -or data bags) where the <code>search_pattern</code> matches the object's value of -<code>field</code>.</p> - -<h3 id="FIELD-NAMES">FIELD NAMES</h3> - -<p>Field names are the keys within the JSON description of the object -being searched. Nested Keys can be searched by placing an underscore -("_") between key names.</p> - -<h3 id="WILDCARD-MATCHING-FOR-FIELD-NAMES">WILDCARD MATCHING FOR FIELD NAMES</h3> - -<p>The field name also has limited support for wildcard matching. Both -the "*" and "?" wildcards (see below) can be used within a field name; -however, they cannot be the first character of the field name.</p> - -<h3 id="EXACT-MATCHES">EXACT MATCHES</h3> - -<p>Without any search modifiers, a search returns those fields for which -the <code>search_pattern</code> exactly matches the value of <code>field</code> in the JSON -description of the object.</p> - -<h3 id="WILDCARD-MATCHES">WILDCARD MATCHES</h3> - -<p>Search support both single- and multi-character wildcard searches -within a search pattern.</p> - -<p>'?' matches exactly one character.</p> - -<p>'*' matches zero or more characters.</p> - -<h3 id="RANGE-MATCHES">RANGE MATCHES</h3> - -<p>Range searches allows one to match values between two given values. To -match values between X and Y, inclusively, use square brackets:</p> - -<pre><code>knife search INDEX 'field:[X TO Y] -</code></pre> - -<p>To match values between X and Y, exclusively, use curly brackets:</p> - -<pre><code>knife search INDEX 'field:{X TO Y}' -</code></pre> - -<p>Values are sorted in lexicographic order.</p> - -<h3 id="FUZZY-MATCHES">FUZZY MATCHES</h3> - -<p>Fuzzy searches allows one to match values based on the Levenshtein -Distance algorithm. To perform a fuzzy match, append a tilda (~) to -the search term:</p> - -<pre><code>knife search INDEX 'field:term~' -</code></pre> - -<p>This search would return nodes whose <code>field</code> was 'perm' or 'germ'.</p> - -<h3 id="BOOLEAN-OPERATORS">BOOLEAN OPERATORS</h3> - -<p>The boolean operators NOT, AND, and OR are supported. To find values -of <code>field</code> that are not X:</p> - -<pre><code>knife search INDEX 'field:(NOT X)' -</code></pre> - -<p>To find records where <code>field1</code> is X and <code>field2</code> is Y:</p> - -<pre><code>knife search INDEX 'field1:X AND field2:Y' -</code></pre> - -<p>To find records where <code>field</code> is X or Y:</p> - -<pre><code>knife search INDEX 'field:X OR field:Y' -</code></pre> - -<h3 id="QUOTING-AND-SPECIAL-CHARACTERS">QUOTING AND SPECIAL CHARACTERS</h3> - -<p>In order to avoid having special characters and escape sequences -within your search term interpreted by either Ruby or the shell, -enclose them in single quotes.</p> - -<p>Search terms that include spaces should be enclosed in double-quotes:</p> - -<pre><code>knife search INDEX 'field:"term with spaces"' -</code></pre> - -<p>The following characters must be escaped:</p> - -<pre><code>+ - && || ! ( ) { } [ ] ^ " ~ * ? : \ -</code></pre> - -<h2 id="EXAMPLES">EXAMPLES</h2> - -<p>Find the nodes with the fully-qualified domain name (FQDN) -www.example.com:</p> - -<pre><code>knife search node 'fqdn:www.example.com' -</code></pre> - -<p>Find the nodes running a version of Ubuntu:</p> - -<pre><code>knife search node 'platform:ubuntu*' -</code></pre> - -<p>Find all nodes running CentOS in the production environment:</p> - -<pre><code>knife search node 'chef_environment:production AND platform:centos' -</code></pre> - -<h2 id="KNOWN-BUGS">KNOWN BUGS</h2> - -<ul> -<li>Searches against the client index return no results in most cases. (CHEF-2477)</li> -<li>Searches using the fuzzy match operator (~) produce an error. (CHEF-2478)</li> -</ul> - - -<h2 id="SEE-ALSO">SEE ALSO</h2> - -<p> <strong>knife-ssh</strong>(1) - <a href="http://wiki.opscode.com/display/chef/Attributes" data-bare-link="true">http://wiki.opscode.com/display/chef/Attributes</a> - <a href="http://lucene.apache.org/java/2_3_2/queryparsersyntax.html">Lucene Query Parser Syntax</a></p> - -<h2 id="AUTHOR">AUTHOR</h2> - -<p> Chef was written by Adam Jacob <a href="mailto:adam@opscode.com" data-bare-link="true">adam@opscode.com</a> with many contributions from the community.</p> - -<h2 id="DOCUMENTATION">DOCUMENTATION</h2> - -<p> This manual page was written by Joshua Timberman <a href="mailto:joshua@opscode.com" data-bare-link="true">joshua@opscode.com</a>. - Permission is granted to copy, distribute and / or modify this document under the terms of the Apache 2.0 License.</p> - -<h2 id="CHEF">CHEF</h2> - -<p> Knife is distributed with Chef. <a href="http://wiki.opscode.com/display/chef/Home" data-bare-link="true">http://wiki.opscode.com/display/chef/Home</a></p> - - - <ol class='man-decor man-foot man foot'> - <li class='tl'>Chef 11.8.0</li> - <li class='tc'>October 2013</li> - <li class='tr'>knife-search(1)</li> - </ol> - - </div> -</body> -</html> diff --git a/distro/common/html/knife-ssh.1.html b/distro/common/html/knife-ssh.1.html deleted file mode 100644 index 944f6bb93a..0000000000 --- a/distro/common/html/knife-ssh.1.html +++ /dev/null @@ -1,156 +0,0 @@ -<!DOCTYPE html> -<html> -<head> - <meta http-equiv='content-type' value='text/html;charset=utf8'> - <meta name='generator' value='Ronn/v0.7.3 (http://github.com/rtomayko/ronn/tree/0.7.3)'> - <title>knife-ssh(1) - Run a command or interactive session on multiple remote hosts</title> - <style type='text/css' media='all'> - /* style: man */ - body#manpage {margin:0} - .mp {max-width:100ex;padding:0 9ex 1ex 4ex} - .mp p,.mp pre,.mp ul,.mp ol,.mp dl {margin:0 0 20px 0} - .mp h2 {margin:10px 0 0 0} - .mp > p,.mp > pre,.mp > ul,.mp > ol,.mp > dl {margin-left:8ex} - .mp h3 {margin:0 0 0 4ex} - .mp dt {margin:0;clear:left} - .mp dt.flush {float:left;width:8ex} - .mp dd {margin:0 0 0 9ex} - .mp h1,.mp h2,.mp h3,.mp h4 {clear:left} - .mp pre {margin-bottom:20px} - .mp pre+h2,.mp pre+h3 {margin-top:22px} - .mp h2+pre,.mp h3+pre {margin-top:5px} - .mp img {display:block;margin:auto} - .mp h1.man-title {display:none} - .mp,.mp code,.mp pre,.mp tt,.mp kbd,.mp samp,.mp h3,.mp h4 {font-family:monospace;font-size:14px;line-height:1.42857142857143} - .mp h2 {font-size:16px;line-height:1.25} - .mp h1 {font-size:20px;line-height:2} - .mp {text-align:justify;background:#fff} - .mp,.mp code,.mp pre,.mp pre code,.mp tt,.mp kbd,.mp samp {color:#131211} - .mp h1,.mp h2,.mp h3,.mp h4 {color:#030201} - .mp u {text-decoration:underline} - .mp code,.mp strong,.mp b {font-weight:bold;color:#131211} - .mp em,.mp var {font-style:italic;color:#232221;text-decoration:none} - .mp a,.mp a:link,.mp a:hover,.mp a code,.mp a pre,.mp a tt,.mp a kbd,.mp a samp {color:#0000ff} - .mp b.man-ref {font-weight:normal;color:#434241} - .mp pre {padding:0 4ex} - .mp pre code {font-weight:normal;color:#434241} - .mp h2+pre,h3+pre {padding-left:0} - ol.man-decor,ol.man-decor li {margin:3px 0 10px 0;padding:0;float:left;width:33%;list-style-type:none;text-transform:uppercase;color:#999;letter-spacing:1px} - ol.man-decor {width:100%} - ol.man-decor li.tl {text-align:left} - ol.man-decor li.tc {text-align:center;letter-spacing:4px} - ol.man-decor li.tr {text-align:right;float:right} - </style> - <style type='text/css' media='all'> - /* style: toc */ - .man-navigation {display:block !important;position:fixed;top:0;left:113ex;height:100%;width:100%;padding:48px 0 0 0;border-left:1px solid #dbdbdb;background:#eee} - .man-navigation a,.man-navigation a:hover,.man-navigation a:link,.man-navigation a:visited {display:block;margin:0;padding:5px 2px 5px 30px;color:#999;text-decoration:none} - .man-navigation a:hover {color:#111;text-decoration:underline} - </style> -</head> -<!-- - The following styles are deprecated and will be removed at some point: - div#man, div#man ol.man, div#man ol.head, div#man ol.man. - - The .man-page, .man-decor, .man-head, .man-foot, .man-title, and - .man-navigation should be used instead. ---> -<body id='manpage'> - <div class='mp' id='man'> - - <div class='man-navigation' style='display:none'> - <a href="#NAME">NAME</a> - <a href="#SYNOPSIS">SYNOPSIS</a> - <a href="#DESCRIPTION">DESCRIPTION</a> - <a href="#TERMINAL-MULTIPLEXING-AND-TERMINAL-TAB-SUPPORT">TERMINAL MULTIPLEXING AND TERMINAL TAB SUPPORT</a> - <a href="#SEE-ALSO">SEE ALSO</a> - <a href="#AUTHOR">AUTHOR</a> - <a href="#DOCUMENTATION">DOCUMENTATION</a> - <a href="#CHEF">CHEF</a> - </div> - - <ol class='man-decor man-head man head'> - <li class='tl'>knife-ssh(1)</li> - <li class='tc'>Chef Manual</li> - <li class='tr'>knife-ssh(1)</li> - </ol> - - <h2 id="NAME">NAME</h2> -<p class="man-name"> - <code>knife-ssh</code> - <span class="man-whatis">Run a command or interactive session on multiple remote hosts</span> -</p> - -<h2 id="SYNOPSIS">SYNOPSIS</h2> - -<p><strong>knife</strong> <strong>ssh QUERY COMMAND</strong> <em>(options)</em></p> - -<dl> -<dt><code>-a</code>, <code>--attribute ATTR </code></dt><dd>The attribute to use for opening the connection - default is fqdn</dd> -<dt><code>-C</code>, <code>--concurrency NUM </code></dt><dd>The number of concurrent connections</dd> -<dt><code>-m</code>, <code>--manual-list </code></dt><dd>QUERY is a space separated list of servers</dd> -<dt><code>-P</code>, <code>--ssh-password PASSWORD</code></dt><dd>The ssh password</dd> -<dt><code>-x</code>, <code>--ssh-user USERNAME </code></dt><dd>The ssh username</dd> -<dt><code>-i</code>, <code>--identity-file IDENTITY_FILE</code></dt><dd>The SSH identity file used for authentication</dd> -<dt><code>-p</code>, <code>--ssh-port PORT</code></dt><dd>The ssh port</dd> -<dt><code>--[no-]host-key-verify</code></dt><dd>Verify host key, enabled by default.</dd> -</dl> - - -<h2 id="DESCRIPTION">DESCRIPTION</h2> - -<p>The <em>ssh</em> sub-command opens an ssh session to each of the nodes in the -search results of the <em>QUERY</em>. This sub-command requires that the -net-ssh-multi and highline Ruby libraries are installed. On Debian -systems, these are the libnet-ssh-multi-ruby and libhighline-ruby -packages. They can also be installed as RubyGems (net-ssh-multi and -highline, respectively).</p> - -<h2 id="TERMINAL-MULTIPLEXING-AND-TERMINAL-TAB-SUPPORT">TERMINAL MULTIPLEXING AND TERMINAL TAB SUPPORT</h2> - -<p><code>knife ssh</code> integrates with several terminal multiplexer programs to -provide a more convenient means of managing multiple ssh sessions. When -the <em>COMMAND</em> option matches one of these, <code>knife ssh</code> will create -multiple interactive ssh sessions running locally in the terminal -multiplexer instead of invoking the command on the remote host.</p> - -<p>The available multiplexers are:</p> - -<dl> -<dt><code>interactive</code></dt><dd>A built-in multiplexer. <code>interactive</code> supports running commands on a -subset of the connected hosts in parallel</dd> -<dt><strong>screen</strong>(1)</dt><dd>Runs ssh interactively inside <code>screen</code>. ~/.screenrc will be sourced -if it exists.</dd> -<dt class="flush"><strong>tmux</strong>(1)</dt><dd>Runs ssh interactively inside tmux.</dd> -<dt><code>macterm</code> (Mac OS X only)</dt><dd>Opens a Terminal.app window and creates a tab for each ssh session. -You must install the rb-appscript gem before you can use this -option.</dd> -</dl> - - -<h2 id="SEE-ALSO">SEE ALSO</h2> - -<p> <strong>knife-search</strong>(1)</p> - -<h2 id="AUTHOR">AUTHOR</h2> - -<p> Chef was written by Adam Jacob <a href="mailto:adam@opscode.com" data-bare-link="true">adam@opscode.com</a> with many contributions from the community.</p> - -<h2 id="DOCUMENTATION">DOCUMENTATION</h2> - -<p> This manual page was written by Joshua Timberman <a href="mailto:joshua@opscode.com" data-bare-link="true">joshua@opscode.com</a>. - Permission is granted to copy, distribute and / or modify this document under the terms of the Apache 2.0 License.</p> - -<h2 id="CHEF">CHEF</h2> - -<p> Knife is distributed with Chef. <a href="http://wiki.opscode.com/display/chef/Home" data-bare-link="true">http://wiki.opscode.com/display/chef/Home</a></p> - - - <ol class='man-decor man-foot man foot'> - <li class='tl'>Chef 11.8.0</li> - <li class='tc'>October 2013</li> - <li class='tr'>knife-ssh(1)</li> - </ol> - - </div> -</body> -</html> diff --git a/distro/common/html/knife-status.1.html b/distro/common/html/knife-status.1.html deleted file mode 100644 index e012d22976..0000000000 --- a/distro/common/html/knife-status.1.html +++ /dev/null @@ -1,128 +0,0 @@ -<!DOCTYPE html> -<html> -<head> - <meta http-equiv='content-type' value='text/html;charset=utf8'> - <meta name='generator' value='Ronn/v0.7.3 (http://github.com/rtomayko/ronn/tree/0.7.3)'> - <title>knife-status(1) - Display status information for the nodes in your infrastructure</title> - <style type='text/css' media='all'> - /* style: man */ - body#manpage {margin:0} - .mp {max-width:100ex;padding:0 9ex 1ex 4ex} - .mp p,.mp pre,.mp ul,.mp ol,.mp dl {margin:0 0 20px 0} - .mp h2 {margin:10px 0 0 0} - .mp > p,.mp > pre,.mp > ul,.mp > ol,.mp > dl {margin-left:8ex} - .mp h3 {margin:0 0 0 4ex} - .mp dt {margin:0;clear:left} - .mp dt.flush {float:left;width:8ex} - .mp dd {margin:0 0 0 9ex} - .mp h1,.mp h2,.mp h3,.mp h4 {clear:left} - .mp pre {margin-bottom:20px} - .mp pre+h2,.mp pre+h3 {margin-top:22px} - .mp h2+pre,.mp h3+pre {margin-top:5px} - .mp img {display:block;margin:auto} - .mp h1.man-title {display:none} - .mp,.mp code,.mp pre,.mp tt,.mp kbd,.mp samp,.mp h3,.mp h4 {font-family:monospace;font-size:14px;line-height:1.42857142857143} - .mp h2 {font-size:16px;line-height:1.25} - .mp h1 {font-size:20px;line-height:2} - .mp {text-align:justify;background:#fff} - .mp,.mp code,.mp pre,.mp pre code,.mp tt,.mp kbd,.mp samp {color:#131211} - .mp h1,.mp h2,.mp h3,.mp h4 {color:#030201} - .mp u {text-decoration:underline} - .mp code,.mp strong,.mp b {font-weight:bold;color:#131211} - .mp em,.mp var {font-style:italic;color:#232221;text-decoration:none} - .mp a,.mp a:link,.mp a:hover,.mp a code,.mp a pre,.mp a tt,.mp a kbd,.mp a samp {color:#0000ff} - .mp b.man-ref {font-weight:normal;color:#434241} - .mp pre {padding:0 4ex} - .mp pre code {font-weight:normal;color:#434241} - .mp h2+pre,h3+pre {padding-left:0} - ol.man-decor,ol.man-decor li {margin:3px 0 10px 0;padding:0;float:left;width:33%;list-style-type:none;text-transform:uppercase;color:#999;letter-spacing:1px} - ol.man-decor {width:100%} - ol.man-decor li.tl {text-align:left} - ol.man-decor li.tc {text-align:center;letter-spacing:4px} - ol.man-decor li.tr {text-align:right;float:right} - </style> - <style type='text/css' media='all'> - /* style: toc */ - .man-navigation {display:block !important;position:fixed;top:0;left:113ex;height:100%;width:100%;padding:48px 0 0 0;border-left:1px solid #dbdbdb;background:#eee} - .man-navigation a,.man-navigation a:hover,.man-navigation a:link,.man-navigation a:visited {display:block;margin:0;padding:5px 2px 5px 30px;color:#999;text-decoration:none} - .man-navigation a:hover {color:#111;text-decoration:underline} - </style> -</head> -<!-- - The following styles are deprecated and will be removed at some point: - div#man, div#man ol.man, div#man ol.head, div#man ol.man. - - The .man-page, .man-decor, .man-head, .man-foot, .man-title, and - .man-navigation should be used instead. ---> -<body id='manpage'> - <div class='mp' id='man'> - - <div class='man-navigation' style='display:none'> - <a href="#NAME">NAME</a> - <a href="#SYNOPSIS">SYNOPSIS</a> - <a href="#DESCRIPTION">DESCRIPTION</a> - <a href="#SEE-ALSO">SEE ALSO</a> - <a href="#AUTHOR">AUTHOR</a> - <a href="#DOCUMENTATION">DOCUMENTATION</a> - <a href="#CHEF">CHEF</a> - </div> - - <ol class='man-decor man-head man head'> - <li class='tl'>knife-status(1)</li> - <li class='tc'>Chef Manual</li> - <li class='tr'>knife-status(1)</li> - </ol> - - <h2 id="NAME">NAME</h2> -<p class="man-name"> - <code>knife-status</code> - <span class="man-whatis">Display status information for the nodes in your infrastructure</span> -</p> - -<h2 id="SYNOPSIS">SYNOPSIS</h2> - -<p><strong>knife</strong> <strong>status</strong> <em>(options)</em></p> - -<dl> -<dt><code>-r</code>, <code>--run-list RUN_LIST</code></dt><dd>Show the run list</dd> -</dl> - - -<h2 id="DESCRIPTION">DESCRIPTION</h2> - -<p>The <em>status</em> sub-command searches the Chef Server for all nodes and -displays information about the last time the node checked into the -server and executed a <code>node.save</code>. The fields displayed are the relative -checkin time, the node name, it's operating system platform and version, -the fully-qualified domain name and the default IP address. If the <code>-r</code> -option is given, the node's run list will also be displayed. Note that -depending on the configuration of the nodes, the FQDN and IP displayed -may not be publicly reachable.</p> - -<h2 id="SEE-ALSO">SEE ALSO</h2> - -<p> <strong>knife-search</strong>(1)</p> - -<h2 id="AUTHOR">AUTHOR</h2> - -<p> Chef was written by Adam Jacob <a href="mailto:adam@opscode.com" data-bare-link="true">adam@opscode.com</a> with many contributions from the community.</p> - -<h2 id="DOCUMENTATION">DOCUMENTATION</h2> - -<p> This manual page was written by Joshua Timberman <a href="mailto:joshua@opscode.com" data-bare-link="true">joshua@opscode.com</a>. - Permission is granted to copy, distribute and / or modify this document under the terms of the Apache 2.0 License.</p> - -<h2 id="CHEF">CHEF</h2> - -<p> Knife is distributed with Chef. <a href="http://wiki.opscode.com/display/chef/Home" data-bare-link="true">http://wiki.opscode.com/display/chef/Home</a></p> - - - <ol class='man-decor man-foot man foot'> - <li class='tl'>Chef 11.8.0</li> - <li class='tc'>October 2013</li> - <li class='tr'>knife-status(1)</li> - </ol> - - </div> -</body> -</html> diff --git a/distro/common/html/knife-tag.1.html b/distro/common/html/knife-tag.1.html deleted file mode 100644 index c33b5c9871..0000000000 --- a/distro/common/html/knife-tag.1.html +++ /dev/null @@ -1,137 +0,0 @@ -<!DOCTYPE html> -<html> -<head> - <meta http-equiv='content-type' value='text/html;charset=utf8'> - <meta name='generator' value='Ronn/v0.7.3 (http://github.com/rtomayko/ronn/tree/0.7.3)'> - <title>knife-tag(1) - Apply tags to nodes on a Chef Server</title> - <style type='text/css' media='all'> - /* style: man */ - body#manpage {margin:0} - .mp {max-width:100ex;padding:0 9ex 1ex 4ex} - .mp p,.mp pre,.mp ul,.mp ol,.mp dl {margin:0 0 20px 0} - .mp h2 {margin:10px 0 0 0} - .mp > p,.mp > pre,.mp > ul,.mp > ol,.mp > dl {margin-left:8ex} - .mp h3 {margin:0 0 0 4ex} - .mp dt {margin:0;clear:left} - .mp dt.flush {float:left;width:8ex} - .mp dd {margin:0 0 0 9ex} - .mp h1,.mp h2,.mp h3,.mp h4 {clear:left} - .mp pre {margin-bottom:20px} - .mp pre+h2,.mp pre+h3 {margin-top:22px} - .mp h2+pre,.mp h3+pre {margin-top:5px} - .mp img {display:block;margin:auto} - .mp h1.man-title {display:none} - .mp,.mp code,.mp pre,.mp tt,.mp kbd,.mp samp,.mp h3,.mp h4 {font-family:monospace;font-size:14px;line-height:1.42857142857143} - .mp h2 {font-size:16px;line-height:1.25} - .mp h1 {font-size:20px;line-height:2} - .mp {text-align:justify;background:#fff} - .mp,.mp code,.mp pre,.mp pre code,.mp tt,.mp kbd,.mp samp {color:#131211} - .mp h1,.mp h2,.mp h3,.mp h4 {color:#030201} - .mp u {text-decoration:underline} - .mp code,.mp strong,.mp b {font-weight:bold;color:#131211} - .mp em,.mp var {font-style:italic;color:#232221;text-decoration:none} - .mp a,.mp a:link,.mp a:hover,.mp a code,.mp a pre,.mp a tt,.mp a kbd,.mp a samp {color:#0000ff} - .mp b.man-ref {font-weight:normal;color:#434241} - .mp pre {padding:0 4ex} - .mp pre code {font-weight:normal;color:#434241} - .mp h2+pre,h3+pre {padding-left:0} - ol.man-decor,ol.man-decor li {margin:3px 0 10px 0;padding:0;float:left;width:33%;list-style-type:none;text-transform:uppercase;color:#999;letter-spacing:1px} - ol.man-decor {width:100%} - ol.man-decor li.tl {text-align:left} - ol.man-decor li.tc {text-align:center;letter-spacing:4px} - ol.man-decor li.tr {text-align:right;float:right} - </style> - <style type='text/css' media='all'> - /* style: toc */ - .man-navigation {display:block !important;position:fixed;top:0;left:113ex;height:100%;width:100%;padding:48px 0 0 0;border-left:1px solid #dbdbdb;background:#eee} - .man-navigation a,.man-navigation a:hover,.man-navigation a:link,.man-navigation a:visited {display:block;margin:0;padding:5px 2px 5px 30px;color:#999;text-decoration:none} - .man-navigation a:hover {color:#111;text-decoration:underline} - </style> -</head> -<!-- - The following styles are deprecated and will be removed at some point: - div#man, div#man ol.man, div#man ol.head, div#man ol.man. - - The .man-page, .man-decor, .man-head, .man-foot, .man-title, and - .man-navigation should be used instead. ---> -<body id='manpage'> - <div class='mp' id='man'> - - <div class='man-navigation' style='display:none'> - <a href="#NAME">NAME</a> - <a href="#SYNOPSIS">SYNOPSIS</a> - <a href="#TAG-SUBCOMMANDS">TAG SUBCOMMANDS</a> - <a href="#CREATE">CREATE</a> - <a href="#DELETE">DELETE</a> - <a href="#LIST">LIST</a> - <a href="#SEE-ALSO">SEE ALSO</a> - <a href="#AUTHOR">AUTHOR</a> - <a href="#DOCUMENTATION">DOCUMENTATION</a> - <a href="#CHEF">CHEF</a> - </div> - - <ol class='man-decor man-head man head'> - <li class='tl'>knife-tag(1)</li> - <li class='tc'>Chef Manual</li> - <li class='tr'>knife-tag(1)</li> - </ol> - - <h2 id="NAME">NAME</h2> -<p class="man-name"> - <code>knife-tag</code> - <span class="man-whatis">Apply tags to nodes on a Chef Server</span> -</p> - -<h2 id="SYNOPSIS">SYNOPSIS</h2> - -<p><strong>knife</strong> <strong>tag</strong> <em>subcommand</em> <em>(options)</em></p> - -<h2 id="TAG-SUBCOMMANDS">TAG SUBCOMMANDS</h2> - -<p>The following <code>tag</code> subcommands are available:</p> - -<h2 id="CREATE">CREATE</h2> - -<p><strong>knife tag create</strong> <em>node</em> <em>tag</em> [<em>...</em>]</p> - -<p>Adds one or more tags to <em>node</em></p> - -<h2 id="DELETE">DELETE</h2> - -<p><strong>knife tag delete</strong> <em>node</em> <em>tag</em> [<em>...</em>]</p> - -<p>Removes one or more tags from <em>node</em></p> - -<h2 id="LIST">LIST</h2> - -<p><strong>knife tag list</strong> <em>node</em></p> - -<p>Lists the tags applied to <em>node</em></p> - -<h2 id="SEE-ALSO">SEE ALSO</h2> - -<p> <strong><span class="man-ref">knife-node<span class="s">(1)</span></span></strong></p> - -<h2 id="AUTHOR">AUTHOR</h2> - -<p> Chef was written by Adam Jacob <a href="mailto:adam@opscode.com" data-bare-link="true">adam@opscode.com</a> with many contributions from the community.</p> - -<h2 id="DOCUMENTATION">DOCUMENTATION</h2> - -<p> This manual page was written by Daniel DeLeo <a href="mailto:dan@opscode.com" data-bare-link="true">dan@opscode.com</a>. - Permission is granted to copy, distribute and / or modify this document under the terms of the Apache 2.0 License.</p> - -<h2 id="CHEF">CHEF</h2> - -<p> Knife is distributed with Chef. <a href="http://wiki.opscode.com/display/chef/Home" data-bare-link="true">http://wiki.opscode.com/display/chef/Home</a></p> - - - <ol class='man-decor man-foot man foot'> - <li class='tl'>Chef 11.8.0</li> - <li class='tc'>October 2013</li> - <li class='tr'>knife-tag(1)</li> - </ol> - - </div> -</body> -</html> diff --git a/distro/common/html/knife.1.html b/distro/common/html/knife.1.html deleted file mode 100644 index 464a02d7ba..0000000000 --- a/distro/common/html/knife.1.html +++ /dev/null @@ -1,315 +0,0 @@ -<!DOCTYPE html> -<html> -<head> - <meta http-equiv='content-type' value='text/html;charset=utf8'> - <meta name='generator' value='Ronn/v0.7.3 (http://github.com/rtomayko/ronn/tree/0.7.3)'> - <title>knife(1) - Chef Server API client utility</title> - <style type='text/css' media='all'> - /* style: man */ - body#manpage {margin:0} - .mp {max-width:100ex;padding:0 9ex 1ex 4ex} - .mp p,.mp pre,.mp ul,.mp ol,.mp dl {margin:0 0 20px 0} - .mp h2 {margin:10px 0 0 0} - .mp > p,.mp > pre,.mp > ul,.mp > ol,.mp > dl {margin-left:8ex} - .mp h3 {margin:0 0 0 4ex} - .mp dt {margin:0;clear:left} - .mp dt.flush {float:left;width:8ex} - .mp dd {margin:0 0 0 9ex} - .mp h1,.mp h2,.mp h3,.mp h4 {clear:left} - .mp pre {margin-bottom:20px} - .mp pre+h2,.mp pre+h3 {margin-top:22px} - .mp h2+pre,.mp h3+pre {margin-top:5px} - .mp img {display:block;margin:auto} - .mp h1.man-title {display:none} - .mp,.mp code,.mp pre,.mp tt,.mp kbd,.mp samp,.mp h3,.mp h4 {font-family:monospace;font-size:14px;line-height:1.42857142857143} - .mp h2 {font-size:16px;line-height:1.25} - .mp h1 {font-size:20px;line-height:2} - .mp {text-align:justify;background:#fff} - .mp,.mp code,.mp pre,.mp pre code,.mp tt,.mp kbd,.mp samp {color:#131211} - .mp h1,.mp h2,.mp h3,.mp h4 {color:#030201} - .mp u {text-decoration:underline} - .mp code,.mp strong,.mp b {font-weight:bold;color:#131211} - .mp em,.mp var {font-style:italic;color:#232221;text-decoration:none} - .mp a,.mp a:link,.mp a:hover,.mp a code,.mp a pre,.mp a tt,.mp a kbd,.mp a samp {color:#0000ff} - .mp b.man-ref {font-weight:normal;color:#434241} - .mp pre {padding:0 4ex} - .mp pre code {font-weight:normal;color:#434241} - .mp h2+pre,h3+pre {padding-left:0} - ol.man-decor,ol.man-decor li {margin:3px 0 10px 0;padding:0;float:left;width:33%;list-style-type:none;text-transform:uppercase;color:#999;letter-spacing:1px} - ol.man-decor {width:100%} - ol.man-decor li.tl {text-align:left} - ol.man-decor li.tc {text-align:center;letter-spacing:4px} - ol.man-decor li.tr {text-align:right;float:right} - </style> - <style type='text/css' media='all'> - /* style: toc */ - .man-navigation {display:block !important;position:fixed;top:0;left:113ex;height:100%;width:100%;padding:48px 0 0 0;border-left:1px solid #dbdbdb;background:#eee} - .man-navigation a,.man-navigation a:hover,.man-navigation a:link,.man-navigation a:visited {display:block;margin:0;padding:5px 2px 5px 30px;color:#999;text-decoration:none} - .man-navigation a:hover {color:#111;text-decoration:underline} - </style> -</head> -<!-- - The following styles are deprecated and will be removed at some point: - div#man, div#man ol.man, div#man ol.head, div#man ol.man. - - The .man-page, .man-decor, .man-head, .man-foot, .man-title, and - .man-navigation should be used instead. ---> -<body id='manpage'> - <div class='mp' id='man'> - - <div class='man-navigation' style='display:none'> - <a href="#NAME">NAME</a> - <a href="#SYNOPSIS">SYNOPSIS</a> - <a href="#DESCRIPTION">DESCRIPTION</a> - <a href="#OPTIONS">OPTIONS</a> - <a href="#SUB-COMMANDS">SUB-COMMANDS</a> - <a href="#CONFIGURATION">CONFIGURATION</a> - <a href="#FILES">FILES</a> - <a href="#FORMATS">FORMATS</a> - <a href="#CHEF-WORKFLOW">CHEF WORKFLOW</a> - <a href="#EXAMPLES">EXAMPLES</a> - <a href="#ENVIRONMENT">ENVIRONMENT</a> - <a href="#SEE-ALSO">SEE ALSO</a> - <a href="#AUTHOR">AUTHOR</a> - <a href="#DOCUMENTATION">DOCUMENTATION</a> - <a href="#LICENSE">LICENSE</a> - <a href="#CHEF">CHEF</a> - </div> - - <ol class='man-decor man-head man head'> - <li class='tl'>knife(1)</li> - <li class='tc'>Chef Manual</li> - <li class='tr'>knife(1)</li> - </ol> - - <h2 id="NAME">NAME</h2> -<p class="man-name"> - <code>knife</code> - <span class="man-whatis">Chef Server API client utility</span> -</p> - -<h2 id="SYNOPSIS">SYNOPSIS</h2> - -<p><strong>knife</strong> <em>sub-command</em> [<em>argument</em>...] <em>(options)</em></p> - -<h2 id="DESCRIPTION">DESCRIPTION</h2> - -<p>Knife is a command-line utility used to manage data on a Chef server -through the HTTP(S) API. Knife is organized into groups of subcommands -centered around the various object types in Chef. Each category of -subcommand is documented in its own manual page. Available topics are:</p> - -<ul> -<li>bootstrap</li> -<li>client</li> -<li>configure</li> -<li>cookbook-site</li> -<li>cookbook</li> -<li>data-bag</li> -<li>environment</li> -<li>exec</li> -<li>index</li> -<li>node</li> -<li>recipe</li> -<li>role</li> -<li>search</li> -<li>ssh</li> -<li>status</li> -<li>tag</li> -</ul> - - -<p>If the knife manuals are in your <code>MANPATH</code>, you can access help for the -above topics using <code>man knife-TOPIC</code>; otherwise, you can view the -documentation using <code>knife help TOPIC</code>.</p> - -<h2 id="OPTIONS">OPTIONS</h2> - -<dl> -<dt><code>-s</code>, <code>--server-url</code> URL</dt><dd>Chef Server URL, corresponds to <code>Chef::Config</code> <code>chef_server_url</code>.</dd> -<dt><code>-k</code>, <code>--key</code> KEY</dt><dd>API Client Key, corresponds to <code>Chef::Config</code> <code>client_key</code>.</dd> -<dt><code>-c</code>, <code>--config</code> CONFIG</dt><dd>The configuration file to use</dd> -<dt><code>-E</code>, <code>--environment ENVIRONMENT</code></dt><dd>Set the Chef environment</dd> -<dt><code>-e</code>, <code>--editor</code> EDITOR</dt><dd>Set the editor to use for interactive commands</dd> -<dt><code>-F</code>, <code>--format</code> FORMAT</dt><dd>Which format to use for output. See FORMATS for details.</dd> -<dt><code>-d</code>, <code>--disable-editing</code></dt><dd>Do not open EDITOR, just accept the data as is</dd> -<dt><code>-u</code>, <code>--user</code> USER</dt><dd>API Client Username, corresponds to <code>Chef::Config</code> <code>node_name</code>.</dd> -<dt><code>-p</code>, <code>--print-after</code></dt><dd>Show the data after a destructive operation</dd> -<dt><code>-v</code>, <code>--version</code></dt><dd>Show chef version</dd> -<dt><code>-V</code>, <code>--verbose</code></dt><dd>More verbose output. Use twice for max verbosity.</dd> -<dt><code>-y</code>, <code>--yes</code></dt><dd>Say yes to all prompts for confirmation</dd> -<dt><code>--defaults</code></dt><dd>Accept default values for all questions</dd> -<dt><code>--[no-]color</code></dt><dd>Use colored output. Color enabled by default.</dd> -<dt><code>-h</code>, <code>--help</code></dt><dd>Show the available options for a command.</dd> -</dl> - - -<h2 id="SUB-COMMANDS">SUB-COMMANDS</h2> - -<p>Sub-commands that operate on the basic Chef data types are structured as -<em>NOUN verb NOUN (options)</em>. For all data types, the following commands -are available:</p> - -<ul> -<li>create (create)</li> -<li>list and show (read)</li> -<li>edit (update)</li> -<li>delete (destroy)</li> -</ul> - - -<p>Knife also includes commands that take actions other than displaying or -modifying data on the Chef Server, such as <strong><span class="man-ref">knife-ssh<span class="s">(1)</span></span></strong>.</p> - -<h2 id="CONFIGURATION">CONFIGURATION</h2> - -<p>The knife configuration file is a Ruby DSL to set configuration -parameters for Knife's <strong>GENERAL OPTIONS</strong>. The default location for the -config file is <code>~/.chef/knife.rb</code>. If managing multiple Chef -repositories, per-repository config files can be created. The file must -be <code>.chef/knife.rb</code> in the current directory of the repository.</p> - -<p>If the config file exists, knife uses these settings for <strong>GENERAL OPTIONS</strong> defaults.</p> - -<ul> -<li><code>node_name</code>: -User or client identity (i.e., <em>name</em>) to use for authenticating -requests to the Chef Server.</li> -<li><code>client_key</code>: -Private key file to authenticate to the Chef server. Corresponds to the -<code>-k</code> or <code>--key</code> option.</li> -<li><code>chef_server_url</code>: -URL of the Chef server. Corresponds to the <code>-s</code> or <code>--server-url</code> -option. This is requested from the user when running this sub-command.</li> -<li><code>syntax_check_cache_path</code>: -Specifies the path to a directory where knife caches information -about files that it has syntax checked.</li> -<li><code>validation_client_name</code>: -Specifies the name of the client used to validate new clients.</li> -<li><code>validation_key</code>: -Specifies the private key file to use when bootstrapping new hosts. -See <span class="man-ref">knife-client<span class="s">(1)</span></span> for more information about the validation -client.</li> -<li><code>cookbook_copyright</code>, <code>cookbook_email</code>, <code>cookbook_license</code>, <code>readme_format</code> -Used by <code>knife cookbook create</code> sub-command to specify the copyright -holder, maintainer email, license and readme format (respectively) for new cookbooks. -The copyright holder is listed as the maintainer in the cookbook's -metadata and as the Copyright in the comments of the default recipe. The -maintainer email is used in the cookbook metadata. The license -determines what preamble to put in the comment of the default recipe, -and is listed as the license in the cookbook metadata. Currently -supported licenses are "apachev2" and "none". Any other values will -result in an empty license in the metadata (needs to be filled in by the -author), and no comment preamble in the default recipe. Currently supported -readme formats are "md", "mkd", "txt", and "rdoc". Any other value will -result in an unformatted README.</li> -</ul> - - -<h2 id="FILES">FILES</h2> - -<p><em>~/.chef/knife.rb</em></p> - -<p>Ruby DSL configuration file for knife. See <strong>CONFIGURATION</strong>.</p> - -<h2 id="FORMATS">FORMATS</h2> - -<p>The amount of content displayed and the output format are -modified by the <code>--format</code> option. If no alternate format is selected, -the default is summary.</p> - -<p>Valid formats are:</p> - -<dl> -<dt class="flush"><code>summary</code></dt><dd>displays the node in a custom, summarized format (default)</dd> -<dt class="flush"><code>text</code></dt><dd>displays the node data in its entirety using the colorized tree display</dd> -<dt class="flush"><code>json</code></dt><dd>displays the node in JSON format</dd> -<dt class="flush"><code>yaml</code></dt><dd>displays the node in YAML format</dd> -<dt class="flush"><code>pp</code></dt><dd>displays the node using Ruby's pretty printer.</dd> -</dl> - - -<p>For brevity, only the first character of the format is required, for -example, -Fj will produce JSON format output.</p> - -<h2 id="CHEF-WORKFLOW">CHEF WORKFLOW</h2> - -<p>When working with Chef and Knife in the local repository, the recommended workflow outline looks like:</p> - -<ul> -<li>Create repository. A skeleton sample is provided at <em>http://github.com/opscode/chef-repo/</em>.</li> -<li>Configure knife, see <strong>CONFIGURATION</strong>.</li> -<li>Download cookbooks from the Opscode cookbooks site, see <strong>COOKBOOK SITE SUB-COMMANDS</strong>.</li> -<li>Or, create new cookbooks, see <code>cookbook create</code> sub-command.</li> -<li>Commit changes to the version control system. See your tool's documentation.</li> -<li>Upload cookbooks to the Chef Server, see <strong>COOKBOOK SUB-COMMANDS</strong>.</li> -<li>Launch instances in the Cloud, OR provision new hosts; see <strong>CLOUD COMPUTING SUB-COMMANDS</strong> and <strong>BOOTSTRAP SUB-COMMANDS</strong>.</li> -<li>Watch Chef configure systems!</li> -</ul> - - -<p>A note about git: Opscode and many folks in the Chef community use git, -but it is not required, except in the case of the <code>cookbook site vendor</code> -sub-command, as it uses git directly. Version control is strongly -recommended though, and git fits with a lot of the workflow paradigms.</p> - -<h2 id="EXAMPLES">EXAMPLES</h2> - -<h2 id="ENVIRONMENT">ENVIRONMENT</h2> - -<dl> -<dt class="flush"><code>EDITOR</code></dt><dd>The text editor to use for editing data. The --editor option takes -precedence over this value, and the --disable-editing option supresses -data editing entirely.</dd> -</dl> - - -<h2 id="SEE-ALSO">SEE ALSO</h2> - -<p> <strong><span class="man-ref">chef-client<span class="s">(8)</span></span></strong> <strong><span class="man-ref">chef-server<span class="s">(8)</span></span></strong> <strong><span class="man-ref">chef-shell<span class="s">(1)</span></span></strong></p> - -<p> <strong><span class="man-ref">knife-bootstrap<span class="s">(1)</span></span></strong> <strong><span class="man-ref">knife-client<span class="s">(1)</span></span></strong> <strong><span class="man-ref">knife-configure<span class="s">(1)</span></span></strong> - <strong><span class="man-ref">knife-cookbook-site<span class="s">(1)</span></span></strong> <strong><span class="man-ref">knife-cookbook<span class="s">(1)</span></span></strong> <strong><span class="man-ref">knife-data-bag<span class="s">(1)</span></span></strong> - <strong><span class="man-ref">knife-environment<span class="s">(1)</span></span></strong> <strong><span class="man-ref">knife-exec<span class="s">(1)</span></span></strong> <strong><span class="man-ref">knife-index<span class="s">(1)</span></span></strong> - <strong><span class="man-ref">knife-node<span class="s">(1)</span></span></strong> <strong><span class="man-ref">knife-recipe<span class="s">(1)</span></span></strong> <strong><span class="man-ref">knife-role<span class="s">(1)</span></span></strong> - <strong><span class="man-ref">knife-search<span class="s">(1)</span></span></strong> <strong><span class="man-ref">knife-ssh<span class="s">(1)</span></span></strong> <strong><span class="man-ref">knife-tag<span class="s">(1)</span></span></strong></p> - -<p> Complete Chef documentation is available online: <a href="http://wiki.opscode.com/display/chef/Home/" data-bare-link="true">http://wiki.opscode.com/display/chef/Home/</a></p> - -<p> JSON is JavaScript Object Notation <a href="http://json.org/" data-bare-link="true">http://json.org/</a></p> - -<p> SOLR is an open source search engine. <a href="http://lucene.apache.org/solr/" data-bare-link="true">http://lucene.apache.org/solr/</a></p> - -<p> <strong><span class="man-ref">git<span class="s">(1)</span></span></strong> is a version control system <a href="http://git-scm.com/" data-bare-link="true">http://git-scm.com/</a></p> - -<p> This manual page was generated from Markdown with <strong><span class="man-ref">ronn<span class="s">(1)</span></span></strong> <a href="http://rtomayko.github.com/ronn/ronn.1.html" data-bare-link="true">http://rtomayko.github.com/ronn/ronn.1.html</a></p> - -<h2 id="AUTHOR">AUTHOR</h2> - -<p> Chef was written by Adam Jacob <a href="mailto:adam@opscode.com" data-bare-link="true">adam@opscode.com</a> of Opscode - (<a href="http://www.opscode.com" data-bare-link="true">http://www.opscode.com</a>), with contributions from the community.</p> - -<h2 id="DOCUMENTATION">DOCUMENTATION</h2> - -<p> This manual page was written by Joshua Timberman <a href="mailto:joshua@opscode.com" data-bare-link="true">joshua@opscode.com</a>.</p> - -<h2 id="LICENSE">LICENSE</h2> - -<p> Both Chef and this documentation are released under the terms of the - Apache 2.0 License. You may view the license online: <a href="http://www.apache.org/licenses/LICENSE-2.0.html" data-bare-link="true">http://www.apache.org/licenses/LICENSE-2.0.html</a> - On some systems, the complete text of the Apache 2.0 License may be found in <code>/usr/share/common-licenses/Apache-2.0</code>.</p> - -<h2 id="CHEF">CHEF</h2> - -<p> Knife is distributed with Chef. <a href="http://wiki.opscode.com/display/chef/Home" data-bare-link="true">http://wiki.opscode.com/display/chef/Home</a></p> - - - <ol class='man-decor man-foot man foot'> - <li class='tl'>Chef 11.8.0</li> - <li class='tc'>October 2013</li> - <li class='tr'>knife(1)</li> - </ol> - - </div> -</body> -</html> diff --git a/distro/common/html/knife.html b/distro/common/html/knife.html new file mode 100644 index 0000000000..d2f425438f --- /dev/null +++ b/distro/common/html/knife.html @@ -0,0 +1,172 @@ + +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> + + +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> + + <title>knife — chef-client Man Pages</title> + + <link rel="stylesheet" href="_static/guide.css" type="text/css" /> + <link rel="stylesheet" href="_static/pygments.css" type="text/css" /> + + <script type="text/javascript"> + var DOCUMENTATION_OPTIONS = { + URL_ROOT: '', + VERSION: '', + COLLAPSE_INDEX: false, + FILE_SUFFIX: '.html', + HAS_SOURCE: true + }; + </script> + <script type="text/javascript" src="_static/jquery.js"></script> + <script type="text/javascript" src="_static/underscore.js"></script> + <script type="text/javascript" src="_static/doctools.js"></script> + <link rel="shortcut icon" href="_static/chef.ico"/> + + + </head> + <body> +<div style="background-color: #212c35; text-align: left; padding: 0px 0px 0px 0px"> +<a href="http://docs.opscode.com/"><img src="_static/chef_html_logo.png" border="0" alt="Chef"/></a> +</div> + + + + + <div class="document"> + <div class="documentwrapper"> + + <div class="body"> + + <div class="section" id="knife"> +<h1>knife<a class="headerlink" href="#knife" title="Permalink to this headline">¶</a></h1> +<p>Knife is a command-line tool that provides an interface between a local chef-repo and the server. Knife helps users to manage:</p> +<ul class="simple"> +<li>Nodes</li> +<li>Cookbooks and recipes</li> +<li>Roles</li> +<li>Stores of JSON data (data bags), including encrypted data</li> +<li>Environments</li> +<li>Cloud resources, including provisioning</li> +<li>The installation of the chef-client on management workstations</li> +<li>Searching of indexed data on the server</li> +</ul> +<p>The following sections describe functionality common to all Knife subcommands:</p> +<ul class="simple"> +<li><a class="reference internal" href="knife_using.html"><em>Working with Knife</em></a></li> +<li><a class="reference internal" href="knife_common_options.html"><em>Common Options</em></a></li> +</ul> +<p>Knife includes the following sub-commands:</p> +<table border="1" class="docutils"> +<colgroup> +<col width="25%" /> +<col width="75%" /> +</colgroup> +<thead valign="bottom"> +<tr class="row-odd"><th class="head">Sub-command</th> +<th class="head">Description</th> +</tr> +</thead> +<tbody valign="top"> +<tr class="row-even"><td><a class="reference internal" href="knife_bootstrap.html"><em>knife bootstrap</em></a></td> +<td>The <strong>knife bootstrap</strong> subcommand is used to run a bootstrap operation that installs the chef-client on the target system. The bootstrap operation must specify the IP address or FQDN of the target system.</td> +</tr> +<tr class="row-odd"><td><a class="reference internal" href="knife_client.html"><em>knife client</em></a></td> +<td>The <strong>knife client</strong> subcommand is used to manage an API client list and their associated RSA public key-pairs. This allows authentication requests to be made to the server by any entity that uses the Chef Server API, such as the chef-client and Knife.</td> +</tr> +<tr class="row-even"><td><a class="reference internal" href="knife_configure.html"><em>knife configure</em></a></td> +<td>The <strong>knife configure</strong> subcommand is used to create the knife.rb and client.rb files so that they can be distributed to workstations and nodes.</td> +</tr> +<tr class="row-odd"><td><a class="reference internal" href="knife_cookbook.html"><em>knife cookbook</em></a></td> +<td>The <strong>knife cookbook</strong> subcommand is used to interact with cookbooks that are located on the server or the local chef-repo.</td> +</tr> +<tr class="row-even"><td><a class="reference internal" href="knife_cookbook_site.html"><em>knife cookbook site</em></a></td> +<td>The <strong>knife cookbook site</strong> subcommand is used to interact with cookbooks that are located at <a class="reference external" href="https://cookbooks.opscode.com">https://cookbooks.opscode.com</a>. A user account is required for any community actions that write data to this site. The following arguments do not require a user account: <tt class="docutils literal"><span class="pre">download</span></tt>, <tt class="docutils literal"><span class="pre">search</span></tt>, <tt class="docutils literal"><span class="pre">install</span></tt>, and <tt class="docutils literal"><span class="pre">list</span></tt>.</td> +</tr> +<tr class="row-odd"><td><a class="reference internal" href="knife_data_bag.html"><em>knife data bag</em></a></td> +<td>The <strong>knife data bag</strong> subcommand is used to manage arbitrary stores of globally available JSON data.</td> +</tr> +<tr class="row-even"><td><a class="reference internal" href="knife_delete.html"><em>knife delete</em></a></td> +<td>The <strong>knife delete</strong> subcommand is used to delete an object from a server. This subcommand works similar to <tt class="docutils literal"><span class="pre">knife</span> <span class="pre">cookbook</span> <span class="pre">delete</span></tt>, <tt class="docutils literal"><span class="pre">knife</span> <span class="pre">data</span> <span class="pre">bag</span> <span class="pre">delete</span></tt>, <tt class="docutils literal"><span class="pre">knife</span> <span class="pre">environment</span> <span class="pre">delete</span></tt>, <tt class="docutils literal"><span class="pre">knife</span> <span class="pre">node</span> <span class="pre">delete</span></tt>, and <tt class="docutils literal"><span class="pre">knife</span> <span class="pre">role</span> <span class="pre">delete</span></tt>, but with a single verb (and a single action).</td> +</tr> +<tr class="row-odd"><td><a class="reference internal" href="knife_deps.html"><em>knife deps</em></a></td> +<td>The <strong>knife deps</strong> subcommand is used to identify dependencies for a node, role, or cookbook.</td> +</tr> +<tr class="row-even"><td><a class="reference internal" href="knife_diff.html"><em>knife diff</em></a></td> +<td>The <strong>knife diff</strong> subcommand is used to compare the differences between files and directories on the server and in the chef-repo. For example, to compare files on the server prior to an uploading or downloading files using the <tt class="docutils literal"><span class="pre">knife</span> <span class="pre">download</span></tt> and <tt class="docutils literal"><span class="pre">knife</span> <span class="pre">upload</span></tt> subcommands, or to ensure that certain files in multiple production environments are the same. This subcommand is similar to the <tt class="docutils literal"><span class="pre">git</span> <span class="pre">diff</span></tt> command that can be used to diff what is in the chef-repo with what is synced to a git repository.</td> +</tr> +<tr class="row-odd"><td><a class="reference internal" href="knife_download.html"><em>knife download</em></a></td> +<td>The <strong>knife download</strong> subcommand is used to download roles, cookbooks, environments, nodes, and data bags from the server to the current working directory. It can be used to back up data on the server, inspect the state of one or more files, or to extract out-of-process changes users may have made to files on the server, such as if a user made a change that bypassed version source control. This subcommand is often used in conjunction with <tt class="docutils literal"><span class="pre">knife</span> <span class="pre">diff</span></tt>, which can be used to see exactly what changes will be downloaded, and then <tt class="docutils literal"><span class="pre">knife</span> <span class="pre">upload</span></tt>, which does the opposite of <tt class="docutils literal"><span class="pre">knife</span> <span class="pre">download</span></tt>.</td> +</tr> +<tr class="row-even"><td><a class="reference internal" href="knife_edit.html"><em>knife edit</em></a></td> +<td>The <strong>knife edit</strong> subcommand is used to edit objects on the server. This subcommand works similar to <tt class="docutils literal"><span class="pre">knife</span> <span class="pre">cookbook</span> <span class="pre">edit</span></tt>, <tt class="docutils literal"><span class="pre">knife</span> <span class="pre">data</span> <span class="pre">bag</span> <span class="pre">edit</span></tt>, <tt class="docutils literal"><span class="pre">knife</span> <span class="pre">environment</span> <span class="pre">edit</span></tt>, <tt class="docutils literal"><span class="pre">knife</span> <span class="pre">node</span> <span class="pre">edit</span></tt>, and <tt class="docutils literal"><span class="pre">knife</span> <span class="pre">role</span> <span class="pre">edit</span></tt>, but with a single verb (and a single action).</td> +</tr> +<tr class="row-odd"><td><a class="reference internal" href="knife_environment.html"><em>knife environment</em></a></td> +<td>The <strong>knife environment</strong> subcommand is used to manage environments within a single organization on the server.</td> +</tr> +<tr class="row-even"><td><a class="reference internal" href="knife_exec.html"><em>knife exec</em></a></td> +<td>The <strong>knife exec</strong> subcommand uses the Knife configuration file to execute Ruby scripts in the context of a fully configured chef-client. This subcommand is most often used to run scripts that will only access server one time (or otherwise very infrequently). Use this subcommand any time that an operation does not warrant full usage of the Knife subcommand library.</td> +</tr> +<tr class="row-odd"><td><a class="reference internal" href="knife_index_rebuild.html"><em>knife index rebuild</em></a></td> +<td>The <strong>knife index rebuild</strong> subcommand is used to rebuild the search indexes for the open source server. This operation is destructive and may take some time.</td> +</tr> +<tr class="row-even"><td><a class="reference internal" href="knife_list.html"><em>knife list</em></a></td> +<td>The <strong>knife list</strong> subcommand is used to view a list of objects on the server. This subcommand works similar to <tt class="docutils literal"><span class="pre">knife</span> <span class="pre">cookbook</span> <span class="pre">list</span></tt>, <tt class="docutils literal"><span class="pre">knife</span> <span class="pre">data</span> <span class="pre">bag</span> <span class="pre">list</span></tt>, <tt class="docutils literal"><span class="pre">knife</span> <span class="pre">environment</span> <span class="pre">list</span></tt>, <tt class="docutils literal"><span class="pre">knife</span> <span class="pre">node</span> <span class="pre">list</span></tt>, and <tt class="docutils literal"><span class="pre">knife</span> <span class="pre">role</span> <span class="pre">list</span></tt>, but with a single verb (and a single action).</td> +</tr> +<tr class="row-odd"><td><a class="reference internal" href="knife_node.html"><em>knife node</em></a></td> +<td>The <strong>knife node</strong> subcommand is used to manage the nodes that exist on a server.</td> +</tr> +<tr class="row-even"><td><a class="reference internal" href="knife_raw.html"><em>knife raw</em></a></td> +<td>The <strong>knife raw</strong> subcommand is used to send a REST request to a specified path using the Chef Server API.</td> +</tr> +<tr class="row-odd"><td><a class="reference internal" href="knife_recipe_list.html"><em>knife recipe list</em></a></td> +<td>The <strong>knife recipe list</strong> subcommand is used to view all of the recipes that are on a server. A regular expression can be used to limit the results to recipes that match a specific pattern. The regular expression must be within quotes and not be surrounded by forward slashes (/).</td> +</tr> +<tr class="row-even"><td><a class="reference internal" href="knife_role.html"><em>knife role</em></a></td> +<td>The <strong>knife role</strong> subcommand is used to manage the roles that are associated with one or more nodes on a server.</td> +</tr> +<tr class="row-odd"><td><a class="reference internal" href="knife_search.html"><em>knife search</em></a></td> +<td>The <strong>knife search</strong> subcommand is used run a search query for information that is indexed on a server.</td> +</tr> +<tr class="row-even"><td><a class="reference internal" href="knife_show.html"><em>knife show</em></a></td> +<td>The <strong>knife show</strong> subcommand is used to view the details of one (or more) objects on the server. This subcommand works similar to <tt class="docutils literal"><span class="pre">knife</span> <span class="pre">cookbook</span> <span class="pre">show</span></tt>, <tt class="docutils literal"><span class="pre">knife</span> <span class="pre">data</span> <span class="pre">bag</span> <span class="pre">show</span></tt>, <tt class="docutils literal"><span class="pre">knife</span> <span class="pre">environment</span> <span class="pre">show</span></tt>, <tt class="docutils literal"><span class="pre">knife</span> <span class="pre">node</span> <span class="pre">show</span></tt>, and <tt class="docutils literal"><span class="pre">knife</span> <span class="pre">role</span> <span class="pre">show</span></tt>, but with a single verb (and a single action).</td> +</tr> +<tr class="row-odd"><td><a class="reference internal" href="knife_ssh.html"><em>knife ssh</em></a></td> +<td>The <strong>knife ssh</strong> subcommand is used to invoke SSH commands (in parallel) on a subset of nodes within an organization, based on the results of a search query.</td> +</tr> +<tr class="row-even"><td><a class="reference internal" href="knife_status.html"><em>knife status</em></a></td> +<td>The <strong>knife status</strong> subcommand is used to display a brief summary of the nodes on a server, including the time of the most recent successful chef-client run.</td> +</tr> +<tr class="row-odd"><td><a class="reference internal" href="knife_tag.html"><em>knife tag</em></a></td> +<td>The <strong>knife tag</strong> subcommand is used to apply tags to nodes on a server.</td> +</tr> +<tr class="row-even"><td><a class="reference internal" href="knife_upload.html"><em>knife upload</em></a></td> +<td>The <strong>knife upload</strong> subcommand is used to upload roles, cookbooks, environments, and data bags to the server from the current working directory in the chef-repo. This subcommand is often used in conjunction with <tt class="docutils literal"><span class="pre">knife</span> <span class="pre">diff</span></tt>, which can be used to see exactly what changes will be uploaded, and then <tt class="docutils literal"><span class="pre">knife</span> <span class="pre">download</span></tt>, which does the opposite of <tt class="docutils literal"><span class="pre">knife</span> <span class="pre">upload</span></tt>.</td> +</tr> +<tr class="row-odd"><td><a class="reference internal" href="knife_user.html"><em>knife user</em></a></td> +<td>The <strong>knife user</strong> subcommand is used to manage the list of users and their associated RSA public key-pairs.</td> +</tr> +<tr class="row-even"><td><a class="reference internal" href="knife_xargs.html"><em>knife xargs</em></a></td> +<td>The <strong>knife xargs</strong> subcommand is used to build and execute command lines against objects on a server using standard input.</td> +</tr> +</tbody> +</table> +</div> + + + </div> + + </div> + + + <div class="clearer"></div> + </div> + + + + + </body> +</html>
\ No newline at end of file diff --git a/distro/common/html/knife_bootstrap.html b/distro/common/html/knife_bootstrap.html new file mode 100644 index 0000000000..121db9cdb0 --- /dev/null +++ b/distro/common/html/knife_bootstrap.html @@ -0,0 +1,250 @@ + +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> + + +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> + + <title>knife bootstrap — chef-client Man Pages</title> + + <link rel="stylesheet" href="_static/guide.css" type="text/css" /> + <link rel="stylesheet" href="_static/pygments.css" type="text/css" /> + + <script type="text/javascript"> + var DOCUMENTATION_OPTIONS = { + URL_ROOT: '', + VERSION: '', + COLLAPSE_INDEX: false, + FILE_SUFFIX: '.html', + HAS_SOURCE: true + }; + </script> + <script type="text/javascript" src="_static/jquery.js"></script> + <script type="text/javascript" src="_static/underscore.js"></script> + <script type="text/javascript" src="_static/doctools.js"></script> + <link rel="shortcut icon" href="_static/chef.ico"/> + + + </head> + <body> +<div style="background-color: #212c35; text-align: left; padding: 0px 0px 0px 0px"> +<a href="http://docs.opscode.com/"><img src="_static/chef_html_logo.png" border="0" alt="Chef"/></a> +</div> + + + + + <div class="document"> + <div class="documentwrapper"> + + <div class="body"> + + <div class="section" id="knife-bootstrap"> +<h1>knife bootstrap<a class="headerlink" href="#knife-bootstrap" title="Permalink to this headline">¶</a></h1> +<p>A bootstrap is a process that installs the chef-client on a target system so that it can run as a chef-client and communicate with a server.</p> +<p>The <strong>knife bootstrap</strong> subcommand is used to run a bootstrap operation that installs the chef-client on the target system. The bootstrap operation must specify the IP address or FQDN of the target system.</p> +<div class="admonition note"> +<p class="first admonition-title">Note</p> +<p class="last">To bootstrap the chef-client on Microsoft Windows machines, the <a class="reference external" href="http://docs.opscode.com/plugin_knife_windows.html">knife-windows</a> plugins is required, which includes the necessary bootstrap scripts that are used to do the actual installation.</p> +</div> +<div class="section" id="syntax"> +<h2>Syntax<a class="headerlink" href="#syntax" title="Permalink to this headline">¶</a></h2> +<p>This argument has the following syntax:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife bootstrap FQDN_or_IP_ADDRESS <span class="o">(</span>options<span class="o">)</span> +</pre></div> +</div> +</div> +<div class="section" id="options"> +<h2>Options<a class="headerlink" href="#options" title="Permalink to this headline">¶</a></h2> +<div class="admonition note"> +<p class="first admonition-title">Note</p> +<p class="last">Review the list of <a class="reference internal" href="knife_common_options.html"><em>common options</em></a> available to this (and all) Knife subcommands and plugins.</p> +</div> +<p>This subcommand has the following options:</p> +<dl class="docutils"> +<dt><tt class="docutils literal"><span class="pre">-A</span></tt>, <tt class="docutils literal"><span class="pre">--forward-agent</span></tt></dt> +<dd>Indicates that SSH agent forwarding is enabled.</dd> +<dt><tt class="docutils literal"><span class="pre">--bootstrap-no-proxy</span> <span class="pre">NO_PROXY_URL_or_IP</span></tt></dt> +<dd>A URL or IP address that specifies a location that should not be proxied. Note: This option is used internally by Chef to help verify bootstrap operations during testing and should never be used during an actual bootstrap operation.</dd> +<dt><tt class="docutils literal"><span class="pre">--bootstrap-proxy</span> <span class="pre">PROXY_URL</span></tt></dt> +<dd>The proxy server for the node that is the target of a bootstrap operation.</dd> +<dt><tt class="docutils literal"><span class="pre">--bootstrap-version</span> <span class="pre">VERSION</span></tt></dt> +<dd>The version of the chef-client to install.</dd> +<dt><tt class="docutils literal"><span class="pre">-d</span> <span class="pre">DISTRO</span></tt>, <tt class="docutils literal"><span class="pre">--distro</span> <span class="pre">DISTRO</span></tt></dt> +<dd><div class="first admonition warning"> +<p class="first admonition-title">Warning</p> +<p class="last">The default bootstrap operation uses the omnibus installer, which means the default template file (<tt class="docutils literal"><span class="pre">chef-full</span></tt>) should work on all supported platforms. It is recommended to use custom bootstrap templates only when the omnibus installer cannot be used.</p> +</div> +<p class="last">The template file to be used during a bootstrap operation. The following distributions are supported: <tt class="docutils literal"><span class="pre">chef-full</span></tt> (the default bootstrap), <tt class="docutils literal"><span class="pre">centos5-gems</span></tt>, <tt class="docutils literal"><span class="pre">fedora13-gems</span></tt>, <tt class="docutils literal"><span class="pre">ubuntu10.04-gems</span></tt>, <tt class="docutils literal"><span class="pre">ubuntu10.04-apt</span></tt>, <tt class="docutils literal"><span class="pre">ubuntu12.04-gems</span></tt>, and the name of a custom bootstrap template file. When this option is used, Knife will search for the template file in the following order: the <tt class="docutils literal"><span class="pre">bootstrap/</span></tt> folder in the current working directory, the <tt class="docutils literal"><span class="pre">bootstrap/</span></tt> folder in the chef-repo, the <tt class="docutils literal"><span class="pre">bootstrap/</span></tt> folder in the <tt class="docutils literal"><span class="pre">~/.chef/</span></tt> directory, or a default bootstrap file. Do not use the <tt class="docutils literal"><span class="pre">--template-file</span></tt> option when <tt class="docutils literal"><span class="pre">--distro</span></tt> is specified.</p> +</dd> +<dt><tt class="docutils literal"><span class="pre">-G</span> <span class="pre">GATEWAY</span></tt>, <tt class="docutils literal"><span class="pre">--ssh-gateway</span> <span class="pre">GATEWAY</span></tt></dt> +<dd>The SSH tunnel or gateway that is used to run a bootstrap action on a machine that is not accessible from the workstation.</dd> +<dt><tt class="docutils literal"><span class="pre">--hint</span> <span class="pre">HINT_NAME[=HINT_FILE]</span></tt></dt> +<dd>An Ohai hint to be set on the target of the bootstrap. The hint is contained in a file and is formatted as JSON: <tt class="docutils literal"><span class="pre">{"attribute":"value","attribute":"value"...}</span></tt>. <tt class="docutils literal"><span class="pre">HINT_NAME</span></tt> is the name of the hint and <tt class="docutils literal"><span class="pre">HINT_FILE</span></tt> is the name of the hint file located at <tt class="docutils literal"><span class="pre">/etc/chef/ohai/hints/HINT_FILE.json</span></tt>. Use multiple <tt class="docutils literal"><span class="pre">--hint</span></tt> options in the command to specify multiple hints.</dd> +<dt><tt class="docutils literal"><span class="pre">-i</span> <span class="pre">IDENTITY_FILE</span></tt>, <tt class="docutils literal"><span class="pre">--identity-file</span> <span class="pre">IDENTITY_FILE</span></tt></dt> +<dd>The SSH identity file used for authentication. Key-based authentication is recommended.</dd> +<dt><tt class="docutils literal"><span class="pre">-j</span> <span class="pre">JSON_ATTRIBS</span></tt>, <tt class="docutils literal"><span class="pre">--json-attributes</span> <span class="pre">JSON_ATTRIBS</span></tt></dt> +<dd>A JSON string that is added to the first run of a chef-client.</dd> +<dt><tt class="docutils literal"><span class="pre">-N</span> <span class="pre">NAME</span></tt>, <tt class="docutils literal"><span class="pre">--node-name</span> <span class="pre">NAME</span></tt></dt> +<dd>The name of the node.</dd> +<dt><tt class="docutils literal"><span class="pre">--[no-]host-key-verify</span></tt></dt> +<dd>Use <tt class="docutils literal"><span class="pre">--no-host-key-verify</span></tt> to disable host key verification. Default setting: <tt class="docutils literal"><span class="pre">--host-key-verify</span></tt>.</dd> +<dt><tt class="docutils literal"><span class="pre">-p</span> <span class="pre">PORT</span></tt>, <tt class="docutils literal"><span class="pre">--ssh-port</span> <span class="pre">PORT</span></tt></dt> +<dd>The SSH port.</dd> +<dt><tt class="docutils literal"><span class="pre">-P</span> <span class="pre">PASSWORD</span></tt>, <tt class="docutils literal"><span class="pre">--ssh-password</span> <span class="pre">PASSWORD</span></tt></dt> +<dd>The SSH password. This can be used to pass the password directly on the command line. If this option is not specified (and a password is required) Knife will prompt for the password.</dd> +<dt><tt class="docutils literal"><span class="pre">--prerelease</span></tt></dt> +<dd>Indicates that pre-release gems should be installed.</dd> +<dt><tt class="docutils literal"><span class="pre">-r</span> <span class="pre">RUN_LIST</span></tt>, <tt class="docutils literal"><span class="pre">--run-list</span> <span class="pre">RUN_LIST</span></tt></dt> +<dd>A comma-separated list of roles and/or recipes to be applied.</dd> +<dt><tt class="docutils literal"><span class="pre">--secret</span> <span class="pre">SECRET</span></tt></dt> +<dd>The encryption key that is used for values contained within a data bag item.</dd> +<dt><tt class="docutils literal"><span class="pre">--secret-file</span> <span class="pre">FILE</span></tt></dt> +<dd>The path to the file that contains the encryption key.</dd> +<dt><tt class="docutils literal"><span class="pre">--sudo</span></tt></dt> +<dd>Indicates that a bootstrap operation should be executed using sudo.</dd> +<dt><tt class="docutils literal"><span class="pre">--template-file</span> <span class="pre">TEMPLATE</span></tt></dt> +<dd>The path to a template file that will be used during a bootstrap operation. Do not use the <tt class="docutils literal"><span class="pre">--distro</span></tt> option when <tt class="docutils literal"><span class="pre">--template-file</span></tt> is specified.</dd> +<dt><tt class="docutils literal"><span class="pre">--use-sudo-password</span></tt></dt> +<dd>Indicates that a bootstrap operation is done using sudo, with the password specified by the <tt class="docutils literal"><span class="pre">-P</span></tt> (or <tt class="docutils literal"><span class="pre">--ssh-password</span></tt>) option.</dd> +<dt><tt class="docutils literal"><span class="pre">-x</span> <span class="pre">USERNAME</span></tt>, <tt class="docutils literal"><span class="pre">--ssh-user</span> <span class="pre">USERNAME</span></tt></dt> +<dd>The SSH user name.</dd> +</dl> +</div> +<div class="section" id="custom-templates"> +<h2>Custom Templates<a class="headerlink" href="#custom-templates" title="Permalink to this headline">¶</a></h2> +<p>The <tt class="docutils literal"><span class="pre">chef-full</span></tt> distribution uses the omnibus installer. For most bootstrap operations, regardless of the platform on which the target node is running, using the <tt class="docutils literal"><span class="pre">chef-full</span></tt> distribution is the best approach for installing the chef-client on a target node. In some situations, using another supported distribution is necessary. And in some situations, a custom template may be required. For example, the default bootstrap operation relies on an Internet connection to get the distribution to the target node. If a target node cannot access the Internet, then a custom template can be used to define a specific location for the distribution so that the target node may access it during the bootstrap operation.</p> +<p>A custom bootstrap template file (<tt class="docutils literal"><span class="pre">template_filename.erb</span></tt>) must be located in a <tt class="docutils literal"><span class="pre">bootstrap/</span></tt> directory. Use the <tt class="docutils literal"><span class="pre">--distro</span></tt> option with the <tt class="docutils literal"><span class="pre">knife</span> <span class="pre">bootstrap</span></tt> subcommand to specify the bootstrap template file. For example, a bootstrap template file named “british_sea_power.erb”:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife bootstrap 123.456.7.8 -x username -P password --sudo --distro <span class="s2">"british_sea_power.erb"</span> +</pre></div> +</div> +<p>The following examples show how a bootstrap template file can be customized for various platforms.</p> +<div class="section" id="ubuntu-12-04"> +<h3>Ubuntu 12.04<a class="headerlink" href="#ubuntu-12-04" title="Permalink to this headline">¶</a></h3> +<p>The following example shows how to modify the default script for Ubuntu 12.04. First, copy the bootstrap template from the default location. If the chef-client is installed from a RubyGems, the full path can be found in the gem contents:</p> +<div class="highlight-bash"><div class="highlight"><pre>% gem contents chef | grep ubuntu12.04-gems +/Users/jtimberman/.rvm/gems/ruby-1.9.2-p180/gems/chef-0.10.2/lib/chef/knife/bootstrap/ubuntu12.04-gems.erb +</pre></div> +</div> +<p>Copy the template to the chef-repo in the <tt class="docutils literal"><span class="pre">.chef/bootstrap</span></tt> directory:</p> +<div class="highlight-bash"><div class="highlight"><pre>% cp /Users/jtimberman/.rvm/gems/ruby-1.9.2-p180/gems/chef-0.10.2/ + lib/chef/knife/bootstrap/ubuntu12.04-gems.erb ~/chef-repo/.chef/ + bootstrap/ubuntu12.04-gems-mine.erb +</pre></div> +</div> +<p>Modify the template with any editor, then use it with the <tt class="docutils literal"><span class="pre">-d</span></tt> or <tt class="docutils literal"><span class="pre">--distro</span></tt> option in the <tt class="docutils literal"><span class="pre">knife</span> <span class="pre">bootstrap</span></tt> operation, or use any of the Knife plug-ins that support cloud computing.</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife bootstrap 192.168.1.100 -r <span class="s1">'role[webserver]'</span> -d ubuntu12.04-gems-mine +</pre></div> +</div> +<p>Alternatively, an example bootstrap template can be found in the git source for the chef-repo: <a class="reference external" href="https://github.com/opscode/chef/blob/master/lib/chef/knife/bootstrap/ubuntu12.04-gems.erb">https://github.com/opscode/chef/blob/master/lib/chef/knife/bootstrap/ubuntu12.04-gems.erb</a>. Copy the template to <tt class="docutils literal"><span class="pre">~/.chef-repo/.chef/bootstrap/ubuntu12.04-apt.erb</span></tt> and modify the template appropriately.</p> +</div> +<div class="section" id="debian-and-apt"> +<h3>Debian and Apt<a class="headerlink" href="#debian-and-apt" title="Permalink to this headline">¶</a></h3> +<p>The following example shows how to use the <strong>knife bootstrap</strong> sub-command to create a client configuration file (/etc/chef/client.rb) that uses Hosted Chef as the server. The configuration file will look something like:</p> +<div class="highlight-ruby"><div class="highlight"><pre><span class="n">log_level</span> <span class="ss">:info</span> +<span class="n">log_location</span> <span class="no">STDOUT</span> +<span class="n">chef_server_url</span> <span class="s1">'https://api.opscode.com/organizations/ORGNAME'</span> +<span class="n">validation_client_name</span> <span class="s1">'ORGNAME-validator'</span> +</pre></div> +</div> +<p>The <strong>knife bootstrap</strong> sub-command will look in three locations for the template that is used during the bootstrap operation. The locations are:</p> +<ol class="arabic simple"> +<li>A bootstrap directory in the installed Knife library; the actual location may vary, depending how the chef-client is installed</li> +<li>A bootstrap directory in the <tt class="docutils literal"><span class="pre">$PWD/.chef</span></tt>, e.g. in <tt class="docutils literal"><span class="pre">~/chef-repo/.chef</span></tt></li> +<li>A bootstrap directory in the users <tt class="docutils literal"><span class="pre">$HOME/.chef</span></tt></li> +</ol> +<p>If, in the example above, the second location was used, then create the <tt class="docutils literal"><span class="pre">.chef/bootstrap/</span></tt> directory in the chef-repo, and then create the Embedded Ruby (ERB) template file by running commands similar to the following:</p> +<div class="highlight-bash"><div class="highlight"><pre>mkdir ~/.chef/bootstrap +vi ~/.chef/bootstrap/debian5.0-apt.erb +</pre></div> +</div> +<p>When finished creating the directory and the Embedded Ruby (ERB) template file, edit the template to run the SSH commands. Then set up the validation certificate and the client configuration file.</p> +<p>Finally, run the chef-client on the node using a <strong>knife bootstrap</strong> command that specifies a run-list (the <tt class="docutils literal"><span class="pre">-r</span></tt> option). The bootstrap template can be called using a command similar to the following:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife bootstrap mynode.example.com -r <span class="s1">'role[webserver]'</span>,<span class="s1">'role[production]'</span> --distro debian5.0-apt +</pre></div> +</div> +</div> +<div class="section" id="microsoft-windows"> +<h3>Microsoft Windows<a class="headerlink" href="#microsoft-windows" title="Permalink to this headline">¶</a></h3> +<p>The following example shows how to modify the default script for Microsoft Windows and Windows PowerShell:</p> +<div class="highlight-bash"><div class="highlight"><pre>@setlocal + +<%<span class="o">=</span> <span class="s2">"SETX HTTP_PROXY \"#{knife_config[:bootstrap_proxy]}\""</span> <span class="k">if </span>knife_config<span class="o">[</span>:bootstrap_proxy<span class="o">]</span> %> +@mkdir <%<span class="o">=</span> bootstrap_directory %> + +> <%<span class="o">=</span> bootstrap_directory %><span class="se">\w</span>get.ps1 <span class="o">(</span> + <%<span class="o">=</span> win_wget_ps %> +<span class="o">)</span> + +:install +@rem Install Chef using chef-client MSI installer + +<% <span class="nv">url</span><span class="o">=</span><span class="s2">"http://reposerver.example.com/chef-client-11.6.0.rc.1-1.windows.msi"</span> -%> +@set <span class="s2">"REMOTE_SOURCE_MSI_URL=<%= url %>"</span> +@set <span class="s2">"LOCAL_DESTINATION_MSI_PATH=<%= local_download_path %>"</span> + +@powershell -ExecutionPolicy Unrestricted -NoProfile -NonInteractive <span class="s2">"& '<%= bootstrap_directory %>\wget.ps1' '%REMOTE_SOURCE_MSI_URL%' '%LOCAL_DESTINATION_MSI_PATH%'"</span> + +@REM Replace install_chef from knife-windows Gem with one that has extra flags to turn on Chef service feature -- only available in Chef ><span class="o">=</span> 11.6.x +@REM <%<span class="o">=</span> install_chef %> +@echo Installing Chef Client 11.6.0.rc1 with msiexec +@msiexec /q /i <span class="s2">"%LOCAL_DESTINATION_MSI_PATH%"</span> <span class="nv">ADDLOCAL</span><span class="o">=</span><span class="s2">"ChefClientFeature,ChefServiceFeature"</span> +@endlocal + +@echo Writing validation key... + +> <%<span class="o">=</span> bootstrap_directory %><span class="se">\v</span>alidation.pem <span class="o">(</span> + <%<span class="o">=</span> validation_key %> +<span class="o">)</span> + +@echo Validation key written. + +<% <span class="k">if</span> @config<span class="o">[</span>:encrypted_data_bag_secret<span class="o">]</span> -%> +> <%<span class="o">=</span> bootstrap_directory %><span class="se">\e</span>ncrypted_data_bag_secret <span class="o">(</span> + <%<span class="o">=</span> encrypted_data_bag_secret %> +<span class="o">)</span> +<% end -%> + +> <%<span class="o">=</span> bootstrap_directory %><span class="se">\c</span>lient.rb <span class="o">(</span> + <%<span class="o">=</span> config_content %> +<span class="o">)</span> + +> <%<span class="o">=</span> bootstrap_directory %><span class="se">\f</span>irst-boot.json <span class="o">(</span> + <%<span class="o">=</span> run_list %> +<span class="o">)</span> + +<%<span class="o">=</span> start_chef %> +</pre></div> +</div> +</div> +</div> +<div class="section" id="examples"> +<h2>Examples<a class="headerlink" href="#examples" title="Permalink to this headline">¶</a></h2> +<p>The following examples show how to use this Knife subcommand:</p> +<p><strong>Use an SSH password</strong></p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife bootstrap 192.168.1.1 -x username -P PASSWORD --sudo +</pre></div> +</div> +<p><strong>Use a file that contains a private key</strong></p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife bootstrap 192.168.1.1 -x username -i ~/.ssh/id_rsa --sudo +</pre></div> +</div> +</div> +</div> + + + </div> + + </div> + + + <div class="clearer"></div> + </div> + + + + + </body> +</html>
\ No newline at end of file diff --git a/distro/common/html/knife_client.html b/distro/common/html/knife_client.html new file mode 100644 index 0000000000..ad9df20318 --- /dev/null +++ b/distro/common/html/knife_client.html @@ -0,0 +1,283 @@ + +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> + + +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> + + <title>knife client — chef-client Man Pages</title> + + <link rel="stylesheet" href="_static/guide.css" type="text/css" /> + <link rel="stylesheet" href="_static/pygments.css" type="text/css" /> + + <script type="text/javascript"> + var DOCUMENTATION_OPTIONS = { + URL_ROOT: '', + VERSION: '', + COLLAPSE_INDEX: false, + FILE_SUFFIX: '.html', + HAS_SOURCE: true + }; + </script> + <script type="text/javascript" src="_static/jquery.js"></script> + <script type="text/javascript" src="_static/underscore.js"></script> + <script type="text/javascript" src="_static/doctools.js"></script> + <link rel="shortcut icon" href="_static/chef.ico"/> + + + </head> + <body> +<div style="background-color: #212c35; text-align: left; padding: 0px 0px 0px 0px"> +<a href="http://docs.opscode.com/"><img src="_static/chef_html_logo.png" border="0" alt="Chef"/></a> +</div> + + + + + <div class="document"> + <div class="documentwrapper"> + + <div class="body"> + + <div class="section" id="knife-client"> +<h1>knife client<a class="headerlink" href="#knife-client" title="Permalink to this headline">¶</a></h1> +<p>The <strong>knife client</strong> subcommand is used to manage an API client list and their associated RSA public key-pairs. This allows authentication requests to be made to the server by any entity that uses the Chef Server API, such as the chef-client and Knife.</p> +<div class="admonition note"> +<p class="first admonition-title">Note</p> +<p class="last">Review the list of <a class="reference internal" href="knife_common_options.html"><em>common options</em></a> available to this (and all) Knife subcommands and plugins.</p> +</div> +<div class="section" id="bulk-delete"> +<h2>bulk delete<a class="headerlink" href="#bulk-delete" title="Permalink to this headline">¶</a></h2> +<p>The <tt class="docutils literal"><span class="pre">bulk</span> <span class="pre">delete</span></tt> argument is used to delete any API client that matches a pattern defined by a regular expression. The regular expression must be within quotes and not be surrounded by forward slashes (/).</p> +<div class="section" id="syntax"> +<h3>Syntax<a class="headerlink" href="#syntax" title="Permalink to this headline">¶</a></h3> +<p>This argument has the following syntax:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife client bulk delete REGEX +</pre></div> +</div> +</div> +<div class="section" id="options"> +<h3>Options<a class="headerlink" href="#options" title="Permalink to this headline">¶</a></h3> +<p>This command does not have any specific options.</p> +</div> +<div class="section" id="examples"> +<h3>Examples<a class="headerlink" href="#examples" title="Permalink to this headline">¶</a></h3> +<p>None.</p> +</div> +</div> +<div class="section" id="create"> +<h2>create<a class="headerlink" href="#create" title="Permalink to this headline">¶</a></h2> +<p>The <tt class="docutils literal"><span class="pre">create</span></tt> argument is used to create a new API client. This process will generate an RSA key pair for the named API client. The public key will be stored on the server and the private key will be displayed on <tt class="docutils literal"><span class="pre">STDOUT</span></tt> or written to a named file.</p> +<ul class="simple"> +<li>For the chef-client, the private key should be copied to the system as <tt class="docutils literal"><span class="pre">/etc/chef/client.pem</span></tt>.</li> +<li>For Knife, the private key is typically copied to <tt class="docutils literal"><span class="pre">~/.chef/client_name.pem</span></tt> and referenced in the knife.rb configuration file.</li> +</ul> +<div class="section" id="id1"> +<h3>Syntax<a class="headerlink" href="#id1" title="Permalink to this headline">¶</a></h3> +<p>This argument has the following syntax:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife client create CLIENT_NAME <span class="o">(</span>options<span class="o">)</span> +</pre></div> +</div> +</div> +<div class="section" id="id2"> +<h3>Options<a class="headerlink" href="#id2" title="Permalink to this headline">¶</a></h3> +<p>This argument has the following options:</p> +<dl class="docutils"> +<dt><tt class="docutils literal"><span class="pre">-a</span></tt>, <tt class="docutils literal"><span class="pre">--admin</span></tt></dt> +<dd>Indicates that a client will be created as an admin client. This is required when users of the open source server need to access the Chef Server API as an administrator. This option only works when used with the open source server and will have no effect when used with Enterprise Chef.</dd> +</dl> +</div> +<div class="section" id="id3"> +<h3>Examples<a class="headerlink" href="#id3" title="Permalink to this headline">¶</a></h3> +<p>The following examples show how to use this Knife subcommand:</p> +<p><strong>Create an admin client</strong></p> +<p>To create a Chef Admin client with the name “exampleorg” and save its private key to a file, enter:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife client create exampleorg -a -f <span class="s2">"/etc/chef/client.pem"</span> +</pre></div> +</div> +<p><strong>Create an admin client for Enterprise Chef</strong></p> +<p>When running the <tt class="docutils literal"><span class="pre">create</span></tt> argument on Enterprise Chef, be sure to omit the <tt class="docutils literal"><span class="pre">-a</span></tt> option:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife client create exampleorg -f <span class="s2">"/etc/chef/client.pem"</span> +</pre></div> +</div> +</div> +</div> +<div class="section" id="delete"> +<h2>delete<a class="headerlink" href="#delete" title="Permalink to this headline">¶</a></h2> +<p>The <tt class="docutils literal"><span class="pre">delete</span></tt> argument is used to delete a registered API client.</p> +<div class="section" id="id4"> +<h3>Syntax<a class="headerlink" href="#id4" title="Permalink to this headline">¶</a></h3> +<p>This argument has the following syntax:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife client delete CLIENT_NAME +</pre></div> +</div> +</div> +<div class="section" id="id5"> +<h3>Options<a class="headerlink" href="#id5" title="Permalink to this headline">¶</a></h3> +<p>This command does not have any specific options.</p> +</div> +<div class="section" id="id6"> +<h3>Examples<a class="headerlink" href="#id6" title="Permalink to this headline">¶</a></h3> +<p>The following examples show how to use this Knife subcommand:</p> +<p><strong>Delete a client</strong></p> +<p>To delete a client with the name “client_foo”, enter:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife client delete client_foo +</pre></div> +</div> +<p>Type <tt class="docutils literal"><span class="pre">Y</span></tt> to confirm a deletion.</p> +</div> +</div> +<div class="section" id="edit"> +<h2>edit<a class="headerlink" href="#edit" title="Permalink to this headline">¶</a></h2> +<p>The <tt class="docutils literal"><span class="pre">edit</span></tt> argument is used to edit the details of a registered API client. When this argument is run, Knife will open $EDITOR to enable editing of the <tt class="docutils literal"><span class="pre">admin</span></tt> attribute. (None of the other attributes should be changed using this argument.) When finished, Knife will update the server with those changes.</p> +<div class="section" id="id7"> +<h3>Syntax<a class="headerlink" href="#id7" title="Permalink to this headline">¶</a></h3> +<p>This argument has the following syntax:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife client edit CLIENT_NAME +</pre></div> +</div> +</div> +<div class="section" id="id8"> +<h3>Options<a class="headerlink" href="#id8" title="Permalink to this headline">¶</a></h3> +<p>This command does not have any specific options.</p> +</div> +<div class="section" id="id9"> +<h3>Examples<a class="headerlink" href="#id9" title="Permalink to this headline">¶</a></h3> +<p>The following examples show how to use this Knife subcommand:</p> +<p><strong>Edit a client</strong></p> +<p>To edit a client with the name “exampleorg”, enter:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife client edit exampleorg +</pre></div> +</div> +</div> +</div> +<div class="section" id="list"> +<h2>list<a class="headerlink" href="#list" title="Permalink to this headline">¶</a></h2> +<p>The <tt class="docutils literal"><span class="pre">list</span></tt> argument is used to view a list of registered API client.</p> +<div class="section" id="id10"> +<h3>Syntax<a class="headerlink" href="#id10" title="Permalink to this headline">¶</a></h3> +<p>This argument has the following syntax:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife client list <span class="o">(</span>options<span class="o">)</span> +</pre></div> +</div> +</div> +<div class="section" id="id11"> +<h3>Options<a class="headerlink" href="#id11" title="Permalink to this headline">¶</a></h3> +<p>This argument has the following options:</p> +<dl class="docutils"> +<dt><tt class="docutils literal"><span class="pre">-w</span></tt>, <tt class="docutils literal"><span class="pre">--with-uri</span></tt></dt> +<dd>Indicates that the corresponding URIs will be shown.</dd> +</dl> +</div> +<div class="section" id="id12"> +<h3>Examples<a class="headerlink" href="#id12" title="Permalink to this headline">¶</a></h3> +<p>The following examples show how to use this Knife subcommand:</p> +<p><strong>View a list of clients</strong></p> +<p>To verify the API client list for the server, enter:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife client list +</pre></div> +</div> +<p>to return something similar to:</p> +<div class="highlight-bash"><div class="highlight"><pre>exampleorg +i-12345678 +rs-123456 +</pre></div> +</div> +<p>To verify that an API client can authenticate to the +server correctly, try getting a list of clients using <tt class="docutils literal"><span class="pre">-u</span></tt> and <tt class="docutils literal"><span class="pre">-k</span></tt> options to specify its name and private key:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife client list -u ORGNAME -k .chef/ORGNAME.pem +</pre></div> +</div> +</div> +</div> +<div class="section" id="reregister"> +<h2>reregister<a class="headerlink" href="#reregister" title="Permalink to this headline">¶</a></h2> +<p>The <tt class="docutils literal"><span class="pre">reregister</span></tt> argument is used to regenerate an RSA key pair for an API client. The public key will be stored on the server and the private key will be displayed on <tt class="docutils literal"><span class="pre">STDOUT</span></tt> or written to a named file.</p> +<div class="admonition note"> +<p class="first admonition-title">Note</p> +<p class="last">Running this argument will invalidate the previous RSA key pair, making it unusable during authentication to the server.</p> +</div> +<div class="section" id="id13"> +<h3>Syntax<a class="headerlink" href="#id13" title="Permalink to this headline">¶</a></h3> +<p>This argument has the following syntax:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife client reregister CLIENT_NAME <span class="o">(</span>options<span class="o">)</span> +</pre></div> +</div> +</div> +<div class="section" id="id14"> +<h3>Options<a class="headerlink" href="#id14" title="Permalink to this headline">¶</a></h3> +<p>This argument has the following options:</p> +<dl class="docutils"> +<dt><tt class="docutils literal"><span class="pre">-f</span> <span class="pre">FILE_NAME</span></tt>, <tt class="docutils literal"><span class="pre">--file</span> <span class="pre">FILE_NAME</span></tt></dt> +<dd>Indicates that the private key will be saved to a specified file name.</dd> +</dl> +</div> +<div class="section" id="id15"> +<h3>Examples<a class="headerlink" href="#id15" title="Permalink to this headline">¶</a></h3> +<p>The following examples show how to use this Knife subcommand:</p> +<p><strong>Reregister clients</strong></p> +<p>To regenerate the RSA key pair for a client named “testclient” and save it to a file named “rsa_key”, enter:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife client regenerate testclient -f rsa_key +</pre></div> +</div> +</div> +</div> +<div class="section" id="show"> +<h2>show<a class="headerlink" href="#show" title="Permalink to this headline">¶</a></h2> +<p>The <tt class="docutils literal"><span class="pre">show</span></tt> argument is used to show the details of an API client.</p> +<div class="section" id="id16"> +<h3>Syntax<a class="headerlink" href="#id16" title="Permalink to this headline">¶</a></h3> +<p>This argument has the following syntax:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife client show CLIENT_NAME <span class="o">(</span>options<span class="o">)</span> +</pre></div> +</div> +</div> +<div class="section" id="id17"> +<h3>Options<a class="headerlink" href="#id17" title="Permalink to this headline">¶</a></h3> +<p>This argument has the following options:</p> +<dl class="docutils"> +<dt><tt class="docutils literal"><span class="pre">-a</span> <span class="pre">ATTR</span></tt>, <tt class="docutils literal"><span class="pre">--attribute</span> <span class="pre">ATTR</span></tt></dt> +<dd>The attribute (or attributes) to show.</dd> +</dl> +</div> +<div class="section" id="id18"> +<h3>Examples<a class="headerlink" href="#id18" title="Permalink to this headline">¶</a></h3> +<p>The following examples show how to use this Knife subcommand:</p> +<p><strong>Show clients</strong></p> +<p>To view a client named “testclient”, enter:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife client show testclient +</pre></div> +</div> +<p>to return something like:</p> +<div class="highlight-bash"><div class="highlight"><pre>admin: <span class="nb">false</span> +chef_type: client +json_class: Chef::ApiClient +name: testclient +public_key: +</pre></div> +</div> +<p>To view information in JSON format, use the <tt class="docutils literal"><span class="pre">-F</span></tt> common option as part of the command like this:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife role show devops -F json +</pre></div> +</div> +<p>Other formats available include <tt class="docutils literal"><span class="pre">text</span></tt>, <tt class="docutils literal"><span class="pre">yaml</span></tt>, and <tt class="docutils literal"><span class="pre">pp</span></tt>.</p> +</div> +</div> +</div> + + + </div> + + </div> + + + <div class="clearer"></div> + </div> + + + + + </body> +</html>
\ No newline at end of file diff --git a/distro/common/html/knife_common_options.html b/distro/common/html/knife_common_options.html new file mode 100644 index 0000000000..694e49112b --- /dev/null +++ b/distro/common/html/knife_common_options.html @@ -0,0 +1,98 @@ + +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> + + +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> + + <title>Common Options — chef-client Man Pages</title> + + <link rel="stylesheet" href="_static/guide.css" type="text/css" /> + <link rel="stylesheet" href="_static/pygments.css" type="text/css" /> + + <script type="text/javascript"> + var DOCUMENTATION_OPTIONS = { + URL_ROOT: '', + VERSION: '', + COLLAPSE_INDEX: false, + FILE_SUFFIX: '.html', + HAS_SOURCE: true + }; + </script> + <script type="text/javascript" src="_static/jquery.js"></script> + <script type="text/javascript" src="_static/underscore.js"></script> + <script type="text/javascript" src="_static/doctools.js"></script> + <link rel="shortcut icon" href="_static/chef.ico"/> + + + </head> + <body> +<div style="background-color: #212c35; text-align: left; padding: 0px 0px 0px 0px"> +<a href="http://docs.opscode.com/"><img src="_static/chef_html_logo.png" border="0" alt="Chef"/></a> +</div> + + + + + <div class="document"> + <div class="documentwrapper"> + + <div class="body"> + + <div class="section" id="common-options"> +<h1>Common Options<a class="headerlink" href="#common-options" title="Permalink to this headline">¶</a></h1> +<p>The following options can be run with all Knife sub-commands and plug-ins:</p> +<dl class="docutils"> +<dt><tt class="docutils literal"><span class="pre">--chef-zero-port</span> <span class="pre">PORT</span></tt></dt> +<dd>The port on which chef-zero will listen.</dd> +<dt><tt class="docutils literal"><span class="pre">-c</span> <span class="pre">CONFIG_FILE</span></tt>, <tt class="docutils literal"><span class="pre">--config</span> <span class="pre">CONFIG_FILE</span></tt></dt> +<dd>The configuration file to use. For example, when Knife is run from a node that is configured to be managed by the server, this option is used to allow Knife to use the same credentials as the chef-client when communicating with the server.</dd> +<dt><tt class="docutils literal"><span class="pre">-d</span></tt>, <tt class="docutils literal"><span class="pre">--disable-editing</span></tt></dt> +<dd>Indicates that $EDITOR will not be opened; data will be accepted as-is.</dd> +<dt><tt class="docutils literal"><span class="pre">--defaults</span></tt></dt> +<dd>Indicates that Knife will use the default value, instead of asking a user to provide one.</dd> +<dt><tt class="docutils literal"><span class="pre">-e</span> <span class="pre">EDITOR</span></tt>, <tt class="docutils literal"><span class="pre">--editor</span> <span class="pre">EDITOR</span></tt></dt> +<dd>The $EDITOR that is used for all interactive commands.</dd> +<dt><tt class="docutils literal"><span class="pre">-E</span> <span class="pre">ENVIRONMENT</span></tt>, <tt class="docutils literal"><span class="pre">--environment</span> <span class="pre">ENVIRONMENT</span></tt></dt> +<dd>The name of the environment. When this option is added to a command, the command will run only against the named environment.</dd> +<dt><tt class="docutils literal"><span class="pre">-F</span> <span class="pre">FORMAT</span></tt>, <tt class="docutils literal"><span class="pre">--format</span> <span class="pre">FORMAT</span></tt></dt> +<dd>The output format: <tt class="docutils literal"><span class="pre">summary</span></tt> (default), <tt class="docutils literal"><span class="pre">text</span></tt>, <tt class="docutils literal"><span class="pre">json</span></tt>, <tt class="docutils literal"><span class="pre">yaml</span></tt>, and <tt class="docutils literal"><span class="pre">pp</span></tt>.</dd> +<dt><tt class="docutils literal"><span class="pre">-h</span></tt>, <tt class="docutils literal"><span class="pre">--help</span></tt></dt> +<dd>Shows help for the command.</dd> +<dt><tt class="docutils literal"><span class="pre">-k</span> <span class="pre">KEY</span></tt>, <tt class="docutils literal"><span class="pre">--key</span> <span class="pre">KEY</span></tt></dt> +<dd>The private key that Knife will use to sign requests made by the API client to the server.</dd> +<dt><tt class="docutils literal"><span class="pre">--[no-]color</span></tt></dt> +<dd>Indicates whether colored output will be used.</dd> +<dt><tt class="docutils literal"><span class="pre">--print-after</span></tt></dt> +<dd>Indicates that data will be shown after a destructive operation.</dd> +<dt><tt class="docutils literal"><span class="pre">-s</span> <span class="pre">URL</span></tt>, <tt class="docutils literal"><span class="pre">--server-url</span> <span class="pre">URL</span></tt></dt> +<dd>The URL for the server.</dd> +<dt><tt class="docutils literal"><span class="pre">-u</span> <span class="pre">USER</span></tt>, <tt class="docutils literal"><span class="pre">--user</span> <span class="pre">USER</span></tt></dt> +<dd>The user name used by Knife to sign requests made by the API client to the server. Authentication will fail if the user name does not match the private key.</dd> +<dt><tt class="docutils literal"><span class="pre">-V</span></tt>, <tt class="docutils literal"><span class="pre">--verbose</span></tt></dt> +<dd>Set for more verbose outputs. Use <tt class="docutils literal"><span class="pre">-VV</span></tt> for maximum verbosity.</dd> +<dt><tt class="docutils literal"><span class="pre">-v</span></tt>, <tt class="docutils literal"><span class="pre">--version</span></tt></dt> +<dd>The version of the chef-client.</dd> +<dt><tt class="docutils literal"><span class="pre">-y</span></tt>, <tt class="docutils literal"><span class="pre">--yes</span></tt></dt> +<dd>Indicates that the response to all confirmation prompts will be “Yes” (and that Knife will not ask for confirmation).</dd> +<dt><tt class="docutils literal"><span class="pre">-z</span></tt>, <tt class="docutils literal"><span class="pre">--local-mode</span></tt></dt> +<dd>Indicates that the chef-client will be run in local mode, which allows all commands that work against the server to also work against the local chef-repo.</dd> +</dl> +</div> + + + </div> + + </div> + + + <div class="clearer"></div> + </div> + + + + + </body> +</html>
\ No newline at end of file diff --git a/distro/common/html/knife_configure.html b/distro/common/html/knife_configure.html new file mode 100644 index 0000000000..08ea58b4e0 --- /dev/null +++ b/distro/common/html/knife_configure.html @@ -0,0 +1,107 @@ + +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> + + +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> + + <title>knife configure — chef-client Man Pages</title> + + <link rel="stylesheet" href="_static/guide.css" type="text/css" /> + <link rel="stylesheet" href="_static/pygments.css" type="text/css" /> + + <script type="text/javascript"> + var DOCUMENTATION_OPTIONS = { + URL_ROOT: '', + VERSION: '', + COLLAPSE_INDEX: false, + FILE_SUFFIX: '.html', + HAS_SOURCE: true + }; + </script> + <script type="text/javascript" src="_static/jquery.js"></script> + <script type="text/javascript" src="_static/underscore.js"></script> + <script type="text/javascript" src="_static/doctools.js"></script> + <link rel="shortcut icon" href="_static/chef.ico"/> + + + </head> + <body> +<div style="background-color: #212c35; text-align: left; padding: 0px 0px 0px 0px"> +<a href="http://docs.opscode.com/"><img src="_static/chef_html_logo.png" border="0" alt="Chef"/></a> +</div> + + + + + <div class="document"> + <div class="documentwrapper"> + + <div class="body"> + + <div class="section" id="knife-configure"> +<h1>knife configure<a class="headerlink" href="#knife-configure" title="Permalink to this headline">¶</a></h1> +<p>The <strong>knife configure</strong> subcommand is used to create the knife.rb and client.rb files so that they can be distributed to workstations and nodes.</p> +<div class="section" id="syntax"> +<h2>Syntax<a class="headerlink" href="#syntax" title="Permalink to this headline">¶</a></h2> +<p>This argument has the following syntax when creating a knife.rb file:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife configure <span class="o">(</span>options<span class="o">)</span> +</pre></div> +</div> +<p>and the following syntax when creating a client.rb file:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife configure client DIRECTORY +</pre></div> +</div> +</div> +<div class="section" id="options"> +<h2>Options<a class="headerlink" href="#options" title="Permalink to this headline">¶</a></h2> +<div class="admonition note"> +<p class="first admonition-title">Note</p> +<p class="last">Review the list of <a class="reference internal" href="knife_common_options.html"><em>common options</em></a> available to this (and all) Knife subcommands and plugins.</p> +</div> +<p>This subcommand has the following options for use when configuring a knife.rb file:</p> +<dl class="docutils"> +<dt><tt class="docutils literal"><span class="pre">--admin-client-name</span> <span class="pre">NAME</span></tt></dt> +<dd>The name of the client, typically the name of the admin client.</dd> +<dt><tt class="docutils literal"><span class="pre">--admin-client-key</span> <span class="pre">PATH</span></tt></dt> +<dd>The path to the private key used by the client, typically a file named <tt class="docutils literal"><span class="pre">admin.pem</span></tt>.</dd> +<dt><tt class="docutils literal"><span class="pre">-i</span></tt>, <tt class="docutils literal"><span class="pre">--initial</span></tt></dt> +<dd>Use to create a API client, typically an administrator client on a freshly-installed server.</dd> +<dt><tt class="docutils literal"><span class="pre">-r</span> <span class="pre">REPO</span></tt>, <tt class="docutils literal"><span class="pre">--repository</span> <span class="pre">REPO</span></tt></dt> +<dd>The path to the chef-repo.</dd> +<dt><tt class="docutils literal"><span class="pre">--validation-client-name</span> <span class="pre">NAME</span></tt></dt> +<dd>The name of the validation client, typically a client named chef-validator</dd> +<dt><tt class="docutils literal"><span class="pre">--validation-key</span> <span class="pre">PATH</span></tt></dt> +<dd>The path to the validation key used by the client, typically a file named <tt class="docutils literal"><span class="pre">validation.pem</span></tt>.</dd> +</dl> +</div> +<div class="section" id="examples"> +<h2>Examples<a class="headerlink" href="#examples" title="Permalink to this headline">¶</a></h2> +<p>The following examples show how to use this Knife subcommand:</p> +<p><strong>Configure knife.rb</strong></p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife configure +</pre></div> +</div> +<p><strong>Configure client.rb</strong></p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife configure client <span class="s1">'/directory'</span> +</pre></div> +</div> +</div> +</div> + + + </div> + + </div> + + + <div class="clearer"></div> + </div> + + + + + </body> +</html>
\ No newline at end of file diff --git a/distro/common/html/knife_cookbook.html b/distro/common/html/knife_cookbook.html new file mode 100644 index 0000000000..0568be98bb --- /dev/null +++ b/distro/common/html/knife_cookbook.html @@ -0,0 +1,481 @@ + +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> + + +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> + + <title>knife cookbook — chef-client Man Pages</title> + + <link rel="stylesheet" href="_static/guide.css" type="text/css" /> + <link rel="stylesheet" href="_static/pygments.css" type="text/css" /> + + <script type="text/javascript"> + var DOCUMENTATION_OPTIONS = { + URL_ROOT: '', + VERSION: '', + COLLAPSE_INDEX: false, + FILE_SUFFIX: '.html', + HAS_SOURCE: true + }; + </script> + <script type="text/javascript" src="_static/jquery.js"></script> + <script type="text/javascript" src="_static/underscore.js"></script> + <script type="text/javascript" src="_static/doctools.js"></script> + <link rel="shortcut icon" href="_static/chef.ico"/> + + + </head> + <body> +<div style="background-color: #212c35; text-align: left; padding: 0px 0px 0px 0px"> +<a href="http://docs.opscode.com/"><img src="_static/chef_html_logo.png" border="0" alt="Chef"/></a> +</div> + + + + + <div class="document"> + <div class="documentwrapper"> + + <div class="body"> + + <div class="section" id="knife-cookbook"> +<h1>knife cookbook<a class="headerlink" href="#knife-cookbook" title="Permalink to this headline">¶</a></h1> +<p>A cookbook is the fundamental unit of configuration and policy distribution. Each cookbook defines a scenario, such as everything needed to install and configure MySQL, and then it contains all of the components that are required to support that scenario, including:</p> +<ul class="simple"> +<li>Attribute values that are set on nodes</li> +<li>Definitions that allow the creation of reusable collections of resources</li> +<li>File distributions</li> +<li>Libraries that extend the chef-client and/or provide helpers to Ruby code</li> +<li>Recipes that specify which resources to manage and the order in which those resources will be applied</li> +<li>Custom resources and providers</li> +<li>Templates</li> +<li>Versions</li> +<li>Metadata about recipes (including dependencies), version constraints, supported platforms, and so on</li> +</ul> +<p>The <strong>knife cookbook</strong> subcommand is used to interact with cookbooks that are located on the server or the local chef-repo.</p> +<div class="admonition note"> +<p class="first admonition-title">Note</p> +<p class="last">Review the list of <a class="reference internal" href="knife_common_options.html"><em>common options</em></a> available to this (and all) Knife subcommands and plugins.</p> +</div> +<div class="section" id="bulk-delete"> +<h2>bulk delete<a class="headerlink" href="#bulk-delete" title="Permalink to this headline">¶</a></h2> +<p>The <tt class="docutils literal"><span class="pre">bulk</span> <span class="pre">delete</span></tt> argument is used to delete cookbook files that match a pattern defined by a regular expression. The regular expression must be within quotes and not be surrounded by forward slashes (/).</p> +<div class="section" id="syntax"> +<h3>Syntax<a class="headerlink" href="#syntax" title="Permalink to this headline">¶</a></h3> +<p>This argument has the following syntax:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife cookbook bulk delete REGEX <span class="o">(</span>options<span class="o">)</span> +</pre></div> +</div> +</div> +<div class="section" id="options"> +<h3>Options<a class="headerlink" href="#options" title="Permalink to this headline">¶</a></h3> +<p>This argument has the following options:</p> +<dl class="docutils"> +<dt><tt class="docutils literal"><span class="pre">-p</span></tt>, <tt class="docutils literal"><span class="pre">--purge</span></tt></dt> +<dd>Indicates that a cookbook (or cookbook version) will be removed entirely from the server. This action should be used carefully because only one copy of any single file is stored on the server. Consequently, purging a cookbook will disable any other cookbook that references one or more files from a cookbook that has been purged.</dd> +</dl> +</div> +<div class="section" id="examples"> +<h3>Examples<a class="headerlink" href="#examples" title="Permalink to this headline">¶</a></h3> +<p>The following examples show how to use this Knife subcommand:</p> +<p><strong>Bulk delete many cookbooks</strong></p> +<p>Use a regular expression to define the pattern used to bulk delete cookbooks:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife cookbook bulk delete <span class="s2">"^[0-9]{3}$"</span> -p +</pre></div> +</div> +</div> +</div> +<div class="section" id="create"> +<h2>create<a class="headerlink" href="#create" title="Permalink to this headline">¶</a></h2> +<p>The <tt class="docutils literal"><span class="pre">create</span></tt> argument is used to create a new cookbook directory on the local machine, including the following directories and files:</p> +<blockquote> +<div><ul class="simple"> +<li>cookbook/attributes</li> +<li>cookbook/CHANGELOG.md</li> +<li>cookbook/definitions</li> +<li>cookbook/files/default</li> +<li>cookbook/libraries</li> +<li>cookbook/metadata.rb</li> +<li>cookbook/providers</li> +<li>cookbook/README.md (or .rdoc)</li> +<li>cookbook/recipes/default.rb</li> +<li>cookbook/resources</li> +<li>cookbook/templates/default</li> +</ul> +</div></blockquote> +<p>After the cookbook is created, it can be uploaded to the server using the <tt class="docutils literal"><span class="pre">knife</span> <span class="pre">upload</span></tt> argument.</p> +<div class="section" id="id1"> +<h3>Syntax<a class="headerlink" href="#id1" title="Permalink to this headline">¶</a></h3> +<p>This argument has the following syntax:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife cookbook create COOKBOOK_NAME <span class="o">(</span>options<span class="o">)</span> +</pre></div> +</div> +</div> +<div class="section" id="id2"> +<h3>Options<a class="headerlink" href="#id2" title="Permalink to this headline">¶</a></h3> +<p>This argument has the following options:</p> +<dl class="docutils"> +<dt><tt class="docutils literal"><span class="pre">-C</span> <span class="pre">COPYRIGHT_HOLDER</span></tt>, <tt class="docutils literal"><span class="pre">--copyright</span> <span class="pre">COPYRIGHT_HOLDER</span></tt></dt> +<dd>The name of the copyright holder. This option will place a copyright notice that contains the name of the copyright holder in each of the pre-created files. If this option is not specified, a copyright name of “your_company_name” will be used instead; it can be easily modified later.</dd> +<dt><tt class="docutils literal"><span class="pre">-I</span> <span class="pre">LICENSE</span></tt>, <tt class="docutils literal"><span class="pre">--license</span> <span class="pre">LICENSE</span></tt></dt> +<dd>The type of license under which a cookbook is distributed: <tt class="docutils literal"><span class="pre">apachev2</span></tt>, <tt class="docutils literal"><span class="pre">gplv2</span></tt>, <tt class="docutils literal"><span class="pre">gplv3</span></tt>, <tt class="docutils literal"><span class="pre">mit</span></tt>, or <tt class="docutils literal"><span class="pre">none</span></tt> (default). This option will place the appropriate license notice in the pre-created files: <tt class="docutils literal"><span class="pre">Apache</span> <span class="pre">v2.0</span></tt> (for <tt class="docutils literal"><span class="pre">apachev2</span></tt>), <tt class="docutils literal"><span class="pre">GPL</span> <span class="pre">v2</span></tt> (for <tt class="docutils literal"><span class="pre">gplv2</span></tt>), <tt class="docutils literal"><span class="pre">GPL</span> <span class="pre">v3</span></tt> (for <tt class="docutils literal"><span class="pre">gplv3</span></tt>), <tt class="docutils literal"><span class="pre">MIT</span></tt> (for <tt class="docutils literal"><span class="pre">mit</span></tt>), or <tt class="docutils literal"><span class="pre">license</span> <span class="pre">'Proprietary</span> <span class="pre">-</span> <span class="pre">All</span> <span class="pre">Rights</span> <span class="pre">Reserved</span></tt> (for <tt class="docutils literal"><span class="pre">none</span></tt>). Be aware of the licenses for files inside of a cookbook and be sure to follow any restrictions they describe.</dd> +<dt><tt class="docutils literal"><span class="pre">-m</span> <span class="pre">EMAIL</span></tt>, <tt class="docutils literal"><span class="pre">--email</span> <span class="pre">EMAIL</span></tt></dt> +<dd>The email address for the individual who maintains the cookbook. This option will place an email address in each of the pre-created files. If this option is not specified, an email name of “your_email” will be used instead; it can be easily modified later.</dd> +<dt><tt class="docutils literal"><span class="pre">-o</span> <span class="pre">PATH</span></tt>, <tt class="docutils literal"><span class="pre">--cookbook-path</span> <span class="pre">PATH</span></tt></dt> +<dd>The directory in which cookbook are created. This can be a colon-separated path.</dd> +<dt><tt class="docutils literal"><span class="pre">-r</span> <span class="pre">FORMAT</span></tt>, <tt class="docutils literal"><span class="pre">--readme-format</span> <span class="pre">FORMAT</span></tt></dt> +<dd>The document format of the readme file: <tt class="docutils literal"><span class="pre">md</span></tt> (markdown) and <tt class="docutils literal"><span class="pre">rdoc</span></tt> (Ruby docs).</dd> +</dl> +</div> +<div class="section" id="id3"> +<h3>Examples<a class="headerlink" href="#id3" title="Permalink to this headline">¶</a></h3> +<p>The following examples show how to use this Knife subcommand:</p> +<p><strong>Create a cookbook</strong></p> +<p>To create a cookbook named “my_cookbook” with copyright, email, license, and readme format options specified, enter:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife cookbook create my_cookbook -C <span class="s2">"My Name"</span> -m <span class="s2">"my@email.com"</span> -I apachev2 -r md +</pre></div> +</div> +<p>to return something like:</p> +<div class="highlight-bash"><div class="highlight"><pre>** Creating cookbook my_cookbook +** Creating README <span class="k">for </span>cookbook: my_cookbook +** Creating metadata <span class="k">for </span>cookbook: my_cookbook +</pre></div> +</div> +</div> +</div> +<div class="section" id="delete"> +<h2>delete<a class="headerlink" href="#delete" title="Permalink to this headline">¶</a></h2> +<p>The <tt class="docutils literal"><span class="pre">delete</span></tt> argument is used to delete a specified cookbook or cookbook version on the server (and not locally).</p> +<div class="section" id="id4"> +<h3>Syntax<a class="headerlink" href="#id4" title="Permalink to this headline">¶</a></h3> +<p>This argument has the following syntax:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife cookbook delete COOKBOOK_NAME <span class="o">[</span>COOKBOOK_VERSION<span class="o">]</span> <span class="o">(</span>options<span class="o">)</span> +</pre></div> +</div> +</div> +<div class="section" id="id5"> +<h3>Options<a class="headerlink" href="#id5" title="Permalink to this headline">¶</a></h3> +<p>This argument has the following options:</p> +<dl class="docutils"> +<dt><tt class="docutils literal"><span class="pre">-a</span></tt>, <tt class="docutils literal"><span class="pre">--all</span></tt></dt> +<dd>Indicates that a cookbook and every version of that cookbook will be deleted.</dd> +<dt><tt class="docutils literal"><span class="pre">COOKBOOK_VERSION</span></tt></dt> +<dd>The version of a cookbook to be deleted. If a cookbook has only one version, this option does not need to be specified. If a cookbook has more than one version and this option is not specified, Knife will prompt for a version.</dd> +<dt><tt class="docutils literal"><span class="pre">-p</span></tt>, <tt class="docutils literal"><span class="pre">--purge</span></tt></dt> +<dd>Indicates that a cookbook (or cookbook version) will be removed entirely from the server. This action should be used carefully because only one copy of any single file is stored on the server. Consequently, purging a cookbook will disable any other cookbook that references one or more files from a cookbook that has been purged.</dd> +</dl> +</div> +<div class="section" id="id6"> +<h3>Examples<a class="headerlink" href="#id6" title="Permalink to this headline">¶</a></h3> +<p>The following examples show how to use this Knife subcommand:</p> +<p><strong>Delete a cookbook</strong></p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife cookbook delete cookbook_name version +</pre></div> +</div> +<p>For example:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife cookbook delete smartmon 0.8 +</pre></div> +</div> +<p>Type <tt class="docutils literal"><span class="pre">Y</span></tt> to confirm a deletion.</p> +</div> +</div> +<div class="section" id="download"> +<h2>download<a class="headerlink" href="#download" title="Permalink to this headline">¶</a></h2> +<p>The <tt class="docutils literal"><span class="pre">download</span></tt> argument is used to download a cookbook from the server to the current working directory.</p> +<div class="section" id="id7"> +<h3>Syntax<a class="headerlink" href="#id7" title="Permalink to this headline">¶</a></h3> +<p>This argument has the following syntax:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife cookbook download COOKBOOK_NAME <span class="o">[</span>COOKBOOK_VERSION<span class="o">]</span> <span class="o">(</span>options<span class="o">)</span> +</pre></div> +</div> +</div> +<div class="section" id="id8"> +<h3>Options<a class="headerlink" href="#id8" title="Permalink to this headline">¶</a></h3> +<p>This argument has the following options:</p> +<dl class="docutils"> +<dt><tt class="docutils literal"><span class="pre">-d</span> <span class="pre">DOWNLOAD_DIRECTORY</span></tt>, <tt class="docutils literal"><span class="pre">--dir</span> <span class="pre">DOWNLOAD_DIRECTORY</span></tt></dt> +<dd>The directory into which a cookbook will be downloaded.</dd> +<dt><tt class="docutils literal"><span class="pre">-f</span></tt>, <tt class="docutils literal"><span class="pre">--force</span></tt></dt> +<dd>Indicates that an existing directory will be overwritten.</dd> +<dt><tt class="docutils literal"><span class="pre">-N</span></tt>, <tt class="docutils literal"><span class="pre">--latest</span></tt></dt> +<dd>Indicates that the most recent version of a cookbook will be downloaded.</dd> +</dl> +</div> +<div class="section" id="id9"> +<h3>Examples<a class="headerlink" href="#id9" title="Permalink to this headline">¶</a></h3> +<p>The following examples show how to use this Knife subcommand:</p> +<p><strong>Download a cookbook</strong></p> +<p>To download a cookbook named “smartmon”, enter:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife cookbook download smartmon +</pre></div> +</div> +</div> +</div> +<div class="section" id="list"> +<h2>list<a class="headerlink" href="#list" title="Permalink to this headline">¶</a></h2> +<p>The <tt class="docutils literal"><span class="pre">list</span></tt> argument is used to view a list of cookbooks that are currently available on the server. The list will contain only the most recent version for each cookbook by default.</p> +<div class="section" id="id10"> +<h3>Syntax<a class="headerlink" href="#id10" title="Permalink to this headline">¶</a></h3> +<p>This argument has the following syntax:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife cookbook list <span class="o">(</span>options<span class="o">)</span> +</pre></div> +</div> +</div> +<div class="section" id="id11"> +<h3>Options<a class="headerlink" href="#id11" title="Permalink to this headline">¶</a></h3> +<p>This argument has the following options:</p> +<dl class="docutils"> +<dt><tt class="docutils literal"><span class="pre">-a</span></tt>, <tt class="docutils literal"><span class="pre">--all</span></tt></dt> +<dd>Indicates that all available versions of each cookbook will be returned.</dd> +<dt><tt class="docutils literal"><span class="pre">-w</span></tt>, <tt class="docutils literal"><span class="pre">--with-uri</span></tt></dt> +<dd>Indicates that the corresponding URIs will be shown.</dd> +</dl> +</div> +<div class="section" id="id12"> +<h3>Examples<a class="headerlink" href="#id12" title="Permalink to this headline">¶</a></h3> +<p>The following examples show how to use this Knife subcommand:</p> +<p><strong>View a list of cookbooks</strong></p> +<p>To view a list of cookbooks:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife cookbook list +</pre></div> +</div> +</div> +</div> +<div class="section" id="metadata"> +<h2>metadata<a class="headerlink" href="#metadata" title="Permalink to this headline">¶</a></h2> +<p>The <tt class="docutils literal"><span class="pre">metadata</span></tt> argument is used to generate the metadata for one or more cookbooks.</p> +<div class="section" id="id13"> +<h3>Syntax<a class="headerlink" href="#id13" title="Permalink to this headline">¶</a></h3> +<p>This argument has the following syntax:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife cookbook metadata <span class="o">(</span>options<span class="o">)</span> +</pre></div> +</div> +</div> +<div class="section" id="id14"> +<h3>Options<a class="headerlink" href="#id14" title="Permalink to this headline">¶</a></h3> +<p>This argument has the following options:</p> +<dl class="docutils"> +<dt><tt class="docutils literal"><span class="pre">-a</span></tt>, <tt class="docutils literal"><span class="pre">--all</span></tt></dt> +<dd>Indicates that metadata should be generated for all cookbooks, and not just for a specified cookbook.</dd> +<dt><tt class="docutils literal"><span class="pre">-o</span> <span class="pre">PATH:PATH</span></tt>, <tt class="docutils literal"><span class="pre">--cookbook-path</span> <span class="pre">PATH:PATH</span></tt></dt> +<dd>The directory in which cookbook are created. This can be a colon-separated path.</dd> +</dl> +</div> +<div class="section" id="id15"> +<h3>Examples<a class="headerlink" href="#id15" title="Permalink to this headline">¶</a></h3> +<p>The following examples show how to use this Knife subcommand:</p> +<p><strong>Generate metadata</strong></p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife cookbook metadata -a +</pre></div> +</div> +</div> +</div> +<div class="section" id="metadata-from-file"> +<h2>metadata from file<a class="headerlink" href="#metadata-from-file" title="Permalink to this headline">¶</a></h2> +<p>The <tt class="docutils literal"><span class="pre">metadata</span> <span class="pre">from</span> <span class="pre">file</span></tt> argument is used to load the metadata for a cookbook from a file.</p> +<div class="section" id="id16"> +<h3>Syntax<a class="headerlink" href="#id16" title="Permalink to this headline">¶</a></h3> +<p>This argument has the following syntax:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife cookbook metadata from file FILE +</pre></div> +</div> +</div> +<div class="section" id="id17"> +<h3>Options<a class="headerlink" href="#id17" title="Permalink to this headline">¶</a></h3> +<p>This command does not have any specific options.</p> +</div> +<div class="section" id="id18"> +<h3>Examples<a class="headerlink" href="#id18" title="Permalink to this headline">¶</a></h3> +<p>The following examples show how to use this Knife subcommand:</p> +<p><strong>View metadata</strong></p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife cookbook metadta from file /path/to/file +</pre></div> +</div> +</div> +</div> +<div class="section" id="show"> +<h2>show<a class="headerlink" href="#show" title="Permalink to this headline">¶</a></h2> +<p>The <tt class="docutils literal"><span class="pre">show</span></tt> argument is used to view information about a cookbook, parts of a cookbook (attributes, definitions, files, libraries, providers, recipes, resources, and templates), or a file that is associated with a cookbook (including attributes such as checksum or specificity).</p> +<div class="section" id="id19"> +<h3>Syntax<a class="headerlink" href="#id19" title="Permalink to this headline">¶</a></h3> +<p>This argument has the following syntax:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife cookbook show COOKBOOK_NAME <span class="o">[</span>COOKBOOK_VERSION<span class="o">]</span> <span class="o">[</span>PART...<span class="o">]</span> <span class="o">[</span>FILE_NAME<span class="o">]</span> <span class="o">(</span>options<span class="o">)</span> +</pre></div> +</div> +</div> +<div class="section" id="id20"> +<h3>Options<a class="headerlink" href="#id20" title="Permalink to this headline">¶</a></h3> +<p>This argument has the following options:</p> +<dl class="docutils"> +<dt><tt class="docutils literal"><span class="pre">COOKBOOK_VERSION</span></tt></dt> +<dd>The version of a cookbook to be shown. If a cookbook has only one version, this option does not need to be specified. If a cookbook has more than one version and this option is not specified, a list of cookbook versions will be returned.</dd> +<dt><tt class="docutils literal"><span class="pre">-f</span> <span class="pre">FQDN</span></tt>, <tt class="docutils literal"><span class="pre">--fqdn</span> <span class="pre">FQDN</span></tt></dt> +<dd>The FQDN of the host.</dd> +<dt><tt class="docutils literal"><span class="pre">FILE_NAME</span></tt></dt> +<dd>The name of a file that is associated with a cookbook.</dd> +<dt><tt class="docutils literal"><span class="pre">-p</span> <span class="pre">PLATFORM</span></tt>, <tt class="docutils literal"><span class="pre">--platform</span> <span class="pre">PLATFORM</span></tt></dt> +<dd>The platform for which a cookbook is designed.</dd> +<dt><tt class="docutils literal"><span class="pre">PART</span></tt></dt> +<dd>The part of the cookbook to show: <tt class="docutils literal"><span class="pre">attributes</span></tt>, <tt class="docutils literal"><span class="pre">definitions</span></tt>, <tt class="docutils literal"><span class="pre">files</span></tt>, <tt class="docutils literal"><span class="pre">libraries</span></tt>, <tt class="docutils literal"><span class="pre">providers</span></tt>, <tt class="docutils literal"><span class="pre">recipes</span></tt>, <tt class="docutils literal"><span class="pre">resources</span></tt>, or <tt class="docutils literal"><span class="pre">templates</span></tt>. More than one part can be specified.</dd> +<dt><tt class="docutils literal"><span class="pre">-V</span> <span class="pre">PLATFORM_VERSION</span></tt>, <tt class="docutils literal"><span class="pre">--platform-version</span> <span class="pre">PLATFORM_VERSION</span></tt></dt> +<dd>The version of the platform.</dd> +<dt><tt class="docutils literal"><span class="pre">-w</span></tt>, <tt class="docutils literal"><span class="pre">--with-uri</span></tt></dt> +<dd>Indicates that the corresponding URIs will be shown.</dd> +</dl> +</div> +<div class="section" id="id21"> +<h3>Examples<a class="headerlink" href="#id21" title="Permalink to this headline">¶</a></h3> +<p>The following examples show how to use this Knife subcommand:</p> +<p><strong>Show cookbook data</strong></p> +<p>To get the list of available versions of a cookbook named “getting-started”, enter:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife cookbook show getting-started +</pre></div> +</div> +<p>to return something like:</p> +<div class="highlight-bash"><div class="highlight"><pre>getting-started 0.3.0 0.2.0 +</pre></div> +</div> +<p><strong>Show cookbook versions</strong></p> +<p>To show a list of data about a cookbook using the name of the cookbook and the version, enter:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife cookbook show getting-started 0.3.0 +</pre></div> +</div> +<p>to return something like:</p> +<div class="highlight-bash"><div class="highlight"><pre>attributes: + checksum: fa0fc4abf3f6787aeb5c3c5c35de667c + name: default.rb + path: attributes/default.rb + specificity: default + url: https://somelongurlhere.com +chef_type: cookbook_version +cookbook_name: getting-started +definitions: <span class="o">[]</span> +files: <span class="o">[]</span> +frozen?: <span class="nb">false</span> +json_class: Chef::CookbookVersion +libraries: <span class="o">[]</span> +</pre></div> +</div> +<p><strong>Show a cookbook version</strong></p> +<p>To only view data about “templates”, enter:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife cookbook show getting-started 0.3.0 templates +</pre></div> +</div> +<p>to return something like:</p> +<div class="highlight-bash"><div class="highlight"><pre>checksum: a29d6f254577b830091f140c3a78b1fe +name: chef-getting-started.txt.erb +path: templates/default/chef-getting-started.txt.erb +specificity: default +url: https://someurlhere.com +</pre></div> +</div> +<p><strong>Show cookbook data as JSON</strong></p> +<p>To view information in JSON format, use the <tt class="docutils literal"><span class="pre">-F</span></tt> common option as part of the command like this:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife role show devops -F json +</pre></div> +</div> +<p>Other formats available include <tt class="docutils literal"><span class="pre">text</span></tt>, <tt class="docutils literal"><span class="pre">yaml</span></tt>, and <tt class="docutils literal"><span class="pre">pp</span></tt>.</p> +</div> +</div> +<div class="section" id="test"> +<h2>test<a class="headerlink" href="#test" title="Permalink to this headline">¶</a></h2> +<p>The <tt class="docutils literal"><span class="pre">test</span></tt> argument is used to test a cookbook for syntax errors. This argument uses Ruby syntax checking to verify every file in a cookbook that ends in .rb and Embedded Ruby (ERB).</p> +<div class="section" id="id22"> +<h3>Syntax<a class="headerlink" href="#id22" title="Permalink to this headline">¶</a></h3> +<p>This argument has the following syntax:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife cookbook <span class="nb">test </span>COOKBOOK_NAME <span class="o">(</span>options<span class="o">)</span> +</pre></div> +</div> +</div> +<div class="section" id="id23"> +<h3>Options<a class="headerlink" href="#id23" title="Permalink to this headline">¶</a></h3> +<p>This argument has the following options:</p> +<dl class="docutils"> +<dt><tt class="docutils literal"><span class="pre">-a</span></tt>, <tt class="docutils literal"><span class="pre">--all</span></tt></dt> +<dd>Indicates that all cookbooks will be tested.</dd> +<dt><tt class="docutils literal"><span class="pre">-o</span> <span class="pre">PATH:PATH</span></tt>, <tt class="docutils literal"><span class="pre">--cookbook-path</span> <span class="pre">PATH:PATH</span></tt></dt> +<dd>The directory in which cookbook are created. This can be a colon-separated path.</dd> +</dl> +</div> +<div class="section" id="id24"> +<h3>Examples<a class="headerlink" href="#id24" title="Permalink to this headline">¶</a></h3> +<p>The following examples show how to use this Knife subcommand:</p> +<p><strong>Test a cookbook</strong></p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife cookbook <span class="nb">test </span>cookbook_name +</pre></div> +</div> +</div> +</div> +<div class="section" id="upload"> +<h2>upload<a class="headerlink" href="#upload" title="Permalink to this headline">¶</a></h2> +<p>The <tt class="docutils literal"><span class="pre">upload</span></tt> argument is used to upload one or more cookbooks (and any files that are associated with those cookbooks) from a local repository to the server. Only files that do not already exist on the server will be uploaded.</p> +<div class="admonition note"> +<p class="first admonition-title">Note</p> +<p class="last">Use a chefignore file to prevent the upload of specific files and file types, such as temporary files or files placed in folders by version control systems. The chefignore file must be located in the root of the cookbook repository and must use rules similar to filename globbing (as defined by the Ruby <tt class="docutils literal"><span class="pre">File.fnmatch</span></tt> syntax).</p> +</div> +<div class="section" id="id25"> +<h3>Syntax<a class="headerlink" href="#id25" title="Permalink to this headline">¶</a></h3> +<p>This argument has the following syntax:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife cookbook upload <span class="o">[</span>COOKBOOK_NAME...<span class="o">]</span> <span class="o">(</span>options<span class="o">)</span> +</pre></div> +</div> +</div> +<div class="section" id="id26"> +<h3>Options<a class="headerlink" href="#id26" title="Permalink to this headline">¶</a></h3> +<p>This argument has the following options:</p> +<dl class="docutils"> +<dt><tt class="docutils literal"><span class="pre">-a</span></tt>, <tt class="docutils literal"><span class="pre">--all</span></tt></dt> +<dd>Indicates that all cookbooks will be uploaded.</dd> +<dt><tt class="docutils literal"><span class="pre">-d</span></tt>, <tt class="docutils literal"><span class="pre">--include-dependencies</span></tt></dt> +<dd>Indicates that when a cookbook has a dependency on one (or more) cookbooks, those cookbooks will also be uploaded.</dd> +<dt><tt class="docutils literal"><span class="pre">--force</span></tt></dt> +<dd>Indicates that a cookbook should be updated even if the <tt class="docutils literal"><span class="pre">--freeze</span></tt> flag has been set.</dd> +<dt><tt class="docutils literal"><span class="pre">--freeze</span></tt></dt> +<dd>Indicates that a cookbook cannot be modified; any changes to this cookbook must be included as a new version. Only the <tt class="docutils literal"><span class="pre">--force</span></tt> option can override this setting.</dd> +<dt><tt class="docutils literal"><span class="pre">-o</span> <span class="pre">PATH:PATH</span></tt>, <tt class="docutils literal"><span class="pre">--cookbook-path</span> <span class="pre">PATH:PATH</span></tt></dt> +<dd>The directory in which cookbook are created. This can be a colon-separated path.</dd> +</dl> +</div> +<div class="section" id="id27"> +<h3>Examples<a class="headerlink" href="#id27" title="Permalink to this headline">¶</a></h3> +<p>The following examples show how to use this Knife subcommand:</p> +<p><strong>Upload a cookbook</strong></p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife cookbook upload cookbook_name +</pre></div> +</div> +<p><strong>Freeze a cookbook</strong></p> +<p>To upload a cookbook, and then prevent other users from being able to make changes to it, enter:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife cookbook upload redis --freeze +</pre></div> +</div> +<p>to return something like:</p> +<div class="highlight-bash"><div class="highlight"><pre>Uploading redis... +Upload completed +</pre></div> +</div> +<p>If a cookbook is frozen and the <tt class="docutils literal"><span class="pre">--force</span></tt> option is not specified, Knife will return an error message similar to the following:</p> +<div class="highlight-bash"><div class="highlight"><pre>Uploading redis... +ERROR: Version 0.1.6 of cookbook redis is frozen. Use --force to override. +</pre></div> +</div> +</div> +</div> +</div> + + + </div> + + </div> + + + <div class="clearer"></div> + </div> + + + + + </body> +</html>
\ No newline at end of file diff --git a/distro/common/html/knife_cookbook_site.html b/distro/common/html/knife_cookbook_site.html new file mode 100644 index 0000000000..4d34dcc998 --- /dev/null +++ b/distro/common/html/knife_cookbook_site.html @@ -0,0 +1,372 @@ + +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> + + +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> + + <title>knife cookbook site — chef-client Man Pages</title> + + <link rel="stylesheet" href="_static/guide.css" type="text/css" /> + <link rel="stylesheet" href="_static/pygments.css" type="text/css" /> + + <script type="text/javascript"> + var DOCUMENTATION_OPTIONS = { + URL_ROOT: '', + VERSION: '', + COLLAPSE_INDEX: false, + FILE_SUFFIX: '.html', + HAS_SOURCE: true + }; + </script> + <script type="text/javascript" src="_static/jquery.js"></script> + <script type="text/javascript" src="_static/underscore.js"></script> + <script type="text/javascript" src="_static/doctools.js"></script> + <link rel="shortcut icon" href="_static/chef.ico"/> + + + </head> + <body> +<div style="background-color: #212c35; text-align: left; padding: 0px 0px 0px 0px"> +<a href="http://docs.opscode.com/"><img src="_static/chef_html_logo.png" border="0" alt="Chef"/></a> +</div> + + + + + <div class="document"> + <div class="documentwrapper"> + + <div class="body"> + + <div class="section" id="knife-cookbook-site"> +<h1>knife cookbook site<a class="headerlink" href="#knife-cookbook-site" title="Permalink to this headline">¶</a></h1> +<p>The Cookbooks Site API is used to provide access to the cookbooks community hosted at <a class="reference external" href="https://cookbooks.opscode.com">https://cookbooks.opscode.com</a>. All of the cookbooks in the community are accessible through a REST API located at <a class="reference external" href="https://cookbooks.opscode.com/api/v1/">https://cookbooks.opscode.com/api/v1/</a> by using any of the supported endpoints. In most cases, using Knife and the <strong>knife cookbook site</strong> sub-command (and any of its arguments) is the recommended method of interacting with these cookbooks, but in some cases, using the REST API directly may make sense.</p> +<p>The <strong>knife cookbook site</strong> subcommand is used to interact with cookbooks that are located at <a class="reference external" href="https://cookbooks.opscode.com">https://cookbooks.opscode.com</a>. A user account is required for any community actions that write data to this site. The following arguments do not require a user account: <tt class="docutils literal"><span class="pre">download</span></tt>, <tt class="docutils literal"><span class="pre">search</span></tt>, <tt class="docutils literal"><span class="pre">install</span></tt>, and <tt class="docutils literal"><span class="pre">list</span></tt>.</p> +<div class="admonition note"> +<p class="first admonition-title">Note</p> +<p class="last">Review the list of <a class="reference internal" href="knife_common_options.html"><em>common options</em></a> available to this (and all) Knife subcommands and plugins.</p> +</div> +<div class="section" id="download"> +<h2>download<a class="headerlink" href="#download" title="Permalink to this headline">¶</a></h2> +<p>The <tt class="docutils literal"><span class="pre">download</span></tt> argument is used to download a cookbook from the community website. A cookbook will be downloaded as a tar.gz archive and placed in the current working directory. If a cookbook (or cookbook version) has been deprecated and the <tt class="docutils literal"><span class="pre">--force</span></tt> option is not used, Knife will alert the user that the cookbook is deprecated and then will provide the name of the most recent non-deprecated version of that cookbook.</p> +<div class="section" id="syntax"> +<h3>Syntax<a class="headerlink" href="#syntax" title="Permalink to this headline">¶</a></h3> +<p>This argument has the following syntax:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife cookbook site download COOKBOOK_NAME <span class="o">[</span>COOKBOOK_VERSION<span class="o">]</span> <span class="o">(</span>options<span class="o">)</span> +</pre></div> +</div> +</div> +<div class="section" id="options"> +<h3>Options<a class="headerlink" href="#options" title="Permalink to this headline">¶</a></h3> +<p>This argument has the following options:</p> +<dl class="docutils"> +<dt><tt class="docutils literal"><span class="pre">COOKBOOK_VERSION</span></tt></dt> +<dd>The version of a cookbook to be downloaded. If a cookbook has only one version, this option does not need to be specified. If a cookbook has more than one version and this option is not specified, Knife will prompt for a version.</dd> +<dt><tt class="docutils literal"><span class="pre">-f</span></tt>, <tt class="docutils literal"><span class="pre">--force</span></tt></dt> +<dd>Indicates that an existing directory will be overwritten.</dd> +</dl> +</div> +<div class="section" id="examples"> +<h3>Examples<a class="headerlink" href="#examples" title="Permalink to this headline">¶</a></h3> +<p>The following examples show how to use this Knife subcommand:</p> +<p><strong>Download a cookbook</strong></p> +<p>To download the cookbook “getting-started”, enter:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife cookbook site download getting-started +</pre></div> +</div> +<p>to return something like:</p> +<div class="highlight-bash"><div class="highlight"><pre>Downloading getting-started from the cookbooks site at version 0.3.0 to + /Users/sdanna/opscodesupport/getting-started-0.3.0.tar.gz +Cookbook saved: /Users/sdanna/opscodesupport/getting-started-0.3.0.tar.gz +</pre></div> +</div> +</div> +</div> +<div class="section" id="install"> +<h2>install<a class="headerlink" href="#install" title="Permalink to this headline">¶</a></h2> +<p>The <tt class="docutils literal"><span class="pre">install</span></tt> argument is used to install a cookbook that has been downloaded from the community site to a local git repository . This action uses the git version control system in conjunction with the <a class="reference external" href="https://cookbooks.opscode.com">https://cookbooks.opscode.com</a> site to install community-contributed cookbooks to the local chef-repo. Using this argument does the following:</p> +<blockquote> +<div><ol class="arabic simple"> +<li>A new “pristine copy” branch is created in git for tracking the upstream.</li> +<li>All existing versions of a cookbook are removed from the branch.</li> +<li>The cookbook is downloaded from <a class="reference external" href="https://cookbooks.opscode.com">https://cookbooks.opscode.com</a> in the tar.gz format.</li> +<li>The downloaded cookbook is untarred and its contents are committed to git and a tag is created.</li> +<li>The “pristine copy” branch is merged into the master branch.</li> +</ol> +</div></blockquote> +<p>This process allows the upstream cookbook in the master branch to be modified while letting git maintain changes as a separate patch. When an updated upstream version becomes available, those changes can be merged while maintaining any local modifications.</p> +<div class="section" id="id1"> +<h3>Syntax<a class="headerlink" href="#id1" title="Permalink to this headline">¶</a></h3> +<p>This argument has the following syntax:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife cookbook site install COOKBOOK_NAME <span class="o">[</span>COOKBOOK_VERSION<span class="o">]</span> <span class="o">(</span>options<span class="o">)</span> +</pre></div> +</div> +</div> +<div class="section" id="id2"> +<h3>Options<a class="headerlink" href="#id2" title="Permalink to this headline">¶</a></h3> +<p>This argument has the following options:</p> +<dl class="docutils"> +<dt><tt class="docutils literal"><span class="pre">-b</span></tt>, <tt class="docutils literal"><span class="pre">--use-current-branch</span></tt></dt> +<dd>Indicates that the current branch will be used.</dd> +<dt><tt class="docutils literal"><span class="pre">-B</span> <span class="pre">BRANCH</span></tt>, <tt class="docutils literal"><span class="pre">--branch</span> <span class="pre">BRANCH</span></tt></dt> +<dd>The name of the default branch. This will default to the master branch.</dd> +<dt><tt class="docutils literal"><span class="pre">COOKBOOK_VERSION</span></tt></dt> +<dd>The version of the cookbook to be installed. If a version is not specified, the most recent version of the cookbook will be installed.</dd> +<dt><tt class="docutils literal"><span class="pre">-D</span></tt>, <tt class="docutils literal"><span class="pre">--skip-dependencies</span></tt></dt> +<dd>Indicates that all cookbooks to which the installed cookbook has a dependency will not be installed.</dd> +<dt><tt class="docutils literal"><span class="pre">-o</span> <span class="pre">PATH:PATH</span></tt>, <tt class="docutils literal"><span class="pre">--cookbook-path</span> <span class="pre">PATH:PATH</span></tt></dt> +<dd>The directory in which cookbook are created. This can be a colon-separated path.</dd> +</dl> +</div> +<div class="section" id="id3"> +<h3>Examples<a class="headerlink" href="#id3" title="Permalink to this headline">¶</a></h3> +<p>The following examples show how to use this Knife subcommand:</p> +<p><strong>Install a cookbook</strong></p> +<p>To install the cookbook “getting-started”, enter:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife cookbook site install getting-started +</pre></div> +</div> +<p>to return something like:</p> +<div class="highlight-bash"><div class="highlight"><pre>Installing getting-started to /Users/sdanna/opscodesupport/.chef/../cookbooks +Checking out the master branch. +Creating pristine copy branch chef-vendor-getting-started +Downloading getting-started from the cookbooks site at version 0.3.0 to + /Users/sdanna/opscodesupport/.chef/../cookbooks/getting-started.tar.gz +Cookbook saved: /Users/sdanna/opscodesupport/.chef/../cookbooks/getting-started.tar.gz +Removing pre-existing version. +Uncompressing getting-started version /Users/sdanna/opscodesupport/.chef/../cookbooks. +removing downloaded tarball +1 files updated, committing changes +Creating tag cookbook-site-imported-getting-started-0.3.0 +Checking out the master branch. +Updating 4d44b5b..b4c32f2 +Fast-forward + cookbooks/getting-started/README.rdoc | 4 +++ + cookbooks/getting-started/attributes/default.rb | 1 + + cookbooks/getting-started/metadata.json | 29 ++++++++++++++++++++ + cookbooks/getting-started/metadata.rb | 6 ++++ + cookbooks/getting-started/recipes/default.rb | 23 +++++++++++++++ + .../templates/default/chef-getting-started.txt.erb | 5 +++ + 6 files changed, 68 insertions<span class="o">(</span>+<span class="o">)</span>, 0 deletions<span class="o">(</span>-<span class="o">)</span> + create mode 100644 cookbooks/getting-started/README.rdoc + create mode 100644 cookbooks/getting-started/attributes/default.rb + create mode 100644 cookbooks/getting-started/metadata.json + create mode 100644 cookbooks/getting-started/metadata.rb + create mode 100644 cookbooks/getting-started/recipes/default.rb + create mode 100644 cookbooks/getting-started/templates/default/chef-getting-started.txt.erb +Cookbook getting-started version 0.3.0 successfully installed +</pre></div> +</div> +</div> +</div> +<div class="section" id="list"> +<h2>list<a class="headerlink" href="#list" title="Permalink to this headline">¶</a></h2> +<p>The <tt class="docutils literal"><span class="pre">list</span></tt> argument is used to view a list of cookbooks that are currently available at <a class="reference external" href="https://cookbooks.opscode.com">https://cookbooks.opscode.com</a>.</p> +<div class="section" id="id4"> +<h3>Syntax<a class="headerlink" href="#id4" title="Permalink to this headline">¶</a></h3> +<p>This argument has the following syntax:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife cookbook site list +</pre></div> +</div> +</div> +<div class="section" id="id5"> +<h3>Options<a class="headerlink" href="#id5" title="Permalink to this headline">¶</a></h3> +<p>This argument has the following options:</p> +<dl class="docutils"> +<dt><tt class="docutils literal"><span class="pre">-w</span></tt>, <tt class="docutils literal"><span class="pre">--with-uri</span></tt></dt> +<dd>Indicates that the corresponding URIs will be shown.</dd> +</dl> +</div> +<div class="section" id="id6"> +<h3>Examples<a class="headerlink" href="#id6" title="Permalink to this headline">¶</a></h3> +<p>The following examples show how to use this Knife subcommand:</p> +<p><strong>View a list of cookbooks</strong></p> +<p>To view a list of cookbooks at <a class="reference external" href="https://cookbooks.opscode.com">https://cookbooks.opscode.com</a> server, enter:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife cookbook site list +</pre></div> +</div> +<p>to return:</p> +<div class="highlight-python"><pre>1password homesick rabbitmq +7-zip hostname rabbitmq-management +AmazonEC2Tag hosts rabbitmq_chef +R hosts-awareness rackspaceknife +accounts htop radiant +ack-grep hudson rails +activemq icinga rails_enterprise +ad id3lib redis-package +ad-likewise iftop redis2 +ant iis redmine +[...truncated...]</pre> +</div> +</div> +</div> +<div class="section" id="search"> +<h2>search<a class="headerlink" href="#search" title="Permalink to this headline">¶</a></h2> +<p>The <tt class="docutils literal"><span class="pre">search</span></tt> argument is used to search for a cookbook at <a class="reference external" href="https://cookbooks.opscode.com">https://cookbooks.opscode.com</a>. A search query is used to return a list of cookbooks at <a class="reference external" href="https://cookbooks.opscode.com">https://cookbooks.opscode.com</a> and uses the same syntax as the <strong>knife search</strong> sub-command.</p> +<div class="section" id="id7"> +<h3>Syntax<a class="headerlink" href="#id7" title="Permalink to this headline">¶</a></h3> +<p>This argument has the following syntax:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife cookbook site search SEARCH_QUERY <span class="o">(</span>options<span class="o">)</span> +</pre></div> +</div> +</div> +<div class="section" id="id8"> +<h3>Options<a class="headerlink" href="#id8" title="Permalink to this headline">¶</a></h3> +<p>This command does not have any specific options.</p> +</div> +<div class="section" id="id9"> +<h3>Examples<a class="headerlink" href="#id9" title="Permalink to this headline">¶</a></h3> +<p>The following examples show how to use this Knife subcommand:</p> +<p><strong>Search for cookbooks</strong></p> +<p>To search for all of the cookbooks that can be used with Apache, enter:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife cookbook site search apache* +</pre></div> +</div> +<p>to return something like:</p> +<div class="highlight-bash"><div class="highlight"><pre>apache2: + cookbook: http://cookbooks.opscode.com/api/v1/cookbooks/apache2 + cookbook_description: Installs and configures apache2 using Debian symlinks with helper definitions + cookbook_maintainer: opscode + cookbook_name: apache2 +instiki: + cookbook: http://cookbooks.opscode.com/api/v1/cookbooks/instiki + cookbook_description: Installs instiki, a Ruby on Rails wiki server under passenger+Apache2. + cookbook_maintainer: jtimberman + cookbook_name: instiki +kickstart: + cookbook: http://cookbooks.opscode.com/api/v1/cookbooks/kickstart + cookbook_description: Creates apache2 vhost and serves a kickstart file. + cookbook_maintainer: opscode + cookbook_name: kickstart +<span class="o">[</span>...truncated...<span class="o">]</span> +</pre></div> +</div> +</div> +</div> +<div class="section" id="share"> +<h2>share<a class="headerlink" href="#share" title="Permalink to this headline">¶</a></h2> +<p>The <tt class="docutils literal"><span class="pre">share</span></tt> argument is used to add a cookbook to <a class="reference external" href="https://cookbooks.opscode.com">https://cookbooks.opscode.com</a>. This action will require a user account and a certificate for <a class="reference external" href="http://community.opscode.com">http://community.opscode.com</a>. By default, Knife will use the user name and API key that is identified in the configuration file used during the upload; otherwise these values must be specified on the command line or in an alternate configuration file. If a cookbook already exists on <a class="reference external" href="https://cookbooks.opscode.com">https://cookbooks.opscode.com</a>, then only an owner or maintainer of that cookbook can make updates.</p> +<div class="section" id="id10"> +<h3>Syntax<a class="headerlink" href="#id10" title="Permalink to this headline">¶</a></h3> +<p>This argument has the following syntax:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife cookbook site share COOKBOOK_NAME CATEGORY <span class="o">(</span>options<span class="o">)</span> +</pre></div> +</div> +</div> +<div class="section" id="id11"> +<h3>Options<a class="headerlink" href="#id11" title="Permalink to this headline">¶</a></h3> +<p>This argument has the following options:</p> +<dl class="docutils"> +<dt><tt class="docutils literal"><span class="pre">CATEGORY</span></tt></dt> +<dd>The cookbook category: <tt class="docutils literal"><span class="pre">Databases</span></tt>, <tt class="docutils literal"><span class="pre">Web</span> <span class="pre">Servers</span></tt>, <tt class="docutils literal"><span class="pre">Process</span> <span class="pre">Management</span></tt>, <tt class="docutils literal"><span class="pre">Monitoring</span> <span class="pre">and</span> <span class="pre">Trending</span></tt>, <tt class="docutils literal"><span class="pre">Programming</span> <span class="pre">Languages</span></tt>, <tt class="docutils literal"><span class="pre">Package</span> <span class="pre">Management</span></tt>, <tt class="docutils literal"><span class="pre">Applications</span></tt>, <tt class="docutils literal"><span class="pre">Networking</span></tt>, <tt class="docutils literal"><span class="pre">Operations</span> <span class="pre">Systems</span> <span class="pre">and</span> <span class="pre">Virtualization</span></tt>, <tt class="docutils literal"><span class="pre">Utilities</span></tt>, or <tt class="docutils literal"><span class="pre">Other</span></tt>.</dd> +<dt><tt class="docutils literal"><span class="pre">-o</span> <span class="pre">PATH:PATH</span></tt>, <tt class="docutils literal"><span class="pre">--cookbook-path</span> <span class="pre">PATH:PATH</span></tt></dt> +<dd>The directory in which cookbook are created. This can be a colon-separated path.</dd> +</dl> +</div> +<div class="section" id="id12"> +<h3>Examples<a class="headerlink" href="#id12" title="Permalink to this headline">¶</a></h3> +<p>The following examples show how to use this Knife subcommand:</p> +<p><strong>Share a cookbook</strong></p> +<p>To share a cookbook named “apache2”:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife cookbook site share <span class="s2">"apache2"</span> <span class="s2">"Web Servers"</span> +</pre></div> +</div> +</div> +</div> +<div class="section" id="show"> +<h2>show<a class="headerlink" href="#show" title="Permalink to this headline">¶</a></h2> +<p>The <tt class="docutils literal"><span class="pre">show</span></tt> argument is used to view information about a cookbook on <a class="reference external" href="https://cookbooks.opscode.com">https://cookbooks.opscode.com</a>.</p> +<div class="section" id="id13"> +<h3>Syntax<a class="headerlink" href="#id13" title="Permalink to this headline">¶</a></h3> +<p>This argument has the following syntax:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife cookbook site show COOKBOOK_NAME <span class="o">[</span>COOKBOOK_VERSION<span class="o">]</span> +</pre></div> +</div> +</div> +<div class="section" id="id14"> +<h3>Options<a class="headerlink" href="#id14" title="Permalink to this headline">¶</a></h3> +<p>This argument has the following options:</p> +<dl class="docutils"> +<dt><tt class="docutils literal"><span class="pre">COOKBOOK_VERSION</span></tt></dt> +<dd>The version of a cookbook to be shown. If a cookbook has only one version, this option does not need to be specified. If a cookbook has more than one version and this option is not specified, a list of cookbook versions will be returned.</dd> +</dl> +</div> +<div class="section" id="id15"> +<h3>Examples<a class="headerlink" href="#id15" title="Permalink to this headline">¶</a></h3> +<p>The following examples show how to use this Knife subcommand:</p> +<p><strong>Show cookbook data</strong></p> +<p>To show the details for a cookbook named “haproxy”:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife cookbook site show haproxy +</pre></div> +</div> +<p>to return something like:</p> +<div class="highlight-bash"><div class="highlight"><pre>average_rating: +category: Networking +created_at: 2009-10-25T23:51:07Z +description: Installs and configures haproxy +external_url: +latest_version: http://cookbooks.opscode.com/api/v1/cookbooks/haproxy/versions/1_0_3 +maintainer: opscode +name: haproxy +updated_at: 2011-06-30T21:53:25Z +versions: + http://cookbooks.opscode.com/api/v1/cookbooks/haproxy/versions/1_0_3 + http://cookbooks.opscode.com/api/v1/cookbooks/haproxy/versions/1_0_2 + http://cookbooks.opscode.com/api/v1/cookbooks/haproxy/versions/1_0_1 + http://cookbooks.opscode.com/api/v1/cookbooks/haproxy/versions/1_0_0 + http://cookbooks.opscode.com/api/v1/cookbooks/haproxy/versions/0_8_1 + http://cookbooks.opscode.com/api/v1/cookbooks/haproxy/versions/0_8_0 + http://cookbooks.opscode.com/api/v1/cookbooks/haproxy/versions/0_7_0 +</pre></div> +</div> +<p><strong>Show cookbook data as JSON</strong></p> +<p>To view information in JSON format, use the <tt class="docutils literal"><span class="pre">-F</span></tt> common option as part of the command like this:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife role show devops -F json +</pre></div> +</div> +<p>Other formats available include <tt class="docutils literal"><span class="pre">text</span></tt>, <tt class="docutils literal"><span class="pre">yaml</span></tt>, and <tt class="docutils literal"><span class="pre">pp</span></tt>.</p> +</div> +</div> +<div class="section" id="unshare"> +<h2>unshare<a class="headerlink" href="#unshare" title="Permalink to this headline">¶</a></h2> +<p>The <tt class="docutils literal"><span class="pre">unshare</span></tt> argument is used to stop the sharing of a cookbook at <a class="reference external" href="https://cookbooks.opscode.com">https://cookbooks.opscode.com</a>. Only the maintainer of a cookbook may perform this action.</p> +<div class="section" id="id16"> +<h3>Syntax<a class="headerlink" href="#id16" title="Permalink to this headline">¶</a></h3> +<p>This argument has the following syntax:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife cookbook site unshare COOKBOOK_NAME +</pre></div> +</div> +</div> +<div class="section" id="id17"> +<h3>Options<a class="headerlink" href="#id17" title="Permalink to this headline">¶</a></h3> +<p>This command does not have any specific options.</p> +</div> +<div class="section" id="id18"> +<h3>Examples<a class="headerlink" href="#id18" title="Permalink to this headline">¶</a></h3> +<p>The following examples show how to use this Knife subcommand:</p> +<p><strong>Unshare a cookbook</strong></p> +<p>To unshare a cookbook named “getting-started”, enter:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife cookbook site unshare getting-started +</pre></div> +</div> +</div> +</div> +</div> + + + </div> + + </div> + + + <div class="clearer"></div> + </div> + + + + + </body> +</html>
\ No newline at end of file diff --git a/distro/common/html/knife_data_bag.html b/distro/common/html/knife_data_bag.html new file mode 100644 index 0000000000..4e888c8963 --- /dev/null +++ b/distro/common/html/knife_data_bag.html @@ -0,0 +1,359 @@ + +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> + + +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> + + <title>knife data bag — chef-client Man Pages</title> + + <link rel="stylesheet" href="_static/guide.css" type="text/css" /> + <link rel="stylesheet" href="_static/pygments.css" type="text/css" /> + + <script type="text/javascript"> + var DOCUMENTATION_OPTIONS = { + URL_ROOT: '', + VERSION: '', + COLLAPSE_INDEX: false, + FILE_SUFFIX: '.html', + HAS_SOURCE: true + }; + </script> + <script type="text/javascript" src="_static/jquery.js"></script> + <script type="text/javascript" src="_static/underscore.js"></script> + <script type="text/javascript" src="_static/doctools.js"></script> + <link rel="shortcut icon" href="_static/chef.ico"/> + + + </head> + <body> +<div style="background-color: #212c35; text-align: left; padding: 0px 0px 0px 0px"> +<a href="http://docs.opscode.com/"><img src="_static/chef_html_logo.png" border="0" alt="Chef"/></a> +</div> + + + + + <div class="document"> + <div class="documentwrapper"> + + <div class="body"> + + <div class="section" id="knife-data-bag"> +<h1>knife data bag<a class="headerlink" href="#knife-data-bag" title="Permalink to this headline">¶</a></h1> +<p>A data bag is a global variable that is stored as JSON data and is accessible from a server. A data bag is indexed for searching and can be loaded by a recipe or accessed during a search. The contents of a data bag can vary, but they often include sensitive information (such as database passwords).</p> +<p>A data bag item may be encrypted using <a class="reference external" href="https://en.wikipedia.org/wiki/Symmetric-key_algorithm">shared secret encryption</a>. This allows each data bag item to store confidential information (such as a database password) or to be managed in a source control system (without plain-text data appearing in revision history). Each data bag item may be encrypted individually; if a data bag contains multiple encrypted data bag items, these data bag items are not required to share the same encryption keys.</p> +<p>The <strong>knife data bag</strong> subcommand is used to manage arbitrary stores of globally available JSON data.</p> +<div class="admonition note"> +<p class="first admonition-title">Note</p> +<p class="last">Review the list of <a class="reference internal" href="knife_common_options.html"><em>common options</em></a> available to this (and all) Knife subcommands and plugins.</p> +</div> +<div class="section" id="create"> +<h2>create<a class="headerlink" href="#create" title="Permalink to this headline">¶</a></h2> +<p>The <tt class="docutils literal"><span class="pre">create</span></tt> argument is used to add a data bag to the server.</p> +<div class="section" id="syntax"> +<h3>Syntax<a class="headerlink" href="#syntax" title="Permalink to this headline">¶</a></h3> +<p>This argument has the following syntax:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife data bag create DATA_BAG_NAME <span class="o">[</span>DATA_BAG_ITEM<span class="o">]</span> <span class="o">(</span>options<span class="o">)</span> +</pre></div> +</div> +</div> +<div class="section" id="options"> +<h3>Options<a class="headerlink" href="#options" title="Permalink to this headline">¶</a></h3> +<p>This argument has the following options:</p> +<dl class="docutils"> +<dt><tt class="docutils literal"><span class="pre">DATA_BAG_ITEM</span></tt></dt> +<dd>The name of a specific item within a data bag.</dd> +<dt><tt class="docutils literal"><span class="pre">--secret</span> <span class="pre">SECRET</span></tt></dt> +<dd>The encryption key that is used for values contained within a data bag item.</dd> +<dt><tt class="docutils literal"><span class="pre">--secret-file</span> <span class="pre">FILE</span></tt></dt> +<dd>The path to the file that contains the encryption key.</dd> +</dl> +<div class="admonition note"> +<p class="first admonition-title">Note</p> +<p class="last">For encrypted data bag items, use <em>either</em> <tt class="docutils literal"><span class="pre">--secret</span></tt> or <tt class="docutils literal"><span class="pre">--secret-file</span></tt>, not both.</p> +</div> +</div> +<div class="section" id="examples"> +<h3>Examples<a class="headerlink" href="#examples" title="Permalink to this headline">¶</a></h3> +<p>The following examples show how to use this Knife subcommand:</p> +<p><strong>Create a data bag</strong></p> +<p>To create a data bag named “admins”, enter:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife data bag create admins +</pre></div> +</div> +<p>to return:</p> +<div class="highlight-bash"><div class="highlight"><pre>Created data_bag<span class="o">[</span>admins<span class="o">]</span> +</pre></div> +</div> +</div> +</div> +<div class="section" id="delete"> +<h2>delete<a class="headerlink" href="#delete" title="Permalink to this headline">¶</a></h2> +<p>The <tt class="docutils literal"><span class="pre">delete</span></tt> argument is used to delete a data bag or a data bag item from a server.</p> +<div class="section" id="id1"> +<h3>Syntax<a class="headerlink" href="#id1" title="Permalink to this headline">¶</a></h3> +<p>This argument has the following syntax:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife data bag delete DATA_BAG_NAME <span class="o">[</span>DATA_BAG_ITEM<span class="o">]</span> <span class="o">(</span>options<span class="o">)</span> +</pre></div> +</div> +</div> +<div class="section" id="id2"> +<h3>Options<a class="headerlink" href="#id2" title="Permalink to this headline">¶</a></h3> +<p>This argument has the following options:</p> +<dl class="docutils"> +<dt><tt class="docutils literal"><span class="pre">DATA_BAG_ITEM</span></tt></dt> +<dd>The name of a specific item within a data bag.</dd> +</dl> +</div> +<div class="section" id="id3"> +<h3>Examples<a class="headerlink" href="#id3" title="Permalink to this headline">¶</a></h3> +<p>The following examples show how to use this Knife subcommand:</p> +<p><strong>Delete a data bag</strong></p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife data bag delete data_bag_name +</pre></div> +</div> +<p><strong>Delete a data bag item</strong></p> +<p>To delete an item named “charlie”, enter:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife data bag delete admins charlie +</pre></div> +</div> +<p>Type <tt class="docutils literal"><span class="pre">Y</span></tt> to confirm a deletion.</p> +</div> +</div> +<div class="section" id="edit"> +<h2>edit<a class="headerlink" href="#edit" title="Permalink to this headline">¶</a></h2> +<p>The <tt class="docutils literal"><span class="pre">edit</span></tt> argument is used to edit the data contained in a data bag. If encryption is being used, the data bag will be decrypted, the data will be made available in the $EDITOR, and then encrypted again before saving it to the server.</p> +<div class="section" id="id4"> +<h3>Syntax<a class="headerlink" href="#id4" title="Permalink to this headline">¶</a></h3> +<p>This argument has the following syntax:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife data bag edit DATA_BAG_NAME <span class="o">[</span>DATA_BAG_ITEM<span class="o">]</span> <span class="o">(</span>options<span class="o">)</span> +</pre></div> +</div> +</div> +<div class="section" id="id5"> +<h3>Options<a class="headerlink" href="#id5" title="Permalink to this headline">¶</a></h3> +<p>This argument has the following options:</p> +<dl class="docutils"> +<dt><tt class="docutils literal"><span class="pre">DATA_BAG_ITEM</span></tt></dt> +<dd>The name of a specific item within a data bag.</dd> +<dt><tt class="docutils literal"><span class="pre">--secret</span> <span class="pre">SECRET</span></tt></dt> +<dd>The encryption key that is used for values contained within a data bag item.</dd> +<dt><tt class="docutils literal"><span class="pre">--secret-file</span> <span class="pre">FILE</span></tt></dt> +<dd>The path to the file that contains the encryption key.</dd> +</dl> +<div class="admonition note"> +<p class="first admonition-title">Note</p> +<p class="last">For encrypted data bag items, use <em>either</em> <tt class="docutils literal"><span class="pre">--secret</span></tt> or <tt class="docutils literal"><span class="pre">--secret-file</span></tt>, not both.</p> +</div> +</div> +<div class="section" id="id6"> +<h3>Examples<a class="headerlink" href="#id6" title="Permalink to this headline">¶</a></h3> +<p>The following examples show how to use this Knife subcommand:</p> +<p><strong>Edit a data bag</strong></p> +<p>To edit the contents of a data bag, enter:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife data bag edit admins +</pre></div> +</div> +<p><strong>Edit a data bag item</strong></p> +<p>To edit an item named “charlie” that is contained in a data bag named “admins”, enter:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife data bag edit admins charlie +</pre></div> +</div> +<p>to open the $EDITOR. Once opened, you can update the data before saving it to the server. For example, by changing:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="o">{</span> + <span class="s2">"id"</span>: <span class="s2">"charlie"</span> +<span class="o">}</span> +</pre></div> +</div> +<p>to:</p> +<div class="highlight-javascript"><div class="highlight"><pre><span class="p">{</span> + <span class="s2">"id"</span><span class="o">:</span> <span class="s2">"charlie"</span><span class="p">,</span> + <span class="s2">"uid"</span><span class="o">:</span> <span class="mi">1005</span><span class="p">,</span> + <span class="s2">"gid"</span><span class="o">:</span><span class="s2">"ops"</span><span class="p">,</span> + <span class="s2">"shell"</span><span class="o">:</span><span class="s2">"/bin/zsh"</span><span class="p">,</span> + <span class="s2">"comment"</span><span class="o">:</span><span class="s2">"Crazy Charlie"</span> +<span class="p">}</span> +</pre></div> +</div> +</div> +</div> +<div class="section" id="from-file"> +<h2>from file<a class="headerlink" href="#from-file" title="Permalink to this headline">¶</a></h2> +<p>The <tt class="docutils literal"><span class="pre">from</span> <span class="pre">file</span></tt> argument is used to create a data bag on the server from a file. The path to the data bag file must specify one of the following:</p> +<ul class="simple"> +<li>the name of a data bag</li> +<li>a relative or absolute path to a file</li> +</ul> +<p>If the name of a data bag is specified, Knife will search for the data bag in <tt class="docutils literal"><span class="pre">./data_bags/bag_name/file</span></tt>. Once opened, the JSON file should be a hash that contains at least an ID key which represents the name of the data bag item.</p> +<div class="admonition warning"> +<p class="first admonition-title">Warning</p> +<p class="last">A chef-client must be version 11.6 (or higher) when using the <tt class="docutils literal"><span class="pre">knife</span> <span class="pre">data</span> <span class="pre">bag</span> <span class="pre">from</span> <span class="pre">file</span></tt> argument with the Enterprise Chef or Open Source Chef version 11 servers.</p> +</div> +<div class="section" id="id7"> +<h3>Syntax<a class="headerlink" href="#id7" title="Permalink to this headline">¶</a></h3> +<p>This argument has the following syntax:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife data bag from file DATA_BAG_NAME_or_PATH +</pre></div> +</div> +</div> +<div class="section" id="id8"> +<h3>Options<a class="headerlink" href="#id8" title="Permalink to this headline">¶</a></h3> +<p>This argument has the following options:</p> +<dl class="docutils"> +<dt><tt class="docutils literal"><span class="pre">-a</span></tt>, <tt class="docutils literal"><span class="pre">--all</span></tt></dt> +<dd>Indicates that all data bags found at the specified path will be uploaded.</dd> +<dt><tt class="docutils literal"><span class="pre">--secret</span> <span class="pre">SECRET</span></tt></dt> +<dd>The encryption key that is used for values contained within a data bag item.</dd> +<dt><tt class="docutils literal"><span class="pre">--secret-file</span> <span class="pre">FILE</span></tt></dt> +<dd>The path to the file that contains the encryption key.</dd> +</dl> +<div class="admonition note"> +<p class="first admonition-title">Note</p> +<p class="last">For encrypted data bag items, use <em>either</em> <tt class="docutils literal"><span class="pre">--secret</span></tt> or <tt class="docutils literal"><span class="pre">--secret-file</span></tt>, not both.</p> +</div> +</div> +<div class="section" id="id9"> +<h3>Examples<a class="headerlink" href="#id9" title="Permalink to this headline">¶</a></h3> +<p>The following examples show how to use this Knife subcommand:</p> +<p><strong>Create a data bag from a file</strong></p> +<p>To create a data bag on the server from a file:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife data bag from file <span class="s2">"path to JSON file"</span> +</pre></div> +</div> +<p><strong>Create an encrypted data bag from a file</strong></p> +<p>To create a data bag named “devops_data” that contains encrypted data, enter:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife data bag from file devops_data --secret-file <span class="s2">"path to decryption file"</span> +</pre></div> +</div> +</div> +</div> +<div class="section" id="list"> +<h2>list<a class="headerlink" href="#list" title="Permalink to this headline">¶</a></h2> +<p>The <tt class="docutils literal"><span class="pre">list</span></tt> argument is used to view a list of data bags that are currently available on the server.</p> +<div class="section" id="id10"> +<h3>Syntax<a class="headerlink" href="#id10" title="Permalink to this headline">¶</a></h3> +<p>This argument has the following syntax:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife data bag list +</pre></div> +</div> +</div> +<div class="section" id="id11"> +<h3>Options<a class="headerlink" href="#id11" title="Permalink to this headline">¶</a></h3> +<p>This argument has the following options:</p> +<dl class="docutils"> +<dt><tt class="docutils literal"><span class="pre">-w</span></tt>, <tt class="docutils literal"><span class="pre">--with-uri</span></tt></dt> +<dd>Indicates that the corresponding URIs will be shown.</dd> +</dl> +</div> +<div class="section" id="id12"> +<h3>Examples<a class="headerlink" href="#id12" title="Permalink to this headline">¶</a></h3> +<p>The following examples show how to use this Knife subcommand:</p> +<p><strong>View a list of data bags</strong></p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife data bag list +</pre></div> +</div> +</div> +</div> +<div class="section" id="show"> +<h2>show<a class="headerlink" href="#show" title="Permalink to this headline">¶</a></h2> +<p>The <tt class="docutils literal"><span class="pre">show</span></tt> argument is used to view the contents of a data bag.</p> +<div class="section" id="id13"> +<h3>Syntax<a class="headerlink" href="#id13" title="Permalink to this headline">¶</a></h3> +<p>This argument has the following syntax:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife data bag show DATA_BAG_NAME <span class="o">(</span>options<span class="o">)</span> +</pre></div> +</div> +</div> +<div class="section" id="id14"> +<h3>Options<a class="headerlink" href="#id14" title="Permalink to this headline">¶</a></h3> +<p>This argument has the following options:</p> +<dl class="docutils"> +<dt><tt class="docutils literal"><span class="pre">DATA_BAG_ITEM</span></tt></dt> +<dd>The name of a specific item within a data bag.</dd> +<dt><tt class="docutils literal"><span class="pre">--secret</span> <span class="pre">SECRET</span></tt></dt> +<dd>The encryption key that is used for values contained within a data bag item.</dd> +<dt><tt class="docutils literal"><span class="pre">--secret-file</span> <span class="pre">FILE</span></tt></dt> +<dd>The path to the file that contains the encryption key.</dd> +</dl> +<div class="admonition note"> +<p class="first admonition-title">Note</p> +<p class="last">For encrypted data bag items, use <em>either</em> <tt class="docutils literal"><span class="pre">--secret</span></tt> or <tt class="docutils literal"><span class="pre">--secret-file</span></tt>, not both.</p> +</div> +</div> +<div class="section" id="id15"> +<h3>Examples<a class="headerlink" href="#id15" title="Permalink to this headline">¶</a></h3> +<p>The following examples show how to use this Knife subcommand:</p> +<p><strong>Show a data bag</strong></p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife data bag show admins +</pre></div> +</div> +<p>to return something like:</p> +<div class="highlight-bash"><div class="highlight"><pre>charlie +</pre></div> +</div> +<p><strong>Show a data bag item</strong></p> +<p>To show the contents of a specific item within data bag, enter:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife data bag show admins charlie +</pre></div> +</div> +<p>to return:</p> +<div class="highlight-bash"><div class="highlight"><pre>comment: Crazy Charlie +gid: ops +id: charlie +shell: /bin/zsh +uid: 1005 +</pre></div> +</div> +<p><strong>Show a data bag, encrypted</strong></p> +<p>To show the contents of a data bag named “passwords” with an item that contains encrypted data named “mysql”, enter:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife data bag show passwords mysql +</pre></div> +</div> +<p>to return:</p> +<div class="highlight-javascript"><pre>## sample: +{ + "id": "mysql", + "pass": "trywgFA6R70NO28PNhMpGhEvKBZuxouemnbnAUQsUyo=\n", + "user": "e/p+8WJYVHY9fHcEgAAReg==\n" +}</pre> +</div> +<p><strong>Show a data bag, decrypted</strong></p> +<p>To show the decrypted contents of the same data bag, enter:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife data bag show --secret-file /path/to/decryption/file passwords mysql +</pre></div> +</div> +<p>to return:</p> +<div class="highlight-javascript"><pre>## sample: +{ + "id": "mysql", + "pass": "thesecret123", + "user": "fred" +}</pre> +</div> +<p><strong>Show a data bag as JSON</strong></p> +<p>To view information in JSON format, use the <tt class="docutils literal"><span class="pre">-F</span></tt> common option as part of the command like this:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife data bag show admins -F json +</pre></div> +</div> +<p>Other formats available include <tt class="docutils literal"><span class="pre">text</span></tt>, <tt class="docutils literal"><span class="pre">yaml</span></tt>, and <tt class="docutils literal"><span class="pre">pp</span></tt>.</p> +</div> +</div> +</div> + + + </div> + + </div> + + + <div class="clearer"></div> + </div> + + + + + </body> +</html>
\ No newline at end of file diff --git a/distro/common/html/knife_delete.html b/distro/common/html/knife_delete.html new file mode 100644 index 0000000000..c9424d04b2 --- /dev/null +++ b/distro/common/html/knife_delete.html @@ -0,0 +1,95 @@ + +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> + + +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> + + <title>knife delete — chef-client Man Pages</title> + + <link rel="stylesheet" href="_static/guide.css" type="text/css" /> + <link rel="stylesheet" href="_static/pygments.css" type="text/css" /> + + <script type="text/javascript"> + var DOCUMENTATION_OPTIONS = { + URL_ROOT: '', + VERSION: '', + COLLAPSE_INDEX: false, + FILE_SUFFIX: '.html', + HAS_SOURCE: true + }; + </script> + <script type="text/javascript" src="_static/jquery.js"></script> + <script type="text/javascript" src="_static/underscore.js"></script> + <script type="text/javascript" src="_static/doctools.js"></script> + <link rel="shortcut icon" href="_static/chef.ico"/> + + + </head> + <body> +<div style="background-color: #212c35; text-align: left; padding: 0px 0px 0px 0px"> +<a href="http://docs.opscode.com/"><img src="_static/chef_html_logo.png" border="0" alt="Chef"/></a> +</div> + + + + + <div class="document"> + <div class="documentwrapper"> + + <div class="body"> + + <div class="section" id="knife-delete"> +<h1>knife delete<a class="headerlink" href="#knife-delete" title="Permalink to this headline">¶</a></h1> +<p>The <strong>knife delete</strong> subcommand is used to delete an object from a server. This subcommand works similar to <tt class="docutils literal"><span class="pre">knife</span> <span class="pre">cookbook</span> <span class="pre">delete</span></tt>, <tt class="docutils literal"><span class="pre">knife</span> <span class="pre">data</span> <span class="pre">bag</span> <span class="pre">delete</span></tt>, <tt class="docutils literal"><span class="pre">knife</span> <span class="pre">environment</span> <span class="pre">delete</span></tt>, <tt class="docutils literal"><span class="pre">knife</span> <span class="pre">node</span> <span class="pre">delete</span></tt>, and <tt class="docutils literal"><span class="pre">knife</span> <span class="pre">role</span> <span class="pre">delete</span></tt>, but with a single verb (and a single action).</p> +<div class="section" id="syntax"> +<h2>Syntax<a class="headerlink" href="#syntax" title="Permalink to this headline">¶</a></h2> +<p>This argument has the following syntax:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife delete <span class="o">[</span>PATTERN...<span class="o">]</span> <span class="o">(</span>options<span class="o">)</span> +</pre></div> +</div> +</div> +<div class="section" id="options"> +<h2>Options<a class="headerlink" href="#options" title="Permalink to this headline">¶</a></h2> +<div class="admonition note"> +<p class="first admonition-title">Note</p> +<p class="last">Review the list of <a class="reference internal" href="knife_common_options.html"><em>common options</em></a> available to this (and all) Knife subcommands and plugins.</p> +</div> +<p>This subcommand has the following options:</p> +<dl class="docutils"> +<dt><tt class="docutils literal"><span class="pre">--both</span></tt></dt> +<dd>Indicates that both local and remote copies of an object should be deleted. Default: <tt class="docutils literal"><span class="pre">false</span></tt>.</dd> +<dt><tt class="docutils literal"><span class="pre">--chef-repo-path</span> <span class="pre">PATH</span></tt></dt> +<dd>The path to the chef-repo. This setting will override the default path to the chef-repo. Default: same as specified by <tt class="docutils literal"><span class="pre">chef_repo_path</span></tt> in config.rb.</dd> +<dt><tt class="docutils literal"><span class="pre">--concurrency</span></tt></dt> +<dd>The number of allowed concurrent connections. Default: <tt class="docutils literal"><span class="pre">10</span></tt>.</dd> +<dt><tt class="docutils literal"><span class="pre">--local</span></tt></dt> +<dd>Indicates that only the local copy of an object should be deleted. (The remote copy will not be deleted.) Default: <tt class="docutils literal"><span class="pre">false</span></tt>.</dd> +<dt><tt class="docutils literal"><span class="pre">-r</span></tt>, <tt class="docutils literal"><span class="pre">--[no-]recurse</span></tt></dt> +<dd>Use <tt class="docutils literal"><span class="pre">--recurse</span></tt> to delete directories recursively. Default: <tt class="docutils literal"><span class="pre">--no-recurse</span></tt>.</dd> +<dt><tt class="docutils literal"><span class="pre">--repo-mode</span> <span class="pre">MODE</span></tt></dt> +<dd>The layout of the local chef-repo. Possible values: <tt class="docutils literal"><span class="pre">static</span></tt>, <tt class="docutils literal"><span class="pre">everything</span></tt>, or <tt class="docutils literal"><span class="pre">hosted_everything</span></tt>. Use <tt class="docutils literal"><span class="pre">static</span></tt> for just roles, environments, cookbooks, and data bags. By default, <tt class="docutils literal"><span class="pre">everything</span></tt> and <tt class="docutils literal"><span class="pre">hosted_everything</span></tt> are dynamically selected depending on the server type. Default: <tt class="docutils literal"><span class="pre">everything</span></tt> / <tt class="docutils literal"><span class="pre">hosted_everything</span></tt>.</dd> +</dl> +</div> +<div class="section" id="examples"> +<h2>Examples<a class="headerlink" href="#examples" title="Permalink to this headline">¶</a></h2> +<p>None.</p> +</div> +</div> + + + </div> + + </div> + + + <div class="clearer"></div> + </div> + + + + + </body> +</html>
\ No newline at end of file diff --git a/distro/common/html/knife_deps.html b/distro/common/html/knife_deps.html new file mode 100644 index 0000000000..c9bbdcdd04 --- /dev/null +++ b/distro/common/html/knife_deps.html @@ -0,0 +1,145 @@ + +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> + + +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> + + <title>knife deps — chef-client Man Pages</title> + + <link rel="stylesheet" href="_static/guide.css" type="text/css" /> + <link rel="stylesheet" href="_static/pygments.css" type="text/css" /> + + <script type="text/javascript"> + var DOCUMENTATION_OPTIONS = { + URL_ROOT: '', + VERSION: '', + COLLAPSE_INDEX: false, + FILE_SUFFIX: '.html', + HAS_SOURCE: true + }; + </script> + <script type="text/javascript" src="_static/jquery.js"></script> + <script type="text/javascript" src="_static/underscore.js"></script> + <script type="text/javascript" src="_static/doctools.js"></script> + <link rel="shortcut icon" href="_static/chef.ico"/> + + + </head> + <body> +<div style="background-color: #212c35; text-align: left; padding: 0px 0px 0px 0px"> +<a href="http://docs.opscode.com/"><img src="_static/chef_html_logo.png" border="0" alt="Chef"/></a> +</div> + + + + + <div class="document"> + <div class="documentwrapper"> + + <div class="body"> + + <div class="section" id="knife-deps"> +<h1>knife deps<a class="headerlink" href="#knife-deps" title="Permalink to this headline">¶</a></h1> +<p>The <strong>knife deps</strong> subcommand is used to identify dependencies for a node, role, or cookbook.</p> +<div class="section" id="syntax"> +<h2>Syntax<a class="headerlink" href="#syntax" title="Permalink to this headline">¶</a></h2> +<p>This argument has the following syntax:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife deps <span class="o">(</span>options<span class="o">)</span> +</pre></div> +</div> +</div> +<div class="section" id="options"> +<h2>Options<a class="headerlink" href="#options" title="Permalink to this headline">¶</a></h2> +<div class="admonition note"> +<p class="first admonition-title">Note</p> +<p class="last">Review the list of <a class="reference internal" href="knife_common_options.html"><em>common options</em></a> available to this (and all) Knife subcommands and plugins.</p> +</div> +<p>This subcommand has the following options:</p> +<dl class="docutils"> +<dt><tt class="docutils literal"><span class="pre">--chef-repo-path</span> <span class="pre">PATH</span></tt></dt> +<dd>The path to the chef-repo. This setting will override the default path to the chef-repo. Default: same as specified by <tt class="docutils literal"><span class="pre">chef_repo_path</span></tt> in config.rb.</dd> +<dt><tt class="docutils literal"><span class="pre">--concurrency</span></tt></dt> +<dd>The number of allowed concurrent connections. Default: <tt class="docutils literal"><span class="pre">10</span></tt>.</dd> +<dt><tt class="docutils literal"><span class="pre">--[no-]recurse</span></tt></dt> +<dd>Use <tt class="docutils literal"><span class="pre">--recurse</span></tt> to list dependencies recursively. This option can only be used when <tt class="docutils literal"><span class="pre">--tree</span></tt> is set to <tt class="docutils literal"><span class="pre">true</span></tt>. Default: <tt class="docutils literal"><span class="pre">--no-recurse</span></tt>.</dd> +<dt><tt class="docutils literal"><span class="pre">--remote</span></tt></dt> +<dd>Indicates that dependencies will be determined from objects located on the server instead of the local chef-repo. Default: <tt class="docutils literal"><span class="pre">false</span></tt>.</dd> +<dt><tt class="docutils literal"><span class="pre">--repo-mode</span> <span class="pre">MODE</span></tt></dt> +<dd>The layout of the local chef-repo. Possible values: <tt class="docutils literal"><span class="pre">static</span></tt>, <tt class="docutils literal"><span class="pre">everything</span></tt>, or <tt class="docutils literal"><span class="pre">hosted_everything</span></tt>. Use <tt class="docutils literal"><span class="pre">static</span></tt> for just roles, environments, cookbooks, and data bags. By default, <tt class="docutils literal"><span class="pre">everything</span></tt> and <tt class="docutils literal"><span class="pre">hosted_everything</span></tt> are dynamically selected depending on the server type. Default: <tt class="docutils literal"><span class="pre">everything</span></tt> / <tt class="docutils literal"><span class="pre">hosted_everything</span></tt>.</dd> +<dt><tt class="docutils literal"><span class="pre">--tree</span></tt></dt> +<dd>Indicates that dependencies are shown in a visual tree structure (including duplicates, if they exist). Default: <tt class="docutils literal"><span class="pre">false</span></tt>.</dd> +</dl> +</div> +<div class="section" id="examples"> +<h2>Examples<a class="headerlink" href="#examples" title="Permalink to this headline">¶</a></h2> +<p>The following examples show how to use this Knife subcommand:</p> +<p><strong>Find dependencies for a node</strong></p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife deps nodes/node_name.json +</pre></div> +</div> +<p><strong>Find dependencies for a role</strong></p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife deps roles/role_name.json +</pre></div> +</div> +<p><strong>Find dependencies for a cookbook</strong></p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife deps cookbooks/cookbook_name.json +</pre></div> +</div> +<p><strong>Find dependencies for an environment</strong></p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife deps environments/environment_name.json +</pre></div> +</div> +<p><strong>Find dependencies for a combination of nodes, roles, and so on</strong></p> +<p>To find the dependencies for a combination of nodes, cookbooks, roles, and/or environments:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife deps cookbooks/git.json cookbooks/github.json roles/base.json environments/desert.json nodes/mynode.json +</pre></div> +</div> +<p><strong>Use a wildcard</strong></p> +<p>A wildcard can be used to return all of the child nodes. For example, all of the environments:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife deps environments/*.json +</pre></div> +</div> +<p><strong>Return as tree</strong></p> +<p>Use the <tt class="docutils literal"><span class="pre">--tree</span></tt> option to view the results with structure:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife deps roles/webserver.json +</pre></div> +</div> +<p>to return something like:</p> +<div class="highlight-bash"><div class="highlight"><pre>roles/webserver.json + roles/base.json + cookbooks/github + cookbooks/git + cookbooks/users + cookbooks/apache2 +</pre></div> +</div> +<p><strong>Pass knife deps output to knife upload</strong></p> +<p>The output of <strong>knife deps</strong> can be passed to <strong>knife upload</strong>:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife upload <span class="sb">`</span>knife deps nodes/*.json +</pre></div> +</div> +<p><strong>Pass knife deps output to knife xargs</strong></p> +<p>The output of <strong>knife deps</strong> can be passed to <strong>knife xargs</strong>:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife deps nodes/*.json | xargs knife upload +</pre></div> +</div> +</div> +</div> + + + </div> + + </div> + + + <div class="clearer"></div> + </div> + + + + + </body> +</html>
\ No newline at end of file diff --git a/distro/common/html/knife_diff.html b/distro/common/html/knife_diff.html new file mode 100644 index 0000000000..db0d7c8546 --- /dev/null +++ b/distro/common/html/knife_diff.html @@ -0,0 +1,125 @@ + +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> + + +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> + + <title>knife diff — chef-client Man Pages</title> + + <link rel="stylesheet" href="_static/guide.css" type="text/css" /> + <link rel="stylesheet" href="_static/pygments.css" type="text/css" /> + + <script type="text/javascript"> + var DOCUMENTATION_OPTIONS = { + URL_ROOT: '', + VERSION: '', + COLLAPSE_INDEX: false, + FILE_SUFFIX: '.html', + HAS_SOURCE: true + }; + </script> + <script type="text/javascript" src="_static/jquery.js"></script> + <script type="text/javascript" src="_static/underscore.js"></script> + <script type="text/javascript" src="_static/doctools.js"></script> + <link rel="shortcut icon" href="_static/chef.ico"/> + + + </head> + <body> +<div style="background-color: #212c35; text-align: left; padding: 0px 0px 0px 0px"> +<a href="http://docs.opscode.com/"><img src="_static/chef_html_logo.png" border="0" alt="Chef"/></a> +</div> + + + + + <div class="document"> + <div class="documentwrapper"> + + <div class="body"> + + <div class="section" id="knife-diff"> +<h1>knife diff<a class="headerlink" href="#knife-diff" title="Permalink to this headline">¶</a></h1> +<p>The <strong>knife diff</strong> subcommand is used to compare the differences between files and directories on the server and in the chef-repo. For example, to compare files on the server prior to an uploading or downloading files using the <tt class="docutils literal"><span class="pre">knife</span> <span class="pre">download</span></tt> and <tt class="docutils literal"><span class="pre">knife</span> <span class="pre">upload</span></tt> subcommands, or to ensure that certain files in multiple production environments are the same. This subcommand is similar to the <tt class="docutils literal"><span class="pre">git</span> <span class="pre">diff</span></tt> command that can be used to diff what is in the chef-repo with what is synced to a git repository.</p> +<div class="section" id="syntax"> +<h2>Syntax<a class="headerlink" href="#syntax" title="Permalink to this headline">¶</a></h2> +<p>This argument has the following syntax:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife diff <span class="o">[</span>PATTERN...<span class="o">]</span> <span class="o">(</span>options<span class="o">)</span> +</pre></div> +</div> +</div> +<div class="section" id="options"> +<h2>Options<a class="headerlink" href="#options" title="Permalink to this headline">¶</a></h2> +<div class="admonition note"> +<p class="first admonition-title">Note</p> +<p class="last">Review the list of <a class="reference internal" href="knife_common_options.html"><em>common options</em></a> available to this (and all) Knife subcommands and plugins.</p> +</div> +<p>This subcommand has the following options:</p> +<dl class="docutils"> +<dt><tt class="docutils literal"><span class="pre">--chef-repo-path</span> <span class="pre">PATH</span></tt></dt> +<dd>The path to the chef-repo. This setting will override the default path to the chef-repo. Default: same as specified by <tt class="docutils literal"><span class="pre">chef_repo_path</span></tt> in config.rb.</dd> +<dt><tt class="docutils literal"><span class="pre">--cookbook-version</span> <span class="pre">VERSION</span></tt></dt> +<dd>The version of a cookbook to be downloaded.</dd> +<dt><tt class="docutils literal"><span class="pre">--concurrency</span></tt></dt> +<dd>The number of allowed concurrent connections. Default: <tt class="docutils literal"><span class="pre">10</span></tt>.</dd> +<dt><tt class="docutils literal"><span class="pre">--diff-filter=[(A|D|M|T)...[*]]</span></tt></dt> +<dd>Indicates that files will be selected that have been added (<tt class="docutils literal"><span class="pre">A</span></tt>), deleted (<tt class="docutils literal"><span class="pre">D</span></tt>), modified (<tt class="docutils literal"><span class="pre">M</span></tt>), and/or have had their type changed (<tt class="docutils literal"><span class="pre">T</span></tt>). Any combination of filter characters may be used, including no filter characters. Use <tt class="docutils literal"><span class="pre">*</span></tt> to select all paths if a file matches other criteria in the comparison. Default value: <tt class="docutils literal"><span class="pre">nil</span></tt>.</dd> +<dt><tt class="docutils literal"><span class="pre">--name-only</span></tt></dt> +<dd>Indicates that only the names of modified files will be shown.</dd> +<dt><tt class="docutils literal"><span class="pre">--name-status</span></tt></dt> +<dd>Indicates that only the names of files with a status of <tt class="docutils literal"><span class="pre">Added</span></tt>, <tt class="docutils literal"><span class="pre">Deleted</span></tt>, <tt class="docutils literal"><span class="pre">Modified</span></tt>, or <tt class="docutils literal"><span class="pre">Type</span> <span class="pre">Changed</span></tt> will be shown.</dd> +<dt><tt class="docutils literal"><span class="pre">--no-recurse</span></tt></dt> +<dd>Use <tt class="docutils literal"><span class="pre">--no-recurse</span></tt> to disable listing a directory recursively. Default: <tt class="docutils literal"><span class="pre">--recurse</span></tt>.</dd> +<dt><tt class="docutils literal"><span class="pre">--repo-mode</span> <span class="pre">MODE</span></tt></dt> +<dd>The layout of the local chef-repo. Possible values: <tt class="docutils literal"><span class="pre">static</span></tt>, <tt class="docutils literal"><span class="pre">everything</span></tt>, or <tt class="docutils literal"><span class="pre">hosted_everything</span></tt>. Use <tt class="docutils literal"><span class="pre">static</span></tt> for just roles, environments, cookbooks, and data bags. By default, <tt class="docutils literal"><span class="pre">everything</span></tt> and <tt class="docutils literal"><span class="pre">hosted_everything</span></tt> are dynamically selected depending on the server type. Default: <tt class="docutils literal"><span class="pre">everything</span></tt> / <tt class="docutils literal"><span class="pre">hosted_everything</span></tt>.</dd> +</dl> +</div> +<div class="section" id="examples"> +<h2>Examples<a class="headerlink" href="#examples" title="Permalink to this headline">¶</a></h2> +<p>The following examples show how to use this Knife subcommand:</p> +<p><strong>Compare files that contain JSON data</strong></p> +<p>To compare the “base.json” role to a “webserver.json” role, enter:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife diff roles/base.json roles/webserver.json +</pre></div> +</div> +<p><strong>Compare the chef-repo and the server</strong></p> +<p>To compare the differences between the local chef-repo and the files that are on the server, enter:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife diff +</pre></div> +</div> +<p><strong>Compare, then return results</strong></p> +<p>To diff a node named <tt class="docutils literal"><span class="pre">node-lb</span></tt> and then only return files that have been added, deleted, modified, or changed, enter:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife diff --name-status node-lb +</pre></div> +</div> +<p>to return something like:</p> +<div class="highlight-bash"><div class="highlight"><pre>node-lb/recipes/eip.rb +node-lb/recipes/heartbeat-int.rb +node-lb/templates/default/corpsite.conf.erb +node-lb/files/default/wildcard.node.com.crt +node-lb/files/default/wildcard.node.com.crt-2009 +node-lb/files/default/wildcard.node.com.key +node-lb/.gitignore +node-lb/Rakefile +</pre></div> +</div> +</div> +</div> + + + </div> + + </div> + + + <div class="clearer"></div> + </div> + + + + + </body> +</html>
\ No newline at end of file diff --git a/distro/common/html/knife_download.html b/distro/common/html/knife_download.html new file mode 100644 index 0000000000..f77c5db277 --- /dev/null +++ b/distro/common/html/knife_download.html @@ -0,0 +1,147 @@ + +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> + + +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> + + <title>knife download — chef-client Man Pages</title> + + <link rel="stylesheet" href="_static/guide.css" type="text/css" /> + <link rel="stylesheet" href="_static/pygments.css" type="text/css" /> + + <script type="text/javascript"> + var DOCUMENTATION_OPTIONS = { + URL_ROOT: '', + VERSION: '', + COLLAPSE_INDEX: false, + FILE_SUFFIX: '.html', + HAS_SOURCE: true + }; + </script> + <script type="text/javascript" src="_static/jquery.js"></script> + <script type="text/javascript" src="_static/underscore.js"></script> + <script type="text/javascript" src="_static/doctools.js"></script> + <link rel="shortcut icon" href="_static/chef.ico"/> + + + </head> + <body> +<div style="background-color: #212c35; text-align: left; padding: 0px 0px 0px 0px"> +<a href="http://docs.opscode.com/"><img src="_static/chef_html_logo.png" border="0" alt="Chef"/></a> +</div> + + + + + <div class="document"> + <div class="documentwrapper"> + + <div class="body"> + + <div class="section" id="knife-download"> +<h1>knife download<a class="headerlink" href="#knife-download" title="Permalink to this headline">¶</a></h1> +<p>The <strong>knife download</strong> subcommand is used to download roles, cookbooks, environments, nodes, and data bags from the server to the current working directory. It can be used to back up data on the server, inspect the state of one or more files, or to extract out-of-process changes users may have made to files on the server, such as if a user made a change that bypassed version source control. This subcommand is often used in conjunction with <tt class="docutils literal"><span class="pre">knife</span> <span class="pre">diff</span></tt>, which can be used to see exactly what changes will be downloaded, and then <tt class="docutils literal"><span class="pre">knife</span> <span class="pre">upload</span></tt>, which does the opposite of <tt class="docutils literal"><span class="pre">knife</span> <span class="pre">download</span></tt>.</p> +<div class="section" id="syntax"> +<h2>Syntax<a class="headerlink" href="#syntax" title="Permalink to this headline">¶</a></h2> +<p>This argument has the following syntax:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife download <span class="o">[</span>PATTERN...<span class="o">]</span> <span class="o">(</span>options<span class="o">)</span> +</pre></div> +</div> +</div> +<div class="section" id="options"> +<h2>Options<a class="headerlink" href="#options" title="Permalink to this headline">¶</a></h2> +<div class="admonition note"> +<p class="first admonition-title">Note</p> +<p class="last">Review the list of <a class="reference internal" href="knife_common_options.html"><em>common options</em></a> available to this (and all) Knife subcommands and plugins.</p> +</div> +<p>This subcommand has the following options:</p> +<dl class="docutils"> +<dt><tt class="docutils literal"><span class="pre">--chef-repo-path</span> <span class="pre">PATH</span></tt></dt> +<dd>The path to the chef-repo. This setting will override the default path to the chef-repo. Default: same as specified by <tt class="docutils literal"><span class="pre">chef_repo_path</span></tt> in config.rb.</dd> +<dt><tt class="docutils literal"><span class="pre">--concurrency</span></tt></dt> +<dd>The number of allowed concurrent connections. Default: <tt class="docutils literal"><span class="pre">10</span></tt>.</dd> +<dt><tt class="docutils literal"><span class="pre">--cookbook-version</span> <span class="pre">VERSION</span></tt></dt> +<dd>The version of a cookbook to be downloaded.</dd> +<dt><tt class="docutils literal"><span class="pre">--[no-]force</span></tt></dt> +<dd>Use <tt class="docutils literal"><span class="pre">--force</span></tt> to download files even when the file on the hard drive is identical to the object on the server (role, cookbook, etc.). By default, files are compared to see if they have equivalent content, and local files are only overwritten if they are different. Default: <tt class="docutils literal"><span class="pre">--no-force</span></tt>.</dd> +<dt><tt class="docutils literal"><span class="pre">-n</span></tt>, <tt class="docutils literal"><span class="pre">--dry-run</span></tt></dt> +<dd>Indicates that no action is taken and that results are only printed out. Default: <tt class="docutils literal"><span class="pre">false</span></tt>.</dd> +<dt><tt class="docutils literal"><span class="pre">--[no-]diff</span></tt></dt> +<dd>Indicates that only new and modified files will be downloaded. Set to <tt class="docutils literal"><span class="pre">false</span></tt> to download all files. Default: <tt class="docutils literal"><span class="pre">--diff</span></tt>.</dd> +<dt><tt class="docutils literal"><span class="pre">--[no-]recurse</span></tt></dt> +<dd>Use <tt class="docutils literal"><span class="pre">--no-recurse</span></tt> to disable downloading a directory recursively. Default: <tt class="docutils literal"><span class="pre">--recurse</span></tt>.</dd> +<dt><tt class="docutils literal"><span class="pre">--[no-]purge</span></tt></dt> +<dd>Use <tt class="docutils literal"><span class="pre">--purge</span></tt> to delete local files and directories that do not exist on the server. By default, if a role, cookbook, etc. does not exist on the server, the local file for said role will be left alone and NOT deleted. Default: <tt class="docutils literal"><span class="pre">--no-purge</span></tt>.</dd> +<dt><tt class="docutils literal"><span class="pre">--repo-mode</span> <span class="pre">MODE</span></tt></dt> +<dd>The layout of the local chef-repo. Possible values: <tt class="docutils literal"><span class="pre">static</span></tt>, <tt class="docutils literal"><span class="pre">everything</span></tt>, or <tt class="docutils literal"><span class="pre">hosted_everything</span></tt>. Use <tt class="docutils literal"><span class="pre">static</span></tt> for just roles, environments, cookbooks, and data bags. By default, <tt class="docutils literal"><span class="pre">everything</span></tt> and <tt class="docutils literal"><span class="pre">hosted_everything</span></tt> are dynamically selected depending on the server type. Default: <tt class="docutils literal"><span class="pre">everything</span></tt> / <tt class="docutils literal"><span class="pre">hosted_everything</span></tt>.</dd> +</dl> +</div> +<div class="section" id="examples"> +<h2>Examples<a class="headerlink" href="#examples" title="Permalink to this headline">¶</a></h2> +<p>The following examples show how to use this Knife subcommand:</p> +<p><strong>Download the entire chef-repo</strong></p> +<p>To download the entire chef-repo from the server, browse to the top level of the chef-repo and enter:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife download / +</pre></div> +</div> +<p><strong>Download the /cookbooks directory</strong></p> +<p>To download the <tt class="docutils literal"><span class="pre">cookbooks/</span></tt> directory from the server, browse to the top level of the chef-repo and enter:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife download cookbooks +</pre></div> +</div> +<p>or from anywhere in the chef-repo, enter:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife download /cookbooks +</pre></div> +</div> +<p><strong>Download the /environments directory</strong></p> +<p>To download the <tt class="docutils literal"><span class="pre">environments/</span></tt> directory from the server, browse to the top level of the chef-repo and enter:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife download environments +</pre></div> +</div> +<p>or from anywhere in the chef-repo, enter:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife download /environments +</pre></div> +</div> +<p><strong>Download an environment</strong></p> +<p>To download an environment named “production” from the server, browse to the top level of the chef-repo and enter:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife download environments/production.json +</pre></div> +</div> +<p>or from the <tt class="docutils literal"><span class="pre">environments/</span></tt> directory, enter:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife download production.json +</pre></div> +</div> +<p><strong>Download the /roles directory</strong></p> +<p>To download the <tt class="docutils literal"><span class="pre">roles/</span></tt> directory from the server, browse to the top level of the chef-repo and enter:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife download roles +</pre></div> +</div> +<p>or from anywhere in the chef-repo, enter:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife download /roles +</pre></div> +</div> +<p><strong>Download cookbooks and roles</strong></p> +<p>To download all cookbooks that start with “apache” and belong to the “webserver” role, browse to the top level of the chef-repo and enter:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span> knife download cookbooks/apache<span class="se">\*</span> roles/webserver.json +</pre></div> +</div> +</div> +</div> + + + </div> + + </div> + + + <div class="clearer"></div> + </div> + + + + + </body> +</html>
\ No newline at end of file diff --git a/distro/common/html/knife_edit.html b/distro/common/html/knife_edit.html new file mode 100644 index 0000000000..0c9728bd9d --- /dev/null +++ b/distro/common/html/knife_edit.html @@ -0,0 +1,91 @@ + +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> + + +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> + + <title>knife edit — chef-client Man Pages</title> + + <link rel="stylesheet" href="_static/guide.css" type="text/css" /> + <link rel="stylesheet" href="_static/pygments.css" type="text/css" /> + + <script type="text/javascript"> + var DOCUMENTATION_OPTIONS = { + URL_ROOT: '', + VERSION: '', + COLLAPSE_INDEX: false, + FILE_SUFFIX: '.html', + HAS_SOURCE: true + }; + </script> + <script type="text/javascript" src="_static/jquery.js"></script> + <script type="text/javascript" src="_static/underscore.js"></script> + <script type="text/javascript" src="_static/doctools.js"></script> + <link rel="shortcut icon" href="_static/chef.ico"/> + + + </head> + <body> +<div style="background-color: #212c35; text-align: left; padding: 0px 0px 0px 0px"> +<a href="http://docs.opscode.com/"><img src="_static/chef_html_logo.png" border="0" alt="Chef"/></a> +</div> + + + + + <div class="document"> + <div class="documentwrapper"> + + <div class="body"> + + <div class="section" id="knife-edit"> +<h1>knife edit<a class="headerlink" href="#knife-edit" title="Permalink to this headline">¶</a></h1> +<p>The <strong>knife edit</strong> subcommand is used to edit objects on the server. This subcommand works similar to <tt class="docutils literal"><span class="pre">knife</span> <span class="pre">cookbook</span> <span class="pre">edit</span></tt>, <tt class="docutils literal"><span class="pre">knife</span> <span class="pre">data</span> <span class="pre">bag</span> <span class="pre">edit</span></tt>, <tt class="docutils literal"><span class="pre">knife</span> <span class="pre">environment</span> <span class="pre">edit</span></tt>, <tt class="docutils literal"><span class="pre">knife</span> <span class="pre">node</span> <span class="pre">edit</span></tt>, and <tt class="docutils literal"><span class="pre">knife</span> <span class="pre">role</span> <span class="pre">edit</span></tt>, but with a single verb (and a single action).</p> +<div class="section" id="syntax"> +<h2>Syntax<a class="headerlink" href="#syntax" title="Permalink to this headline">¶</a></h2> +<p>This argument has the following syntax:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife edit <span class="o">(</span>options<span class="o">)</span> +</pre></div> +</div> +</div> +<div class="section" id="options"> +<h2>Options<a class="headerlink" href="#options" title="Permalink to this headline">¶</a></h2> +<div class="admonition note"> +<p class="first admonition-title">Note</p> +<p class="last">Review the list of <a class="reference internal" href="knife_common_options.html"><em>common options</em></a> available to this (and all) Knife subcommands and plugins.</p> +</div> +<p>This subcommand has the following options:</p> +<dl class="docutils"> +<dt><tt class="docutils literal"><span class="pre">--chef-repo-path</span> <span class="pre">PATH</span></tt></dt> +<dd>The path to the chef-repo. This setting will override the default path to the chef-repo. Default: same as specified by <tt class="docutils literal"><span class="pre">chef_repo_path</span></tt> in config.rb.</dd> +<dt><tt class="docutils literal"><span class="pre">--concurrency</span></tt></dt> +<dd>The number of allowed concurrent connections. Default: <tt class="docutils literal"><span class="pre">10</span></tt>.</dd> +<dt><tt class="docutils literal"><span class="pre">--local</span></tt></dt> +<dd>Use to show files in the local chef-repo instead of a remote location. Default: <tt class="docutils literal"><span class="pre">false</span></tt>.</dd> +<dt><tt class="docutils literal"><span class="pre">--repo-mode</span> <span class="pre">MODE</span></tt></dt> +<dd>The layout of the local chef-repo. Possible values: <tt class="docutils literal"><span class="pre">static</span></tt>, <tt class="docutils literal"><span class="pre">everything</span></tt>, or <tt class="docutils literal"><span class="pre">hosted_everything</span></tt>. Use <tt class="docutils literal"><span class="pre">static</span></tt> for just roles, environments, cookbooks, and data bags. By default, <tt class="docutils literal"><span class="pre">everything</span></tt> and <tt class="docutils literal"><span class="pre">hosted_everything</span></tt> are dynamically selected depending on the server type. Default: <tt class="docutils literal"><span class="pre">everything</span></tt> / <tt class="docutils literal"><span class="pre">hosted_everything</span></tt>.</dd> +</dl> +</div> +<div class="section" id="examples"> +<h2>Examples<a class="headerlink" href="#examples" title="Permalink to this headline">¶</a></h2> +<p>None.</p> +</div> +</div> + + + </div> + + </div> + + + <div class="clearer"></div> + </div> + + + + + </body> +</html>
\ No newline at end of file diff --git a/distro/common/html/knife_environment.html b/distro/common/html/knife_environment.html new file mode 100644 index 0000000000..5fcc34d4f6 --- /dev/null +++ b/distro/common/html/knife_environment.html @@ -0,0 +1,328 @@ + +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> + + +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> + + <title>knife environment — chef-client Man Pages</title> + + <link rel="stylesheet" href="_static/guide.css" type="text/css" /> + <link rel="stylesheet" href="_static/pygments.css" type="text/css" /> + + <script type="text/javascript"> + var DOCUMENTATION_OPTIONS = { + URL_ROOT: '', + VERSION: '', + COLLAPSE_INDEX: false, + FILE_SUFFIX: '.html', + HAS_SOURCE: true + }; + </script> + <script type="text/javascript" src="_static/jquery.js"></script> + <script type="text/javascript" src="_static/underscore.js"></script> + <script type="text/javascript" src="_static/doctools.js"></script> + <link rel="shortcut icon" href="_static/chef.ico"/> + + + </head> + <body> +<div style="background-color: #212c35; text-align: left; padding: 0px 0px 0px 0px"> +<a href="http://docs.opscode.com/"><img src="_static/chef_html_logo.png" border="0" alt="Chef"/></a> +</div> + + + + + <div class="document"> + <div class="documentwrapper"> + + <div class="body"> + + <div class="section" id="knife-environment"> +<h1>knife environment<a class="headerlink" href="#knife-environment" title="Permalink to this headline">¶</a></h1> +<p>An environment is a way to map an organization’s real-life workflow to what can be configured and managed when using server. Every organization begins with a single environment called the <tt class="docutils literal"><span class="pre">_default</span></tt> environment, which cannot be modified (or deleted). Additional environments can be created to reflect each organization’s patterns and workflow. For example, creating <tt class="docutils literal"><span class="pre">production</span></tt>, <tt class="docutils literal"><span class="pre">staging</span></tt>, <tt class="docutils literal"><span class="pre">testing</span></tt>, and <tt class="docutils literal"><span class="pre">development</span></tt> environments. Generally, an environment is also associated with one (or more) cookbook versions.</p> +<p>The <strong>knife environment</strong> subcommand is used to manage environments within a single organization on the server.</p> +<div class="admonition note"> +<p class="first admonition-title">Note</p> +<p class="last">Review the list of <a class="reference internal" href="knife_common_options.html"><em>common options</em></a> available to this (and all) Knife subcommands and plugins.</p> +</div> +<div class="section" id="compare"> +<h2>compare<a class="headerlink" href="#compare" title="Permalink to this headline">¶</a></h2> +<p>The <tt class="docutils literal"><span class="pre">compare</span></tt> argument is used to compare the cookbook version constraints that are set on one (or more) environments.</p> +<p><strong>Syntax</strong></p> +<p>This argument has the following syntax:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife environment compare <span class="o">[</span>ENVIRONMENT_NAME...<span class="o">]</span> <span class="o">(</span>options<span class="o">)</span> +</pre></div> +</div> +<p><strong>Options</strong></p> +<p>This argument has the following options:</p> +<dl class="docutils"> +<dt><tt class="docutils literal"><span class="pre">-a</span></tt>, <tt class="docutils literal"><span class="pre">--all</span></tt></dt> +<dd>Indicates that all environments found at the specified path will be uploaded.</dd> +<dt><tt class="docutils literal"><span class="pre">-m</span></tt>, <tt class="docutils literal"><span class="pre">--mismatch</span></tt></dt> +<dd>Use to show only matching versions.</dd> +</dl> +<p><strong>Example</strong></p> +<p>To compare cookbook versions for a single environment:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife environment compare development +</pre></div> +</div> +<p>to return something similar to:</p> +<div class="highlight-bash"><div class="highlight"><pre> development +apache 2.3.1 +windows 4.1.2 +</pre></div> +</div> +<p>To compare cookbook versions for multiple environments:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife environment compare development staging +</pre></div> +</div> +<p>to return something similar to:</p> +<div class="highlight-bash"><div class="highlight"><pre> development staging +apache 2.3.1 1.2.2 +windows 4.1.2 1.0.0 +postgresql 1.0.0 1.0.0 +</pre></div> +</div> +<p>To compare all cookbook versions for all environments:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife environment compare --all +</pre></div> +</div> +<p>to return something similar to:</p> +<div class="highlight-bash"><div class="highlight"><pre> staging development +<span class="nb">ulimit </span>latest latest +redisio latest latest +journly latest latest +aws latest latest +<span class="nb">test </span>latest latest +unicorn latest latest +sensu latest latest +runit latest latest +templater latest latest +powershell latest latest +openssl latest latest +rbenv latest latest +rabbitmq latest latest +postgresql latest latest +mysql latest latest +ohai latest latest +git latest latest +erlang latest latest +ssh_known_hosts latest latest +nginx latest latest +database latest latest +yum latest latest +xfs latest latest +apt latest latest +dmg latest latest +chef_handler latest latest +windows 1.0.0 4.1.2 +</pre></div> +</div> +</div> +<div class="section" id="create"> +<h2>create<a class="headerlink" href="#create" title="Permalink to this headline">¶</a></h2> +<p>The <tt class="docutils literal"><span class="pre">create</span></tt> argument is used to add an environment object to the server. When this argument is run, Knife will open $EDITOR to enable editing of the <tt class="docutils literal"><span class="pre">ENVIRONMENT</span></tt> description field (unless a description is specified as part of the command). When finished, Knife will add the environment to the server.</p> +<div class="section" id="syntax"> +<h3>Syntax<a class="headerlink" href="#syntax" title="Permalink to this headline">¶</a></h3> +<p>This argument has the following syntax:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife environment create ENVIRONMENT_NAME -d DESCRIPTION +</pre></div> +</div> +</div> +<div class="section" id="options"> +<h3>Options<a class="headerlink" href="#options" title="Permalink to this headline">¶</a></h3> +<p>This argument has the following options:</p> +<dl class="docutils"> +<dt><tt class="docutils literal"><span class="pre">-d</span> <span class="pre">DESCRIPTION</span></tt>, <tt class="docutils literal"><span class="pre">--description</span> <span class="pre">DESCRIPTION</span></tt></dt> +<dd>The description of the environment. This value will populate the description field for the environment on the server.</dd> +</dl> +</div> +<div class="section" id="examples"> +<h3>Examples<a class="headerlink" href="#examples" title="Permalink to this headline">¶</a></h3> +<p>The following examples show how to use this Knife subcommand:</p> +<p><strong>Create an environment</strong></p> +<p>To create an environment named “dev” with a description of “The development environment.”:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife environment create dev -d <span class="s2">"The development environment."</span> +</pre></div> +</div> +</div> +</div> +<div class="section" id="delete"> +<h2>delete<a class="headerlink" href="#delete" title="Permalink to this headline">¶</a></h2> +<p>The <tt class="docutils literal"><span class="pre">delete</span></tt> argument is used to delete an environment from a server.</p> +<div class="section" id="id1"> +<h3>Syntax<a class="headerlink" href="#id1" title="Permalink to this headline">¶</a></h3> +<p>This argument has the following syntax:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife environment delete ENVIRONMENT_NAME +</pre></div> +</div> +</div> +<div class="section" id="id2"> +<h3>Options<a class="headerlink" href="#id2" title="Permalink to this headline">¶</a></h3> +<p>This command does not have any specific options.</p> +</div> +<div class="section" id="id3"> +<h3>Examples<a class="headerlink" href="#id3" title="Permalink to this headline">¶</a></h3> +<p>The following examples show how to use this Knife subcommand:</p> +<p><strong>Delete an environment</strong></p> +<p>To delete an environment named “dev”, enter:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife environment delete dev +</pre></div> +</div> +<p>Type <tt class="docutils literal"><span class="pre">Y</span></tt> to confirm a deletion.</p> +</div> +</div> +<div class="section" id="edit"> +<h2>edit<a class="headerlink" href="#edit" title="Permalink to this headline">¶</a></h2> +<p>The <tt class="docutils literal"><span class="pre">edit</span></tt> argument is used to edit the attributes of an environment. When this argument is run, Knife will open $EDITOR to enable editing of <tt class="docutils literal"><span class="pre">ENVIRONMENT</span></tt> attributes. When finished, Knife will update the server with those changes.</p> +<div class="section" id="id4"> +<h3>Syntax<a class="headerlink" href="#id4" title="Permalink to this headline">¶</a></h3> +<p>This argument has the following syntax:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife environment edit ENVIRONMENT_NAME +</pre></div> +</div> +</div> +<div class="section" id="id5"> +<h3>Options<a class="headerlink" href="#id5" title="Permalink to this headline">¶</a></h3> +<p>This command does not have any specific options.</p> +</div> +<div class="section" id="id6"> +<h3>Examples<a class="headerlink" href="#id6" title="Permalink to this headline">¶</a></h3> +<p>The following examples show how to use this Knife subcommand:</p> +<p><strong>Edit an environment</strong></p> +<p>To edit an environment named “devops”, enter:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife environment edit devops +</pre></div> +</div> +</div> +</div> +<div class="section" id="from-file"> +<h2>from file<a class="headerlink" href="#from-file" title="Permalink to this headline">¶</a></h2> +<p>The <tt class="docutils literal"><span class="pre">from</span> <span class="pre">file</span></tt> argument is used to add or update an environment using a JSON or Ruby DSL description. It must be run with the <tt class="docutils literal"><span class="pre">create</span></tt> or <tt class="docutils literal"><span class="pre">edit</span></tt> arguments.</p> +<div class="section" id="id7"> +<h3>Syntax<a class="headerlink" href="#id7" title="Permalink to this headline">¶</a></h3> +<p>This argument has the following syntax:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife environment <span class="o">[</span>create | edit<span class="o">]</span> from file FILE <span class="o">(</span>options<span class="o">)</span> +</pre></div> +</div> +</div> +<div class="section" id="id8"> +<h3>Options<a class="headerlink" href="#id8" title="Permalink to this headline">¶</a></h3> +<p>This argument has the following options:</p> +<dl class="docutils"> +<dt><tt class="docutils literal"><span class="pre">-a</span></tt>, <tt class="docutils literal"><span class="pre">--all</span></tt></dt> +<dd>Indicates that all environments found at the specified path will be uploaded.</dd> +</dl> +</div> +<div class="section" id="id9"> +<h3>Examples<a class="headerlink" href="#id9" title="Permalink to this headline">¶</a></h3> +<p>The following examples show how to use this Knife subcommand:</p> +<p><strong>Create an environment from a JSON file</strong></p> +<p>To add an environment using data contained in a JSON file:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife environment create devops from file <span class="s2">"path to JSON file"</span> +</pre></div> +</div> +<p>or:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife environment edit devops from file <span class="s2">"path to JSON file"</span> +</pre></div> +</div> +</div> +</div> +<div class="section" id="list"> +<h2>list<a class="headerlink" href="#list" title="Permalink to this headline">¶</a></h2> +<p>The <tt class="docutils literal"><span class="pre">list</span></tt> argument is used to list all of the environments that are currently available on the server.</p> +<div class="section" id="id10"> +<h3>Syntax<a class="headerlink" href="#id10" title="Permalink to this headline">¶</a></h3> +<p>This argument has the following syntax:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife environment list -w +</pre></div> +</div> +</div> +<div class="section" id="id11"> +<h3>Options<a class="headerlink" href="#id11" title="Permalink to this headline">¶</a></h3> +<p>This argument has the following options:</p> +<dl class="docutils"> +<dt><tt class="docutils literal"><span class="pre">-w</span></tt>, <tt class="docutils literal"><span class="pre">--with-uri</span></tt></dt> +<dd>Indicates that the corresponding URIs will be shown.</dd> +</dl> +</div> +<div class="section" id="id12"> +<h3>Examples<a class="headerlink" href="#id12" title="Permalink to this headline">¶</a></h3> +<p>The following examples show how to use this Knife subcommand:</p> +<p><strong>View a list of environments</strong></p> +<p>To view a list of environments:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife environment list -w +</pre></div> +</div> +</div> +</div> +<div class="section" id="show"> +<h2>show<a class="headerlink" href="#show" title="Permalink to this headline">¶</a></h2> +<p>The <tt class="docutils literal"><span class="pre">show</span></tt> argument is used to display information about the specified environment.</p> +<div class="section" id="id13"> +<h3>Syntax<a class="headerlink" href="#id13" title="Permalink to this headline">¶</a></h3> +<p>This argument has the following syntax:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife environment show ENVIRONMENT_NAME +</pre></div> +</div> +</div> +<div class="section" id="id14"> +<h3>Options<a class="headerlink" href="#id14" title="Permalink to this headline">¶</a></h3> +<p>This argument has the following options:</p> +<dl class="docutils"> +<dt><tt class="docutils literal"><span class="pre">-a</span> <span class="pre">ATTR</span></tt>, <tt class="docutils literal"><span class="pre">--attribute</span> <span class="pre">ATTR</span></tt></dt> +<dd>The attribute (or attributes) to show.</dd> +</dl> +</div> +<div class="section" id="id15"> +<h3>Examples<a class="headerlink" href="#id15" title="Permalink to this headline">¶</a></h3> +<p>The following examples show how to use this Knife subcommand:</p> +<p><strong>Show environments</strong></p> +<p>To view information about the “dev” environment enter:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife environment show dev +</pre></div> +</div> +<p>to return:</p> +<div class="highlight-bash"><div class="highlight"><pre>% knife environment show dev +chef_type: environment +cookbook_versions: +default_attributes: +description: +json_class: Chef::Environment +name: dev +override_attributes: + +<span class="se">\\</span> +<span class="se">\\</span> +<span class="se">\\</span> +<span class="se">\\</span> +</pre></div> +</div> +<p><strong>Show environments as JSON</strong></p> +<p>To view information in JSON format, use the <tt class="docutils literal"><span class="pre">-F</span></tt> common option as part of the command like this:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife role show devops -F json +</pre></div> +</div> +<p>Other formats available include <tt class="docutils literal"><span class="pre">text</span></tt>, <tt class="docutils literal"><span class="pre">yaml</span></tt>, and <tt class="docutils literal"><span class="pre">pp</span></tt>.</p> +</div> +</div> +</div> + + + </div> + + </div> + + + <div class="clearer"></div> + </div> + + + + + </body> +</html>
\ No newline at end of file diff --git a/distro/common/html/knife_exec.html b/distro/common/html/knife_exec.html new file mode 100644 index 0000000000..e458205356 --- /dev/null +++ b/distro/common/html/knife_exec.html @@ -0,0 +1,222 @@ + +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> + + +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> + + <title>knife exec — chef-client Man Pages</title> + + <link rel="stylesheet" href="_static/guide.css" type="text/css" /> + <link rel="stylesheet" href="_static/pygments.css" type="text/css" /> + + <script type="text/javascript"> + var DOCUMENTATION_OPTIONS = { + URL_ROOT: '', + VERSION: '', + COLLAPSE_INDEX: false, + FILE_SUFFIX: '.html', + HAS_SOURCE: true + }; + </script> + <script type="text/javascript" src="_static/jquery.js"></script> + <script type="text/javascript" src="_static/underscore.js"></script> + <script type="text/javascript" src="_static/doctools.js"></script> + <link rel="shortcut icon" href="_static/chef.ico"/> + + + </head> + <body> +<div style="background-color: #212c35; text-align: left; padding: 0px 0px 0px 0px"> +<a href="http://docs.opscode.com/"><img src="_static/chef_html_logo.png" border="0" alt="Chef"/></a> +</div> + + + + + <div class="document"> + <div class="documentwrapper"> + + <div class="body"> + + <div class="section" id="knife-exec"> +<h1>knife exec<a class="headerlink" href="#knife-exec" title="Permalink to this headline">¶</a></h1> +<p>The <strong>knife exec</strong> subcommand uses the Knife configuration file to execute Ruby scripts in the context of a fully configured chef-client. This subcommand is most often used to run scripts that will only access server one time (or otherwise very infrequently). Use this subcommand any time that an operation does not warrant full usage of the Knife subcommand library.</p> +<div class="section" id="authenticated-api-requests"> +<h2>Authenticated API Requests<a class="headerlink" href="#authenticated-api-requests" title="Permalink to this headline">¶</a></h2> +<p>The <tt class="docutils literal"><span class="pre">knife</span> <span class="pre">exec</span></tt> subcommand can be used to make authenticated API requests to the server using the following methods:</p> +<table border="1" class="docutils"> +<colgroup> +<col width="13%" /> +<col width="88%" /> +</colgroup> +<thead valign="bottom"> +<tr class="row-odd"><th class="head">Method</th> +<th class="head">Description</th> +</tr> +</thead> +<tbody valign="top"> +<tr class="row-even"><td><tt class="docutils literal"><span class="pre">api.delete</span></tt></td> +<td>Use to delete an object from the server.</td> +</tr> +<tr class="row-odd"><td><tt class="docutils literal"><span class="pre">api.get</span></tt></td> +<td>Use to get the details of an object on the server.</td> +</tr> +<tr class="row-even"><td><tt class="docutils literal"><span class="pre">api.post</span></tt></td> +<td>Use to add an object to the server.</td> +</tr> +<tr class="row-odd"><td><tt class="docutils literal"><span class="pre">api.put</span></tt></td> +<td>Use to update an object on the server.</td> +</tr> +</tbody> +</table> +<p>These methods are used with the <tt class="docutils literal"><span class="pre">-E</span></tt> option, which executes that string locally on the workstation using chef-shell. These methods have the following syntax:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife <span class="nb">exec</span> -E <span class="s1">'api.method(/endpoint)'</span> +</pre></div> +</div> +<p>where:</p> +<ul class="simple"> +<li><tt class="docutils literal"><span class="pre">api.method</span></tt> is the corresponding authentication method — <tt class="docutils literal"><span class="pre">api.delete</span></tt>, <tt class="docutils literal"><span class="pre">api.get</span></tt>, <tt class="docutils literal"><span class="pre">api.post</span></tt>, or <tt class="docutils literal"><span class="pre">api.put</span></tt></li> +<li><tt class="docutils literal"><span class="pre">/endpoint</span></tt> is an endpoint in the Chef Server API</li> +</ul> +<p>For example, to get the data for a node named “Example_Node”:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife <span class="nb">exec</span> -E <span class="s1">'puts api.get("/nodes/Example_Node")'</span> +</pre></div> +</div> +<p>and to ensure that the output is visible in the console, add the <tt class="docutils literal"><span class="pre">puts</span></tt> in front of the API authorization request:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife <span class="nb">exec</span> -E <span class="s1">'puts api.get("/nodes/Example_Node")'</span> +</pre></div> +</div> +<p>where <tt class="docutils literal"><span class="pre">puts</span></tt> is the shorter version of the <tt class="docutils literal"><span class="pre">$stdout.puts</span></tt> predefined variable in Ruby.</p> +<p>The following example shows how to add a client named “IBM305RAMAC” and the <tt class="docutils literal"><span class="pre">/clients</span></tt> endpoint, and then return the private key for that user in the console:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ client_desc</span> <span class="o">=</span> <span class="o">{</span> + <span class="s2">"name"</span> <span class="o">=</span>> <span class="s2">"IBM305RAMAC"</span>, + <span class="s2">"admin"</span> <span class="o">=</span>> <span class="nb">false</span> + <span class="o">}</span> + + <span class="nv">new_client</span> <span class="o">=</span> api.post<span class="o">(</span><span class="s2">"/clients"</span>, client_desc<span class="o">)</span> + puts new_client<span class="o">[</span><span class="s2">"private_key"</span><span class="o">]</span> +</pre></div> +</div> +</div> +<div class="section" id="ruby-scripts"> +<h2>Ruby Scripts<a class="headerlink" href="#ruby-scripts" title="Permalink to this headline">¶</a></h2> +<p>For Ruby scripts that will be run using the <tt class="docutils literal"><span class="pre">exec</span></tt> subcommand, note the following:</p> +<blockquote> +<div><ul class="simple"> +<li>The Ruby script must be located on the system from which Knife is run (and not be located on any of the systems that Knife will be managing).</li> +<li>Shell commands will be run from a management workstation. For example, something like <tt class="docutils literal"><span class="pre">%x[ls</span> <span class="pre">-lash</span> <span class="pre">/opt/only-on-a-node]</span></tt> would give you the directory listing for the “opt/only-on-a-node” directory or a “No such file or directory” error if the file does not already exist locally.</li> +<li>When the chef-shell DSL is available, the chef-client DSL will not be (unless the management workstation is also a chef-client). Without the chef-client DSL, a bash block cannot be used to run bash commands.</li> +</ul> +</div></blockquote> +</div> +<div class="section" id="syntax"> +<h2>Syntax<a class="headerlink" href="#syntax" title="Permalink to this headline">¶</a></h2> +<p>This argument has the following syntax:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife <span class="nb">exec </span>SCRIPT <span class="o">(</span>options<span class="o">)</span> +</pre></div> +</div> +</div> +<div class="section" id="options"> +<h2>Options<a class="headerlink" href="#options" title="Permalink to this headline">¶</a></h2> +<div class="admonition note"> +<p class="first admonition-title">Note</p> +<p class="last">Review the list of <a class="reference internal" href="knife_common_options.html"><em>common options</em></a> available to this (and all) Knife subcommands and plugins.</p> +</div> +<p>This subcommand has the following options:</p> +<dl class="docutils"> +<dt><tt class="docutils literal"><span class="pre">-E</span> <span class="pre">CODE</span></tt>, <tt class="docutils literal"><span class="pre">--exec</span> <span class="pre">CODE</span></tt></dt> +<dd>A string of code that will be executed.</dd> +<dt><tt class="docutils literal"><span class="pre">-p</span> <span class="pre">PATH:PATH</span></tt>, <tt class="docutils literal"><span class="pre">--script-path</span> <span class="pre">PATH:PATH</span></tt></dt> +<dd>A colon-separated path at which Ruby scripts are located.</dd> +</dl> +</div> +<div class="section" id="examples"> +<h2>Examples<a class="headerlink" href="#examples" title="Permalink to this headline">¶</a></h2> +<p>The following examples show how to use this Knife subcommand:</p> +<p><strong>Run Ruby scripts</strong></p> +<p>There are three ways to use <strong>knife exec</strong> to run Ruby script files. For example:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife <span class="nb">exec</span> /path/to/script_file +</pre></div> +</div> +<p>Or:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife <span class="nb">exec</span> -E <span class="s1">'RUBY CODE'</span> +</pre></div> +</div> +<p>Or:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife <span class="nb">exec</span> +RUBY CODE +^D +</pre></div> +</div> +<p><strong>Chef Knife status</strong></p> +<p>To check the status of Knife using a Ruby script named “status.rb” (which looks like):</p> +<div class="highlight-ruby"><div class="highlight"><pre><span class="nb">printf</span> <span class="s2">"%-5s %-12s %-8s %s</span><span class="se">\n</span><span class="s2">"</span><span class="p">,</span> <span class="s2">"Check In"</span><span class="p">,</span> <span class="s2">"Name"</span><span class="p">,</span> <span class="s2">"Ruby"</span><span class="p">,</span> <span class="s2">"Recipes"</span> +<span class="n">nodes</span><span class="o">.</span><span class="n">all</span> <span class="k">do</span> <span class="o">|</span><span class="n">n</span><span class="o">|</span> + <span class="n">checkin</span> <span class="o">=</span> <span class="no">Time</span><span class="o">.</span><span class="n">at</span><span class="p">(</span><span class="n">n</span><span class="o">[</span><span class="s1">'ohai_time'</span><span class="o">]</span><span class="p">)</span><span class="o">.</span><span class="n">strftime</span><span class="p">(</span><span class="s2">"%F %R"</span><span class="p">)</span> + <span class="n">rubyver</span> <span class="o">=</span> <span class="n">n</span><span class="o">[</span><span class="s1">'languages'</span><span class="o">][</span><span class="s1">'ruby'</span><span class="o">][</span><span class="s1">'version'</span><span class="o">]</span> + <span class="n">recipes</span> <span class="o">=</span> <span class="n">n</span><span class="o">.</span><span class="n">run_list</span><span class="o">.</span><span class="n">expand</span><span class="p">(</span><span class="n">_default</span><span class="p">)</span><span class="o">.</span><span class="n">recipes</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="s2">", "</span><span class="p">)</span> + <span class="nb">printf</span> <span class="s2">"%-20s %-12s %-8s %s</span><span class="se">\n</span><span class="s2">"</span><span class="p">,</span> <span class="n">checkin</span><span class="p">,</span> <span class="n">n</span><span class="o">.</span><span class="n">name</span><span class="p">,</span> <span class="n">rubyver</span><span class="p">,</span> <span class="n">recipes</span> +<span class="k">end</span> +</pre></div> +</div> +<p>and is located in a directory named “scripts”, enter:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife <span class="nb">exec </span>scripts/status.rb +</pre></div> +</div> +<p><strong>List available free memory</strong></p> +<p>To show the available free memory for all nodes, enter:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife <span class="nb">exec</span> -E <span class="s1">'nodes.all {|n| puts "#{n.name} has #{n.memory.total} free memory"}'</span> +</pre></div> +</div> +<p><strong>List available search indexes</strong></p> +<p>To list all of the available search indexes, enter:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife <span class="nb">exec</span> -E <span class="s1">'puts api.get("search").keys'</span> +</pre></div> +</div> +<p><strong>Query for multiple attributes</strong></p> +<p>To query a node for multiple attributes using a Ruby script named <tt class="docutils literal"><span class="pre">search_attributes.rb</span></tt> (which looks like):</p> +<div class="highlight-ruby"><div class="highlight"><pre><span class="sx">% cat </span><span class="n">scripts</span><span class="o">/</span><span class="n">search_attributes</span><span class="o">.</span><span class="n">rb</span> +<span class="n">query</span> <span class="o">=</span> <span class="no">ARGV</span><span class="o">[</span><span class="mi">2</span><span class="o">]</span> +<span class="n">attributes</span> <span class="o">=</span> <span class="no">ARGV</span><span class="o">[</span><span class="mi">3</span><span class="o">].</span><span class="n">split</span><span class="p">(</span><span class="s2">","</span><span class="p">)</span> +<span class="nb">puts</span> <span class="s2">"Your query: </span><span class="si">#{</span><span class="n">query</span><span class="si">}</span><span class="s2">"</span> +<span class="nb">puts</span> <span class="s2">"Your attributes: </span><span class="si">#{</span><span class="n">attributes</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="s2">" "</span><span class="p">)</span><span class="si">}</span><span class="s2">"</span> +<span class="n">results</span> <span class="o">=</span> <span class="p">{}</span> +<span class="n">search</span><span class="p">(</span><span class="ss">:node</span><span class="p">,</span> <span class="n">query</span><span class="p">)</span> <span class="k">do</span> <span class="o">|</span><span class="n">n</span><span class="o">|</span> + <span class="n">results</span><span class="o">[</span><span class="n">n</span><span class="o">.</span><span class="n">name</span><span class="o">]</span> <span class="o">=</span> <span class="p">{}</span> + <span class="n">attributes</span><span class="o">.</span><span class="n">each</span> <span class="p">{</span><span class="o">|</span><span class="n">a</span><span class="o">|</span> <span class="n">results</span><span class="o">[</span><span class="n">n</span><span class="o">.</span><span class="n">name</span><span class="o">][</span><span class="n">a</span><span class="o">]</span> <span class="o">=</span> <span class="n">n</span><span class="o">[</span><span class="n">a</span><span class="o">]</span><span class="p">}</span> +<span class="k">end</span> + +<span class="nb">puts</span> <span class="n">results</span> +<span class="nb">exit</span> <span class="mi">0</span> +</pre></div> +</div> +<p>enter:</p> +<div class="highlight-bash"><div class="highlight"><pre>% knife <span class="nb">exec </span>scripts/search_attributes.rb <span class="s2">"hostname:test_system"</span> ipaddress,fqdn +</pre></div> +</div> +<p>to return something like:</p> +<div class="highlight-bash"><div class="highlight"><pre>Your query: hostname:test_system +Your attributes: ipaddress fqdn +<span class="o">{</span><span class="s2">"test_system.example.com"</span><span class="o">=</span>><span class="o">{</span><span class="s2">"ipaddress"</span><span class="o">=</span>><span class="s2">"10.1.1.200"</span>, <span class="s2">"fqdn"</span><span class="o">=</span>><span class="s2">"test_system.example.com"</span><span class="o">}}</span> +</pre></div> +</div> +</div> +</div> + + + </div> + + </div> + + + <div class="clearer"></div> + </div> + + + + + </body> +</html>
\ No newline at end of file diff --git a/distro/common/html/knife_index_rebuild.html b/distro/common/html/knife_index_rebuild.html new file mode 100644 index 0000000000..82dc5698da --- /dev/null +++ b/distro/common/html/knife_index_rebuild.html @@ -0,0 +1,85 @@ + +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> + + +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> + + <title>knife index rebuild — chef-client Man Pages</title> + + <link rel="stylesheet" href="_static/guide.css" type="text/css" /> + <link rel="stylesheet" href="_static/pygments.css" type="text/css" /> + + <script type="text/javascript"> + var DOCUMENTATION_OPTIONS = { + URL_ROOT: '', + VERSION: '', + COLLAPSE_INDEX: false, + FILE_SUFFIX: '.html', + HAS_SOURCE: true + }; + </script> + <script type="text/javascript" src="_static/jquery.js"></script> + <script type="text/javascript" src="_static/underscore.js"></script> + <script type="text/javascript" src="_static/doctools.js"></script> + <link rel="shortcut icon" href="_static/chef.ico"/> + + + </head> + <body> +<div style="background-color: #212c35; text-align: left; padding: 0px 0px 0px 0px"> +<a href="http://docs.opscode.com/"><img src="_static/chef_html_logo.png" border="0" alt="Chef"/></a> +</div> + + + + + <div class="document"> + <div class="documentwrapper"> + + <div class="body"> + + <div class="section" id="knife-index-rebuild"> +<h1>knife index rebuild<a class="headerlink" href="#knife-index-rebuild" title="Permalink to this headline">¶</a></h1> +<p>The <strong>knife index rebuild</strong> subcommand is used to rebuild the search indexes for the open source server. This operation is destructive and may take some time.</p> +<div class="admonition note"> +<p class="first admonition-title">Note</p> +<p class="last">This subcommand ONLY works when run against the open source server version 10.x. This subcommand will NOT run against open source server 11, Enterprise Chef (including hosted Enterprise Chef), or Private Chef.</p> +</div> +<div class="section" id="syntax"> +<h2>Syntax<a class="headerlink" href="#syntax" title="Permalink to this headline">¶</a></h2> +<p>This argument has the following syntax:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife index rebuild +</pre></div> +</div> +</div> +<div class="section" id="options"> +<h2>Options<a class="headerlink" href="#options" title="Permalink to this headline">¶</a></h2> +<div class="admonition note"> +<p class="first admonition-title">Note</p> +<p class="last">Review the list of <a class="reference internal" href="knife_common_options.html"><em>common options</em></a> available to this (and all) Knife subcommands and plugins.</p> +</div> +<p>This command does not have any specific options.</p> +</div> +<div class="section" id="examples"> +<h2>Examples<a class="headerlink" href="#examples" title="Permalink to this headline">¶</a></h2> +<p>None.</p> +</div> +</div> + + + </div> + + </div> + + + <div class="clearer"></div> + </div> + + + + + </body> +</html>
\ No newline at end of file diff --git a/distro/common/html/knife_list.html b/distro/common/html/knife_list.html new file mode 100644 index 0000000000..51d6ff0a55 --- /dev/null +++ b/distro/common/html/knife_list.html @@ -0,0 +1,116 @@ + +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> + + +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> + + <title>knife list — chef-client Man Pages</title> + + <link rel="stylesheet" href="_static/guide.css" type="text/css" /> + <link rel="stylesheet" href="_static/pygments.css" type="text/css" /> + + <script type="text/javascript"> + var DOCUMENTATION_OPTIONS = { + URL_ROOT: '', + VERSION: '', + COLLAPSE_INDEX: false, + FILE_SUFFIX: '.html', + HAS_SOURCE: true + }; + </script> + <script type="text/javascript" src="_static/jquery.js"></script> + <script type="text/javascript" src="_static/underscore.js"></script> + <script type="text/javascript" src="_static/doctools.js"></script> + <link rel="shortcut icon" href="_static/chef.ico"/> + + + </head> + <body> +<div style="background-color: #212c35; text-align: left; padding: 0px 0px 0px 0px"> +<a href="http://docs.opscode.com/"><img src="_static/chef_html_logo.png" border="0" alt="Chef"/></a> +</div> + + + + + <div class="document"> + <div class="documentwrapper"> + + <div class="body"> + + <div class="section" id="knife-list"> +<h1>knife list<a class="headerlink" href="#knife-list" title="Permalink to this headline">¶</a></h1> +<p>The <strong>knife list</strong> subcommand is used to view a list of objects on the server. This subcommand works similar to <tt class="docutils literal"><span class="pre">knife</span> <span class="pre">cookbook</span> <span class="pre">list</span></tt>, <tt class="docutils literal"><span class="pre">knife</span> <span class="pre">data</span> <span class="pre">bag</span> <span class="pre">list</span></tt>, <tt class="docutils literal"><span class="pre">knife</span> <span class="pre">environment</span> <span class="pre">list</span></tt>, <tt class="docutils literal"><span class="pre">knife</span> <span class="pre">node</span> <span class="pre">list</span></tt>, and <tt class="docutils literal"><span class="pre">knife</span> <span class="pre">role</span> <span class="pre">list</span></tt>, but with a single verb (and a single action).</p> +<div class="section" id="syntax"> +<h2>Syntax<a class="headerlink" href="#syntax" title="Permalink to this headline">¶</a></h2> +<p>This argument has the following syntax:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife list <span class="o">[</span>PATTERN...<span class="o">]</span> <span class="o">(</span>options<span class="o">)</span> +</pre></div> +</div> +</div> +<div class="section" id="options"> +<h2>Options<a class="headerlink" href="#options" title="Permalink to this headline">¶</a></h2> +<div class="admonition note"> +<p class="first admonition-title">Note</p> +<p class="last">Review the list of <a class="reference internal" href="knife_common_options.html"><em>common options</em></a> available to this (and all) Knife subcommands and plugins.</p> +</div> +<p>This subcommand has the following options:</p> +<dl class="docutils"> +<dt><tt class="docutils literal"><span class="pre">-1</span></tt></dt> +<dd>Indicates that only one column of results will be shown. Default: <tt class="docutils literal"><span class="pre">false</span></tt>.</dd> +<dt><tt class="docutils literal"><span class="pre">--chef-repo-path</span> <span class="pre">PATH</span></tt></dt> +<dd>The path to the chef-repo. This setting will override the default path to the chef-repo. Default: same as specified by <tt class="docutils literal"><span class="pre">chef_repo_path</span></tt> in config.rb.</dd> +<dt><tt class="docutils literal"><span class="pre">--concurrency</span></tt></dt> +<dd>The number of allowed concurrent connections. Default: <tt class="docutils literal"><span class="pre">10</span></tt>.</dd> +<dt><tt class="docutils literal"><span class="pre">-d</span></tt></dt> +<dd>Indicates that a directory’s children will not be shown when a directory matches a pattern. Default value: <tt class="docutils literal"><span class="pre">false</span></tt>.</dd> +<dt><tt class="docutils literal"><span class="pre">-f</span></tt>, <tt class="docutils literal"><span class="pre">--flat</span></tt></dt> +<dd>Indicates that a list of file names will be shown. Set to <tt class="docutils literal"><span class="pre">false</span></tt> to view ls-like output. Default: <tt class="docutils literal"><span class="pre">false</span></tt>.</dd> +<dt><tt class="docutils literal"><span class="pre">--local</span></tt></dt> +<dd>Indicates that only contents of the local directory will be returned. Default: <tt class="docutils literal"><span class="pre">false</span></tt>.</dd> +<dt><tt class="docutils literal"><span class="pre">-p</span></tt></dt> +<dd>Indicates that trailing slashes (/) will be shown for directories. Default: <tt class="docutils literal"><span class="pre">false</span></tt>.</dd> +<dt><tt class="docutils literal"><span class="pre">-R</span></tt></dt> +<dd>Indicates that directories will be listed recursively. Default: <tt class="docutils literal"><span class="pre">false</span></tt>.</dd> +<dt><tt class="docutils literal"><span class="pre">--repo-mode</span> <span class="pre">MODE</span></tt></dt> +<dd>The layout of the local chef-repo. Possible values: <tt class="docutils literal"><span class="pre">static</span></tt>, <tt class="docutils literal"><span class="pre">everything</span></tt>, or <tt class="docutils literal"><span class="pre">hosted_everything</span></tt>. Use <tt class="docutils literal"><span class="pre">static</span></tt> for just roles, environments, cookbooks, and data bags. By default, <tt class="docutils literal"><span class="pre">everything</span></tt> and <tt class="docutils literal"><span class="pre">hosted_everything</span></tt> are dynamically selected depending on the server type. Default: <tt class="docutils literal"><span class="pre">everything</span></tt> / <tt class="docutils literal"><span class="pre">hosted_everything</span></tt>.</dd> +</dl> +</div> +<div class="section" id="examples"> +<h2>Examples<a class="headerlink" href="#examples" title="Permalink to this headline">¶</a></h2> +<p>The following examples show how to use this Knife subcommand:</p> +<p><strong>List roles</strong></p> +<p>For example, to view a list of roles on the server:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife list roles/ +</pre></div> +</div> +<p><strong>List roles and environments</strong></p> +<p>To view a list of roles and environments on the server:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife list roles/ environments/ +</pre></div> +</div> +<p><strong>List everything</strong></p> +<p>To view a list of absolutely everything on the server:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife list -R / +</pre></div> +</div> +</div> +</div> + + + </div> + + </div> + + + <div class="clearer"></div> + </div> + + + + + </body> +</html>
\ No newline at end of file diff --git a/distro/common/html/knife_node.html b/distro/common/html/knife_node.html new file mode 100644 index 0000000000..9e90175075 --- /dev/null +++ b/distro/common/html/knife_node.html @@ -0,0 +1,450 @@ + +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> + + +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> + + <title>knife node — chef-client Man Pages</title> + + <link rel="stylesheet" href="_static/guide.css" type="text/css" /> + <link rel="stylesheet" href="_static/pygments.css" type="text/css" /> + + <script type="text/javascript"> + var DOCUMENTATION_OPTIONS = { + URL_ROOT: '', + VERSION: '', + COLLAPSE_INDEX: false, + FILE_SUFFIX: '.html', + HAS_SOURCE: true + }; + </script> + <script type="text/javascript" src="_static/jquery.js"></script> + <script type="text/javascript" src="_static/underscore.js"></script> + <script type="text/javascript" src="_static/doctools.js"></script> + <link rel="shortcut icon" href="_static/chef.ico"/> + + + </head> + <body> +<div style="background-color: #212c35; text-align: left; padding: 0px 0px 0px 0px"> +<a href="http://docs.opscode.com/"><img src="_static/chef_html_logo.png" border="0" alt="Chef"/></a> +</div> + + + + + <div class="document"> + <div class="documentwrapper"> + + <div class="body"> + + <div class="section" id="knife-node"> +<h1>knife node<a class="headerlink" href="#knife-node" title="Permalink to this headline">¶</a></h1> +<p>A node is any physical, virtual, or cloud machine that is configured to be maintained by a chef-client.</p> +<p>The <strong>knife node</strong> subcommand is used to manage the nodes that exist on a server.</p> +<div class="admonition note"> +<p class="first admonition-title">Note</p> +<p class="last">Review the list of <a class="reference internal" href="knife_common_options.html"><em>common options</em></a> available to this (and all) Knife subcommands and plugins.</p> +</div> +<div class="section" id="bulk-delete"> +<h2>bulk delete<a class="headerlink" href="#bulk-delete" title="Permalink to this headline">¶</a></h2> +<p>The <tt class="docutils literal"><span class="pre">bulk</span> <span class="pre">delete</span></tt> argument is used to delete one or more nodes that match a pattern defined by a regular expression. The regular expression must be within quotes and not be surrounded by forward slashes (/).</p> +<div class="section" id="syntax"> +<h3>Syntax<a class="headerlink" href="#syntax" title="Permalink to this headline">¶</a></h3> +<p>This argument has the following syntax:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife node bulk delete REGEX +</pre></div> +</div> +</div> +<div class="section" id="options"> +<h3>Options<a class="headerlink" href="#options" title="Permalink to this headline">¶</a></h3> +<p>This command does not have any specific options.</p> +</div> +<div class="section" id="examples"> +<h3>Examples<a class="headerlink" href="#examples" title="Permalink to this headline">¶</a></h3> +<p>The following examples show how to use this Knife subcommand:</p> +<p><strong>Bulk delete nodes</strong></p> +<p>Use a regular expression to define the pattern used to bulk delete nodes:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife node bulk delete <span class="s2">"^[0-9]{3}$"</span> +</pre></div> +</div> +<p>Type <tt class="docutils literal"><span class="pre">Y</span></tt> to confirm a deletion.</p> +</div> +</div> +<div class="section" id="create"> +<h2>create<a class="headerlink" href="#create" title="Permalink to this headline">¶</a></h2> +<p>The <tt class="docutils literal"><span class="pre">create</span></tt> argument is used to add a node to the server. Node data is stored as JSON on the server.</p> +<div class="section" id="id1"> +<h3>Syntax<a class="headerlink" href="#id1" title="Permalink to this headline">¶</a></h3> +<p>This argument has the following syntax:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife node create NODE_NAME +</pre></div> +</div> +</div> +<div class="section" id="id2"> +<h3>Options<a class="headerlink" href="#id2" title="Permalink to this headline">¶</a></h3> +<p>This command does not have any specific options.</p> +</div> +<div class="section" id="id3"> +<h3>Examples<a class="headerlink" href="#id3" title="Permalink to this headline">¶</a></h3> +<p>The following examples show how to use this Knife subcommand:</p> +<p><strong>Create a node</strong></p> +<p>To add a node, enter:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife node create node1 +</pre></div> +</div> +<p>In the $EDITOR enter the node data in JSON:</p> +<div class="highlight-javascript"><pre>## sample: +{ + "normal": { + }, + "name": "foobar", + "override": { + }, + "default": { + }, + "json_class": "Chef::Node", + "automatic": { + }, + "run_list": [ + "recipe[zsh]", + "role[webserver]" + ], + "chef_type": "node" +}</pre> +</div> +<p>When finished, save it.</p> +</div> +</div> +<div class="section" id="delete"> +<h2>delete<a class="headerlink" href="#delete" title="Permalink to this headline">¶</a></h2> +<p>The <tt class="docutils literal"><span class="pre">delete</span></tt> argument is used to delete a node from the server.</p> +<div class="admonition note"> +<p class="first admonition-title">Note</p> +<p class="last">Deleting a node will not delete any corresponding API clients.</p> +</div> +<div class="section" id="id4"> +<h3>Syntax<a class="headerlink" href="#id4" title="Permalink to this headline">¶</a></h3> +<p>This argument has the following syntax:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife node delete NODE_NAME +</pre></div> +</div> +</div> +<div class="section" id="id5"> +<h3>Options<a class="headerlink" href="#id5" title="Permalink to this headline">¶</a></h3> +<p>This command does not have any specific options.</p> +</div> +<div class="section" id="id6"> +<h3>Examples<a class="headerlink" href="#id6" title="Permalink to this headline">¶</a></h3> +<p>The following examples show how to use this Knife subcommand:</p> +<p><strong>Delete a node</strong></p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife node delete node_name +</pre></div> +</div> +</div> +</div> +<div class="section" id="edit"> +<h2>edit<a class="headerlink" href="#edit" title="Permalink to this headline">¶</a></h2> +<p>The <tt class="docutils literal"><span class="pre">edit</span></tt> argument is used to edit the details of a node on a server. Node data is stored as JSON on the server.</p> +<div class="section" id="id7"> +<h3>Syntax<a class="headerlink" href="#id7" title="Permalink to this headline">¶</a></h3> +<p>This argument has the following syntax:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife node edit NODE_NAME <span class="o">(</span>options<span class="o">)</span> +</pre></div> +</div> +</div> +<div class="section" id="id8"> +<h3>Options<a class="headerlink" href="#id8" title="Permalink to this headline">¶</a></h3> +<p>This argument has the following options:</p> +<dl class="docutils"> +<dt><tt class="docutils literal"><span class="pre">-a</span></tt>, <tt class="docutils literal"><span class="pre">--all</span></tt></dt> +<dd>Displays a node in the $EDITOR. By default, attributes that are default, override, or automatic are not shown.</dd> +</dl> +</div> +<div class="section" id="id9"> +<h3>Examples<a class="headerlink" href="#id9" title="Permalink to this headline">¶</a></h3> +<p>The following examples show how to use this Knife subcommand:</p> +<p><strong>Edit a node</strong></p> +<p>To edit the data for a node named “node1”, enter:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife node edit node1 -a +</pre></div> +</div> +<p>Update the role data in JSON:</p> +<div class="highlight-javascript"><pre>## sample: +{ + "normal": { + }, + "name": "node1", + "override": { + }, + "default": { + }, + "json_class": "Chef::Node", + "automatic": { + }, + "run_list": [ + "recipe[devops]", + "role[webserver]" + ], + "chef_type": "node" +}</pre> +</div> +<p>When finished, save it.</p> +</div> +</div> +<div class="section" id="from-file"> +<h2>from file<a class="headerlink" href="#from-file" title="Permalink to this headline">¶</a></h2> +<p>The <tt class="docutils literal"><span class="pre">from</span> <span class="pre">file</span></tt> argument is used to create a node using existing node data as a template.</p> +<div class="section" id="id10"> +<h3>Syntax<a class="headerlink" href="#id10" title="Permalink to this headline">¶</a></h3> +<p>This argument has the following syntax:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife node from file FILE +</pre></div> +</div> +</div> +<div class="section" id="id11"> +<h3>Options<a class="headerlink" href="#id11" title="Permalink to this headline">¶</a></h3> +<p>This command does not have any specific options.</p> +</div> +<div class="section" id="id12"> +<h3>Examples<a class="headerlink" href="#id12" title="Permalink to this headline">¶</a></h3> +<p>The following examples show how to use this Knife subcommand:</p> +<p><strong>Create a node using a JSON file</strong></p> +<p>To add a node using data contained in a JSON file:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife node from file <span class="s2">"path to JSON file"</span> +</pre></div> +</div> +</div> +</div> +<div class="section" id="list"> +<h2>list<a class="headerlink" href="#list" title="Permalink to this headline">¶</a></h2> +<p>The <tt class="docutils literal"><span class="pre">list</span></tt> argument is used to view all of the nodes that exist on a server.</p> +<div class="section" id="id13"> +<h3>Syntax<a class="headerlink" href="#id13" title="Permalink to this headline">¶</a></h3> +<p>This argument has the following syntax:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife node list <span class="o">(</span>options<span class="o">)</span> +</pre></div> +</div> +</div> +<div class="section" id="id14"> +<h3>Options<a class="headerlink" href="#id14" title="Permalink to this headline">¶</a></h3> +<p>This argument has the following options:</p> +<dl class="docutils"> +<dt><tt class="docutils literal"><span class="pre">-w</span></tt>, <tt class="docutils literal"><span class="pre">--with-uri</span></tt></dt> +<dd>Indicates that the corresponding URIs will be shown.</dd> +</dl> +</div> +<div class="section" id="id15"> +<h3>Examples<a class="headerlink" href="#id15" title="Permalink to this headline">¶</a></h3> +<p>The following examples show how to use this Knife subcommand:</p> +<p><strong>View a list of nodes</strong></p> +<p>To verify the list of nodes that are registered with the server, enter:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife node list +</pre></div> +</div> +<p>to return something similar to:</p> +<div class="highlight-bash"><div class="highlight"><pre>i-12345678 +rs-123456 +</pre></div> +</div> +</div> +</div> +<div class="section" id="run-list-add"> +<h2>run_list add<a class="headerlink" href="#run-list-add" title="Permalink to this headline">¶</a></h2> +<p>A run-list is an ordered list of roles and/or recipes that are run in an exact order. A run-list is always specific to the node on which it runs, though it is possible for many nodes to have run-lists that are similar or even identical. The items within a run-list are maintained using Knife and are uploaded to the server and stored as part of the node object for each node. The chef-client always configures a node in the exact order specified by its run-list and will never run the same recipe twice.</p> +<p>The <tt class="docutils literal"><span class="pre">run_list</span> <span class="pre">add</span></tt> argument is used to add run list items (roles or recipes) to a node.</p> +<p>A run-list must be in one of the following formats: fully qualified, cookbook, or default. Both roles and recipes must be in quotes, for example:</p> +<div class="highlight-ruby"><div class="highlight"><pre><span class="s1">'role[ROLE_NAME]'</span> +</pre></div> +</div> +<p>or</p> +<div class="highlight-ruby"><div class="highlight"><pre><span class="s1">'recipe[COOKBOOK::RECIPE_NAME]'</span> +</pre></div> +</div> +<p>Use a comma to separate roles and recipes when adding more than one item the run-list:</p> +<div class="highlight-ruby"><div class="highlight"><pre><span class="s1">'recipe[COOKBOOK::RECIPE_NAME],COOKBOOK::RECIPE_NAME,role[ROLE_NAME]'</span> +</pre></div> +</div> +<div class="section" id="id16"> +<h3>Syntax<a class="headerlink" href="#id16" title="Permalink to this headline">¶</a></h3> +<p>This argument has the following syntax:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife node run_list add NODE_NAME RUN_LIST_ITEM <span class="o">(</span>options<span class="o">)</span> +</pre></div> +</div> +</div> +<div class="section" id="id17"> +<h3>Options<a class="headerlink" href="#id17" title="Permalink to this headline">¶</a></h3> +<p>This argument has the following options:</p> +<dl class="docutils"> +<dt><tt class="docutils literal"><span class="pre">-a</span> <span class="pre">ITEM</span></tt>, <tt class="docutils literal"><span class="pre">--after</span> <span class="pre">ITEM</span></tt></dt> +<dd>Use this to add the run list item after the specified run list item.</dd> +</dl> +</div> +<div class="section" id="id18"> +<h3>Examples<a class="headerlink" href="#id18" title="Permalink to this headline">¶</a></h3> +<p>The following examples show how to use this Knife subcommand:</p> +<p><strong>Add a role</strong></p> +<p>To add a role to a run list, enter:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife node run_list add node <span class="s1">'role[ROLE_NAME]'</span> +</pre></div> +</div> +<p><strong>Add roles and recipes</strong></p> +<p>To add roles and recipes to a run list, enter:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife node run_list add node <span class="s1">'recipe[COOKBOOK::RECIPE_NAME],recipe[COOKBOOK::RECIPE_NAME],role[ROLE_NAME]'</span> +</pre></div> +</div> +<p><strong>Add a recipe with a FQDN</strong></p> +<p>To add a recipe to a run list using the fully qualified format, enter:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife node run_list add node <span class="s1">'recipe[COOKBOOK::RECIPE_NAME]'</span> +</pre></div> +</div> +<p><strong>Add a recipe with a cookbook</strong></p> +<p>To add a recipe to a run list using the cookbook format, enter:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife node run_list add node <span class="s1">'COOKBOOK::RECIPE_NAME'</span> +</pre></div> +</div> +<p><strong>Add the default recipe</strong></p> +<p>To add the default recipe of a cookbook to a run list, enter:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife node run_list add node <span class="s1">'COOKBOOK'</span> +</pre></div> +</div> +</div> +</div> +<div class="section" id="run-list-remove"> +<h2>run_list remove<a class="headerlink" href="#run-list-remove" title="Permalink to this headline">¶</a></h2> +<p>The <tt class="docutils literal"><span class="pre">run_list</span> <span class="pre">remove</span></tt> argument is used to remove run list items (roles or recipes) from a node. A recipe must be in one of the following formats: fully qualified, cookbook, or default. Both roles and recipes must be in quotes, for example: <tt class="docutils literal"><span class="pre">'role[ROLE_NAME]'</span></tt> or <tt class="docutils literal"><span class="pre">'recipe[COOKBOOK::RECIPE_NAME]'</span></tt>. Use a comma to separate roles and recipes when removing more than one, like this: <tt class="docutils literal"><span class="pre">'recipe[COOKBOOK::RECIPE_NAME],COOKBOOK::RECIPE_NAME,role[ROLE_NAME]'</span></tt>.</p> +<div class="section" id="id19"> +<h3>Syntax<a class="headerlink" href="#id19" title="Permalink to this headline">¶</a></h3> +<p>This argument has the following syntax:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife node run_list remove NODE_NAME RUN_LIST_ITEM +</pre></div> +</div> +</div> +<div class="section" id="id20"> +<h3>Options<a class="headerlink" href="#id20" title="Permalink to this headline">¶</a></h3> +<p>This command does not have any specific options.</p> +</div> +<div class="section" id="id21"> +<h3>Examples<a class="headerlink" href="#id21" title="Permalink to this headline">¶</a></h3> +<p>The following examples show how to use this Knife subcommand:</p> +<p><strong>Remove a role</strong></p> +<p>To remove a role from a run list, enter:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife node run_list remove node <span class="s1">'role[ROLE_NAME]'</span> +</pre></div> +</div> +<p><strong>Remove a run-list</strong></p> +<p>To remove a recipe from a run list using the fully qualified format, enter:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife node run_list remove node <span class="s1">'recipe[COOKBOOK::RECIPE_NAME]'</span> +</pre></div> +</div> +</div> +</div> +<div class="section" id="show"> +<h2>show<a class="headerlink" href="#show" title="Permalink to this headline">¶</a></h2> +<p>The <tt class="docutils literal"><span class="pre">show</span></tt> argument is used to display information about a node.</p> +<div class="section" id="id22"> +<h3>Syntax<a class="headerlink" href="#id22" title="Permalink to this headline">¶</a></h3> +<p>This argument has the following syntax:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife node show NODE_NAME <span class="o">(</span>options<span class="o">)</span> +</pre></div> +</div> +</div> +<div class="section" id="id23"> +<h3>Options<a class="headerlink" href="#id23" title="Permalink to this headline">¶</a></h3> +<p>This argument has the following options:</p> +<dl class="docutils"> +<dt><tt class="docutils literal"><span class="pre">-a</span> <span class="pre">ATTR</span></tt>, <tt class="docutils literal"><span class="pre">--attribute</span> <span class="pre">ATTR</span></tt></dt> +<dd>The attribute (or attributes) to show.</dd> +<dt><tt class="docutils literal"><span class="pre">-l</span></tt>, <tt class="docutils literal"><span class="pre">--long</span></tt></dt> +<dd>Display long output when searching nodes while using the default summary format.</dd> +<dt><tt class="docutils literal"><span class="pre">-m</span></tt>, <tt class="docutils literal"><span class="pre">--medium</span></tt></dt> +<dd>Display more, but not all, of a node’s data when searching using the default summary format.</dd> +<dt><tt class="docutils literal"><span class="pre">-r</span></tt>, <tt class="docutils literal"><span class="pre">--run-list</span></tt></dt> +<dd>Indicates that only the run-list will be shown.</dd> +</dl> +</div> +<div class="section" id="id24"> +<h3>Examples<a class="headerlink" href="#id24" title="Permalink to this headline">¶</a></h3> +<p>The following examples show how to use this Knife subcommand:</p> +<p><strong>Show all data about nodes</strong></p> +<p>To view all data for a node named “build”, enter:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife node show build +</pre></div> +</div> +<p>to return:</p> +<div class="highlight-bash"><div class="highlight"><pre>Node Name: build +Environment: _default +FQDN: +IP: +Run List: +Roles: +Recipes: +Platform: +</pre></div> +</div> +<p><strong>Show basic information about nodes</strong></p> +<p>To show basic information about a node, truncated and nicely formatted:</p> +<div class="highlight-bash"><div class="highlight"><pre>knife node show <node_name> +</pre></div> +</div> +<p><strong>Show all data about nodes, truncated</strong></p> +<p>To show all information about a node, nicely formatted:</p> +<div class="highlight-bash"><div class="highlight"><pre>knife node show -l <node_name> +</pre></div> +</div> +<p><strong>Show attributes</strong></p> +<p>To list a single node attribute:</p> +<div class="highlight-bash"><div class="highlight"><pre>knife node show <node_name> -a <attribute_name> +</pre></div> +</div> +<p>where <tt class="docutils literal"><span class="pre"><attribute_name></span></tt> is something like kernel or platform. (This doesn’t work for nested attributes like <tt class="docutils literal"><span class="pre">node[kernel][machine]</span></tt> because <tt class="docutils literal"><span class="pre">knife</span> <span class="pre">node</span> <span class="pre">show</span></tt> doesn’t understand nested attributes.)</p> +<p><strong>Show the FQDN</strong></p> +<p>To view the FQDN for a node named “i-12345678”, enter:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife node show i-12345678 -a fqdn +</pre></div> +</div> +<p>to return:</p> +<div class="highlight-bash"><div class="highlight"><pre>fqdn: ip-10-251-75-20.ec2.internal +</pre></div> +</div> +<p><strong>Show a run-list</strong></p> +<p>To view the run list for a node named “dev”, enter:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife node show dev -r +</pre></div> +</div> +<p><strong>Show as JSON data</strong></p> +<p>To view information in JSON format, use the <tt class="docutils literal"><span class="pre">-F</span></tt> common option as part of the command like this:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife role show devops -F json +</pre></div> +</div> +<p>Other formats available include <tt class="docutils literal"><span class="pre">text</span></tt>, <tt class="docutils literal"><span class="pre">yaml</span></tt>, and <tt class="docutils literal"><span class="pre">pp</span></tt>.</p> +<p><strong>Show as raw JSON data</strong></p> +<p>To view node information in raw JSON, use the <tt class="docutils literal"><span class="pre">-l</span></tt> or <tt class="docutils literal"><span class="pre">--long</span></tt> option:</p> +<div class="highlight-bash"><div class="highlight"><pre>knife node show -l -F json <node_name> +</pre></div> +</div> +<p>and/or:</p> +<div class="highlight-bash"><div class="highlight"><pre>knife node show -l --format<span class="o">=</span>json <node_name> +</pre></div> +</div> +</div> +</div> +</div> + + + </div> + + </div> + + + <div class="clearer"></div> + </div> + + + + + </body> +</html>
\ No newline at end of file diff --git a/distro/common/html/knife_raw.html b/distro/common/html/knife_raw.html new file mode 100644 index 0000000000..fdca3e1fa4 --- /dev/null +++ b/distro/common/html/knife_raw.html @@ -0,0 +1,112 @@ + +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> + + +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> + + <title>knife raw — chef-client Man Pages</title> + + <link rel="stylesheet" href="_static/guide.css" type="text/css" /> + <link rel="stylesheet" href="_static/pygments.css" type="text/css" /> + + <script type="text/javascript"> + var DOCUMENTATION_OPTIONS = { + URL_ROOT: '', + VERSION: '', + COLLAPSE_INDEX: false, + FILE_SUFFIX: '.html', + HAS_SOURCE: true + }; + </script> + <script type="text/javascript" src="_static/jquery.js"></script> + <script type="text/javascript" src="_static/underscore.js"></script> + <script type="text/javascript" src="_static/doctools.js"></script> + <link rel="shortcut icon" href="_static/chef.ico"/> + + + </head> + <body> +<div style="background-color: #212c35; text-align: left; padding: 0px 0px 0px 0px"> +<a href="http://docs.opscode.com/"><img src="_static/chef_html_logo.png" border="0" alt="Chef"/></a> +</div> + + + + + <div class="document"> + <div class="documentwrapper"> + + <div class="body"> + + <div class="section" id="knife-raw"> +<h1>knife raw<a class="headerlink" href="#knife-raw" title="Permalink to this headline">¶</a></h1> +<p>The <strong>knife raw</strong> subcommand is used to send a REST request to a specified path using the Chef Server API.</p> +<div class="section" id="syntax"> +<h2>Syntax<a class="headerlink" href="#syntax" title="Permalink to this headline">¶</a></h2> +<p>This argument has the following syntax:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife raw REQUEST_PATH <span class="o">(</span>options<span class="o">)</span> +</pre></div> +</div> +</div> +<div class="section" id="options"> +<h2>Options<a class="headerlink" href="#options" title="Permalink to this headline">¶</a></h2> +<div class="admonition note"> +<p class="first admonition-title">Note</p> +<p class="last">Review the list of <a class="reference internal" href="knife_common_options.html"><em>common options</em></a> available to this (and all) Knife subcommands and plugins.</p> +</div> +<p>This subcommand has the following options:</p> +<dl class="docutils"> +<dt><tt class="docutils literal"><span class="pre">-i</span> <span class="pre">FILE</span></tt>, <tt class="docutils literal"><span class="pre">--input</span> <span class="pre">FILE</span></tt></dt> +<dd>The name of a file to be used with the <tt class="docutils literal"><span class="pre">PUT</span></tt> or a <tt class="docutils literal"><span class="pre">POST</span></tt> request.</dd> +<dt><tt class="docutils literal"><span class="pre">--[no-]pretty</span></tt></dt> +<dd>Use <tt class="docutils literal"><span class="pre">--no-pretty</span></tt> to disable pretty-print output for JSON. Default: <tt class="docutils literal"><span class="pre">--pretty</span></tt>.</dd> +<dt><tt class="docutils literal"><span class="pre">-m</span> <span class="pre">METHOD</span></tt>, <tt class="docutils literal"><span class="pre">--method</span> <span class="pre">METHOD</span></tt></dt> +<dd>The request method: <tt class="docutils literal"><span class="pre">DELETE</span></tt>, <tt class="docutils literal"><span class="pre">GET</span></tt>, <tt class="docutils literal"><span class="pre">POST</span></tt>, or <tt class="docutils literal"><span class="pre">PUT</span></tt>. Default value: <tt class="docutils literal"><span class="pre">GET</span></tt>.</dd> +</dl> +</div> +<div class="section" id="examples"> +<h2>Examples<a class="headerlink" href="#examples" title="Permalink to this headline">¶</a></h2> +<p>The following examples show how to use this Knife subcommand:</p> +<p><strong>View a client</strong></p> +<p>To view information about a client:</p> +<div class="highlight-bash"><div class="highlight"><pre>knife raw /clients/<client_name> +</pre></div> +</div> +<p><strong>View a node</strong></p> +<p>To view information about a node:</p> +<div class="highlight-bash"><div class="highlight"><pre>knife raw /nodes/<node_name> +</pre></div> +</div> +<p><strong>Delete a data bag</strong></p> +<p>To delete a data bag, enter a command similar to:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife raw -m DELETE /data/foo +</pre></div> +</div> +<p>to return something similar to:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="o">{</span> + <span class="s2">"name"</span>:<span class="s2">"foo"</span>, + <span class="s2">"json_class"</span>:<span class="s2">"Chef::DataBag"</span>, + <span class="s2">"chef_type"</span>:<span class="s2">"data_bag"</span> +<span class="o">}</span> +</pre></div> +</div> +</div> +</div> + + + </div> + + </div> + + + <div class="clearer"></div> + </div> + + + + + </body> +</html>
\ No newline at end of file diff --git a/distro/common/html/knife_recipe_list.html b/distro/common/html/knife_recipe_list.html new file mode 100644 index 0000000000..b7a0d9be70 --- /dev/null +++ b/distro/common/html/knife_recipe_list.html @@ -0,0 +1,93 @@ + +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> + + +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> + + <title>knife recipe list — chef-client Man Pages</title> + + <link rel="stylesheet" href="_static/guide.css" type="text/css" /> + <link rel="stylesheet" href="_static/pygments.css" type="text/css" /> + + <script type="text/javascript"> + var DOCUMENTATION_OPTIONS = { + URL_ROOT: '', + VERSION: '', + COLLAPSE_INDEX: false, + FILE_SUFFIX: '.html', + HAS_SOURCE: true + }; + </script> + <script type="text/javascript" src="_static/jquery.js"></script> + <script type="text/javascript" src="_static/underscore.js"></script> + <script type="text/javascript" src="_static/doctools.js"></script> + <link rel="shortcut icon" href="_static/chef.ico"/> + + + </head> + <body> +<div style="background-color: #212c35; text-align: left; padding: 0px 0px 0px 0px"> +<a href="http://docs.opscode.com/"><img src="_static/chef_html_logo.png" border="0" alt="Chef"/></a> +</div> + + + + + <div class="document"> + <div class="documentwrapper"> + + <div class="body"> + + <div class="section" id="knife-recipe-list"> +<h1>knife recipe list<a class="headerlink" href="#knife-recipe-list" title="Permalink to this headline">¶</a></h1> +<p>The <strong>knife recipe list</strong> subcommand is used to view all of the recipes that are on a server. A regular expression can be used to limit the results to recipes that match a specific pattern. The regular expression must be within quotes and not be surrounded by forward slashes (/).</p> +<div class="section" id="syntax"> +<h2>Syntax<a class="headerlink" href="#syntax" title="Permalink to this headline">¶</a></h2> +<p>This argument has the following syntax:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife recipe list REGEX +</pre></div> +</div> +</div> +<div class="section" id="options"> +<h2>Options<a class="headerlink" href="#options" title="Permalink to this headline">¶</a></h2> +<div class="admonition note"> +<p class="first admonition-title">Note</p> +<p class="last">Review the list of <a class="reference internal" href="knife_common_options.html"><em>common options</em></a> available to this (and all) Knife subcommands and plugins.</p> +</div> +<p>This command does not have any specific options.</p> +</div> +<div class="section" id="examples"> +<h2>Examples<a class="headerlink" href="#examples" title="Permalink to this headline">¶</a></h2> +<p>The following examples show how to use this Knife subcommand:</p> +<p><strong>View a list of recipes</strong></p> +<p>To view a list of recipes:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife recipe list <span class="s1">'couchdb::*'</span> +</pre></div> +</div> +<p>to return:</p> +<div class="highlight-bash"><div class="highlight"><pre>couchdb::main_monitors +couchdb::master +couchdb::default +couchdb::org_cleanu +</pre></div> +</div> +</div> +</div> + + + </div> + + </div> + + + <div class="clearer"></div> + </div> + + + + + </body> +</html>
\ No newline at end of file diff --git a/distro/common/html/knife_role.html b/distro/common/html/knife_role.html new file mode 100644 index 0000000000..0ed0deb624 --- /dev/null +++ b/distro/common/html/knife_role.html @@ -0,0 +1,295 @@ + +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> + + +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> + + <title>knife role — chef-client Man Pages</title> + + <link rel="stylesheet" href="_static/guide.css" type="text/css" /> + <link rel="stylesheet" href="_static/pygments.css" type="text/css" /> + + <script type="text/javascript"> + var DOCUMENTATION_OPTIONS = { + URL_ROOT: '', + VERSION: '', + COLLAPSE_INDEX: false, + FILE_SUFFIX: '.html', + HAS_SOURCE: true + }; + </script> + <script type="text/javascript" src="_static/jquery.js"></script> + <script type="text/javascript" src="_static/underscore.js"></script> + <script type="text/javascript" src="_static/doctools.js"></script> + <link rel="shortcut icon" href="_static/chef.ico"/> + + + </head> + <body> +<div style="background-color: #212c35; text-align: left; padding: 0px 0px 0px 0px"> +<a href="http://docs.opscode.com/"><img src="_static/chef_html_logo.png" border="0" alt="Chef"/></a> +</div> + + + + + <div class="document"> + <div class="documentwrapper"> + + <div class="body"> + + <div class="section" id="knife-role"> +<h1>knife role<a class="headerlink" href="#knife-role" title="Permalink to this headline">¶</a></h1> +<p>A role is a way to define certain patterns and processes that exist across nodes in an organization as belonging to a single job function. Each role consists of zero (or more) attributes and a run list. Each node can have zero (or more) roles assigned to it. When a role is run against a node, the configuration details of that node are compared against the attributes of the role, and then the contents of that role’s run list are applied to the node’s configuration details. When a chef-client runs, it merges its own attributes and run lists with those contained within each assigned role.</p> +<p>The <strong>knife role</strong> subcommand is used to manage the roles that are associated with one or more nodes on a server.</p> +<div class="admonition note"> +<p class="first admonition-title">Note</p> +<p class="last">To add a role to a node and then build out the run-list for that node, use the <a class="reference internal" href="knife_node.html"><em>knife node</em></a> sub-command and its <tt class="docutils literal"><span class="pre">run_list</span> <span class="pre">add</span></tt> argument.</p> +</div> +<div class="admonition note"> +<p class="first admonition-title">Note</p> +<p class="last">Review the list of <a class="reference internal" href="knife_common_options.html"><em>common options</em></a> available to this (and all) Knife subcommands and plugins.</p> +</div> +<div class="section" id="bulk-delete"> +<h2>bulk delete<a class="headerlink" href="#bulk-delete" title="Permalink to this headline">¶</a></h2> +<p>The <tt class="docutils literal"><span class="pre">bulk</span> <span class="pre">delete</span></tt> argument is used to delete one or more roles that match a pattern defined by a regular expression. The regular expression must be within quotes and not be surrounded by forward slashes (/).</p> +<div class="section" id="syntax"> +<h3>Syntax<a class="headerlink" href="#syntax" title="Permalink to this headline">¶</a></h3> +<p>This argument has the following syntax:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife role bulk delete REGEX +</pre></div> +</div> +</div> +<div class="section" id="options"> +<h3>Options<a class="headerlink" href="#options" title="Permalink to this headline">¶</a></h3> +<p>This command does not have any specific options.</p> +</div> +<div class="section" id="examples"> +<h3>Examples<a class="headerlink" href="#examples" title="Permalink to this headline">¶</a></h3> +<p>The following examples show how to use this Knife subcommand:</p> +<p><strong>Bulk delete roles</strong></p> +<p>Use a regular expression to define the pattern used to bulk delete roles:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife role bulk delete <span class="s2">"^[0-9]{3}$"</span> +</pre></div> +</div> +</div> +</div> +<div class="section" id="create"> +<h2>create<a class="headerlink" href="#create" title="Permalink to this headline">¶</a></h2> +<p>The <tt class="docutils literal"><span class="pre">create</span></tt> argument is used to add a role to the server. Role data is saved as JSON on the server.</p> +<div class="section" id="id1"> +<h3>Syntax<a class="headerlink" href="#id1" title="Permalink to this headline">¶</a></h3> +<p>This argument has the following syntax:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife role create ROLE_NAME <span class="o">(</span>options<span class="o">)</span> +</pre></div> +</div> +</div> +<div class="section" id="id2"> +<h3>Options<a class="headerlink" href="#id2" title="Permalink to this headline">¶</a></h3> +<p>This argument has the following options:</p> +<dl class="docutils"> +<dt><tt class="docutils literal"><span class="pre">-d</span> <span class="pre">DESCRIPTION</span></tt>, <tt class="docutils literal"><span class="pre">--description</span> <span class="pre">DESCRIPTION</span></tt></dt> +<dd>The description of the role. This value will populate the description field for the role on the server.</dd> +</dl> +</div> +<div class="section" id="id3"> +<h3>Examples<a class="headerlink" href="#id3" title="Permalink to this headline">¶</a></h3> +<p>The following examples show how to use this Knife subcommand:</p> +<p><strong>Create a role</strong></p> +<p>To add a role named “role1”, enter:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife role create role1 +</pre></div> +</div> +<p>In the $EDITOR enter the role data in JSON:</p> +<div class="highlight-javascript"><pre>## sample: +{ + "name": "role1", + "default_attributes": { + }, + "json_class": "Chef::Role", + "run_list": ['recipe[cookbook_name::recipe_name], + role[role_name]' + ], + "description": "", + "chef_type": "role", + "override_attributes": { + } +}</pre> +</div> +<p>When finished, save it.</p> +</div> +</div> +<div class="section" id="delete"> +<h2>delete<a class="headerlink" href="#delete" title="Permalink to this headline">¶</a></h2> +<p>The <tt class="docutils literal"><span class="pre">delete</span></tt> argument is used to delete a role from the server.</p> +<div class="section" id="id4"> +<h3>Syntax<a class="headerlink" href="#id4" title="Permalink to this headline">¶</a></h3> +<p>This argument has the following syntax:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife role delete ROLE_NAME +</pre></div> +</div> +</div> +<div class="section" id="id5"> +<h3>Options<a class="headerlink" href="#id5" title="Permalink to this headline">¶</a></h3> +<p>This command does not have any specific options.</p> +</div> +<div class="section" id="id6"> +<h3>Examples<a class="headerlink" href="#id6" title="Permalink to this headline">¶</a></h3> +<p>The following examples show how to use this Knife subcommand:</p> +<p><strong>Delete a role</strong></p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife role delete devops +</pre></div> +</div> +<p>Type <tt class="docutils literal"><span class="pre">Y</span></tt> to confirm a deletion.</p> +</div> +</div> +<div class="section" id="edit"> +<h2>edit<a class="headerlink" href="#edit" title="Permalink to this headline">¶</a></h2> +<p>The <tt class="docutils literal"><span class="pre">edit</span></tt> argument is used to edit role details on the server.</p> +<div class="section" id="id7"> +<h3>Syntax<a class="headerlink" href="#id7" title="Permalink to this headline">¶</a></h3> +<p>This argument has the following syntax:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife role edit ROLE_NAME +</pre></div> +</div> +</div> +<div class="section" id="id8"> +<h3>Options<a class="headerlink" href="#id8" title="Permalink to this headline">¶</a></h3> +<p>This command does not have any specific options.</p> +</div> +<div class="section" id="id9"> +<h3>Examples<a class="headerlink" href="#id9" title="Permalink to this headline">¶</a></h3> +<p>The following examples show how to use this Knife subcommand:</p> +<p><strong>Edit a role</strong></p> +<p>To edit the data for a role named “role1”, enter:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife role edit role1 +</pre></div> +</div> +<p>Update the role data in JSON:</p> +<div class="highlight-javascript"><pre>## sample: +{ + "name": "role1", + "default_attributes": { + }, + "json_class": "Chef::Role", + "run_list": ['recipe[cookbook_name::recipe_name], + role[role_name]' + ], + "description": "This is the description for the role1 role.", + "chef_type": "role", + "override_attributes": { + } +}</pre> +</div> +<p>When finished, save it.</p> +</div> +</div> +<div class="section" id="from-file"> +<h2>from file<a class="headerlink" href="#from-file" title="Permalink to this headline">¶</a></h2> +<p>The <tt class="docutils literal"><span class="pre">from</span> <span class="pre">file</span></tt> argument is used to create a role using existing JSON data as a template.</p> +<div class="section" id="id10"> +<h3>Syntax<a class="headerlink" href="#id10" title="Permalink to this headline">¶</a></h3> +<p>This argument has the following syntax:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife role from file FILE +</pre></div> +</div> +</div> +<div class="section" id="id11"> +<h3>Options<a class="headerlink" href="#id11" title="Permalink to this headline">¶</a></h3> +<p>This command does not have any specific options.</p> +</div> +<div class="section" id="id12"> +<h3>Examples<a class="headerlink" href="#id12" title="Permalink to this headline">¶</a></h3> +<p>The following examples show how to use this Knife subcommand:</p> +<p><strong>Create a role using JSON data</strong></p> +<p>To view role details based on the values contained in a JSON file:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife role from file <span class="s2">"path to JSON file"</span> +</pre></div> +</div> +</div> +</div> +<div class="section" id="list"> +<h2>list<a class="headerlink" href="#list" title="Permalink to this headline">¶</a></h2> +<p>The <tt class="docutils literal"><span class="pre">list</span></tt> argument is used to view a list of roles that are currently available on the server.</p> +<div class="section" id="id13"> +<h3>Syntax<a class="headerlink" href="#id13" title="Permalink to this headline">¶</a></h3> +<p>This argument has the following syntax:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife role list +</pre></div> +</div> +</div> +<div class="section" id="id14"> +<h3>Options<a class="headerlink" href="#id14" title="Permalink to this headline">¶</a></h3> +<p>This argument has the following options:</p> +<dl class="docutils"> +<dt><tt class="docutils literal"><span class="pre">-w</span></tt>, <tt class="docutils literal"><span class="pre">--with-uri</span></tt></dt> +<dd>Indicates that the corresponding URIs will be shown.</dd> +</dl> +</div> +<div class="section" id="id15"> +<h3>Examples<a class="headerlink" href="#id15" title="Permalink to this headline">¶</a></h3> +<p>The following examples show how to use this Knife subcommand:</p> +<p><strong>View a list of roles</strong></p> +<p>To view a list of roles on the server and display the URI for each role returned, enter:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife role list -w +</pre></div> +</div> +</div> +</div> +<div class="section" id="show"> +<h2>show<a class="headerlink" href="#show" title="Permalink to this headline">¶</a></h2> +<p>The <tt class="docutils literal"><span class="pre">show</span></tt> argument is used to view the details of a role.</p> +<div class="section" id="id16"> +<h3>Syntax<a class="headerlink" href="#id16" title="Permalink to this headline">¶</a></h3> +<p>This argument has the following syntax:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife role show ROLE_NAME +</pre></div> +</div> +</div> +<div class="section" id="id17"> +<h3>Options<a class="headerlink" href="#id17" title="Permalink to this headline">¶</a></h3> +<p>This argument has the following options:</p> +<dl class="docutils"> +<dt><tt class="docutils literal"><span class="pre">-a</span> <span class="pre">ATTR</span></tt>, <tt class="docutils literal"><span class="pre">--attribute</span> <span class="pre">ATTR</span></tt></dt> +<dd>The attribute (or attributes) to show.</dd> +</dl> +</div> +<div class="section" id="id18"> +<h3>Examples<a class="headerlink" href="#id18" title="Permalink to this headline">¶</a></h3> +<p>The following examples show how to use this Knife subcommand:</p> +<p><strong>Show as JSON data</strong></p> +<p>To view information in JSON format, use the <tt class="docutils literal"><span class="pre">-F</span></tt> common option as part of the command like this:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife role show devops -F json +</pre></div> +</div> +<p>Other formats available include <tt class="docutils literal"><span class="pre">text</span></tt>, <tt class="docutils literal"><span class="pre">yaml</span></tt>, and <tt class="docutils literal"><span class="pre">pp</span></tt>.</p> +<p><strong>Show as raw JSON data</strong></p> +<p>To view node information in raw JSON, use the <tt class="docutils literal"><span class="pre">-l</span></tt> or <tt class="docutils literal"><span class="pre">--long</span></tt> option:</p> +<div class="highlight-bash"><div class="highlight"><pre>knife node show -l -F json <node_name> +</pre></div> +</div> +<p>and/or:</p> +<div class="highlight-bash"><div class="highlight"><pre>knife node show -l --format<span class="o">=</span>json <node_name> +</pre></div> +</div> +</div> +</div> +</div> + + + </div> + + </div> + + + <div class="clearer"></div> + </div> + + + + + </body> +</html>
\ No newline at end of file diff --git a/distro/common/html/knife_search.html b/distro/common/html/knife_search.html new file mode 100644 index 0000000000..b4b01e306a --- /dev/null +++ b/distro/common/html/knife_search.html @@ -0,0 +1,204 @@ + +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> + + +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> + + <title>knife search — chef-client Man Pages</title> + + <link rel="stylesheet" href="_static/guide.css" type="text/css" /> + <link rel="stylesheet" href="_static/pygments.css" type="text/css" /> + + <script type="text/javascript"> + var DOCUMENTATION_OPTIONS = { + URL_ROOT: '', + VERSION: '', + COLLAPSE_INDEX: false, + FILE_SUFFIX: '.html', + HAS_SOURCE: true + }; + </script> + <script type="text/javascript" src="_static/jquery.js"></script> + <script type="text/javascript" src="_static/underscore.js"></script> + <script type="text/javascript" src="_static/doctools.js"></script> + <link rel="shortcut icon" href="_static/chef.ico"/> + + + </head> + <body> +<div style="background-color: #212c35; text-align: left; padding: 0px 0px 0px 0px"> +<a href="http://docs.opscode.com/"><img src="_static/chef_html_logo.png" border="0" alt="Chef"/></a> +</div> + + + + + <div class="document"> + <div class="documentwrapper"> + + <div class="body"> + + <div class="section" id="knife-search"> +<h1>knife search<a class="headerlink" href="#knife-search" title="Permalink to this headline">¶</a></h1> +<p>Search indexes allow queries to be made for any type of data that is indexed by the server, including data bags (and data bag items), environments, nodes, and roles. A defined query syntax is used to support search patterns like exact, wildcard, range, and fuzzy. A search is a full-text query that can be done from several locations, including from within a recipe, by using the <tt class="docutils literal"><span class="pre">search</span></tt> subcommand in Knife, by using the search functionality in the Chef Manage, or by using the <tt class="docutils literal"><span class="pre">/search</span></tt> or <tt class="docutils literal"><span class="pre">/search/INDEX</span></tt> endpoints in the Chef Server API. The search engine is based on Apache Solr and is run from the server.</p> +<p>The <strong>knife search</strong> subcommand is used run a search query for information that is indexed on a server.</p> +<div class="section" id="syntax"> +<h2>Syntax<a class="headerlink" href="#syntax" title="Permalink to this headline">¶</a></h2> +<p>This argument has the following syntax:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife search INDEX SEARCH_QUERY +</pre></div> +</div> +<p>where <tt class="docutils literal"><span class="pre">INDEX</span></tt> is one of <tt class="docutils literal"><span class="pre">client</span></tt>, <tt class="docutils literal"><span class="pre">environment</span></tt>, <tt class="docutils literal"><span class="pre">node</span></tt>, <tt class="docutils literal"><span class="pre">role</span></tt>, or the name of a data bag and <tt class="docutils literal"><span class="pre">SEARCH_QUERY</span></tt> is the search query syntax for the query that will be executed.</p> +<p><tt class="docutils literal"><span class="pre">INDEX</span></tt> is implied if omitted, and will default to <tt class="docutils literal"><span class="pre">node</span></tt>. For example:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife search <span class="s1">'*:*'</span> -i +</pre></div> +</div> +<p>will return something similar to:</p> +<div class="highlight-bash"><div class="highlight"><pre>8 items found + +centos-62-dev +opensuse-1203 +ubuntu-1304-dev +ubuntu-1304-orgtest +ubuntu-1204-ohai-test +ubuntu-1304-ifcfg-test +ohai-test +win2k8-dev +</pre></div> +</div> +<p>and is the same search as:</p> +<div class="highlight-bash"><pre>$ knife search node '*:*" -i</pre> +</div> +<p>If the <tt class="docutils literal"><span class="pre">SEARCH_QUERY</span></tt> does not contain a colon character (<tt class="docutils literal"><span class="pre">:</span></tt>), then the default query pattern is <tt class="docutils literal"><span class="pre">tags:*#{@query}*</span> <span class="pre">OR</span> <span class="pre">roles:*#{@query}*</span> <span class="pre">OR</span> <span class="pre">fqdn:*#{@query}*</span> <span class="pre">OR</span> <span class="pre">addresses:*#{@query}*</span></tt>, which means the following two search queries are effectively the same:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife search ubuntu +</pre></div> +</div> +<p>or:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife search node <span class="s2">"tags:*ubuntu* OR roles:*ubuntu* OR fqdn:*ubuntu* (etc.)"</span> +</pre></div> +</div> +</div> +<div class="section" id="options"> +<h2>Options<a class="headerlink" href="#options" title="Permalink to this headline">¶</a></h2> +<div class="admonition note"> +<p class="first admonition-title">Note</p> +<p class="last">Review the list of <a class="reference internal" href="knife_common_options.html"><em>common options</em></a> available to this (and all) Knife subcommands and plugins.</p> +</div> +<p>This sub-command has the following options:</p> +<dl class="docutils"> +<dt><tt class="docutils literal"><span class="pre">-a</span> <span class="pre">ATTR</span></tt>, <tt class="docutils literal"><span class="pre">--attribute</span> <span class="pre">ATTR</span></tt></dt> +<dd>The attribute (or attributes) to show.</dd> +<dt><tt class="docutils literal"><span class="pre">-b</span> <span class="pre">ROW</span></tt>, <tt class="docutils literal"><span class="pre">--start</span> <span class="pre">ROW</span></tt></dt> +<dd>The row at which return results will begin.</dd> +<dt><tt class="docutils literal"><span class="pre">-i</span></tt>, <tt class="docutils literal"><span class="pre">--id-only</span></tt></dt> +<dd>Indicates that only matching object IDs will be shown.</dd> +<dt><tt class="docutils literal"><span class="pre">INDEX</span></tt></dt> +<dd>The name of the index to be queried: <tt class="docutils literal"><span class="pre">client</span></tt>, <tt class="docutils literal"><span class="pre">environment</span></tt>, <tt class="docutils literal"><span class="pre">node</span></tt>, <tt class="docutils literal"><span class="pre">role</span></tt>, or <tt class="docutils literal"><span class="pre">DATA_BAG_NAME</span></tt>. Default index: <tt class="docutils literal"><span class="pre">node</span></tt>.</dd> +<dt><tt class="docutils literal"><span class="pre">-l</span></tt>, <tt class="docutils literal"><span class="pre">--long</span></tt></dt> +<dd>Display long output when searching nodes while using the default summary format.</dd> +<dt><tt class="docutils literal"><span class="pre">-m</span></tt>, <tt class="docutils literal"><span class="pre">--medium</span></tt></dt> +<dd>Display more, but not all, of a node’s data when searching using the default summary format.</dd> +<dt><tt class="docutils literal"><span class="pre">-o</span> <span class="pre">SORT</span></tt>, <tt class="docutils literal"><span class="pre">--sort</span> <span class="pre">SORT</span></tt></dt> +<dd>The order in which search results will be sorted.</dd> +<dt><tt class="docutils literal"><span class="pre">-q</span> <span class="pre">SEARCH_QUERY</span></tt>, <tt class="docutils literal"><span class="pre">--query</span> <span class="pre">SEARCH_QUERY</span></tt></dt> +<dd>Use to protect search queries that start with a hyphen (-). A <tt class="docutils literal"><span class="pre">-q</span></tt> query may be specified as an argument or an option, but not both.</dd> +<dt><tt class="docutils literal"><span class="pre">-r</span></tt>, <tt class="docutils literal"><span class="pre">--run-list</span></tt></dt> +<dd>Indicates that only the run-list will be shown.</dd> +<dt><tt class="docutils literal"><span class="pre">-R</span> <span class="pre">INT</span></tt>, <tt class="docutils literal"><span class="pre">--rows</span> <span class="pre">INT</span></tt></dt> +<dd>The number of rows to be returned.</dd> +<dt><tt class="docutils literal"><span class="pre">SEARCH_QUERY</span></tt></dt> +<dd>The search query used to identify a a list of items on a server. This option uses the same syntax as the <tt class="docutils literal"><span class="pre">search</span></tt> sub-command.</dd> +</dl> +</div> +<div class="section" id="examples"> +<h2>Examples<a class="headerlink" href="#examples" title="Permalink to this headline">¶</a></h2> +<p>The following examples show how to use this Knife subcommand:</p> +<p><strong>Search by platform ID</strong></p> +<p>To search for the IDs of all nodes running on the Amazon EC2 platform, enter:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife search node <span class="s1">'ec2:*'</span> -i +</pre></div> +</div> +<p>to return something like:</p> +<div class="highlight-bash"><div class="highlight"><pre>4 items found + +ip-0A7CA19F.ec2.internal + +ip-0A58CF8E.ec2.internal + +ip-0A58E134.ec2.internal + +ip-0A7CFFD5.ec2.internal +</pre></div> +</div> +<p><strong>Search by instance type</strong></p> +<p>To search for the instance type (flavor) of all nodes running on the Amazon EC2 platform, enter:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife search node <span class="s1">'ec2:*'</span> -a ec2.instance_type +</pre></div> +</div> +<p>to return something like:</p> +<div class="highlight-bash"><div class="highlight"><pre>4 items found + +ec2.instance_type: m1.large +id: ip-0A7CA19F.ec2.internal + +ec2.instance_type: m1.large +id: ip-0A58CF8E.ec2.internal + +ec2.instance_type: m1.large +id: ip-0A58E134.ec2.internal + +ec2.instance_type: m1.large +id: ip-0A7CFFD5.ec2.internal +</pre></div> +</div> +<p><strong>Search by node</strong></p> +<p>To search for all nodes running Ubuntu, enter:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife search node <span class="s1">'platform:ubuntu'</span> +</pre></div> +</div> +<p><strong>Search by node and environment</strong></p> +<p>To search for all nodes running CentOS in the production environment, enter:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife search node <span class="s1">'chef_environment:production AND platform:centos'</span> +</pre></div> +</div> +<p><strong>Search for nested attributes</strong></p> +<p>To find a nested attribute, use a pattern similar to the following:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife search node <query_to_run> -a <main_attribute>.<nested_attribute> +</pre></div> +</div> +<p><strong>Search for multiple attributes</strong></p> +<p>To build a search query to use more than one attribute, use an underscore (<tt class="docutils literal"><span class="pre">_</span></tt>) to separate each attribute. For example, the following query will search for all nodes running a specific version of Ruby:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife search node <span class="s2">"languages_ruby_version:1.9.3"</span> +</pre></div> +</div> +<p><strong>Search for nested attributes using a search query</strong></p> +<p>To build a search query that can find a nested attribute:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife search node name:<node_name> -a kernel.machine +</pre></div> +</div> +<p><strong>Use a test query</strong></p> +<p>To test a search query that will be used in a <strong>knife ssh</strong> command:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife search node <span class="s2">"role:web NOT name:web03"</span> +</pre></div> +</div> +<p>where the query in the previous example will search all servers that have the <tt class="docutils literal"><span class="pre">web</span></tt> role, but not on the server named <tt class="docutils literal"><span class="pre">web03</span></tt>.</p> +</div> +</div> + + + </div> + + </div> + + + <div class="clearer"></div> + </div> + + + + + </body> +</html>
\ No newline at end of file diff --git a/distro/common/html/knife_show.html b/distro/common/html/knife_show.html new file mode 100644 index 0000000000..acf50a2228 --- /dev/null +++ b/distro/common/html/knife_show.html @@ -0,0 +1,106 @@ + +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> + + +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> + + <title>knife show — chef-client Man Pages</title> + + <link rel="stylesheet" href="_static/guide.css" type="text/css" /> + <link rel="stylesheet" href="_static/pygments.css" type="text/css" /> + + <script type="text/javascript"> + var DOCUMENTATION_OPTIONS = { + URL_ROOT: '', + VERSION: '', + COLLAPSE_INDEX: false, + FILE_SUFFIX: '.html', + HAS_SOURCE: true + }; + </script> + <script type="text/javascript" src="_static/jquery.js"></script> + <script type="text/javascript" src="_static/underscore.js"></script> + <script type="text/javascript" src="_static/doctools.js"></script> + <link rel="shortcut icon" href="_static/chef.ico"/> + + + </head> + <body> +<div style="background-color: #212c35; text-align: left; padding: 0px 0px 0px 0px"> +<a href="http://docs.opscode.com/"><img src="_static/chef_html_logo.png" border="0" alt="Chef"/></a> +</div> + + + + + <div class="document"> + <div class="documentwrapper"> + + <div class="body"> + + <div class="section" id="knife-show"> +<h1>knife show<a class="headerlink" href="#knife-show" title="Permalink to this headline">¶</a></h1> +<p>The <strong>knife show</strong> subcommand is used to view the details of one (or more) objects on the server. This subcommand works similar to <tt class="docutils literal"><span class="pre">knife</span> <span class="pre">cookbook</span> <span class="pre">show</span></tt>, <tt class="docutils literal"><span class="pre">knife</span> <span class="pre">data</span> <span class="pre">bag</span> <span class="pre">show</span></tt>, <tt class="docutils literal"><span class="pre">knife</span> <span class="pre">environment</span> <span class="pre">show</span></tt>, <tt class="docutils literal"><span class="pre">knife</span> <span class="pre">node</span> <span class="pre">show</span></tt>, and <tt class="docutils literal"><span class="pre">knife</span> <span class="pre">role</span> <span class="pre">show</span></tt>, but with a single verb (and a single action).</p> +<div class="section" id="syntax"> +<h2>Syntax<a class="headerlink" href="#syntax" title="Permalink to this headline">¶</a></h2> +<p>This argument has the following syntax:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife show <span class="o">[</span>PATTERN...<span class="o">]</span> <span class="o">(</span>options<span class="o">)</span> +</pre></div> +</div> +</div> +<div class="section" id="options"> +<h2>Options<a class="headerlink" href="#options" title="Permalink to this headline">¶</a></h2> +<div class="admonition note"> +<p class="first admonition-title">Note</p> +<p class="last">Review the list of <a class="reference internal" href="knife_common_options.html"><em>common options</em></a> available to this (and all) Knife subcommands and plugins.</p> +</div> +<p>This subcommand has the following options:</p> +<dl class="docutils"> +<dt><tt class="docutils literal"><span class="pre">-a</span> <span class="pre">ATTR</span></tt>, <tt class="docutils literal"><span class="pre">--attribute</span> <span class="pre">ATTR</span></tt></dt> +<dd>The attribute (or attributes) to show.</dd> +<dt><tt class="docutils literal"><span class="pre">--chef-repo-path</span> <span class="pre">PATH</span></tt></dt> +<dd>The path to the chef-repo. This setting will override the default path to the chef-repo. Default: same as specified by <tt class="docutils literal"><span class="pre">chef_repo_path</span></tt> in config.rb.</dd> +<dt><tt class="docutils literal"><span class="pre">--concurrency</span></tt></dt> +<dd>The number of allowed concurrent connections. Default: <tt class="docutils literal"><span class="pre">10</span></tt>.</dd> +<dt><tt class="docutils literal"><span class="pre">--local</span></tt></dt> +<dd>Indicates that instead of remote files, local files will be shown.</dd> +<dt><tt class="docutils literal"><span class="pre">--repo-mode</span> <span class="pre">MODE</span></tt></dt> +<dd>The layout of the local chef-repo. Possible values: <tt class="docutils literal"><span class="pre">static</span></tt>, <tt class="docutils literal"><span class="pre">everything</span></tt>, or <tt class="docutils literal"><span class="pre">hosted_everything</span></tt>. Use <tt class="docutils literal"><span class="pre">static</span></tt> for just roles, environments, cookbooks, and data bags. By default, <tt class="docutils literal"><span class="pre">everything</span></tt> and <tt class="docutils literal"><span class="pre">hosted_everything</span></tt> are dynamically selected depending on the server type. Default: <tt class="docutils literal"><span class="pre">everything</span></tt> / <tt class="docutils literal"><span class="pre">hosted_everything</span></tt>.</dd> +</dl> +</div> +<div class="section" id="examples"> +<h2>Examples<a class="headerlink" href="#examples" title="Permalink to this headline">¶</a></h2> +<p>The following examples show how to use this Knife subcommand:</p> +<p><strong>Show all cookbooks</strong></p> +<p>To show all cookbooks in the <tt class="docutils literal"><span class="pre">cookbooks/</span></tt> directory:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife show cookbooks/ +</pre></div> +</div> +<p>or, (if already in the <tt class="docutils literal"><span class="pre">cookbooks/</span></tt> directory in the local chef-repo):</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife show +</pre></div> +</div> +<p><strong>Show roles and environments</strong></p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife show roles/ environments/ +</pre></div> +</div> +</div> +</div> + + + </div> + + </div> + + + <div class="clearer"></div> + </div> + + + + + </body> +</html>
\ No newline at end of file diff --git a/distro/common/html/knife_ssh.html b/distro/common/html/knife_ssh.html new file mode 100644 index 0000000000..a8e9f283fa --- /dev/null +++ b/distro/common/html/knife_ssh.html @@ -0,0 +1,179 @@ + +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> + + +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> + + <title>knife ssh — chef-client Man Pages</title> + + <link rel="stylesheet" href="_static/guide.css" type="text/css" /> + <link rel="stylesheet" href="_static/pygments.css" type="text/css" /> + + <script type="text/javascript"> + var DOCUMENTATION_OPTIONS = { + URL_ROOT: '', + VERSION: '', + COLLAPSE_INDEX: false, + FILE_SUFFIX: '.html', + HAS_SOURCE: true + }; + </script> + <script type="text/javascript" src="_static/jquery.js"></script> + <script type="text/javascript" src="_static/underscore.js"></script> + <script type="text/javascript" src="_static/doctools.js"></script> + <link rel="shortcut icon" href="_static/chef.ico"/> + + + </head> + <body> +<div style="background-color: #212c35; text-align: left; padding: 0px 0px 0px 0px"> +<a href="http://docs.opscode.com/"><img src="_static/chef_html_logo.png" border="0" alt="Chef"/></a> +</div> + + + + + <div class="document"> + <div class="documentwrapper"> + + <div class="body"> + + <div class="section" id="knife-ssh"> +<h1>knife ssh<a class="headerlink" href="#knife-ssh" title="Permalink to this headline">¶</a></h1> +<p>The <strong>knife ssh</strong> subcommand is used to invoke SSH commands (in parallel) on a subset of nodes within an organization, based on the results of a search query.</p> +<div class="section" id="syntax"> +<h2>Syntax<a class="headerlink" href="#syntax" title="Permalink to this headline">¶</a></h2> +<p>This argument has the following syntax:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife ssh SEARCH_QUERY SSH_COMMAND <span class="o">(</span>options<span class="o">)</span> +</pre></div> +</div> +</div> +<div class="section" id="options"> +<h2>Options<a class="headerlink" href="#options" title="Permalink to this headline">¶</a></h2> +<div class="admonition note"> +<p class="first admonition-title">Note</p> +<p class="last">Review the list of <a class="reference internal" href="knife_common_options.html"><em>common options</em></a> available to this (and all) Knife subcommands and plugins.</p> +</div> +<p>This subcommand has the following options:</p> +<dl class="docutils"> +<dt><tt class="docutils literal"><span class="pre">-a</span> <span class="pre">SSH_ATTR</span></tt>, <tt class="docutils literal"><span class="pre">--attribute</span> <span class="pre">SSH_ATTR</span></tt></dt> +<dd>The attribute that is used when opening the SSH connection. The default attribute is the FQDN of the host. Other possible values include a public IP address, a private IP address, or a hostname.</dd> +<dt><tt class="docutils literal"><span class="pre">-A</span></tt>, <tt class="docutils literal"><span class="pre">--forward-agent</span></tt></dt> +<dd>Indicates that SSH agent forwarding is enabled.</dd> +<dt><tt class="docutils literal"><span class="pre">-C</span> <span class="pre">NUM</span></tt>, <tt class="docutils literal"><span class="pre">--concurrency</span> <span class="pre">NUM</span></tt></dt> +<dd>The number of allowed concurrent connections.</dd> +<dt><tt class="docutils literal"><span class="pre">-G</span> <span class="pre">GATEWAY</span></tt>, <tt class="docutils literal"><span class="pre">--ssh-gateway</span> <span class="pre">GATEWAY</span></tt></dt> +<dd>The SSH tunnel or gateway that is used to run a bootstrap action on a machine that is not accessible from the workstation.</dd> +<dt><tt class="docutils literal"><span class="pre">-i</span> <span class="pre">IDENTITY_FILE</span></tt>, <tt class="docutils literal"><span class="pre">--identity-file</span> <span class="pre">IDENTIFY_FILE</span></tt></dt> +<dd>The SSH identity file used for authentication. Key-based authentication is recommended.</dd> +<dt><tt class="docutils literal"><span class="pre">-m</span></tt>, <tt class="docutils literal"><span class="pre">--manual-list</span></tt></dt> +<dd>Indicates that a search query is a space-separated list of servers. If there is more than one item in the list, put quotes around the entire list. For example: <tt class="docutils literal"><span class="pre">--manual-list</span> <span class="pre">"server01</span> <span class="pre">server</span> <span class="pre">02</span> <span class="pre">server</span> <span class="pre">03"</span></tt></dd> +<dt><tt class="docutils literal"><span class="pre">--[no-]host-key-verify</span></tt></dt> +<dd>Use <tt class="docutils literal"><span class="pre">--no-host-key-verify</span></tt> to disable host key verification. Default setting: <tt class="docutils literal"><span class="pre">--host-key-verify</span></tt>.</dd> +<dt><tt class="docutils literal"><span class="pre">OTHER</span></tt></dt> +<dd>The shell type. Possible values: <tt class="docutils literal"><span class="pre">interactive</span></tt>, <tt class="docutils literal"><span class="pre">screen</span></tt>, <tt class="docutils literal"><span class="pre">tmux</span></tt>, <tt class="docutils literal"><span class="pre">macterm</span></tt>, or <tt class="docutils literal"><span class="pre">cssh</span></tt>. (<tt class="docutils literal"><span class="pre">csshx</span></tt> is deprecated in favor of <tt class="docutils literal"><span class="pre">cssh</span></tt>.)</dd> +<dt><tt class="docutils literal"><span class="pre">-p</span> <span class="pre">PORT</span></tt>, <tt class="docutils literal"><span class="pre">--ssh-port</span> <span class="pre">PORT</span></tt></dt> +<dd>The SSH port.</dd> +<dt><tt class="docutils literal"><span class="pre">-P</span> <span class="pre">PASSWORD</span></tt>, <tt class="docutils literal"><span class="pre">--ssh-password</span> <span class="pre">PASSWORD</span></tt></dt> +<dd>The SSH password. This can be used to pass the password directly on the command line. If this option is not specified (and a password is required) Knife will prompt for the password.</dd> +<dt><tt class="docutils literal"><span class="pre">SEARCH_QUERY</span></tt></dt> +<dd>The search query used to return a list of servers to be accessed using SSH and the specified <tt class="docutils literal"><span class="pre">SSH_COMMAND</span></tt>. This option uses the same syntax as the search sub-command.</dd> +<dt><tt class="docutils literal"><span class="pre">SSH_COMMAND</span></tt></dt> +<dd>The command that will be run against the results of a search query.</dd> +<dt><tt class="docutils literal"><span class="pre">-x</span> <span class="pre">USER_NAME</span></tt>, <tt class="docutils literal"><span class="pre">--ssh-user</span> <span class="pre">USER_NAME</span></tt></dt> +<dd>The SSH user name.</dd> +</dl> +</div> +<div class="section" id="examples"> +<h2>Examples<a class="headerlink" href="#examples" title="Permalink to this headline">¶</a></h2> +<p>The following examples show how to use this Knife subcommand:</p> +<p><strong>Find server uptime</strong></p> +<p>To find the uptime of all of web servers running Ubuntu on the Amazon EC2 platform, enter:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife ssh <span class="s2">"role:web"</span> <span class="s2">"uptime"</span> -x ubuntu -a ec2.public_hostname +</pre></div> +</div> +<p>to return something like:</p> +<div class="highlight-bash"><div class="highlight"><pre>ec2-174-129-127-206.compute-1.amazonaws.com 13:50:47 up 1 day, 23:26, 1 user, load average: 0.25, 0.18, 0.11 +ec2-67-202-63-102.compute-1.amazonaws.com 13:50:47 up 1 day, 23:33, 1 user, load average: 0.12, 0.13, 0.10 +ec2-184-73-9-250.compute-1.amazonaws.com 13:50:48 up 16:45, 1 user, load average: 0.30, 0.22, 0.13 +ec2-75-101-240-230.compute-1.amazonaws.com 13:50:48 up 1 day, 22:59, 1 user, load average: 0.24, 0.17, 0.11 +ec2-184-73-60-141.compute-1.amazonaws.com 13:50:48 up 1 day, 23:30, 1 user, load average: 0.32, 0.17, 0.15 +</pre></div> +</div> +<p><strong>Run the chef-client on all nodes</strong></p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife ssh <span class="s1">'name:*'</span> <span class="s1">'sudo chef-client'</span> +</pre></div> +</div> +<p><strong>Force a chef-client run</strong></p> +<p>To force a chef-client run on all of the web servers running Ubuntu on the Amazon EC2 platform, enter:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife ssh <span class="s2">"role:web"</span> <span class="s2">"sudo chef-client"</span> -x ubuntu -a ec2.public_hostname +</pre></div> +</div> +<p>to return something like:</p> +<div class="highlight-bash"><div class="highlight"><pre>ec2-67-202-63-102.compute-1.amazonaws.com <span class="o">[</span>Fri, 22 Oct 2010 14:18:37 +0000<span class="o">]</span> INFO: Starting Chef Run <span class="o">(</span>Version 0.9.10<span class="o">)</span> +ec2-174-129-127-206.compute-1.amazonaws.com <span class="o">[</span>Fri, 22 Oct 2010 14:18:37 +0000<span class="o">]</span> INFO: Starting Chef Run <span class="o">(</span>Version 0.9.10<span class="o">)</span> +ec2-184-73-9-250.compute-1.amazonaws.com <span class="o">[</span>Fri, 22 Oct 2010 14:18:38 +0000<span class="o">]</span> INFO: Starting Chef Run <span class="o">(</span>Version 0.9.10<span class="o">)</span> +ec2-75-101-240-230.compute-1.amazonaws.com <span class="o">[</span>Fri, 22 Oct 2010 14:18:38 +0000<span class="o">]</span> INFO: Starting Chef Run <span class="o">(</span>Version 0.9.10<span class="o">)</span> +ec2-184-73-60-141.compute-1.amazonaws.com <span class="o">[</span>Fri, 22 Oct 2010 14:18:38 +0000<span class="o">]</span> INFO: Starting Chef Run <span class="o">(</span>Version 0.9.10<span class="o">)</span> +ec2-174-129-127-206.compute-1.amazonaws.com <span class="o">[</span>Fri, 22 Oct 2010 14:18:39 +0000<span class="o">]</span> INFO: Chef Run <span class="nb">complete </span>in 1.419243 seconds +ec2-174-129-127-206.compute-1.amazonaws.com <span class="o">[</span>Fri, 22 Oct 2010 14:18:39 +0000<span class="o">]</span> INFO: cleaning the checksum cache +ec2-174-129-127-206.compute-1.amazonaws.com <span class="o">[</span>Fri, 22 Oct 2010 14:18:39 +0000<span class="o">]</span> INFO: Running report handlers +ec2-174-129-127-206.compute-1.amazonaws.com <span class="o">[</span>Fri, 22 Oct 2010 14:18:39 +0000<span class="o">]</span> INFO: Report handlers <span class="nb">complete</span> +ec2-67-202-63-102.compute-1.amazonaws.com <span class="o">[</span>Fri, 22 Oct 2010 14:18:39 +0000<span class="o">]</span> INFO: Chef Run <span class="nb">complete </span>in 1.578265 seconds +ec2-67-202-63-102.compute-1.amazonaws.com <span class="o">[</span>Fri, 22 Oct 2010 14:18:39 +0000<span class="o">]</span> INFO: cleaning the checksum cache +ec2-67-202-63-102.compute-1.amazonaws.com <span class="o">[</span>Fri, 22 Oct 2010 14:18:39 +0000<span class="o">]</span> INFO: Running report handlers +ec2-67-202-63-102.compute-1.amazonaws.com <span class="o">[</span>Fri, 22 Oct 2010 14:18:39 +0000<span class="o">]</span> INFO: Report handlers <span class="nb">complete</span> +ec2-184-73-9-250.compute-1.amazonaws.com <span class="o">[</span>Fri, 22 Oct 2010 14:18:40 +0000<span class="o">]</span> INFO: Chef Run <span class="nb">complete </span>in 1.638884 seconds +ec2-184-73-9-250.compute-1.amazonaws.com <span class="o">[</span>Fri, 22 Oct 2010 14:18:40 +0000<span class="o">]</span> INFO: cleaning the checksum cache +ec2-184-73-9-250.compute-1.amazonaws.com <span class="o">[</span>Fri, 22 Oct 2010 14:18:40 +0000<span class="o">]</span> INFO: Running report handlers +ec2-184-73-9-250.compute-1.amazonaws.com <span class="o">[</span>Fri, 22 Oct 2010 14:18:40 +0000<span class="o">]</span> INFO: Report handlers <span class="nb">complete</span> +ec2-75-101-240-230.compute-1.amazonaws.com <span class="o">[</span>Fri, 22 Oct 2010 14:18:40 +0000<span class="o">]</span> INFO: Chef Run <span class="nb">complete </span>in 1.540257 seconds +ec2-75-101-240-230.compute-1.amazonaws.com <span class="o">[</span>Fri, 22 Oct 2010 14:18:40 +0000<span class="o">]</span> INFO: cleaning the checksum cache +ec2-75-101-240-230.compute-1.amazonaws.com <span class="o">[</span>Fri, 22 Oct 2010 14:18:40 +0000<span class="o">]</span> INFO: Running report handlers +ec2-75-101-240-230.compute-1.amazonaws.com <span class="o">[</span>Fri, 22 Oct 2010 14:18:40 +0000<span class="o">]</span> INFO: Report handlers <span class="nb">complete</span> +ec2-184-73-60-141.compute-1.amazonaws.com <span class="o">[</span>Fri, 22 Oct 2010 14:18:40 +0000<span class="o">]</span> INFO: Chef Run <span class="nb">complete </span>in 1.502489 seconds +ec2-184-73-60-141.compute-1.amazonaws.com <span class="o">[</span>Fri, 22 Oct 2010 14:18:40 +0000<span class="o">]</span> INFO: cleaning the checksum cache +ec2-184-73-60-141.compute-1.amazonaws.com <span class="o">[</span>Fri, 22 Oct 2010 14:18:40 +0000<span class="o">]</span> INFO: Running report handlers +ec2-184-73-60-141.compute-1.amazonaws.com <span class="o">[</span>Fri, 22 Oct 2010 14:18:40 +0000<span class="o">]</span> INFO: Report handlers <span class="nb">complete</span> +</pre></div> +</div> +<p><strong>Run a command based on search query</strong></p> +<p>To query for all nodes that have the “webserver” role and then use SSH to run the command “sudo chef-client”, enter:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife ssh <span class="s2">"role:webserver"</span> <span class="s2">"sudo chef-client"</span> +</pre></div> +</div> +<p><strong>Upgrade all nodes</strong></p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife ssh name:* <span class="s2">"sudo aptitude upgrade -y"</span> +</pre></div> +</div> +<p><strong>Specify the shell type</strong></p> +<p>To specify the shell type used on the nodes returned by a search query:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife ssh roles:opscode-omnitruck macterm +</pre></div> +</div> +<p>where <tt class="docutils literal"><span class="pre">screen</span></tt> is one of the following values: <tt class="docutils literal"><span class="pre">cssh</span></tt>, <tt class="docutils literal"><span class="pre">interactive</span></tt>, <tt class="docutils literal"><span class="pre">macterm</span></tt>, <tt class="docutils literal"><span class="pre">screen</span></tt>, or <tt class="docutils literal"><span class="pre">tmux</span></tt>. If the node does not have the shell type installed, Knife will return an error similar to the following:</p> +<div class="highlight-bash"><div class="highlight"><pre>you need the rb-appscript gem to use knife ssh macterm. +<span class="sb">`</span><span class="o">(</span>sudo<span class="o">)</span> gem install rb-appscript<span class="sb">`</span> to install +ERROR: LoadError: cannot load such file -- appscript +</pre></div> +</div> +</div> +</div> + + + </div> + + </div> + + + <div class="clearer"></div> + </div> + + + + + </body> +</html>
\ No newline at end of file diff --git a/distro/common/html/knife_status.html b/distro/common/html/knife_status.html new file mode 100644 index 0000000000..ab4e11400d --- /dev/null +++ b/distro/common/html/knife_status.html @@ -0,0 +1,142 @@ + +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> + + +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> + + <title>knife status — chef-client Man Pages</title> + + <link rel="stylesheet" href="_static/guide.css" type="text/css" /> + <link rel="stylesheet" href="_static/pygments.css" type="text/css" /> + + <script type="text/javascript"> + var DOCUMENTATION_OPTIONS = { + URL_ROOT: '', + VERSION: '', + COLLAPSE_INDEX: false, + FILE_SUFFIX: '.html', + HAS_SOURCE: true + }; + </script> + <script type="text/javascript" src="_static/jquery.js"></script> + <script type="text/javascript" src="_static/underscore.js"></script> + <script type="text/javascript" src="_static/doctools.js"></script> + <link rel="shortcut icon" href="_static/chef.ico"/> + + + </head> + <body> +<div style="background-color: #212c35; text-align: left; padding: 0px 0px 0px 0px"> +<a href="http://docs.opscode.com/"><img src="_static/chef_html_logo.png" border="0" alt="Chef"/></a> +</div> + + + + + <div class="document"> + <div class="documentwrapper"> + + <div class="body"> + + <div class="section" id="knife-status"> +<h1>knife status<a class="headerlink" href="#knife-status" title="Permalink to this headline">¶</a></h1> +<p>The <strong>knife status</strong> subcommand is used to display a brief summary of the nodes on a server, including the time of the most recent successful chef-client run.</p> +<div class="section" id="syntax"> +<h2>Syntax<a class="headerlink" href="#syntax" title="Permalink to this headline">¶</a></h2> +<p>This argument has the following syntax:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife status <span class="o">(</span>options<span class="o">)</span> +</pre></div> +</div> +</div> +<div class="section" id="options"> +<h2>Options<a class="headerlink" href="#options" title="Permalink to this headline">¶</a></h2> +<div class="admonition note"> +<p class="first admonition-title">Note</p> +<p class="last">Review the list of <a class="reference internal" href="knife_common_options.html"><em>common options</em></a> available to this (and all) Knife subcommands and plugins.</p> +</div> +<p>This subcommand has the following options:</p> +<dl class="docutils"> +<dt><tt class="docutils literal"><span class="pre">QUERY</span></tt></dt> +<dd>The search query used to identify a a list of items on a server. This option uses the same syntax as the <tt class="docutils literal"><span class="pre">search</span></tt> sub-command.</dd> +<dt><tt class="docutils literal"><span class="pre">-H</span></tt>, <tt class="docutils literal"><span class="pre">--hide-healthy</span></tt></dt> +<dd>Indicates that nodes on which a chef-client run has occurred within the previous hour will be hidden.</dd> +<dt><tt class="docutils literal"><span class="pre">-r</span> <span class="pre">RUN_LIST</span></tt>, <tt class="docutils literal"><span class="pre">--run-list</span> <span class="pre">RUN_LIST</span></tt></dt> +<dd>A comma-separated list of roles and/or recipes to be applied.</dd> +<dt><tt class="docutils literal"><span class="pre">-s</span></tt>, <tt class="docutils literal"><span class="pre">--sort-reverse</span></tt></dt> +<dd>Indicates that the list will be sorted by last run time, descending.</dd> +</dl> +</div> +<div class="section" id="examples"> +<h2>Examples<a class="headerlink" href="#examples" title="Permalink to this headline">¶</a></h2> +<p>The following examples show how to use this Knife subcommand:</p> +<p><strong>View status, include run-lists</strong></p> +<p>To include run lists in the status, enter:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife status --run-list +</pre></div> +</div> +<p>to return something like:</p> +<div class="highlight-bash"><div class="highlight"><pre>20 hours ago, dev-vm.chisamore.com, ubuntu 10.04, dev-vm.chisamore.com, 10.66.44.126, role<span class="o">[</span>lb<span class="o">]</span>. +3 hours ago, i-225f954f, ubuntu 10.04, ec2-67-202-63-102.compute-1.amazonaws.com, 67.202.63.102, role<span class="o">[</span>web<span class="o">]</span>. +3 hours ago, i-a45298c9, ubuntu 10.04, ec2-174-129-127-206.compute-1.amazonaws.com, 174.129.127.206, role<span class="o">[</span>web<span class="o">]</span>. +3 hours ago, i-5272a43f, ubuntu 10.04, ec2-184-73-9-250.compute-1.amazonaws.com, 184.73.9.250, role<span class="o">[</span>web<span class="o">]</span>. +3 hours ago, i-226ca64f, ubuntu 10.04, ec2-75-101-240-230.compute-1.amazonaws.com, 75.101.240.230, role<span class="o">[</span>web<span class="o">]</span>. +3 hours ago, i-f65c969b, ubuntu 10.04, ec2-184-73-60-141.compute-1.amazonaws.com, 184.73.60.141, role<span class="o">[</span>web<span class="o">]</span>. +</pre></div> +</div> +<p><strong>View status using a date range</strong></p> +<p>To show the status for nodes on which the chef-client did not run successfully within the past hour, enter:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife status --hide-healthy +</pre></div> +</div> +<p>to return something like:</p> +<div class="highlight-bash"><div class="highlight"><pre>1 hour ago, i-256f884f, ubuntu 12.04, ec2-67-202-63-102.compute-1.amazonaws.com, 67.202.63.102, role<span class="o">[</span>web<span class="o">]</span>. +1 hour ago, i-a47823c9, ubuntu 10.04, ec2-174-129-127-206.compute-1.amazonaws.com, 184.129.143.111, role<span class="o">[</span>lb<span class="o">]</span>. +</pre></div> +</div> +<p><strong>View status using a query</strong></p> +<p>To show the status of a subset of nodes that are returned by a specific query, enter:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife status <span class="s2">"role:web"</span> --run-list +</pre></div> +</div> +<p>to return something like:</p> +<div class="highlight-bash"><div class="highlight"><pre>3 hours ago, i-225f954f, ubuntu 10.04, ec2-67-202-63-102.compute-1.amazonaws.com, 67.202.63.102, role<span class="o">[</span>web<span class="o">]</span>. +3 hours ago, i-a45298c9, ubuntu 10.04, ec2-174-129-127-206.compute-1.amazonaws.com, 174.129.127.206, role<span class="o">[</span>web<span class="o">]</span>. +3 hours ago, i-5272a43f, ubuntu 10.04, ec2-184-73-9-250.compute-1.amazonaws.com, 184.73.9.250, role<span class="o">[</span>web<span class="o">]</span>. +3 hours ago, i-226ca64f, ubuntu 10.04, ec2-75-101-240-230.compute-1.amazonaws.com, 75.101.240.230, role<span class="o">[</span>web<span class="o">]</span>. +3 hours ago, i-f65c969b, ubuntu 10.04, ec2-184-73-60-141.compute-1.amazonaws.com, 184.73.60.141, role<span class="o">[</span>web<span class="o">]</span>. +</pre></div> +</div> +<p><strong>View status for all nodes</strong></p> +<p>To view the status of all nodes in the organization, enter:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife status +</pre></div> +</div> +<p>to return something like:</p> +<div class="highlight-bash"><div class="highlight"><pre>20 hours ago, dev-vm.chisamore.com, ubuntu 10.04, dev-vm.chisamore.com, 10.66.44.126 +3 hours ago, i-225f954f, ubuntu 10.04, ec2-67-202-63-102.compute-1.amazonaws.com, 67.202.63.102 +3 hours ago, i-a45298c9, ubuntu 10.04, ec2-174-129-127-206.compute-1.amazonaws.com, 174.129.127.206 +3 hours ago, i-5272a43f, ubuntu 10.04, ec2-184-73-9-250.compute-1.amazonaws.com, 184.73.9.250 +3 hours ago, i-226ca64f, ubuntu 10.04, ec2-75-101-240-230.compute-1.amazonaws.com, 75.101.240.230 +3 hours ago, i-f65c969b, ubuntu 10.04, ec2-184-73-60-141.compute-1.amazonaws.com, 184.73.60.141 +</pre></div> +</div> +</div> +</div> + + + </div> + + </div> + + + <div class="clearer"></div> + </div> + + + + + </body> +</html>
\ No newline at end of file diff --git a/distro/common/html/knife_tag.html b/distro/common/html/knife_tag.html new file mode 100644 index 0000000000..0aab5089b9 --- /dev/null +++ b/distro/common/html/knife_tag.html @@ -0,0 +1,140 @@ + +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> + + +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> + + <title>knife tag — chef-client Man Pages</title> + + <link rel="stylesheet" href="_static/guide.css" type="text/css" /> + <link rel="stylesheet" href="_static/pygments.css" type="text/css" /> + + <script type="text/javascript"> + var DOCUMENTATION_OPTIONS = { + URL_ROOT: '', + VERSION: '', + COLLAPSE_INDEX: false, + FILE_SUFFIX: '.html', + HAS_SOURCE: true + }; + </script> + <script type="text/javascript" src="_static/jquery.js"></script> + <script type="text/javascript" src="_static/underscore.js"></script> + <script type="text/javascript" src="_static/doctools.js"></script> + <link rel="shortcut icon" href="_static/chef.ico"/> + + + </head> + <body> +<div style="background-color: #212c35; text-align: left; padding: 0px 0px 0px 0px"> +<a href="http://docs.opscode.com/"><img src="_static/chef_html_logo.png" border="0" alt="Chef"/></a> +</div> + + + + + <div class="document"> + <div class="documentwrapper"> + + <div class="body"> + + <div class="section" id="knife-tag"> +<h1>knife tag<a class="headerlink" href="#knife-tag" title="Permalink to this headline">¶</a></h1> +<p>A tag is a custom description that is applied to a node. A tag, once applied, can be helpful when managing nodes using Knife or when building recipes by providing alternate methods of grouping similar types of information.</p> +<p>The <strong>knife tag</strong> subcommand is used to apply tags to nodes on a server.</p> +<div class="admonition note"> +<p class="first admonition-title">Note</p> +<p class="last">Review the list of <a class="reference internal" href="knife_common_options.html"><em>common options</em></a> available to this (and all) Knife subcommands and plugins.</p> +</div> +<div class="section" id="create"> +<h2>create<a class="headerlink" href="#create" title="Permalink to this headline">¶</a></h2> +<p>The <tt class="docutils literal"><span class="pre">create</span></tt> argument is used to add one or more tags to a node.</p> +<div class="section" id="syntax"> +<h3>Syntax<a class="headerlink" href="#syntax" title="Permalink to this headline">¶</a></h3> +<p>This argument has the following syntax:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife tag create NODE_NAME <span class="o">[</span>TAG...<span class="o">]</span> +</pre></div> +</div> +</div> +<div class="section" id="options"> +<h3>Options<a class="headerlink" href="#options" title="Permalink to this headline">¶</a></h3> +<p>This command does not have any specific options.</p> +</div> +<div class="section" id="examples"> +<h3>Examples<a class="headerlink" href="#examples" title="Permalink to this headline">¶</a></h3> +<p>The following examples show how to use this Knife subcommand:</p> +<p><strong>Create tags</strong></p> +<p>To create tags named “seattle”, “portland”, and “vancouver”, enter:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife tag create node seattle portland vancouver +</pre></div> +</div> +</div> +</div> +<div class="section" id="delete"> +<h2>delete<a class="headerlink" href="#delete" title="Permalink to this headline">¶</a></h2> +<p>The <tt class="docutils literal"><span class="pre">delete</span></tt> argument is used to delete one or more tags from a node.</p> +<div class="section" id="id1"> +<h3>Syntax<a class="headerlink" href="#id1" title="Permalink to this headline">¶</a></h3> +<p>This argument has the following syntax:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife tag delete NODE_NAME <span class="o">[</span>TAG...<span class="o">]</span> +</pre></div> +</div> +</div> +<div class="section" id="id2"> +<h3>Options<a class="headerlink" href="#id2" title="Permalink to this headline">¶</a></h3> +<p>This command does not have any specific options.</p> +</div> +<div class="section" id="id3"> +<h3>Examples<a class="headerlink" href="#id3" title="Permalink to this headline">¶</a></h3> +<p>The following examples show how to use this Knife subcommand:</p> +<p><strong>Delete tags</strong></p> +<p>To delete tags named “denver” and “phoenix”, enter:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife tag delete node denver phoenix +</pre></div> +</div> +<p>Type <tt class="docutils literal"><span class="pre">Y</span></tt> to confirm a deletion.</p> +</div> +</div> +<div class="section" id="list"> +<h2>list<a class="headerlink" href="#list" title="Permalink to this headline">¶</a></h2> +<p>The <tt class="docutils literal"><span class="pre">list</span></tt> argument is used to list all of the tags that have been applied to a node.</p> +<div class="section" id="id4"> +<h3>Syntax<a class="headerlink" href="#id4" title="Permalink to this headline">¶</a></h3> +<p>This argument has the following syntax:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife tag list <span class="o">[</span>NODE_NAME...<span class="o">]</span> +</pre></div> +</div> +</div> +<div class="section" id="id5"> +<h3>Options<a class="headerlink" href="#id5" title="Permalink to this headline">¶</a></h3> +<p>This command does not have any specific options.</p> +</div> +<div class="section" id="id6"> +<h3>Examples<a class="headerlink" href="#id6" title="Permalink to this headline">¶</a></h3> +<p>The following examples show how to use this Knife subcommand:</p> +<p><strong>View a list of tags</strong></p> +<p>To view the tags for a node named “devops_prod1”, enter:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife tag list devops_prod1 +</pre></div> +</div> +</div> +</div> +</div> + + + </div> + + </div> + + + <div class="clearer"></div> + </div> + + + + + </body> +</html>
\ No newline at end of file diff --git a/distro/common/html/knife_upload.html b/distro/common/html/knife_upload.html new file mode 100644 index 0000000000..b1a4de29a7 --- /dev/null +++ b/distro/common/html/knife_upload.html @@ -0,0 +1,155 @@ + +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> + + +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> + + <title>knife upload — chef-client Man Pages</title> + + <link rel="stylesheet" href="_static/guide.css" type="text/css" /> + <link rel="stylesheet" href="_static/pygments.css" type="text/css" /> + + <script type="text/javascript"> + var DOCUMENTATION_OPTIONS = { + URL_ROOT: '', + VERSION: '', + COLLAPSE_INDEX: false, + FILE_SUFFIX: '.html', + HAS_SOURCE: true + }; + </script> + <script type="text/javascript" src="_static/jquery.js"></script> + <script type="text/javascript" src="_static/underscore.js"></script> + <script type="text/javascript" src="_static/doctools.js"></script> + <link rel="shortcut icon" href="_static/chef.ico"/> + + + </head> + <body> +<div style="background-color: #212c35; text-align: left; padding: 0px 0px 0px 0px"> +<a href="http://docs.opscode.com/"><img src="_static/chef_html_logo.png" border="0" alt="Chef"/></a> +</div> + + + + + <div class="document"> + <div class="documentwrapper"> + + <div class="body"> + + <div class="section" id="knife-upload"> +<h1>knife upload<a class="headerlink" href="#knife-upload" title="Permalink to this headline">¶</a></h1> +<p>The <strong>knife upload</strong> subcommand is used to upload roles, cookbooks, environments, and data bags to the server from the current working directory in the chef-repo. This subcommand is often used in conjunction with <tt class="docutils literal"><span class="pre">knife</span> <span class="pre">diff</span></tt>, which can be used to see exactly what changes will be uploaded, and then <tt class="docutils literal"><span class="pre">knife</span> <span class="pre">download</span></tt>, which does the opposite of <tt class="docutils literal"><span class="pre">knife</span> <span class="pre">upload</span></tt>.</p> +<div class="section" id="syntax"> +<h2>Syntax<a class="headerlink" href="#syntax" title="Permalink to this headline">¶</a></h2> +<p>This argument has the following syntax:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife upload <span class="o">[</span>PATTERN...<span class="o">]</span> <span class="o">(</span>options<span class="o">)</span> +</pre></div> +</div> +</div> +<div class="section" id="options"> +<h2>Options<a class="headerlink" href="#options" title="Permalink to this headline">¶</a></h2> +<div class="admonition note"> +<p class="first admonition-title">Note</p> +<p class="last">Review the list of <a class="reference internal" href="knife_common_options.html"><em>common options</em></a> available to this (and all) Knife subcommands and plugins.</p> +</div> +<p>This subcommand has the following options:</p> +<dl class="docutils"> +<dt><tt class="docutils literal"><span class="pre">--chef-repo-path</span> <span class="pre">PATH</span></tt></dt> +<dd>The path to the chef-repo. This setting will override the default path to the chef-repo. Default: same as specified by <tt class="docutils literal"><span class="pre">chef_repo_path</span></tt> in config.rb.</dd> +<dt><tt class="docutils literal"><span class="pre">--concurrency</span></tt></dt> +<dd>The number of allowed concurrent connections. Default: <tt class="docutils literal"><span class="pre">10</span></tt>.</dd> +<dt><tt class="docutils literal"><span class="pre">--[no-]diff</span></tt></dt> +<dd>Indicates that only new and modified files will be uploaded. Set to <tt class="docutils literal"><span class="pre">false</span></tt> to upload all files. Default: <tt class="docutils literal"><span class="pre">true</span></tt>.</dd> +<dt><tt class="docutils literal"><span class="pre">--[no-]force</span></tt></dt> +<dd>Use <tt class="docutils literal"><span class="pre">--force</span></tt> to upload roles, cookbooks, etc. even if the file in the directory is identical (by default, no <tt class="docutils literal"><span class="pre">POST</span></tt> or <tt class="docutils literal"><span class="pre">PUT</span></tt> is performed unless an actual change would be made). Default: <tt class="docutils literal"><span class="pre">--no-force</span></tt>.</dd> +<dt><tt class="docutils literal"><span class="pre">--[no-]freeze</span></tt></dt> +<dd>Indicates that a cookbook cannot be modified; any changes to this cookbook must be included as a new version. Only the <tt class="docutils literal"><span class="pre">--force</span></tt> option can override this setting. Default: <tt class="docutils literal"><span class="pre">false</span></tt>.</dd> +<dt><tt class="docutils literal"><span class="pre">-n</span></tt>, <tt class="docutils literal"><span class="pre">--dry-run</span></tt></dt> +<dd>Indicates that no action is taken and that results are only printed out. Default: <tt class="docutils literal"><span class="pre">false</span></tt>.</dd> +<dt><tt class="docutils literal"><span class="pre">--[no-]purge</span></tt></dt> +<dd>Use <tt class="docutils literal"><span class="pre">--purge</span></tt> to delete roles, cookbooks, etc. from the server if their corresponding files do not exist in the chef-repo. By default, such objects are left alone and NOT purged. Default: <tt class="docutils literal"><span class="pre">--no-purge</span></tt>.</dd> +<dt><tt class="docutils literal"><span class="pre">--[no-]recurse</span></tt></dt> +<dd>Use <tt class="docutils literal"><span class="pre">--no-recurse</span></tt> to disable uploading a directory recursively. Default: <tt class="docutils literal"><span class="pre">--recurse</span></tt>.</dd> +<dt><tt class="docutils literal"><span class="pre">--repo-mode</span> <span class="pre">MODE</span></tt></dt> +<dd>The layout of the local chef-repo. Possible values: <tt class="docutils literal"><span class="pre">static</span></tt>, <tt class="docutils literal"><span class="pre">everything</span></tt>, or <tt class="docutils literal"><span class="pre">hosted_everything</span></tt>. Use <tt class="docutils literal"><span class="pre">static</span></tt> for just roles, environments, cookbooks, and data bags. By default, <tt class="docutils literal"><span class="pre">everything</span></tt> and <tt class="docutils literal"><span class="pre">hosted_everything</span></tt> are dynamically selected depending on the server type. Default: <tt class="docutils literal"><span class="pre">everything</span></tt> / <tt class="docutils literal"><span class="pre">hosted_everything</span></tt>.</dd> +</dl> +</div> +<div class="section" id="examples"> +<h2>Examples<a class="headerlink" href="#examples" title="Permalink to this headline">¶</a></h2> +<p>The following examples show how to use this Knife subcommand:</p> +<p><strong>Upload the entire chef-repo</strong></p> +<p>Browse to the top level of the chef-repo and enter:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife upload +</pre></div> +</div> +<p>or from anywhere in the chef-repo, enter:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife upload / +</pre></div> +</div> +<p><strong>Upload the /cookbooks directory</strong></p> +<p>Browse to the top level of the chef-repo and enter:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife upload cookbooks +</pre></div> +</div> +<p>or from anywhere in the chef-repo, enter:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife upload /cookbooks +</pre></div> +</div> +<p><strong>Upload the /environments directory</strong></p> +<p>Browse to the top level of the chef-repo and enter:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife upload environments +</pre></div> +</div> +<p>or from anywhere in the chef-repo, enter:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife upload /environments +</pre></div> +</div> +<p><strong>Upload a single environment</strong></p> +<p>Browse to the top level of the chef-repo and enter:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife upload environments/production.json +</pre></div> +</div> +<p>or from the <tt class="docutils literal"><span class="pre">environments/</span></tt> directory, enter:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife upload production.json +</pre></div> +</div> +<p><strong>Upload the /roles directory</strong></p> +<p>Browse to the top level of the chef-repo and enter:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife upload roles +</pre></div> +</div> +<p>or from anywhere in the chef-repo, enter:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife upload /roles +</pre></div> +</div> +<p><strong>Upload cookbooks and roles</strong></p> +<p>Browse to the top level of the chef-repo and enter:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife upload cookbooks/apache<span class="se">\*</span> roles/webserver.json +</pre></div> +</div> +<p><strong>Use output of knife deps to pass command to knife upload</strong></p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife upload <span class="sb">`</span>knife deps nodes/*.json<span class="sb">`</span> +</pre></div> +</div> +</div> +</div> + + + </div> + + </div> + + + <div class="clearer"></div> + </div> + + + + + </body> +</html>
\ No newline at end of file diff --git a/distro/common/html/knife_user.html b/distro/common/html/knife_user.html new file mode 100644 index 0000000000..cd07585fc8 --- /dev/null +++ b/distro/common/html/knife_user.html @@ -0,0 +1,244 @@ + +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> + + +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> + + <title>knife user — chef-client Man Pages</title> + + <link rel="stylesheet" href="_static/guide.css" type="text/css" /> + <link rel="stylesheet" href="_static/pygments.css" type="text/css" /> + + <script type="text/javascript"> + var DOCUMENTATION_OPTIONS = { + URL_ROOT: '', + VERSION: '', + COLLAPSE_INDEX: false, + FILE_SUFFIX: '.html', + HAS_SOURCE: true + }; + </script> + <script type="text/javascript" src="_static/jquery.js"></script> + <script type="text/javascript" src="_static/underscore.js"></script> + <script type="text/javascript" src="_static/doctools.js"></script> + <link rel="shortcut icon" href="_static/chef.ico"/> + + + </head> + <body> +<div style="background-color: #212c35; text-align: left; padding: 0px 0px 0px 0px"> +<a href="http://docs.opscode.com/"><img src="_static/chef_html_logo.png" border="0" alt="Chef"/></a> +</div> + + + + + <div class="document"> + <div class="documentwrapper"> + + <div class="body"> + + <div class="section" id="knife-user"> +<h1>knife user<a class="headerlink" href="#knife-user" title="Permalink to this headline">¶</a></h1> +<p>The <strong>knife user</strong> subcommand is used to manage the list of users and their associated RSA public key-pairs.</p> +<div class="admonition note"> +<p class="first admonition-title">Note</p> +<p class="last">This subcommand ONLY works when run against the open source server and will not run against Enterprise Chef (including hosted Enterprise Chef), or Private Chef.</p> +</div> +<div class="admonition note"> +<p class="first admonition-title">Note</p> +<p class="last">Review the list of <a class="reference internal" href="knife_common_options.html"><em>common options</em></a> available to this (and all) Knife subcommands and plugins.</p> +</div> +<div class="section" id="create"> +<h2>create<a class="headerlink" href="#create" title="Permalink to this headline">¶</a></h2> +<p>The <tt class="docutils literal"><span class="pre">create</span></tt> argument is used to create a user. This process will generate an RSA key pair for the named user. The public key will be stored on the server and the private key will be displayed on <tt class="docutils literal"><span class="pre">STDOUT</span></tt> or written to a named file.</p> +<ul class="simple"> +<li>For the user, the private key should be copied to the system as <tt class="docutils literal"><span class="pre">/etc/chef/client.pem</span></tt>.</li> +<li>For Knife, the private key is typically copied to <tt class="docutils literal"><span class="pre">~/.chef/client_name.pem</span></tt> and referenced in the knife.rb configuration file.</li> +</ul> +<div class="section" id="syntax"> +<h3>Syntax<a class="headerlink" href="#syntax" title="Permalink to this headline">¶</a></h3> +<p>This argument has the following syntax:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife user create USER_NAME <span class="o">(</span>options<span class="o">)</span> +</pre></div> +</div> +</div> +<div class="section" id="options"> +<h3>Options<a class="headerlink" href="#options" title="Permalink to this headline">¶</a></h3> +<p>This argument has the following options:</p> +<dl class="docutils"> +<dt><tt class="docutils literal"><span class="pre">-a</span></tt>, <tt class="docutils literal"><span class="pre">--admin</span></tt></dt> +<dd>Indicates that a client will be created as an admin client. This is required when users of the open source server need to access the Chef Server API as an administrator. This option only works when used with the open source server and will have no effect when used with Enterprise Chef.</dd> +<dt><tt class="docutils literal"><span class="pre">-f</span> <span class="pre">FILE_NAME</span></tt>, <tt class="docutils literal"><span class="pre">--file</span> <span class="pre">FILE_NAME</span></tt></dt> +<dd>Indicates that the private key will be saved to a specified file name.</dd> +<dt><tt class="docutils literal"><span class="pre">-p</span> <span class="pre">PASSWORD</span></tt>, <tt class="docutils literal"><span class="pre">--password</span> <span class="pre">PASSWORD</span></tt></dt> +<dd>The user password.</dd> +<dt><tt class="docutils literal"><span class="pre">--user-key</span> <span class="pre">FILE_NAME</span></tt></dt> +<dd>All users are assigned a public key. Use to write the public key to a file.</dd> +</dl> +</div> +<div class="section" id="examples"> +<h3>Examples<a class="headerlink" href="#examples" title="Permalink to this headline">¶</a></h3> +<p>The following examples show how to use this Knife subcommand:</p> +<p><strong>Create a user</strong></p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife user create <span class="s2">"Radio Birdman"</span> -f /keys/user_name +</pre></div> +</div> +</div> +</div> +<div class="section" id="delete"> +<h2>delete<a class="headerlink" href="#delete" title="Permalink to this headline">¶</a></h2> +<p>The <tt class="docutils literal"><span class="pre">delete</span></tt> argument is used to delete a registered user.</p> +<div class="section" id="id1"> +<h3>Syntax<a class="headerlink" href="#id1" title="Permalink to this headline">¶</a></h3> +<p>This argument has the following syntax:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife user delete USER_NAME +</pre></div> +</div> +</div> +<div class="section" id="id2"> +<h3>Options<a class="headerlink" href="#id2" title="Permalink to this headline">¶</a></h3> +<p>This command does not have any specific options.</p> +</div> +<div class="section" id="id3"> +<h3>Examples<a class="headerlink" href="#id3" title="Permalink to this headline">¶</a></h3> +<p>The following examples show how to use this Knife subcommand:</p> +<p><strong>Delete a user</strong></p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife user delete <span class="s2">"Steve Danno"</span> +</pre></div> +</div> +</div> +</div> +<div class="section" id="edit"> +<h2>edit<a class="headerlink" href="#edit" title="Permalink to this headline">¶</a></h2> +<p>The <tt class="docutils literal"><span class="pre">edit</span></tt> argument is used to edit the details of a user. When this argument is run, Knife will open $EDITOR. When finished, Knife will update the server with those changes.</p> +<div class="section" id="id4"> +<h3>Syntax<a class="headerlink" href="#id4" title="Permalink to this headline">¶</a></h3> +<p>This argument has the following syntax:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife user edit USER_NAME +</pre></div> +</div> +</div> +<div class="section" id="id5"> +<h3>Options<a class="headerlink" href="#id5" title="Permalink to this headline">¶</a></h3> +<p>This command does not have any specific options.</p> +</div> +<div class="section" id="id6"> +<h3>Examples<a class="headerlink" href="#id6" title="Permalink to this headline">¶</a></h3> +<p>None.</p> +</div> +</div> +<div class="section" id="list"> +<h2>list<a class="headerlink" href="#list" title="Permalink to this headline">¶</a></h2> +<p>The <tt class="docutils literal"><span class="pre">list</span></tt> argument is used to view a list of registered users.</p> +<div class="section" id="id7"> +<h3>Syntax<a class="headerlink" href="#id7" title="Permalink to this headline">¶</a></h3> +<p>This argument has the following syntax:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife user list <span class="o">(</span>options<span class="o">)</span> +</pre></div> +</div> +</div> +<div class="section" id="id8"> +<h3>Options<a class="headerlink" href="#id8" title="Permalink to this headline">¶</a></h3> +<p>This argument has the following options:</p> +<dl class="docutils"> +<dt><tt class="docutils literal"><span class="pre">-w</span></tt>, <tt class="docutils literal"><span class="pre">--with-uri</span></tt></dt> +<dd>Indicates that the corresponding URIs will be shown.</dd> +</dl> +</div> +<div class="section" id="id9"> +<h3>Examples<a class="headerlink" href="#id9" title="Permalink to this headline">¶</a></h3> +<p>None.</p> +</div> +</div> +<div class="section" id="reregister"> +<h2>reregister<a class="headerlink" href="#reregister" title="Permalink to this headline">¶</a></h2> +<p>The <tt class="docutils literal"><span class="pre">reregister</span></tt> argument is used to regenerate an RSA key pair for a user. The public key will be stored on the server and the private key will be displayed on <tt class="docutils literal"><span class="pre">STDOUT</span></tt> or written to a named file.</p> +<div class="admonition note"> +<p class="first admonition-title">Note</p> +<p class="last">Running this argument will invalidate the previous RSA key pair, making it unusable during authentication to the server.</p> +</div> +<div class="section" id="id10"> +<h3>Syntax<a class="headerlink" href="#id10" title="Permalink to this headline">¶</a></h3> +<p>This argument has the following syntax:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife user reregister USER_NAME <span class="o">(</span>options<span class="o">)</span> +</pre></div> +</div> +</div> +<div class="section" id="id11"> +<h3>Options<a class="headerlink" href="#id11" title="Permalink to this headline">¶</a></h3> +<p>This argument has the following options:</p> +<dl class="docutils"> +<dt><tt class="docutils literal"><span class="pre">-f</span> <span class="pre">FILE_NAME</span></tt>, <tt class="docutils literal"><span class="pre">--file</span> <span class="pre">FILE_NAME</span></tt></dt> +<dd>Indicates that the private key will be saved to a specified file name.</dd> +</dl> +</div> +<div class="section" id="id12"> +<h3>Examples<a class="headerlink" href="#id12" title="Permalink to this headline">¶</a></h3> +<p>The following examples show how to use this Knife subcommand:</p> +<p><strong>Regenerate the RSA key-pair</strong></p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife user reregister <span class="s2">"Robert Younger"</span> +</pre></div> +</div> +</div> +</div> +<div class="section" id="show"> +<h2>show<a class="headerlink" href="#show" title="Permalink to this headline">¶</a></h2> +<p>The <tt class="docutils literal"><span class="pre">show</span></tt> argument is used to show the details of a user.</p> +<div class="section" id="id13"> +<h3>Syntax<a class="headerlink" href="#id13" title="Permalink to this headline">¶</a></h3> +<p>This argument has the following syntax:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife user show USER_NAME <span class="o">(</span>options<span class="o">)</span> +</pre></div> +</div> +</div> +<div class="section" id="id14"> +<h3>Options<a class="headerlink" href="#id14" title="Permalink to this headline">¶</a></h3> +<p>This argument has the following options:</p> +<dl class="docutils"> +<dt><tt class="docutils literal"><span class="pre">-a</span> <span class="pre">ATTR</span></tt>, <tt class="docutils literal"><span class="pre">--attribute</span> <span class="pre">ATTR</span></tt></dt> +<dd>The attribute (or attributes) to show.</dd> +</dl> +</div> +<div class="section" id="id15"> +<h3>Examples<a class="headerlink" href="#id15" title="Permalink to this headline">¶</a></h3> +<p>The following examples show how to use this Knife subcommand:</p> +<p><strong>Show user data</strong></p> +<p>To view a user named “Dennis Teck”, enter:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife user show <span class="s2">"Dennis Teck"</span> +</pre></div> +</div> +<p>to return something like:</p> +<div class="highlight-bash"><div class="highlight"><pre>chef_type: user +json_class: Chef::User +name: Dennis Teck +public_key: +</pre></div> +</div> +<p><strong>Show user data as JSON</strong></p> +<p>To view information in JSON format, use the <tt class="docutils literal"><span class="pre">-F</span></tt> common option as part of the command like this:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife user show <span class="s2">"Dennis Teck"</span> -F json +</pre></div> +</div> +<p>(Other formats available include <tt class="docutils literal"><span class="pre">text</span></tt>, <tt class="docutils literal"><span class="pre">yaml</span></tt>, and <tt class="docutils literal"><span class="pre">pp</span></tt>, e.g. <tt class="docutils literal"><span class="pre">-F</span> <span class="pre">yaml</span></tt> for YAML.)</p> +</div> +</div> +</div> + + + </div> + + </div> + + + <div class="clearer"></div> + </div> + + + + + </body> +</html>
\ No newline at end of file diff --git a/distro/common/html/knife_using.html b/distro/common/html/knife_using.html new file mode 100644 index 0000000000..d22557e466 --- /dev/null +++ b/distro/common/html/knife_using.html @@ -0,0 +1,211 @@ + +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> + + +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> + + <title>Working with Knife — chef-client Man Pages</title> + + <link rel="stylesheet" href="_static/guide.css" type="text/css" /> + <link rel="stylesheet" href="_static/pygments.css" type="text/css" /> + + <script type="text/javascript"> + var DOCUMENTATION_OPTIONS = { + URL_ROOT: '', + VERSION: '', + COLLAPSE_INDEX: false, + FILE_SUFFIX: '.html', + HAS_SOURCE: true + }; + </script> + <script type="text/javascript" src="_static/jquery.js"></script> + <script type="text/javascript" src="_static/underscore.js"></script> + <script type="text/javascript" src="_static/doctools.js"></script> + <link rel="shortcut icon" href="_static/chef.ico"/> + + + </head> + <body> +<div style="background-color: #212c35; text-align: left; padding: 0px 0px 0px 0px"> +<a href="http://docs.opscode.com/"><img src="_static/chef_html_logo.png" border="0" alt="Chef"/></a> +</div> + + + + + <div class="document"> + <div class="documentwrapper"> + + <div class="body"> + + <div class="section" id="working-with-knife"> +<h1>Working with Knife<a class="headerlink" href="#working-with-knife" title="Permalink to this headline">¶</a></h1> +<p>Knife runs from a management workstation and sits in-between a server and an organization’s infrastructure. Knife interacts with a server by using the same REST API that is used by a chef-client. Role-based authentication controls (RBAC) can be used to authorize changes when Knife is run with Enterprise Chef. Knife is configured during workstation setup, but subsequent modifications can be made using the knife.rb configuration file.</p> +<div class="section" id="json-data-format"> +<h2>JSON Data Format<a class="headerlink" href="#json-data-format" title="Permalink to this headline">¶</a></h2> +<p>Most data is entered using a text editor in JSON format, unless the <tt class="docutils literal"><span class="pre">--disable-editing</span></tt> option is entered as part of a command. (Encrypted data bags use YAML, which is a superset of JSON.) JSON is a common, language-independent data format that provides a simple text representation of arbitrary data structures. For more information about JSON, see <a class="reference external" href="http://www.json.org/">http://www.json.org/</a> or <a class="reference external" href="http://en.wikipedia.org/wiki/JSON">http://en.wikipedia.org/wiki/JSON</a>.</p> +<div class="section" id="set-the-text-editor"> +<h3>Set the Text Editor<a class="headerlink" href="#set-the-text-editor" title="Permalink to this headline">¶</a></h3> +<p>Some Knife commands, such as <tt class="docutils literal"><span class="pre">knife</span> <span class="pre">data</span> <span class="pre">bag</span> <span class="pre">edit</span></tt>, require that information be edited as JSON data using a text editor. For example, the following command:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife data bag edit admins admin_name +</pre></div> +</div> +<p>will open up the text editor with data similar to:</p> +<div class="highlight-javascript"><div class="highlight"><pre><span class="p">{</span> + <span class="s2">"id"</span><span class="o">:</span> <span class="s2">"admin_name"</span> +<span class="p">}</span> +</pre></div> +</div> +<p>Changes to that file can then be made:</p> +<div class="highlight-javascript"><div class="highlight"><pre><span class="p">{</span> + <span class="s2">"id"</span><span class="o">:</span> <span class="s2">"Justin C."</span> + <span class="s2">"description"</span><span class="o">:</span> <span class="s2">"I am passing the time by letting time pass over me ..."</span> +<span class="p">}</span> +</pre></div> +</div> +<p>The type of text editor that is used by Knife can be configured by adding an entry to the knife.rb file or by setting an <tt class="docutils literal"><span class="pre">EDITOR</span></tt> environment variable. For example, to configure the text editor to always open with vim, add the following to the knife.rb file:</p> +<div class="highlight-ruby"><div class="highlight"><pre><span class="n">knife</span><span class="o">[</span><span class="ss">:editor</span><span class="o">]</span> <span class="o">=</span> <span class="s2">"/usr/bin/vim"</span> +</pre></div> +</div> +<p>When a Microsoft Windows file path is enclosed in a double-quoted string (” ”), the same backslash character (<tt class="docutils literal"><span class="pre">\</span></tt>) that is used to define the file path separator is also used in Ruby to define an escape character. The knife.rb file is a Ruby file; therefore, file path separators must be escaped. In addition, spaces in the file path must be replaced with <tt class="docutils literal"><span class="pre">~1</span></tt> so that the length of each section within the file path is not more than 8 characters. For example, if EditPad Pro is the text editor of choice and is located at the following path:</p> +<div class="highlight-python"><pre>C:\\Program Files (x86)\EditPad Pro\EditPad.exe</pre> +</div> +<p>the setting in the knife.rb file would be similar to:</p> +<div class="highlight-ruby"><div class="highlight"><pre><span class="n">knife</span><span class="o">[</span><span class="ss">:editor</span><span class="o">]</span> <span class="o">=</span> <span class="s2">"C:</span><span class="se">\\</span><span class="s2">Progra~1</span><span class="se">\\</span><span class="s2">EditPa~1</span><span class="se">\\</span><span class="s2">EditPad.exe"</span> +</pre></div> +</div> +<p>One approach to working around the double- vs. single-quote issue is to put the single-quotes outside of the double-quotes. For example, for Notepad++:</p> +<div class="highlight-ruby"><div class="highlight"><pre><span class="n">knife</span><span class="o">[</span><span class="ss">:editor</span><span class="o">]</span> <span class="o">=</span> <span class="s1">'"C:\Program Files (x86)\Notepad++\notepad++.exe -nosession -multiInst"'</span> +</pre></div> +</div> +<p>for Sublime Text:</p> +<div class="highlight-ruby"><div class="highlight"><pre><span class="n">knife</span><span class="o">[</span><span class="ss">:editor</span><span class="o">]</span> <span class="o">=</span> <span class="s1">'"C:\Program Files\Sublime Text 2\sublime_text.exe --wait"'</span> +</pre></div> +</div> +<p>for TextPad:</p> +<div class="highlight-ruby"><div class="highlight"><pre><span class="n">knife</span><span class="o">[</span><span class="ss">:editor</span><span class="o">]</span> <span class="o">=</span> <span class="s1">'"C:\Program Files (x86)\TextPad 7\TextPad.exe"'</span> +</pre></div> +</div> +<p>and for vim:</p> +<div class="highlight-ruby"><div class="highlight"><pre><span class="n">knife</span><span class="o">[</span><span class="ss">:editor</span><span class="o">]</span> <span class="o">=</span> <span class="s1">'"C:\Program Files (x86)\vim\vim74\gvim.exe"'</span> +</pre></div> +</div> +</div> +</div> +<div class="section" id="using-quotes"> +<h2>Using Quotes<a class="headerlink" href="#using-quotes" title="Permalink to this headline">¶</a></h2> +<p>Values can be entered with double quotes (” ”) or single quotes (‘ ‘), but this should be done consistently.</p> +</div> +<div class="section" id="sub-commands"> +<h2>Sub-commands<a class="headerlink" href="#sub-commands" title="Permalink to this headline">¶</a></h2> +<p>Knife comes with a collection of built in subcommands that work together to provide all of the functionality required to take specific actions against any object in an organization, including cookbooks, nodes, roles, data bags, environments, and users. A Knife plugin extends the functionality beyond built-in subcommands.</p> +<p>Knife has the following subcommands: <tt class="docutils literal"><span class="pre">bootstrap</span></tt>, <tt class="docutils literal"><span class="pre">client</span></tt>, <tt class="docutils literal"><span class="pre">configure</span></tt>, <tt class="docutils literal"><span class="pre">cookbook</span></tt>, <tt class="docutils literal"><span class="pre">cookbook</span> <span class="pre">site</span></tt>, <tt class="docutils literal"><span class="pre">data</span> <span class="pre">bag</span></tt>, <tt class="docutils literal"><span class="pre">delete</span></tt>, <tt class="docutils literal"><span class="pre">deps</span></tt>, <tt class="docutils literal"><span class="pre">diff</span></tt>, <tt class="docutils literal"><span class="pre">download</span></tt>, <tt class="docutils literal"><span class="pre">edit</span></tt>, <tt class="docutils literal"><span class="pre">environment</span></tt>, <tt class="docutils literal"><span class="pre">exec</span></tt>, <tt class="docutils literal"><span class="pre">index</span> <span class="pre">rebuild</span></tt>, <tt class="docutils literal"><span class="pre">list</span></tt>, <tt class="docutils literal"><span class="pre">node</span></tt>, <tt class="docutils literal"><span class="pre">recipe</span> <span class="pre">list</span></tt>, <tt class="docutils literal"><span class="pre">role</span></tt>, <tt class="docutils literal"><span class="pre">search</span></tt>, <tt class="docutils literal"><span class="pre">show</span></tt>, <tt class="docutils literal"><span class="pre">ssh</span></tt>, <tt class="docutils literal"><span class="pre">status</span></tt>, <tt class="docutils literal"><span class="pre">tag</span></tt>, <tt class="docutils literal"><span class="pre">upload</span></tt>, <tt class="docutils literal"><span class="pre">user</span></tt>, and <tt class="docutils literal"><span class="pre">xargs</span></tt>.</p> +<div class="admonition note"> +<p class="first admonition-title">Note</p> +<p class="last">The following subcommands run only against the open source server: <tt class="docutils literal"><span class="pre">index</span> <span class="pre">rebuild</span></tt> and <tt class="docutils literal"><span class="pre">user</span></tt>.</p> +</div> +</div> +<div class="section" id="verb-sub-commands"> +<h2>Verb Sub-commands<a class="headerlink" href="#verb-sub-commands" title="Permalink to this headline">¶</a></h2> +<p>Knife includes a set of subcommands that are built around common verbs: <tt class="docutils literal"><span class="pre">delete</span></tt>, <tt class="docutils literal"><span class="pre">deps</span></tt>, <tt class="docutils literal"><span class="pre">diff</span></tt>, <tt class="docutils literal"><span class="pre">download</span></tt>, <tt class="docutils literal"><span class="pre">edit</span></tt>, <tt class="docutils literal"><span class="pre">list</span></tt>, <tt class="docutils literal"><span class="pre">show</span></tt>, <tt class="docutils literal"><span class="pre">upload</span></tt>, <tt class="docutils literal"><span class="pre">xargs</span></tt>. These subcommands allow Knife to issue commands that interact with any object stored in the chef-repo or stored on the server. Some important principles behind this group of subcommands includes:</p> +<ul class="simple"> +<li>A command that works with each object in the chef-repo. The subcommands specify the desired action (the “verb”), and then directory in which that object resides (<tt class="docutils literal"><span class="pre">clients</span></tt>, <tt class="docutils literal"><span class="pre">cookbooks/</span></tt>, <tt class="docutils literal"><span class="pre">data_bags/</span></tt>, <tt class="docutils literal"><span class="pre">environments/</span></tt>, <tt class="docutils literal"><span class="pre">nodes</span></tt>, <tt class="docutils literal"><span class="pre">roles/</span></tt>, and <tt class="docutils literal"><span class="pre">users</span></tt>). For example: <tt class="docutils literal"><span class="pre">download</span> <span class="pre">cookbooks/</span></tt></li> +<li>A command that works with certain objects in Enterprise Chef, including <tt class="docutils literal"><span class="pre">acls</span></tt>, <tt class="docutils literal"><span class="pre">groups</span></tt>, and <tt class="docutils literal"><span class="pre">containers</span></tt></li> +<li>Uses the server as if it were a file system, allowing the chef-repo on the server to behave like a mirror of the chef-repo on the workstation. The server will have the same objects as the local chef-repo. To make changes to the files on the server, just download files from the server or upload files from the chef-repo</li> +<li>The context from which a command is run matters. For example, when working in the <tt class="docutils literal"><span class="pre">roles/</span></tt> directory, Knife will know what is being worked with. Enter <tt class="docutils literal"><span class="pre">knife</span> <span class="pre">show</span> <span class="pre">base.json</span></tt> and Knife will return the base role from the server. From the chef-repo root, enter <tt class="docutils literal"><span class="pre">knife</span> <span class="pre">show</span> <span class="pre">roles/base.json</span></tt> to get the same result</li> +<li>Parallel requests can be made to the server and are configurable on a per-command basis</li> +</ul> +<div class="section" id="wildcard-search"> +<h3>Wildcard Search<a class="headerlink" href="#wildcard-search" title="Permalink to this headline">¶</a></h3> +<p>A wildcard matching pattern can be used for substring matches that replace zero (or more) characters. There are two types of wildcard patterns:</p> +<ul class="simple"> +<li>A question mark (”?”) can be used to replace exactly one character (as long as that character is not the first character)</li> +<li>An asterisk (“*”) can be used to replace any number of characters (including zero)</li> +</ul> +<p>Wildcard patterns must be escaped (using a backslash) so that the wildcard itself can reach the server. If they are not escaped, the wildcard is expanded into the actual filenames and Knife will not know the wildcard was intended to be used. For example, if the server has data bags named <tt class="docutils literal"><span class="pre">aardvarks</span></tt>, <tt class="docutils literal"><span class="pre">anagrams</span></tt>, and <tt class="docutils literal"><span class="pre">arp_tables</span></tt>, but the local file system only has <tt class="docutils literal"><span class="pre">aardvarks</span></tt> and <tt class="docutils literal"><span class="pre">anagrams</span></tt>, escaping vs. not escaping the wildcard pattern will yield different results:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife list data_bags/a<span class="se">\*</span> +</pre></div> +</div> +<p>asks the server for everything starting with the letter “a” and will return:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>aardvarks/ anagrams/ arp_tables/ +</pre></div> +</div> +<p>But, the following:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife list data_bags/a* +</pre></div> +</div> +<p>will return:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>aardvarks/ anagrams/ +</pre></div> +</div> +<p>Which is the same as entering:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife list data_bags/aardvarks data_bags/anagrams +</pre></div> +</div> +<p>to return:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>aardvarks/ anagrams/ +</pre></div> +</div> +</div> +</div> +<div class="section" id="plug-ins"> +<h2>Plug-ins<a class="headerlink" href="#plug-ins" title="Permalink to this headline">¶</a></h2> +<p>Chef provides the following plugins, which work the same as built-in subcommands (including common options), but must be installed separately (using RubyGems): <strong>knife azure</strong>, <strong>knife bluebox</strong>, <strong>knife ec2</strong>, <strong>knife eucalyptus</strong>, <strong>knife google</strong>, <strong>knife hp</strong>, <strong>knife linode</strong>, <strong>knife openstack</strong>, <strong>knife rackspace</strong>, <strong>knife terremark</strong>, <strong>knife vcloud</strong>, and <strong>knife windows</strong>.</p> +<p>The community provides many other plugins for Knife: <a class="reference external" href="http://community.opscode.com/">http://community.opscode.com/</a>.</p> +</div> +<div class="section" id="syntax"> +<h2>Syntax<a class="headerlink" href="#syntax" title="Permalink to this headline">¶</a></h2> +<p>All Knife subcommands have the following syntax:</p> +<blockquote> +<div>knife subcommand [ARGUMENT] (options)</div></blockquote> +<p>Each subcommand has its own set of arguments and options.</p> +<div class="admonition note"> +<p class="first admonition-title">Note</p> +<p class="last">All syntax examples in this document show variables in ALL_CAPS. For example <tt class="docutils literal"><span class="pre">-u</span> <span class="pre">PORT_LIST</span></tt> (where PORT_LIST is a comma-separated list of local and public UDP ports) or <tt class="docutils literal"><span class="pre">-F</span> <span class="pre">FORMAT</span></tt> (where FORMAT determines the output format, either <tt class="docutils literal"><span class="pre">summary</span></tt>, <tt class="docutils literal"><span class="pre">text</span></tt>, <tt class="docutils literal"><span class="pre">json</span></tt>, <tt class="docutils literal"><span class="pre">yaml</span></tt>, or <tt class="docutils literal"><span class="pre">pp</span></tt>). These variables often require specific values that are unique to each organization.</p> +</div> +</div> +<div class="section" id="many-users-same-repo"> +<h2>Many Users, Same Repo<a class="headerlink" href="#many-users-same-repo" title="Permalink to this headline">¶</a></h2> +<p>It is possible for multiple users to access the server using the same knife.rb file. (A user can even access multiple organizations if, for example, each instance of the chef-repo contained the same copy of the knife.rb file.) This can be done by adding the knife.rb file to the chef-repo, and then using environment variables to handle the user-specific credential details and/or sensitive values. For example:</p> +<div class="highlight-ruby"><div class="highlight"><pre><span class="n">current_dir</span> <span class="o">=</span> <span class="no">File</span><span class="o">.</span><span class="n">dirname</span><span class="p">(</span><span class="bp">__FILE__</span><span class="p">)</span> + <span class="n">user</span> <span class="o">=</span> <span class="no">ENV</span><span class="o">[</span><span class="s1">'OPSCODE_USER'</span><span class="o">]</span> <span class="o">||</span> <span class="no">ENV</span><span class="o">[</span><span class="s1">'USER'</span><span class="o">]</span> + <span class="n">node_name</span> <span class="n">user</span> + <span class="n">client_key</span> <span class="s2">"</span><span class="si">#{</span><span class="no">ENV</span><span class="o">[</span><span class="s1">'HOME'</span><span class="o">]</span><span class="si">}</span><span class="s2">/.chef/</span><span class="si">#{</span><span class="n">user</span><span class="si">}</span><span class="s2">.pem"</span> + <span class="n">validation_client_name</span> <span class="s2">"</span><span class="si">#{</span><span class="no">ENV</span><span class="o">[</span><span class="s1">'ORGNAME'</span><span class="o">]</span><span class="si">}</span><span class="s2">-validator"</span> + <span class="n">validation_key</span> <span class="s2">"</span><span class="si">#{</span><span class="no">ENV</span><span class="o">[</span><span class="s1">'HOME'</span><span class="o">]</span><span class="si">}</span><span class="s2">/.chef/</span><span class="si">#{</span><span class="no">ENV</span><span class="o">[</span><span class="s1">'ORGNAME'</span><span class="o">]</span><span class="si">}</span><span class="s2">-validator.pem"</span> + <span class="n">chef_server_url</span> <span class="s2">"https://api.opscode.com/organizations/</span><span class="si">#{</span><span class="no">ENV</span><span class="o">[</span><span class="s1">'ORGNAME'</span><span class="o">]</span><span class="si">}</span><span class="s2">"</span> + <span class="n">syntax_check_cache_path</span> <span class="s2">"</span><span class="si">#{</span><span class="no">ENV</span><span class="o">[</span><span class="s1">'HOME'</span><span class="o">]</span><span class="si">}</span><span class="s2">/.chef/syntax_check_cache"</span> + <span class="n">cookbook_path</span> <span class="o">[</span><span class="s2">"</span><span class="si">#{</span><span class="n">current_dir</span><span class="si">}</span><span class="s2">/../cookbooks"</span><span class="o">]</span> + <span class="n">cookbook_copyright</span> <span class="s2">"Your Company, Inc."</span> + <span class="n">cookbook_license</span> <span class="s2">"apachev2"</span> + <span class="n">cookbook_email</span> <span class="s2">"cookbooks@yourcompany.com"</span> + + <span class="c1"># Amazon AWS</span> + <span class="n">knife</span><span class="o">[</span><span class="ss">:aws_access_key_id</span><span class="o">]</span> <span class="o">=</span> <span class="no">ENV</span><span class="o">[</span><span class="s1">'AWS_ACCESS_KEY_ID'</span><span class="o">]</span> + <span class="n">knife</span><span class="o">[</span><span class="ss">:aws_secret_access_key</span><span class="o">]</span> <span class="o">=</span> <span class="no">ENV</span><span class="o">[</span><span class="s1">'AWS_SECRET_ACCESS_KEY'</span><span class="o">]</span> + + <span class="c1"># Rackspace Cloud</span> + <span class="n">knife</span><span class="o">[</span><span class="ss">:rackspace_api_username</span><span class="o">]</span> <span class="o">=</span> <span class="no">ENV</span><span class="o">[</span><span class="s1">'RACKSPACE_USERNAME'</span><span class="o">]</span> + <span class="n">knife</span><span class="o">[</span><span class="ss">:rackspace_api_key</span><span class="o">]</span> <span class="o">=</span> <span class="no">ENV</span><span class="o">[</span><span class="s1">'RACKSPACE_API_KEY'</span><span class="o">]</span> +</pre></div> +</div> +</div> +</div> + + + </div> + + </div> + + + <div class="clearer"></div> + </div> + + + + + </body> +</html>
\ No newline at end of file diff --git a/distro/common/html/knife_xargs.html b/distro/common/html/knife_xargs.html new file mode 100644 index 0000000000..d6071137f5 --- /dev/null +++ b/distro/common/html/knife_xargs.html @@ -0,0 +1,115 @@ + +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> + + +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> + + <title>knife xargs — chef-client Man Pages</title> + + <link rel="stylesheet" href="_static/guide.css" type="text/css" /> + <link rel="stylesheet" href="_static/pygments.css" type="text/css" /> + + <script type="text/javascript"> + var DOCUMENTATION_OPTIONS = { + URL_ROOT: '', + VERSION: '', + COLLAPSE_INDEX: false, + FILE_SUFFIX: '.html', + HAS_SOURCE: true + }; + </script> + <script type="text/javascript" src="_static/jquery.js"></script> + <script type="text/javascript" src="_static/underscore.js"></script> + <script type="text/javascript" src="_static/doctools.js"></script> + <link rel="shortcut icon" href="_static/chef.ico"/> + + + </head> + <body> +<div style="background-color: #212c35; text-align: left; padding: 0px 0px 0px 0px"> +<a href="http://docs.opscode.com/"><img src="_static/chef_html_logo.png" border="0" alt="Chef"/></a> +</div> + + + + + <div class="document"> + <div class="documentwrapper"> + + <div class="body"> + + <div class="section" id="knife-xargs"> +<h1>knife xargs<a class="headerlink" href="#knife-xargs" title="Permalink to this headline">¶</a></h1> +<p>The <strong>knife xargs</strong> subcommand is used to build and execute command lines against objects on a server using standard input.</p> +<div class="section" id="syntax"> +<h2>Syntax<a class="headerlink" href="#syntax" title="Permalink to this headline">¶</a></h2> +<p>This argument has the following syntax:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife xargs <span class="o">[</span>PATTERN...<span class="o">]</span> <span class="o">(</span>options<span class="o">)</span> +</pre></div> +</div> +</div> +<div class="section" id="options"> +<h2>Options<a class="headerlink" href="#options" title="Permalink to this headline">¶</a></h2> +<div class="admonition note"> +<p class="first admonition-title">Note</p> +<p class="last">Review the list of <a class="reference internal" href="knife_common_options.html"><em>common options</em></a> available to this (and all) Knife subcommands and plugins.</p> +</div> +<p>This subcommand has the following options:</p> +<dl class="docutils"> +<dt><tt class="docutils literal"><span class="pre">-0</span></tt></dt> +<dd>Indicates that a <tt class="docutils literal"><span class="pre">NULL</span></tt> character (<tt class="docutils literal"><span class="pre">\0</span></tt>) will be used as a separator, instead of white space. Default: <tt class="docutils literal"><span class="pre">false</span></tt>.</dd> +<dt><tt class="docutils literal"><span class="pre">--chef-repo-path</span> <span class="pre">PATH</span></tt></dt> +<dd>The path to the chef-repo. This setting will override the default path to the chef-repo. Default: same as specified by <tt class="docutils literal"><span class="pre">chef_repo_path</span></tt> in config.rb.</dd> +<dt><tt class="docutils literal"><span class="pre">--concurrency</span></tt></dt> +<dd>The number of allowed concurrent connections. Default: <tt class="docutils literal"><span class="pre">10</span></tt>.</dd> +<dt><tt class="docutils literal"><span class="pre">--[no-]diff</span></tt></dt> +<dd>Use to show a diff when a file changes. Default: <tt class="docutils literal"><span class="pre">--diff</span></tt>.</dd> +<dt><tt class="docutils literal"><span class="pre">--dry-run</span></tt></dt> +<dd>Use to prevent changes from being uploaded to the server. Default: <tt class="docutils literal"><span class="pre">false</span></tt>.</dd> +<dt><tt class="docutils literal"><span class="pre">--[no-]force</span></tt></dt> +<dd>Use to force the upload of files even if they haven’t been changed. Default: <tt class="docutils literal"><span class="pre">--no-force</span></tt>.</dd> +<dt><tt class="docutils literal"><span class="pre">--local</span></tt></dt> +<dd>Indicates that a command line will be built or executed against a local file. Set to <tt class="docutils literal"><span class="pre">false</span></tt> to build or execute against a remote file. Default: <tt class="docutils literal"><span class="pre">false</span></tt>.</dd> +<dt><tt class="docutils literal"><span class="pre">-n</span> <span class="pre">MAX_ARGS</span></tt>, <tt class="docutils literal"><span class="pre">--max-args</span> <span class="pre">MAX_ARGS</span></tt></dt> +<dd>The maximum number of arguments per command line. Default: <tt class="docutils literal"><span class="pre">nil</span></tt>.</dd> +<dt><tt class="docutils literal"><span class="pre">-s</span> <span class="pre">LENGTH</span></tt>, <tt class="docutils literal"><span class="pre">--max-chars</span> <span class="pre">LENGTH</span></tt></dt> +<dd>The maximum size (in characters) for a command line. Default: <tt class="docutils literal"><span class="pre">nil</span></tt>.</dd> +<dt><tt class="docutils literal"><span class="pre">-p</span> <span class="pre">[PATTERN...]</span></tt>, <tt class="docutils literal"><span class="pre">--pattern</span> <span class="pre">[PATTERN...]</span></tt></dt> +<dd>One (or more) patterns for a command line. If this option is not specified, a list of patterns may be expected on standard input. Default: <tt class="docutils literal"><span class="pre">nil</span></tt>.</dd> +<dt><tt class="docutils literal"><span class="pre">-I</span> <span class="pre">REPLACE_STRING</span></tt>, <tt class="docutils literal"><span class="pre">--replace</span> <span class="pre">REPLACE_STRING</span></tt></dt> +<dd>Use to define a string that will be used to replace all occurrences of a file name. Default: <tt class="docutils literal"><span class="pre">nil</span></tt>.</dd> +<dt><tt class="docutils literal"><span class="pre">-J</span> <span class="pre">REPLACE_STRING</span></tt>, <tt class="docutils literal"><span class="pre">--replace-first</span> <span class="pre">REPLACE_STRING</span></tt></dt> +<dd>Use to define a string that will be used to replace the first occurrence of a file name. Default: <tt class="docutils literal"><span class="pre">nil</span></tt>.</dd> +<dt><tt class="docutils literal"><span class="pre">--repo-mode</span> <span class="pre">MODE</span></tt></dt> +<dd>The layout of the local chef-repo. Possible values: <tt class="docutils literal"><span class="pre">static</span></tt>, <tt class="docutils literal"><span class="pre">everything</span></tt>, or <tt class="docutils literal"><span class="pre">hosted_everything</span></tt>. Use <tt class="docutils literal"><span class="pre">static</span></tt> for just roles, environments, cookbooks, and data bags. By default, <tt class="docutils literal"><span class="pre">everything</span></tt> and <tt class="docutils literal"><span class="pre">hosted_everything</span></tt> are dynamically selected depending on the server type. Default value: <tt class="docutils literal"><span class="pre">default</span></tt>.</dd> +<dt><tt class="docutils literal"><span class="pre">-t</span></tt></dt> +<dd>Indicates that the print command will be run on the command line. Default: <tt class="docutils literal"><span class="pre">nil</span></tt>.</dd> +</dl> +</div> +<div class="section" id="examples"> +<h2>Examples<a class="headerlink" href="#examples" title="Permalink to this headline">¶</a></h2> +<p>The following examples show how to use this Knife subcommand:</p> +<p><strong>Use output of knife deps to pass command to knife xargs</strong></p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife deps nodes/*.json | xargs knife upload +</pre></div> +</div> +</div> +</div> + + + </div> + + </div> + + + <div class="clearer"></div> + </div> + + + + + </body> +</html>
\ No newline at end of file diff --git a/distro/common/html/objects.inv b/distro/common/html/objects.inv Binary files differnew file mode 100644 index 0000000000..2dbcd31810 --- /dev/null +++ b/distro/common/html/objects.inv diff --git a/distro/common/html/search.html b/distro/common/html/search.html new file mode 100644 index 0000000000..fdb4be6edc --- /dev/null +++ b/distro/common/html/search.html @@ -0,0 +1,84 @@ + +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> + + +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> + + <title>Search — chef-client Man Pages</title> + + <link rel="stylesheet" href="_static/guide.css" type="text/css" /> + <link rel="stylesheet" href="_static/pygments.css" type="text/css" /> + + <script type="text/javascript"> + var DOCUMENTATION_OPTIONS = { + URL_ROOT: '', + VERSION: '', + COLLAPSE_INDEX: false, + FILE_SUFFIX: '.html', + HAS_SOURCE: true + }; + </script> + <script type="text/javascript" src="_static/jquery.js"></script> + <script type="text/javascript" src="_static/underscore.js"></script> + <script type="text/javascript" src="_static/doctools.js"></script> + <script type="text/javascript" src="_static/searchtools.js"></script> + <link rel="shortcut icon" href="_static/chef.ico"/> + + + </head> + <body> +<div style="background-color: #212c35; text-align: left; padding: 0px 0px 0px 0px"> +<a href="http://docs.opscode.com/"><img src="_static/chef_html_logo.png" border="0" alt="Chef"/></a> +</div> + + + + + <div class="document"> + <div class="documentwrapper"> + + <div class="body"> + + +<h1 id="search-documentation">Search the Documentation for Chef</h1> + +<div class="container"> + +<p> +From here you can use a scoped Google search query to search all of the documentation about Chef that is located at docs.opscode.com. (This page requires JavaScript be enabled to view the search box.) +</p> + +<!-- Place this tag where you want both of the search box and the search results to render --> +<gcse:search defaultToRefinement="Chef Documentation" webSearchResultSetSize="20"></gcse:search> + + <br> + <br> + <br> + <br> + <br> + + <br> + <br> + <br> + <br> + <br> + +</div> + + + </div> + + </div> + + + <div class="clearer"></div> + </div> + + + + + </body> +</html>
\ No newline at end of file diff --git a/distro/common/html/searchindex.js b/distro/common/html/searchindex.js new file mode 100644 index 0000000000..f846b10631 --- /dev/null +++ b/distro/common/html/searchindex.js @@ -0,0 +1 @@ +Search.setIndex({objects:{},terms:{kickstart:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],perl:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],chisamor:12,poorli:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],prefix:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],dirnam:24,rsyslog:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],oldest:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],whose:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],accur:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],service_nam:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],umask:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],chef_typ:[0,14,28,29,4,7,18],under:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],slowest:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],everi:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],cookbook_maintain:5,upstream:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],affect:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],ibm305ramac:1,csshx:30,cmd:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],upload:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],rabbitmq:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],rabbitmqctl:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],verif:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],x86_64:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],proxy_url:27,hord:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],application_java:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],hint_fil:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],direct:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],chef:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],consequ:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],second:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],street:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],aggreg:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],ips_packag:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],start_chef:27,blue:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],hide:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],eventlet:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],asid:25,dism:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],"new":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],net:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],topolog:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],metadata:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],supervisor_servic:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],default_attribut:[4,0],manipul:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],run_list_item:[29,9,31],never:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],macports_packag:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],here:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],num_vers:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],recipe_nam:[29,0],path:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],print_aft:[],interpret:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],hosted_everyth:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],dry:[6,32,26],erl_cal:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],runlist:[9,31],brought:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],substr:24,unix:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],printf:1,hipchat:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],txt:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],unit:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],describ:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],would:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],bundler:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],call:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],asset:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],recommend:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],indiana:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],envdir:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],until:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],fastcgi:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],relat:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],server_url:25,notic:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],warn:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],exce:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],relai:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],killal:31,hold:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],must:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],gecod:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],join:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],orgnam:[24,18,27],setup:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],work:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],bluebox:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],raid1:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],erb:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],fnmatch:28,root:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],ss6p92l_sca:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],minfd:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],overrid:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],give:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],smtp:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],elrepo:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],indic:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],want:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],end:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],quot:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],vagrant:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],how:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],env:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],place:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],config:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],checkin:1,updat:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],after:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],hide_healthi:[],lab:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],befor:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],windows_packag:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],arch:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],parallel:[13,30,19,24],demonstr:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],request_path:14,attempt:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],client_nam:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],opaqu:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],bootstrap:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],credenti:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],python_virtualenv:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],exclud:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],alias:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],maintain:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],environ:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],danno:7,enter:[12,20,31,0,14,1,29,30,15,28,4,5,6,32,7,34,17,24,33,18],order:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],oper:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],over:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],php_pear:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],becaus:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],privileg:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],vari:[33,27],cli:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],fit:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],generic_execut:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],denver:34,better:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],persist:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],hidden:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],erlang:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],windowsreboothandl:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],them:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],woken:31,thei:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],fragment:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],rackspaceknif:5,"40g":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],choic:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],etag:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],changelog:28,use_sudo:[],languages_ruby_vers:15,timeout:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],each:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],debug:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],search_queri:[30,15,5],eacc:31,side:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],mean:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],voxel:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],ssh_user:[],log_loc:27,extract:[6,9,19,13],linod:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],unshar:5,network:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],reg_sz:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],god:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],newli:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],content:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],rewrit:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],devops_prod1:34,billing_admin:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],erubi:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],http_request:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],putti:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],gunicorn:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],ntp:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],multilib:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],free:1,standard:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],qword:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],node1:29,kit:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],"1_0_0":5,"1_0_1":5,"1_0_2":5,"1_0_3":5,reconfigur:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],sigkil:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],reg_dword_big_endian:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],whateverthedefaultmightb:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],openssh:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],openssl:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],filter:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],iso:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],isn:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],nosess:24,pristin:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],rang:[12,15],render:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],mkdir:27,cron_d:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],system:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],restrict:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],hook:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],hkey_classes_root:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],alreadi:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],messag:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],apt_repositori:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],agre:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],primari:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],role1:0,tinydn:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],top:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],sometim:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],mercuri:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],master:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],too:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],amqp_us:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],listen:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],cloudform:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],iptabl:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],consol:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],"8wjyvhy9fhcegaareg":33,namespac:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],tool:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],erchef:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],"0a58cf8":15,yield:24,"10g":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],bookshelf:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],task:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],max_arg:26,auxw:31,target:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],provid:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],tree:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],zero:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],project:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],matter:24,gnupg:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],british_sea_pow:27,minut:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],provis:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],abov:27,ram:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],mine:27,unicast:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],raw:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],seed:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],application_rubi:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],mint:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],environment_nam:[9,4,23],client:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],chefservicefeatur:27,even:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],template_fil:[],though:29,usernam:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],glob:28,object:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],regular:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],s001:31,specifi:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],letter:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],breakpoint:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],don:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],doc:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],doe:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],cookbook_licens:24,wildcard:[20,15,23,24],teck:7,enclos:24,unchang:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],dot:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],runit:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],opposit:[6,13,19,32],whitelist:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],random:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],ruby_block:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],syntax:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],radio:7,identifi:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],dhcpserver:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],make:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],celeri:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],absolut:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],bind:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],layout:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],"0a58e134":15,holder:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],fstab:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],apach:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],lwrp:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],ldap:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],folder:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],oct:30,firewall_rul:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],likewis:5,stop:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],amazon:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],servermanagercmd:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],report:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],youtub:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],"public":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],runa:31,reload:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],bad:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],respond:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],application_python_django:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],groupinstal:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],homedr:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],num:30,mandatori:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],result:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],respons:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],noinput:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],key_fil:31,mdadm:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],best:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],rsa_kei:18,awar:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],said:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],databas:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],multiinst:24,wikipedia:24,discoveri:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],irb:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],irc:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],approach:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],databag:14,attribut:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],extend:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],extens:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],host_key_verifi:[],toler:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],advertis:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],protect:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],metadta:28,easi:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],met:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],howev:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],against:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],fedora13:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],logic:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],countri:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],login:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],stopsign:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],com:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],publishset:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],excess:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],cookbook_descript:5,usr2:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],your_email:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],usr1:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],diff:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],trust:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],assum:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],duplic:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],chrome:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],fri:30,patch:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],three:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],webpi:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],trigger:31,basic:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],homepath:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],hesit:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],quickli:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],life:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],file_edit:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],suppress:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],worker:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],telnet:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],ani:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],verify_api_cert:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],application_java_tomcat:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],child:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],"catch":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],no_dep:[],ident:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],aix:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],data_bag_nam:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],gnu:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],hat:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],servic:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],properti:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],calcul:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],dashboard:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],nexenta:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],bin:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],cont:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],remount:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],player:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],attribute_nam:29,conf:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],sever:15,cookbook_vers:[4,5,28],growl:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],perform:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],suggest:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],use_last_modifi:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],couchdb:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],preserv:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],descend:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],djbdn:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],complet:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],raid:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],nil:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],rail:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],orgmapp:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],rais:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],portal:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],unicorn:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],tune:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],mirror_expir:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],kept:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],scenario:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],"30t21":5,inherit:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],contact:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],thi:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],gzip:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],everyth:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],left:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],protocol:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],just:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],sigusr1:31,bandwidth:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],qr_knife_web:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],human:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],name_of_servic:17,yet:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],languag:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],previous:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],mod_php:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],had:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],macport:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],save:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],ubuntu12:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],ubuntu10:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],opt:1,applic:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],supervisord:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],metabas:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],fusion:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],"256f884f":12,shadow:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],daemon:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],specif:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],deprec:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],nrpe:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],arbitrari:[13,33,19,24],manual:[30,31],graylog:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],deploy_revis:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],public_kei:[7,18],sublime_text:24,grizzli:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],underli:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],multi_str:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],right:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],application_python_celeri:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],interv:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],percentag:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],intern:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],user_kei:[],successfulli:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],transmiss:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],knife_config:27,total:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],setloc:27,fidel:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],tornado:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],fog:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],select:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],condit:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],script_fil:1,localhost:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],core:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],plu:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],uncompress:5,repositori:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],peer:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],post:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],"super":31,subkei:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],plug:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],postgresql:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],surround:[13,0,28,29,3,19,18],birdman:7,svn_argument:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],horizon:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],commit:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],ssh_port:[],"float":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],profession:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],www:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],value_nam:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],run_list:[12,29,27,0,1],storag:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],git:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],wai:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],support:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],nova:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],why:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],avail:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],reli:27,gid:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],wordpress:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],editor:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],war:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],fork:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],head:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],noevict:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],form:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],forc:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],macterm:30,transmission_torrent_fil:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],useradd:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],"25t23":5,"true":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],reset:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],wmi:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],attr:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],type:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],unpin:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],maximum:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],mtu:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],inaccur:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],solaris_packag:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],opensus:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],featur:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],openbsd:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],application_php_php:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],decrypt:33,exist:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],glanc:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],ship:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],check:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],sticki:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],assembl:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],vista:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],groupmod:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],encrypt:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],when:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],actor:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],win_wget_p:27,role:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],test:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],roll:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],node:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],notif:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],intend:24,phoenix:34,null_separ:[],kvm:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],notepad:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],devop:[0,28,29,4,5,18],stompserv:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],intent:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],consid:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],sql:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],younger:7,search_attribut:1,longer:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],anywher:[6,32],ignor:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],time:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],push:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],backward:25,skip:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],consum:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],redis2:5,mysql_databas:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],netbsd:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],childn:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],row:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],millisecond:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],varnish:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],depend:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],zone:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],decim:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],installonlypkg:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],decis:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],jvm:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],aspx:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],undon:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],sourc:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],string:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],cookbooks_path:9,cloudstack:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],lru:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],template_filenam:27,brows:[6,32],public_hostnam:30,supervisor_group:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],windows_batch:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],hour:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],administr:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],level:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],did:12,item:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],cooki:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],reregist:[7,18],dir:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],validation_kei:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],windows_featur:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],bffcreat:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],trend:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],sign:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],cost:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],unprotect:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],learnchef:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],port:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],"5272a43f":12,raid5:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],appear:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],icinga:5,current:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],id3lib:5,reg_binari:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],executionpolici:27,gener:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],unauthor:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],satisfi:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],modif:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],address:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],along:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],redmin:5,wait:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],box:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],chef_environ:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],invit:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],netdev:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],checksum:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],membership:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],behav:24,healthi:12,regardless:27,rightscal:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],extra:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],modul:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],test_system:1,prefer:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],anagram:24,seattl:34,visibl:1,instal:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],regex:[29,3,28,0,18],memori:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],subvers:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],msn:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],live:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],handler:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],msi:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],criteria:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],checkout:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],peopl:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],rabbitmq_chef:5,visual:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],templat:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],trywgfa6r70no28pnhmpghevkbzuxouemnbnauqsuyo:33,effort:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],role_nam:[29,0,23],tokyo:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],uniqu:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],cat:1,descriptor:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],profitbrick:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],graphit:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],can:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],cloudkick_monitor:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],purpos:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],nearest:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],backslash:24,agent:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],topic:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],critic:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],recycl:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],occur:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],alwai:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],sundai:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],multipl:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],gem_packag:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],uptim:30,write:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],mixlib:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],windows_reboot:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],purg:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],webplcmdlin:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],stomp:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],map:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],product:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],omnitruck:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],max:26,clone:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],sp4:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],identity_fil:[30,27],appnam:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],mac:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],hklm:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],mai:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],log_level:[9,31,27],roundrobin:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],data:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],man:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],nullsoft:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],purge_before_symlink:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],logwatch:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],inform:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],preced:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],combin:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],talk:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],port_list:24,config_fil:10,ssh_wrapper:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],partial_search:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],ttl:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],gitignor:20,still:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],dynam:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],entiti:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],application_ruby_rail:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],conjunct:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],group:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],monitor:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],rvm:27,duplex:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],name_statu:[],platform:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],window:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],gem:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],mail:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],main:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],non:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],main_monitor:3,rake:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],initi:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],bound:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],run_stat:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],safari:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],half:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],nov:31,superset:24,discuss:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],term:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],name:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],drop:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],separ:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],junip:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],compil:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],domain:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],replac:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],individu:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],continu:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],unlock:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],gnu_parallel:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],year:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],happen:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],subnet:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],shown:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],"3rd":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],space:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],"100g":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],profil:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],vrrp:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],internet:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],formula:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],correct:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],hkey_us:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],orgtest:15,migrat:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],argv:1,mime:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],pacman_aur:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],org:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],"byte":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],care:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],reusabl:28,suffici:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],question:24,frequenc:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],synchron:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],homebrew_tap:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],turn:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],yum:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],fa0fc4abf3f6787aeb5c3c5c35de667c:28,router:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],principl:24,think:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],frequent:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],first:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],origin:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],directli:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],carri:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],onc:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],arrai:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],windows_auto_run:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],use_current_branch:[],fast:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],oppos:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],ring:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],open:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],predefin:1,size:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],given:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],reprepro:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],silent:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],install_chef:27,ssh_command:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],iaa:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],baremetalcloud:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],cumul:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],averag:30,white:26,apt_packag:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],json_attrib:[9,27],repo_mod:[],provinc:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],copi:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],full_control:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],artifact:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],broadcast:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],github:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],hup:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],mostli:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],nested_attribut:15,pecl:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],than:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],png:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],serv:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],wide:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],user_hom:[],sbuild:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],cloudkick_check:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],posix:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],balanc:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],were:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],posit:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],zsh:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],pre:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],lowest:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],config_cont:27,pro:24,delim:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],argument:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],client_kei:[24,31],ant:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],medium:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],smartos_packag:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],bash:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],extralarg:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],engin:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],displayvers:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],destroi:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],note:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],sendfil:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],ideal:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],copyright_hold:28,take:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],noth:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],channel:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],begin:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],sure:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],trace:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],normal:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],buffer:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],compress:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],statu:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],instiki:5,timestamped_deploi:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],beta:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],pair:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],application_ruby_passenger_apache2:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],collectstat:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],later:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],drive:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],reg_expand_sz:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],runtim:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],superblock:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],expand_str:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],steadi:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],review:[0,1,2,3,4,5,6,7,8,11,12,14,15,16,32,27,20,21,22,23,26,18,28,29,30,33,34],"4d44b5b":5,show:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],encrypted_data_bag_secret:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],concurr:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],permiss:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],sysctl:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],rotat:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],xml:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],onli:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],moneta:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],transact:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],activ:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],written:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],application_java_webapp:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],dword:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],hello_world:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],overwritten:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],nearli:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],variou:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],get:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],stdout_logfil:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],secondari:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],repo:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],ssl:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],cannot:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],ssh:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],requir:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],chef_shel:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],debian5:27,aptitud:30,netscalar:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],where:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],summari:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],wiki:[24,5],kernel:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],installshield:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],proce:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],endloc:27,data_bag:[24,33,14],python_pip:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],xenserv:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],detect:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],netdev_interfac:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],label:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],enough:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],volatil:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],between:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],"import":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],across:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],sname:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],parent:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],node_nam:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],screen:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],fundament:28,syntax_check_cache_path:24,uncondition:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],come:24,tue:31,gpasswd:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],uuid:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],windows_path:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],region:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],quiet:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],pychef:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],library_nam:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],datamapp:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],mani:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],runcontext:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],rabbitmq_vhost:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],reindex:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],prereleas:27,color:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],period:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],symfoni:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],colon:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],generic_writ:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],cancel:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],bluepil:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],ultim:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],west:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],rebuild:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],replace_str:26,altern:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],mark:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],spiceweasel:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],rebuilt:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],my_cookbook:28,rubi:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],editpad:24,bare_directori:[],those:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],"case":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],eip:20,pedant:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],mount:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],invok:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],librato:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],suse:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],application_nginx:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],stdout:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],metric:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],airbrak:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],cluster:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],ascii:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],aa384235:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],develop:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],dry_run:[],author:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],media:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],same:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],binari:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],html:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],document:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],week:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],finish:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],webserv:[20,29,30,23,6,32,27],see:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],nagios_nrpecheck:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],nest:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],confidenti:33,openldap:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],cinder:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],extern:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],repoforg:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],appropri:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],without:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],disassoci:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],model:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],etm:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],a29d6f254577b830091f140c3a78b1f:28,execut:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],loaderror:30,key_nam:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],rest:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],kill:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],aspect:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],org_cleanu:3,touch:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],passphras:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],http_proxi:27,speed:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],aws_access_key_id:24,samba:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],display_nam:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],hint:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],except:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],apache2:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],identif:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],instrument:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],blob:27,query_to_run:15,ruby1:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],pill:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],iis_app:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],real:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],around:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],ohai:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],read:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],traffic:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],platform_vers:28,world:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],yyyymmddhhmmss:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],meaning:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],iftop:5,integ:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],server:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],either:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],output:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],rubyv:1,manag:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],cisco:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],glesi:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],pushi:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],user_nam:[30,7],freez:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],rsync:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],keytab:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],easili:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],definit:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],appscript:30,exit:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],highcpu:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],portage_packag:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],knife:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],refer:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],power:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],asterisk:24,inspect:[6,13,19],a45298c9:12,starttim:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],fulli:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],bazaar:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],comparison:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],central:9,ack:5,gplv2:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],gplv3:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],appcmd:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],acl:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],chef_server_url:[24,31,25,27],act:25,backup:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],processor:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],effici:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],application_ruby_memcach:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],your:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],charli:33,hkey_current_config:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],log:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],application_nginx_load_balanc:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],daemontool:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],overwrit:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],start:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],interfac:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],ipv4:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],ipv6:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],lang:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],iis_pool:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],bundl:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],untar:5,cabinet:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],opensolari:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],activemq:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],faster:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],chefclientfeatur:27,pull:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],possibl:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],"default":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],pacman:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],powershell_script:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],vhd:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],embed:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],expect:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],cbc:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],displaynam:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],uid:33,creat:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],certain:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],remote_directori:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],yourcompani:24,chef_handl:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],fail2ban:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],file:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],fill:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],incorrect:31,file_maxbyt:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],googl:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],prepend:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],field:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],valid:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],you:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],trash:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],ssh_gatewai:[],architectur:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],openid:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],codecademi:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],registri:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],sublim:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],sequenc:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],symbol:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],pear:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],fsck:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],track:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],snitch:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],dropbox:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],djbdns_rr:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],pool:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],netdev_lag:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],directori:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],cookbook_copyright:24,mask:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],mash:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],use_etag:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],escap:24,cpu:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],scm:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],represent:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],all:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],selinux:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],forbidden:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],month:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],lacp:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],netdev_l2_interfac:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],follow:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],disk:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],children:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],sympa:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],dsl:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],init:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],program:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],app_conf:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],introduc:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],cloudkick:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],global:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],fals:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],secret_fil:[],subcommand:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],util:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],verb:[13,21,22,8,24,11,19],failur:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],veri:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],ossec:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],excluded_memb:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],list:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],recipe_fil:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],stderr:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],plain:33,small:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],pid_fil:31,enterpris:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],drbd:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],sync:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],past:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],syslog:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],rate:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],keyston:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],design:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],pass:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],ssh_attr:30,val2:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],val1:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],current_dir:24,devops_data:33,what:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],yum_repositori:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],sub:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],section:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],abl:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],brief:[12,13,19],rackspac:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],delet:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],abbrevi:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],version:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],noprofil:27,method:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],zookeep:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],full:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],hash:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],berkelei:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],situat:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],solari:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],trunk:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],gandi:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],fred:33,modifi:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],valu:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],thrift:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],search:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],memcach:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],prior:[13,19,20],amount:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],action:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],elsewher:9,transit:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],bluepill_servic:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],tmux:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],vim:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],filenam:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],iis_sit:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],establish:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],redisio:4,proceed:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],regist:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],two:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],validation_client_nam:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],taken:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],more:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],flat:8,aws_elastic_lb:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],desir:24,rpc_password:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],slicehost:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],flag:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],particular:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],known:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],compani:24,destin:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],cach:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],installroot:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],psql:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],none:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],endpoint:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],pkgbuild:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],dep:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],dev:[12,29,15,4],histori:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],oktawav:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],remain:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],hkey_local_machin:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],learn:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],deb:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],nagio:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],external_url:5,prompt:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],sensu:4,share:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],bootstrap_directori:27,accept:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],verify_non:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],minimum:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],poni:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],explor:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],csh:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],freshli:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],secur:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],rather:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],anoth:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],pxe_dust:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],reject:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],simpl:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],distro:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],regener:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],resourc:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],referenc:[7,18],vlan:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],fstype:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],rbac:24,bootstrap_vers:[],associ:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],application_php_mod_php_apache2:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],"short":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],postfix:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],created_at:5,django:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],caus:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],allkei:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],azur:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],logrot:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],opscod:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],help:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],templatefortextstr:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],i386:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],through:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],htop:5,paramet:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],create_dirs_before_symlink:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],systemd:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],exact:[29,15],pend:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],cookbook_nam:[0,23,5,28],bypass:[6,13,19],verbose_command:[],application_python_gunicorn:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],independ:24,"return":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],graylog2:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],timestamp:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],framework:31,detach:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],admin_nam:24,instruct:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],authent:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],"1password":5,userprofil:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],token:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],average_r:5,compris:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],found:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],unicod:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],only_if:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],truncat:[29,5],denni:7,"300mb":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],hard:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],crontab:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],connect:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],new_client:1,portland:34,beyond:24,event:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],ftp:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],vancouv:34,robert:7,publish:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],mirrorlist:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],print:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],occurr:26,file_nam:[28,7,18],pgdg:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],qualifi:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],asp:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],proxi:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],advanc:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],campfir:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],quick:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],reason:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],base:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],ask:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],workstat:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],lag:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],basi:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],launch:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],omit:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],perman:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],heartbeat:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],assign:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],notifi:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],prevent:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],number:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],placehold:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],env_vari:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],done:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],stdlib:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],stabl:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],file_atomic_upd:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],gpl:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],ssl_ca_path:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],php:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],script:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],ipaddress:1,interact:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],unrestrict:27,least:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],checkpoint:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],swarm:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],win2k8:15,storm:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],zeromq:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],scheme:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],journli:4,jetti:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],store:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],dpkg_packag:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],statement:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],behind:24,bag_nam:33,part:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],pars:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],consult:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],dpkg:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],reinstal:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],grep:[31,5,27],remot:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],remov:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],reg_qword:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],randomli:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],comput:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],gvim:24,packag:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],expir:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],dedic:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],"null":26,option:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],berkshelf:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],built:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],equival:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],also:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],centos5:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],rakefil:20,build:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],stackforg:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],splai:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],pipelin:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],distribut:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],exec:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],previou:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],reach:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],erlang_solut:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],most:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],private_kei:1,alpha:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],clear:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],cover:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],destruct:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],clojur:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],clean:30,microsoft:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],readme_format:[],carefulli:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],xcode:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],alphanumer:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],ignore_failur:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],session:25,value_data:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],fine:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],affin:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],cssh:30,firewal:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],pretti:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],solut:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],jtimberman:[5,27],darwin:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],yml:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],everysec:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],unus:[7,18],chef_gem:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],"__file__":24,express:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],verify_p:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],nativ:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],fastest:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],restart:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],"225f954f":12,data_bag_name_or_path:33,crt:20,boost:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],your_company_nam:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],common:[0,1,2,3,4,5,6,7,8,10,11,12,13,14,15,16,32,18,19,20,21,22,23,24,26,27,28,29,30,33,34],gelf:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],syntax_check_cach:24,certif:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],set:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],dump:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],creator:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],startup:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],ifconfig:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],emac:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],arg:26,reserv:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],ark:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],flavor:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],ps1:27,git_ssh:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],example_nod:1,jenkin:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],someth:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],subscript:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],max_arguments_per_command:[],solo:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],gemfil:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],ssh_password:[],numer:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],javascript:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],succeed:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],distinguish:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],solr:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],popul:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],both:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],reg_multi_sz:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],delimit:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],hint_nam:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],alon:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],pdn:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],context:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],lash:1,application_ruby_unicorn:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],load:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],markdown:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],point:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],schedul:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],header:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],shutdown:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],linux:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],ucspi:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],desktop:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],authz:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],rackspace_api_kei:24,unsuccess:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],java:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],devic:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],omnibu:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],empti:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],secret:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],strategi:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],atomic_upd:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],imag:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],understand:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],"0_8_0":5,bifrost:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],look:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],registry_kei:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],frozen:28,hkcc:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],bill:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],batch:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],durat:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],formatt:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],"while":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],corpsit:20,behavior:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],error:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],hkcr:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],maradn:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],loop:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],hkcu:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],ami:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],motd:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],key2:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],key1:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],readm:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],client_desc:1,dynect:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],itself:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],cento:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],skype:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],vcloud:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],unmount:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],fedora:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],grant:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],belong:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],hadoop:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],shorter:1,octal:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],conflict:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],higher:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],x86:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],"0_7_0":5,wherea:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],inflat:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],alert:5,jpackag:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],temporari:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],user:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],chang:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],recent:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],lower:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],sha1:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],lib:27,older:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],entri:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],person:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],reflect:4,elev:31,rbenv:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],propos:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],override_attribut:[4,0],mysql:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],openstack:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],"07z":5,shortcut:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],freebsd_port_opt:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],web03:15,appli:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],input:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],tell:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],subsequ:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],approxim:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],powershel:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],vendor:5,obsolet:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],fqdn_or_ip_address:27,format:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],ipmi:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],main_attribut:15,local_download_path:27,nginx:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],exceptionclass:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],bit:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],characterist:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],dynect_rr:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],fsync:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],signal:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],svlogd:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],resolv:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],elaps:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],collect:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],princip:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],"boolean":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],alrm:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],encount:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],vsphere:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],often:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],simplifi:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],add_formatt:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],acknowledg:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],creation:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],some:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],back:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],unspecifi:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],sampl:[29,33,0],staticfil:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],force_overrid:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],mirror:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],virtualenv:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],lamin:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],per:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],pem:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],retri:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],larg:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],application_python:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],slash:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],max_command_lin:[],proc:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],snort:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],machin:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],run:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],agreement:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],step:31,wget:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],crond:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],ufw:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],generic_read:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],constraint:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],drbdadm:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],idl:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],block:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],instance_typ:15,nsi:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],doubl:24,ohai_tim:1,smart_o_s_packag:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],opscodesupport:5,within:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],ensur:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],rundeck:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],errno:31,megabyt:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],"long":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],custom:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],includ:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],suit:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],forward:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],repo_nam:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],properli:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],ifcfg:15,myinstal:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],textpad:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],remote_source_msi_url:27,pwd:27,link:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],translat:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],newer:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],atom:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],noninteract:27,line:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],php_pear_channel:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],info:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],utc:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],consist:[24,0],munin:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],rabbitmq_plugin:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],nscd:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],similar:[13,18,14,20,21,30,15,28,4,22,29,34,24,8,9,11,19,27],nsca:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],supervisor:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],doesn:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],repres:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],"char":26,server01:30,incomplet:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],chat:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],curl:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],titl:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],sequenti:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],invalid:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],"_imag":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],librari:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],nice:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],gigabyt:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],mongodb:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],drag:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],percona:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],eval:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],splunk:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],ladvd:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],desert:23,svn:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],"1024mb":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],infrequ:[13,19,1],algorithm:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],confirm:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],svc:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],depth:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],minproc:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],chef_overview_attribut:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],hello:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],endtim:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],code:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],partial:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],queri:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],groupadd:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],steve:7,privat:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],ulimit:4,base64:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],send:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],aris:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],fatal:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],user_password:[],sent:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],passiv:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],unzip:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],vlc:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],volum:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],recip:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],magic:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],netdev_vlan:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],id_rsa:27,geograph:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],hive:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],"try":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],pleas:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],impli:15,jdk:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],cron:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],slackwar:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],download:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],click:31,append:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],compat:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],index:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],compar:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],a47823c9:12,gunicorn_instal:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],winrm:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],find:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],access:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],windows_registri:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],f65c969b:12,logloc:[9,31],isapi:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],hku:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],let:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],ubuntu:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],becom:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],sinc:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],convert:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],copyright:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],apt_prefer:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],aardvark:24,larger:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],converg:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],rpm_packag:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],ctl:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],typic:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],honor:25,configur:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],firefox:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],ago:12,danger:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],win:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],app:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],gatewai:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],apt:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],api:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],smartmon:28,redi:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],cloud:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],wix:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],from:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],zip:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],commun:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],hudson:5,upgrad:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],nexu:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],next:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],websit:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],few:31,use_conditional_get:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],usr:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],sort:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],src:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],mismatch:4,sbin:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],trail:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],"transient":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],iis_modul:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],starter:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],justin:24,account:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],chdir:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],retriev:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],tunnel:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],alia:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],crazi:33,fetch:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],control:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],sqlite:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],weaker:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],tap:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],tar:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],process:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],lock:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],sudo:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],cookbook_collect:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],high:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],tag:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],proprietari:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],tarbal:5,serial:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],someurlher:28,symlink_before_migr:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],delai:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],sit:24,zenpack:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],reg_dword:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],instead:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],opscode_us:24,zendmd:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],msdn:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],somelongurlher:28,overridden:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],watch:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],apicli:18,chef_repo_path:[20,21,32,23,22,6,8,11,26],physic:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],alloc:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],delete_kei:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],essenti:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],ssh_known_host:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],zenoss:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],correspond:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],issu:[24,31],client_foo:18,allow:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],yum_globalconfig:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],aws_secret_access_kei:24,jira:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],restorecon:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],comma:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],webpi_product:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],suppli:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],admin_client_nam:[],infrastructur:[9,24],openvpn:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],asa:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],bittorr:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],therefor:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],keepaliv:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],iis_config:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],greater:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],python:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],auto:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],rabbitmq_us:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],dai:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],auth:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],devel:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],rubygem:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],data_bag_item:33,fingerprint:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],front:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],file_cache_path:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],trac:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],anyth:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],edit:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],radiant:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],pacman_packag:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],"0a7cffd5":15,mode:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],all_cap:24,subset:[12,13,30,19,17],chunk:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],riak_clust:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],meta:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],"static":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],ec2:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],citrix:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],differ:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],special:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],out:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],variabl:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],gentoo:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],bag:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],armor:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],reboot:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],users_manag:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],rails_enterpris:5,categori:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],suitabl:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],rel:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],rem:27,hardwar:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],dhcp:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],"_default":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],merg:[0,5],local_destination_msi_path:27,red:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],sql_server:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],insid:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],workflow:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],kilobyt:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],standalon:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],releas:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],tenant:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],qpid:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],stackscript:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],could:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],put:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],fqdn:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],keep:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],length:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],outsid:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],retain:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],cookbook_fil:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],no_proxy_url_or_ip:27,polici:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],echo:27,date:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],ssh_attribut:[],puppet:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],pgp:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],kerbero:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],owner:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],facil:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],underscor:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],prioriti:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],unknown:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],licens:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],chefignor:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],capac:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],wrapper:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],attach:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],privaci:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],termin:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],"final":27,udp:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],shell:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],fuzzi:15,shallow:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],rdoc:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],rsa:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],exactli:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],haven:26,passenger_apache2:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],prune:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],split:1,stderr_logfil:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],structur:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],charact:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],sens:5,sensit:[24,33],torrent:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],start_tim:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],dmg_packag:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],disable_edit:[],plaintext:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],remote_fil:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],inno:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],download_directori:28,have:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],tabl:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],bootstrap_proxi:27,cfengin:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],freebsd_packag:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],min:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],rout:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],atim:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],accuraci:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],which:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],json_class:[0,14,28,29,4,7,18],datacent:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],zlib:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],mit:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],force_default:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],reposerv:27,unless:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],freebsd:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],deploy:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],who:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],oracl:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],discov:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],cipher:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],deploi:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],xarg:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],kuwata:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],segment:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],"class":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],p180:27,url:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],request:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],uri:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],recipe_url:9,deni:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],snapshot:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],determin:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],editpa:24,aws_elastic_ip:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],text:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],verbos:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],bring:31,nagl:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],vim74:24,redirect:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],highest:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],locat:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],launchpad:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],rackspace_usernam:24,terremark:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],"26am":31,jar:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],sendmail:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],should:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],local:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],contribut:5,"226ca64f":12,notat:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],familiar:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],passeng:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],autom:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],beam:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],increas:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],replace_al:[],enabl:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],organ:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],twice:29,upper:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],sudoer:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],num_to_keep:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],sha:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],integr:[9,17],contain:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],script_path:[],view:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],debconf:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],conform:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],legaci:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],libshadow:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],signatur:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],rc1:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],elast:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],temporarili:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],imagemagick:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],xxxxx:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],closer:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],datadog:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],impos:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],open_sourc:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],correctli:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],pattern:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],windows_shortcut:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],favor:30,state:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],progress:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],application_php:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],email:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],verifi:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],kei:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],retry_delai:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],job:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],entir:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],homebrew:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],swift:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],addit:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],plugin:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],admin:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],equal:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],etc:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],instanc:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],uncaught:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],testclient:18,strftime:1,resource_collect:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],comment:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],epel:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],pacman_group:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],replace_first:[],hyphen:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],chmod:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],name_onli:[],b4c32f2:5,rpm:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],ceilomet:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],mailto:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],quit:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],cookbook_email:24,yaml:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],bluelock:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],dword_big_endian:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],compos:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],insuffici:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],compon:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],json:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],ruleset:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],scriptabl:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],ia2itmjrsw8:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],immedi:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],capistrano:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],vmware:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],bulk:[29,28,0,18],togeth:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],last:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],thesecret123:33,present:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],authorized_kei:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],need:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],mvc3:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],samba_us:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],defin:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],hkey_current_us:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],flowdock:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],helper:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],squid:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],site:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],archiv:[9,5],lightweight:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],incom:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],revis:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],parti:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],member:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],handl:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],amazonec2tag:5,infer:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],backtrac:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],http:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],hostnam:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],again:33,keepal:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],upon:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],effect:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],identify_fil:30,logfil:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],yum_packag:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],tftp:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],expand:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],cosmet:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],center:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],not_if:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],well:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],exampl:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],command:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],digitalocean:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],fail:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],setx:27,latest:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],newest:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],paus:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],less:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],tcp:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],end_tim:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],webui:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],sdanna:5,simultan:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],sku:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],web:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],foo:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],add:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],myhelpermodul:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],apparmor:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],foobar:29,logger:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],warrant:[13,19,1],match:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],cookbook_path:24,cpan:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],know:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],mynod:[23,27],password:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],recurs:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],insert:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],tail:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],resid:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],like:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],success:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],latest_vers:5,amazonaw:[12,30],necessari:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],page:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],apachev2:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],shef:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],eucalyptu:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],revers:12,captur:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],twitter:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],installer_typ:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],kdc:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],msiexec:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],gevent:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],"export":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],flush:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],proper:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],home:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],supervisor_fcgi:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],transport:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],tmp:31,cookbookvers:28,leaf:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],leak:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],leav:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],"0a7ca19f":15,easy_install_packag:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],throttl:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],usag:[13,19,1],symlink:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],maven:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],vhost:5,host:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],offset:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],stage:4,homesick:5,about:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],ntlm:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],actual:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],socket:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],column:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],gunicorn_config:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],haproxi:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],loftninja:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],disabl:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],sort_revers:[],own:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],automat:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],guard:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],been:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],smarto:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],merb:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],virtualbox:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],"56g":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],omnio:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],transfer:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],netfx:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],singl:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],appl:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],downgrad:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],progra:24,"var":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],exampleorg:18,"function":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],unexpect:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],subscrib:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],baseurl:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],addloc:27,bff_packag:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],uninstal:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],oauth:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],inlin:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],bug:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],count:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],made:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],wise:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],arp_tabl:24,dmg:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],whether:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],aws_ebs_volum:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],displai:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],brightbox:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],asynchron:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],record:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],below:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],limit:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],lvm:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],otherwis:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],problem:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],extrasmal:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],pin:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],"int":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],descript:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],dure:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],pid:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],updated_at:5,ephemer:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],implement:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],ini:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],mtime:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],pip:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],daemontools_servic:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],inc:24,windows_zipfil:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],aws_resource_tag:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],boot:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],detail:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],virtual:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],other:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],branch:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],riak:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],upstart:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],juno:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],rackspace_api_usernam:24,"100m":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],sbdm:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],debian:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],stai:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],"25z":5,sphinx:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],tomcat:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],scientif:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],rule:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],blog:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],emerg:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],"0_8_1":5,cookbook:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34]},objtypes:{},titles:["knife role","knife exec","knife configure","knife recipe list","knife environment","knife cookbook site","knife download","knife user","knife list","chef-solo","Common Options","knife delete","knife status","chef-client Man Pages","knife raw","knife search","knife index rebuild","chef-server-ctl","knife client","knife","knife diff","knife edit","knife show","knife deps","Working with Knife","chef-shell","knife xargs","knife bootstrap","knife cookbook","knife node","knife ssh","chef-client","knife upload","knife data bag","knife tag"],objnames:{},filenames:["knife_role","knife_exec","knife_configure","knife_recipe_list","knife_environment","knife_cookbook_site","knife_download","knife_user","knife_list","ctl_chef_solo","knife_common_options","knife_delete","knife_status","index","knife_raw","knife_search","knife_index_rebuild","ctl_chef_server","knife_client","knife","knife_diff","knife_edit","knife_show","knife_deps","knife_using","ctl_chef_shell","knife_xargs","knife_bootstrap","knife_cookbook","knife_node","knife_ssh","ctl_chef_client","knife_upload","knife_data_bag","knife_tag"]})
\ No newline at end of file diff --git a/distro/common/man/man1/chef-shell.1 b/distro/common/man/man1/chef-shell.1 index d865ce52ae..9b00184610 100644 --- a/distro/common/man/man1/chef-shell.1 +++ b/distro/common/man/man1/chef-shell.1 @@ -1,4 +1,4 @@ -.TH "CHEF-SHELL" "1" "Chef 11.8.0" "" "chef-shell" +.TH "CHEF-SHELL" "1" "Chef 11.10.0" "" "chef-shell" .SH NAME chef-shell \- The man page for the chef-shell command line tool. . @@ -92,10 +92,10 @@ The configuration file to use. Shows help for the command. .TP .B \fB\-j PATH\fP, \fB\-\-json\-attributes PATH\fP -The path to a file that contains JSON data. Use this option to override attributes that are set from other locations, such as from within a cookbook or by a role. +The path to a file that contains JSON data. .TP -.B \fB\-l LEVEL\fP, \fB\-\-log_level LEVEL\fP -The level of logging that will be stored in a log file: \fBdebug\fP, \fBinfo\fP, \fBwarn\fP, \fBerror\fP, or \fBfatal\fP. +.B \fB\-l LEVEL\fP, \fB\-\-log\-level LEVEL\fP +The level of logging that will be stored in a log file. .TP .B \fB\-s\fP, \fB\-\-solo\fP Indicates that chef\-shell will be run in chef\-solo mode. @@ -110,6 +110,6 @@ The version of the chef\-client. Indicates that chef\-shell will be run in chef\-client mode. .UNINDENT .SH AUTHOR -Opscode +Chef .\" Generated by docutils manpage writer. . diff --git a/distro/common/man/man1/knife-bootstrap.1 b/distro/common/man/man1/knife-bootstrap.1 index c6c86a26b0..8b934f8ed7 100644 --- a/distro/common/man/man1/knife-bootstrap.1 +++ b/distro/common/man/man1/knife-bootstrap.1 @@ -1,4 +1,4 @@ -.TH "KNIFE-BOOTSTRAP" "1" "Chef 11.8.0" "" "knife bootstrap" +.TH "KNIFE-BOOTSTRAP" "1" "Chef 11.10.0" "" "knife bootstrap" .SH NAME knife-bootstrap \- The man page for the knife bootstrap subcommand. . @@ -34,9 +34,6 @@ level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] A bootstrap is a process that installs the chef\-client on a target system so that it can run as a chef\-client and communicate with a server. .sp The \fBknife bootstrap\fP subcommand is used run a bootstrap operation that installs the chef\-client on the target system. The bootstrap operation must specify the IP address or FQDN of the target system. -.IP Note -To bootstrap the chef\-client on Microsoft Windows machines, the \fI\%knife-windows\fP plugins is required, which includes the necessary bootstrap scripts that are used to do the actual installation. -.RE .sp \fBSyntax\fP .sp @@ -75,6 +72,10 @@ The port on which chef\-zero will listen. Indicates whether colored output will be used. .TP .B \fB\-d DISTRO\fP, \fB\-\-distro DISTRO\fP +.IP Warning +The default bootstrap operation uses the omnibus installer, which means the default template file (\fBchef\-full\fP) should work on all supported platforms. It is recommended to use custom bootstrap templates only when the omnibus installer cannot be used. +.RE +.sp The template file to be used during a bootstrap operation. The following distributions are supported: \fBchef\-full\fP (the default bootstrap), \fBcentos5\-gems\fP, \fBfedora13\-gems\fP, \fBubuntu10.04\-gems\fP, \fBubuntu10.04\-apt\fP, \fBubuntu12.04\-gems\fP, and the name of a custom bootstrap template file. When this option is used, Knife will search for the template file in the following order: the \fBbootstrap/\fP folder in the current working directory, the \fBbootstrap/\fP folder in the chef\-repo, the \fBbootstrap/\fP folder in the \fB~/.chef/\fP directory, or a default bootstrap file. Do not use the \fB\-\-template\-file\fP option when \fB\-\-distro\fP is specified. .TP .B \fB\-\-defaults\fP @@ -135,7 +136,7 @@ A comma\-separated list of roles and/or recipes to be applied. The URL for the server. .TP .B \fB\-\-secret SECRET\fP -The encryption key that is used for values contained within a data bag. +The encryption key that is used for values contained within a data bag item. .TP .B \fB\-\-secret\-file FILE\fP The path to the file that contains the encryption key. @@ -170,16 +171,12 @@ Indicates that the chef\-client will be run in local mode, which allows all comm .sp \fBExamples\fP .sp -To pass an SSH password as part of the command: -.sp .nf .ft C $ knife bootstrap 192.168.1.1 \-x username \-P PASSWORD \-\-sudo .ft P .fi .sp -To use a file that contains a private key: -.sp .nf .ft C $ knife bootstrap 192.168.1.1 \-x username \-i ~/.ssh/id_rsa \-\-sudo diff --git a/distro/common/man/man1/knife-client.1 b/distro/common/man/man1/knife-client.1 index 3431e35067..6303359f84 100644 --- a/distro/common/man/man1/knife-client.1 +++ b/distro/common/man/man1/knife-client.1 @@ -1,4 +1,4 @@ -.TH "KNIFE-CLIENT" "1" "Chef 11.8.0" "" "knife client" +.TH "KNIFE-CLIENT" "1" "Chef 11.10.0" "" "knife client" .SH NAME knife-client \- The man page for the knife client subcommand. . @@ -36,14 +36,6 @@ When a node runs the chef\-client for the first time, it generally does not yet Once the chef\-client has registered itself with the server, it no longer uses the validation client for anything. It is recommended that you delete the private key for the chef\-validator from the host after the host has registered or use the \fBdelete_validation\fP recipe that can be found in the \fBchef\-client\fP cookbook (\fI\%https://github.com/opscode-cookbooks/chef-client\fP). .sp The \fBknife client\fP subcommand is used to manage an API client list and their associated RSA public key\-pairs. This allows authentication requests to be made to the server by any entity that uses the Chef Server API, such as the chef\-client and Knife. -.sp -This subcommand has the following syntax: -.sp -.nf -.ft C -$ knife client [ARGUMENT] (options) -.ft P -.fi .SH COMMON OPTIONS .sp The following options may be used with any of the arguments available to the \fBknife client\fP subcommand: diff --git a/distro/common/man/man1/knife-configure.1 b/distro/common/man/man1/knife-configure.1 index 33feb16c0c..49b7f9dac5 100644 --- a/distro/common/man/man1/knife-configure.1 +++ b/distro/common/man/man1/knife-configure.1 @@ -1,4 +1,4 @@ -.TH "KNIFE-CONFIGURE" "1" "Chef 11.8.0" "" "knife configure" +.TH "KNIFE-CONFIGURE" "1" "Chef 11.10.0" "" "knife configure" .SH NAME knife-configure \- The man page for the knife configure subcommand. . @@ -35,7 +35,7 @@ The \fBknife configure\fP subcommand is used to create the knife.rb and client.r .sp \fBSyntax\fP .sp -This argument has the following syntax: +This argument has the following syntax when creating a knife.rb file: .sp .nf .ft C @@ -43,6 +43,14 @@ $ knife configure (options) .ft P .fi .sp +and the following syntax when creating a client.rb file: +.sp +.nf +.ft C +$ knife configure client DIRECTORY +.ft P +.fi +.sp \fBOptions\fP .sp This subcommand has the following options: @@ -120,16 +128,12 @@ Indicates that the chef\-client will be run in local mode, which allows all comm .sp \fBExamples\fP .sp -To create a knife.rb file, enter: -.sp .nf .ft C $ knife configure .ft P .fi .sp -To configure a client.rb, enter: -.sp .nf .ft C $ knife configure client \(aq/directory\(aq diff --git a/distro/common/man/man1/knife-cookbook-site.1 b/distro/common/man/man1/knife-cookbook-site.1 index ae76688144..d1a8a0a9da 100644 --- a/distro/common/man/man1/knife-cookbook-site.1 +++ b/distro/common/man/man1/knife-cookbook-site.1 @@ -1,4 +1,4 @@ -.TH "KNIFE-COOKBOOK-SITE" "1" "Chef 11.8.0" "" "knife cookbook site" +.TH "KNIFE-COOKBOOK-SITE" "1" "Chef 11.10.0" "" "knife cookbook site" .SH NAME knife-cookbook-site \- The man page for the knife cookbook site subcommand. . @@ -34,14 +34,6 @@ level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] The Cookbooks Site API is used to provide access to the cookbooks community hosted at \fI\%https://cookbooks.opscode.com\fP. All of the cookbooks in the community are accessible through a REST API located at \fI\%https://cookbooks.opscode.com/api/v1/\fP by using any of the supported endpoints. In most cases, using Knife and the \fBknife cookbook site\fP sub\-command (and any of its arguments) is the recommended method of interacting with these cookbooks, but in some cases, using the REST API directly may make sense. .sp The \fBknife cookbook site\fP subcommand is used to interact with cookbooks that are located at \fI\%https://cookbooks.opscode.com\fP. A user account is required for any community actions that write data to this site. The following arguments do not require a user account: \fBdownload\fP, \fBsearch\fP, \fBinstall\fP, and \fBlist\fP. -.sp -This subcommand has the following syntax: -.sp -.nf -.ft C -$ knife cookbook site [ARGUMENT] (options) -.ft P -.fi .SH COMMON OPTIONS .sp The following options may be used with any of the arguments available to the \fBknife cookbook site\fP subcommand: diff --git a/distro/common/man/man1/knife-cookbook.1 b/distro/common/man/man1/knife-cookbook.1 index 7e4c643f78..31648f0cd8 100644 --- a/distro/common/man/man1/knife-cookbook.1 +++ b/distro/common/man/man1/knife-cookbook.1 @@ -1,4 +1,4 @@ -.TH "KNIFE-COOKBOOK" "1" "Chef 11.8.0" "" "knife cookbook" +.TH "KNIFE-COOKBOOK" "1" "Chef 11.10.0" "" "knife cookbook" .SH NAME knife-cookbook \- The man page for the knife cookbook subcommand. . @@ -54,14 +54,6 @@ Metadata about recipes (including dependencies), version constraints, supported .UNINDENT .sp The \fBknife cookbook\fP subcommand is used to interact with cookbooks that are located on the server or the local chef\-repo. -.sp -This subcommand has the following syntax: -.sp -.nf -.ft C -$ knife cookbook [ARGUMENT] (options) -.ft P -.fi .SH COMMON OPTIONS .sp The following options may be used with any of the arguments available to the \fBknife cookbook\fP subcommand: @@ -143,7 +135,7 @@ Indicates that a cookbook (or cookbook version) will be removed entirely from th .sp \fBExamples\fP .sp -To bulk delete many cookbooks, use a regular expression to define the pattern: +Use a regular expression to define the pattern used to bulk delete cookbooks: .sp .nf .ft C @@ -265,7 +257,13 @@ Indicates that a cookbook (or cookbook version) will be removed entirely from th .sp \fBExamples\fP .sp -To delete version "0.8" from a cookbook named "smartmon", enter: +.nf +.ft C +$ knife cookbook delete cookbook_name version +.ft P +.fi +.sp +For example: .sp .nf .ft C @@ -375,8 +373,6 @@ The directory in which cookbook are created. This can be a colon\-separated path .sp \fBExamples\fP .sp -To generate metadata for all cookbooks: -.sp .nf .ft C $ knife cookbook metadata \-a @@ -402,8 +398,6 @@ This command does not have any specific options. .sp \fBExamples\fP .sp -To view cookbook metadata from a JSON file: -.sp .nf .ft C $ knife cookbook metadta from file /path/to/file @@ -553,11 +547,9 @@ The directory in which cookbook are created. This can be a colon\-separated path .sp \fBExamples\fP .sp -To test a cookbook named "getting\-started", enter: -.sp .nf .ft C -$ knife cookbook test getting\-started +$ knife cookbook test cookbook_name .ft P .fi .SH UPLOAD @@ -600,11 +592,9 @@ The directory in which cookbook are created. This can be a colon\-separated path .sp \fBExamples\fP .sp -To upload a cookbook named "getting\-started": -.sp .nf .ft C -$ knife cookbook upload getting\-started +$ knife cookbook upload cookbook_name .ft P .fi .sp diff --git a/distro/common/man/man1/knife-data-bag.1 b/distro/common/man/man1/knife-data-bag.1 index 88864af721..20f48dd2fa 100644 --- a/distro/common/man/man1/knife-data-bag.1 +++ b/distro/common/man/man1/knife-data-bag.1 @@ -1,4 +1,4 @@ -.TH "KNIFE-DATA-BAG" "1" "Chef 11.8.0" "" "knife data bag" +.TH "KNIFE-DATA-BAG" "1" "Chef 11.10.0" "" "knife data bag" .SH NAME knife-data-bag \- The man page for the knife data bag subcommand. . @@ -33,17 +33,9 @@ level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] .sp A data bag is a global variable that is stored as JSON data and is accessible from a server. A data bag is indexed for searching and can be loaded by a recipe or accessed during a search. The contents of a data bag can vary, but they often include sensitive information (such as database passwords). .sp -The contents of a data bag can be encrypted using \fI\%shared secret encryption\fP. This allows a data bag to store confidential information (such as a database password) or to be managed in a source control system (without plain\-text data appearing in revision history). +A data bag item may be encrypted using \fI\%shared secret encryption\fP. This allows each data bag item to store confidential information (such as a database password) or to be managed in a source control system (without plain\-text data appearing in revision history). Each data bag item may be encrypted individually; if a data bag contains multiple encrypted data bag items, these data bag items are not required to share the same encryption keys. .sp The \fBknife data bag\fP subcommand is used to manage arbitrary stores of globally available JSON data. -.sp -This subcommand has the following syntax: -.sp -.nf -.ft C -$ knife data bag [ARGUMENT] (options) -.ft P -.fi .SH COMMON OPTIONS .sp The following options may be used with any of the arguments available to the \fBknife data bag\fP subcommand: @@ -123,7 +115,7 @@ This argument has the following options: The name of a specific item within a data bag. .TP .B \fB\-\-secret SECRET\fP -The encryption key that is used for values contained within a data bag. +The encryption key that is used for values contained within a data bag item. .TP .B \fB\-\-secret\-file FILE\fP The path to the file that contains the encryption key. @@ -174,11 +166,9 @@ The name of a specific item within a data bag. .sp \fBExamples\fP .sp -To a data bag named "admins", enter: -.sp .nf .ft C -$ knife data bag delete admins +$ knife data bag delete data_bag_name .ft P .fi .sp @@ -214,7 +204,7 @@ This argument has the following options: The name of a specific item within a data bag. .TP .B \fB\-\-secret SECRET\fP -The encryption key that is used for values contained within a data bag. +The encryption key that is used for values contained within a data bag item. .TP .B \fB\-\-secret\-file FILE\fP The path to the file that contains the encryption key. @@ -298,7 +288,7 @@ This argument has the following options: Indicates that all data bags found at the specified path will be uploaded. .TP .B \fB\-\-secret SECRET\fP -The encryption key that is used for values contained within a data bag. +The encryption key that is used for values contained within a data bag item. .TP .B \fB\-\-secret\-file FILE\fP The path to the file that contains the encryption key. @@ -349,8 +339,6 @@ Indicates that the corresponding URIs will be shown. .sp \fBExamples\fP .sp -For example, to view a list of data bags on the server, enter: -.sp .nf .ft C $ knife data bag list @@ -379,7 +367,7 @@ This argument has the following options: The name of a specific item within a data bag. .TP .B \fB\-\-secret SECRET\fP -The encryption key that is used for values contained within a data bag. +The encryption key that is used for values contained within a data bag item. .TP .B \fB\-\-secret\-file FILE\fP The path to the file that contains the encryption key. @@ -390,15 +378,13 @@ For encrypted data bag items, use \fIeither\fP \fB\-\-secret\fP or \fB\-\-secret .sp \fBExamples\fP .sp -To show the contents of a data bag, enter: -.sp .nf .ft C $ knife data bag show admins .ft P .fi .sp -to return: +to return something like: .sp .nf .ft C diff --git a/distro/common/man/man1/knife-delete.1 b/distro/common/man/man1/knife-delete.1 index 078f8224d3..f5207b8dfc 100644 --- a/distro/common/man/man1/knife-delete.1 +++ b/distro/common/man/man1/knife-delete.1 @@ -1,4 +1,4 @@ -.TH "KNIFE-DELETE" "1" "Chef 11.8.0" "" "knife delete" +.TH "KNIFE-DELETE" "1" "Chef 11.10.0" "" "knife delete" .SH NAME knife-delete \- The man page for the knife delete subcommand. . diff --git a/distro/common/man/man1/knife-deps.1 b/distro/common/man/man1/knife-deps.1 index 1de4aa4b33..9199556f9b 100644 --- a/distro/common/man/man1/knife-deps.1 +++ b/distro/common/man/man1/knife-deps.1 @@ -1,4 +1,4 @@ -.TH "KNIFE-DEPS" "1" "Chef 11.8.0" "" "knife deps" +.TH "KNIFE-DEPS" "1" "Chef 11.10.0" "" "knife deps" .SH NAME knife-deps \- The man page for the knife deps subcommand. . @@ -120,32 +120,24 @@ Indicates that the chef\-client will be run in local mode, which allows all comm .sp \fBExamples\fP .sp -To find the dependencies for a node: -.sp .nf .ft C $ knife deps nodes/node_name.json .ft P .fi .sp -To find the dependencies for a role: -.sp .nf .ft C $ knife deps roles/role_name.json .ft P .fi .sp -To find the dependencies for a cookbook: -.sp .nf .ft C $ knife deps cookbooks/cookbook_name.json .ft P .fi .sp -To find the dependencies for an environment: -.sp .nf .ft C $ knife deps environments/environment_name.json @@ -160,7 +152,7 @@ $ knife deps cookbooks/git.json cookbooks/github.json roles/base.json environmen .ft P .fi .sp -To use a wildcard to return all the child nodes: +A wildcard can be used to return all of the child nodes. For example, all of the environments: .sp .nf .ft C @@ -189,7 +181,7 @@ roles/webserver.json .ft P .fi .sp -To pass the output of \fBknife deps\fP to \fBknife upload\fP, do something like the following: +The output of \fBknife deps\fP can be passed to \fBknife upload\fP: .sp .nf .ft C @@ -197,7 +189,7 @@ $ knife upload \(gaknife deps nodes/*.json .ft P .fi .sp -To pass the output of \fBknife deps\fP to \fBknife xargs\fP: +The output of \fBknife deps\fP can be passed to \fBknife xargs\fP: .sp .nf .ft C diff --git a/distro/common/man/man1/knife-diff.1 b/distro/common/man/man1/knife-diff.1 index c3ee7ae771..0ffd499991 100644 --- a/distro/common/man/man1/knife-diff.1 +++ b/distro/common/man/man1/knife-diff.1 @@ -1,4 +1,4 @@ -.TH "KNIFE-DIFF" "1" "Chef 11.8.0" "" "knife diff" +.TH "KNIFE-DIFF" "1" "Chef 11.10.0" "" "knife diff" .SH NAME knife-diff \- The man page for the knife diff subcommand. . diff --git a/distro/common/man/man1/knife-download.1 b/distro/common/man/man1/knife-download.1 index 29daeec0ed..f76fe9530c 100644 --- a/distro/common/man/man1/knife-download.1 +++ b/distro/common/man/man1/knife-download.1 @@ -1,4 +1,4 @@ -.TH "KNIFE-DOWNLOAD" "1" "Chef 11.8.0" "" "knife download" +.TH "KNIFE-DOWNLOAD" "1" "Chef 11.10.0" "" "knife download" .SH NAME knife-download \- The man page for the knife download subcommand. . @@ -31,7 +31,7 @@ level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] .\" Man page generated from reStructuredText. . .sp -The \fBknife download\fP subcommand is used to download roles, cookbooks, environments, nodes, and data bags from the server to the current working directory.. It can be used to back up data on the server, inspect the state of one or more files, or to extract out\-of\-process changes users may have made to files on the server, such as if a user made a change that bypassed version source control. This subcommand is often used in conjunction with \fBknife diff\fP, which can be used to see exactly what changes will be downloaded, and then \fBknife upload\fP, which does the opposite of \fBknife download\fP. +The \fBknife download\fP subcommand is used to download roles, cookbooks, environments, nodes, and data bags from the server to the current working directory. It can be used to back up data on the server, inspect the state of one or more files, or to extract out\-of\-process changes users may have made to files on the server, such as if a user made a change that bypassed version source control. This subcommand is often used in conjunction with \fBknife diff\fP, which can be used to see exactly what changes will be downloaded, and then \fBknife upload\fP, which does the opposite of \fBknife download\fP. .sp \fBSyntax\fP .sp diff --git a/distro/common/man/man1/knife-edit.1 b/distro/common/man/man1/knife-edit.1 index 84f808a286..aa9919b1a7 100644 --- a/distro/common/man/man1/knife-edit.1 +++ b/distro/common/man/man1/knife-edit.1 @@ -1,4 +1,4 @@ -.TH "KNIFE-EDIT" "1" "Chef 11.8.0" "" "knife edit" +.TH "KNIFE-EDIT" "1" "Chef 11.10.0" "" "knife edit" .SH NAME knife-edit \- The man page for the knife edit subcommand. . diff --git a/distro/common/man/man1/knife-environment.1 b/distro/common/man/man1/knife-environment.1 index 32ff9fb7a4..7d91ab7f22 100644 --- a/distro/common/man/man1/knife-environment.1 +++ b/distro/common/man/man1/knife-environment.1 @@ -1,4 +1,4 @@ -.TH "KNIFE-ENVIRONMENT" "1" "Chef 11.8.0" "" "knife environment" +.TH "KNIFE-ENVIRONMENT" "1" "Chef 11.10.0" "" "knife environment" .SH NAME knife-environment \- The man page for the knife environment subcommand. . @@ -34,14 +34,6 @@ level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] An environment is a way to map an organization\(aqs real\-life workflow to what can be configured and managed when using server. Every organization begins with a single environment called the \fB_default\fP environment, which cannot be modified (or deleted). Additional environments can be created to reflect each organization\(aqs patterns and workflow. For example, creating \fBproduction\fP, \fBstaging\fP, \fBtesting\fP, and \fBdevelopment\fP environments. Generally, an environment is also associated with one (or more) cookbook versions. .sp The \fBknife environment\fP subcommand is used to manage environments within a single organization on the server. -.sp -This subcommand has the following syntax: -.sp -.nf -.ft C -$ knife environment [ARGUMENT] (options) -.ft P -.fi .SH COMMON OPTIONS .sp The following options may be used with any of the arguments available to the \fBknife environment\fP subcommand: @@ -98,6 +90,113 @@ Indicates that the response to all confirmation prompts will be "Yes" (and that .B \fB\-z\fP, \fB\-\-local\-mode\fP Indicates that the chef\-client will be run in local mode, which allows all commands that work against the server to also work against the local chef\-repo. .UNINDENT +.SH COMPARE +.sp +The \fBcompare\fP argument is used to compare the cookbook version constraints that are set on one (or more) environments. +.sp +\fBSyntax\fP +.sp +This argument has the following syntax: +.sp +.nf +.ft C +$ knife environment compare [ENVIRONMENT_NAME...] (options) +.ft P +.fi +.sp +\fBOptions\fP +.sp +This argument has the following options: +.INDENT 0.0 +.TP +.B \fB\-a\fP, \fB\-\-all\fP +Indicates that all environments found at the specified path will be uploaded. +.TP +.B \fB\-m\fP, \fB\-\-mismatch\fP +Use to show only matching versions. +.UNINDENT +.sp +\fBExample\fP +.sp +To compare cookbook versions for a single environment: +.sp +.nf +.ft C +$ knife environment compare development +.ft P +.fi +.sp +to return something similar to: +.sp +.nf +.ft C + development +apache 2.3.1 +windows 4.1.2 +.ft P +.fi +.sp +To compare cookbook versions for multiple environments: +.sp +.nf +.ft C +$ knife environment compare development staging +.ft P +.fi +.sp +to return something similar to: +.sp +.nf +.ft C + development staging +apache 2.3.1 1.2.2 +windows 4.1.2 1.0.0 +postgresql 1.0.0 1.0.0 +.ft P +.fi +.sp +To compare all cookbook versions for all environments: +.sp +.nf +.ft C +$ knife environment compare \-\-all +.ft P +.fi +.sp +to return something similar to: +.sp +.nf +.ft C + staging development +ulimit latest latest +redisio latest latest +journly latest latest +aws latest latest +test latest latest +unicorn latest latest +sensu latest latest +runit latest latest +templater latest latest +powershell latest latest +openssl latest latest +rbenv latest latest +rabbitmq latest latest +postgresql latest latest +mysql latest latest +ohai latest latest +git latest latest +erlang latest latest +ssh_known_hosts latest latest +nginx latest latest +database latest latest +yum latest latest +xfs latest latest +apt latest latest +dmg latest latest +chef_handler latest latest +windows 1.0.0 4.1.2 +.ft P +.fi .SH CREATE .sp The \fBcreate\fP argument is used to add an environment object to the server. When this argument is run, Knife will open $EDITOR to enable editing of the \fBENVIRONMENT\fP description field (unless a description is specified as part of the command). When finished, Knife will add the environment to the server. diff --git a/distro/common/man/man1/knife-exec.1 b/distro/common/man/man1/knife-exec.1 index d931615119..f9a2c3b570 100644 --- a/distro/common/man/man1/knife-exec.1 +++ b/distro/common/man/man1/knife-exec.1 @@ -1,4 +1,4 @@ -.TH "KNIFE-EXEC" "1" "Chef 11.8.0" "" "knife exec" +.TH "KNIFE-EXEC" "1" "Chef 11.10.0" "" "knife exec" .SH NAME knife-exec \- The man page for the knife exec subcommand. . @@ -33,20 +33,6 @@ level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] .sp The \fBknife exec\fP subcommand uses the Knife configuration file to execute Ruby scripts in the context of a fully configured chef\-client. This subcommand is most often used to run scripts that will only access server one time (or otherwise very infrequently). Use this subcommand any time that an operation does not warrant full usage of the Knife subcommand library. .sp -For Ruby scripts that will be run using the \fBexec\fP subcommand, note the following: -.INDENT 0.0 -.INDENT 3.5 -.INDENT 0.0 -.IP \(bu 2 -The Ruby script must be located on the system from which Knife is run (and not be located on any of the systems that Knife will be managing). -.IP \(bu 2 -Shell commands will be run from a management workstation. For example, something like \fB%x[ls \-lash /opt/only\-on\-a\-node]\fP would give you the directory listing for the "opt/only\-on\-a\-node" directory or a "No such file or directory" error if the file does not already exist locally. -.IP \(bu 2 -When the chef\-shell DSL is available, the chef\-client DSL will not be (unless the management workstation is also a chef\-client). Without the chef\-client DSL, a bash block cannot be used to run bash commands. -.UNINDENT -.UNINDENT -.UNINDENT -.sp \fBAuthenticated API Requests\fP .sp The \fBknife exec\fP subcommand can be used to make authenticated API requests to the server using the following methods: diff --git a/distro/common/man/man1/knife-index-rebuild.1 b/distro/common/man/man1/knife-index-rebuild.1 index c3d3411ae0..03c8332a31 100644 --- a/distro/common/man/man1/knife-index-rebuild.1 +++ b/distro/common/man/man1/knife-index-rebuild.1 @@ -1,4 +1,4 @@ -.TH "KNIFE-INDEX-REBUILD" "1" "Chef 11.8.0" "" "knife index rebuild" +.TH "KNIFE-INDEX-REBUILD" "1" "Chef 11.10.0" "" "knife index rebuild" .SH NAME knife-index-rebuild \- The man page for the knife index rebuild subcommand. . diff --git a/distro/common/man/man1/knife-list.1 b/distro/common/man/man1/knife-list.1 index 233c9dcc3d..acc3fe47c7 100644 --- a/distro/common/man/man1/knife-list.1 +++ b/distro/common/man/man1/knife-list.1 @@ -1,4 +1,4 @@ -.TH "KNIFE-LIST" "1" "Chef 11.8.0" "" "knife list" +.TH "KNIFE-LIST" "1" "Chef 11.10.0" "" "knife list" .SH NAME knife-list \- The man page for the knife list subcommand. . diff --git a/distro/common/man/man1/knife-node.1 b/distro/common/man/man1/knife-node.1 index 0e1b46b655..1eae3344f2 100644 --- a/distro/common/man/man1/knife-node.1 +++ b/distro/common/man/man1/knife-node.1 @@ -1,4 +1,4 @@ -.TH "KNIFE-NODE" "1" "Chef 11.8.0" "" "knife node" +.TH "KNIFE-NODE" "1" "Chef 11.10.0" "" "knife node" .SH NAME knife-node \- The man page for the knife node subcommand. . @@ -34,14 +34,6 @@ level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] A node is any physical, virtual, or cloud machine that is configured to be maintained by a chef\-client. .sp The \fBknife node\fP subcommand is used to manage the nodes that exist on a server. -.sp -This subcommand has the following syntax: -.sp -.nf -.ft C -$ knife node [ARGUMENT] (options) -.ft P -.fi .SH COMMON OPTIONS .sp The following options may be used with any of the arguments available to the \fBknife node\fP subcommand: @@ -118,7 +110,7 @@ This command does not have any specific options. .sp \fBExamples\fP .sp -To bulk delete many nodes, use a regular expression to define the pattern: +Use a regular expression to define the pattern used to bulk delete nodes: .sp .nf .ft C @@ -204,11 +196,9 @@ This command does not have any specific options. .sp \fBExamples\fP .sp -To delete a node called "dev", enter: -.sp .nf .ft C -$ knife node delete dev +$ knife node delete node_name .ft P .fi .SH EDIT diff --git a/distro/common/man/man1/knife-raw.1 b/distro/common/man/man1/knife-raw.1 index cb7c557077..4965ea315b 100644 --- a/distro/common/man/man1/knife-raw.1 +++ b/distro/common/man/man1/knife-raw.1 @@ -1,4 +1,4 @@ -.TH "KNIFE-RAW" "1" "Chef 11.8.0" "" "knife raw" +.TH "KNIFE-RAW" "1" "Chef 11.10.0" "" "knife raw" .SH NAME knife-raw \- The man page for the knife raw subcommand. . diff --git a/distro/common/man/man1/knife-recipe-list.1 b/distro/common/man/man1/knife-recipe-list.1 index 846b3c6b47..06f8936f70 100644 --- a/distro/common/man/man1/knife-recipe-list.1 +++ b/distro/common/man/man1/knife-recipe-list.1 @@ -1,4 +1,4 @@ -.TH "KNIFE-RECIPE-LIST" "1" "Chef 11.8.0" "" "knife recipe list" +.TH "KNIFE-RECIPE-LIST" "1" "Chef 11.10.0" "" "knife recipe list" .SH NAME knife-recipe-list \- The man page for the knife recipe list subcommand. . diff --git a/distro/common/man/man1/knife-role.1 b/distro/common/man/man1/knife-role.1 index c26d953b2d..347eac4c82 100644 --- a/distro/common/man/man1/knife-role.1 +++ b/distro/common/man/man1/knife-role.1 @@ -1,4 +1,4 @@ -.TH "KNIFE-ROLE" "1" "Chef 11.8.0" "" "knife role" +.TH "KNIFE-ROLE" "1" "Chef 11.10.0" "" "knife role" .SH NAME knife-role \- The man page for the knife role subcommand. . @@ -34,14 +34,6 @@ level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] A role is a way to define certain patterns and processes that exist across nodes in an organization as belonging to a single job function. Each role consists of zero (or more) attributes and a run list. Each node can have zero (or more) roles assigned to it. When a role is run against a node, the configuration details of that node are compared against the attributes of the role, and then the contents of that role\(aqs run list are applied to the node\(aqs configuration details. When a chef\-client runs, it merges its own attributes and run lists with those contained within each assigned role. .sp The \fBknife role\fP subcommand is used to manage the roles that are associated with one or more nodes on a server. -.sp -This subcommand has the following syntax: -.sp -.nf -.ft C -$ knife role [ARGUMENT] (options) -.ft P -.fi .SH COMMON OPTIONS .sp The following options may be used with any of the arguments available to the \fBknife role\fP subcommand: @@ -118,7 +110,7 @@ This command does not have any specific options. .sp \fBExamples\fP .sp -To bulk delete roles using a regular expression: +Use a regular expression to define the pattern used to bulk delete roles: .sp .nf .ft C @@ -200,8 +192,6 @@ This command does not have any specific options. .sp \fBExamples\fP .sp -To delete a role: -.sp .nf .ft C $ knife role delete devops diff --git a/distro/common/man/man1/knife-search.1 b/distro/common/man/man1/knife-search.1 index 689e2f14b4..6cd09b57f4 100644 --- a/distro/common/man/man1/knife-search.1 +++ b/distro/common/man/man1/knife-search.1 @@ -1,4 +1,4 @@ -.TH "KNIFE-SEARCH" "1" "Chef 11.8.0" "" "knife search" +.TH "KNIFE-SEARCH" "1" "Chef 11.10.0" "" "knife search" .SH NAME knife-search \- The man page for the knife search subcommand. . @@ -31,7 +31,7 @@ level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] .\" Man page generated from reStructuredText. . .sp -Search indexes allow queries to be made for any type of data that is indexed by the server, including data bags (and data bag items), environments, nodes, and roles. A defined query syntax is used to support search patterns like exact, wildcard, range, and fuzzy. A search is a full\-text query that can be done from several locations, including from within a recipe, by using the \fBsearch\fP subcommand in Knife, by using the search functionality in the Chef Manager, or by using the \fB/search\fP or \fB/search/INDEX\fP endpoints in the Chef Server API. The search engine is based on Apache Solr and is run from the server. +Search indexes allow queries to be made for any type of data that is indexed by the server, including data bags (and data bag items), environments, nodes, and roles. A defined query syntax is used to support search patterns like exact, wildcard, range, and fuzzy. A search is a full\-text query that can be done from several locations, including from within a recipe, by using the \fBsearch\fP subcommand in Knife, by using the search functionality in the Chef Manage, or by using the \fB/search\fP or \fB/search/INDEX\fP endpoints in the Chef Server API. The search engine is based on Apache Solr and is run from the server. .sp The \fBknife search\fP subcommand is used run a search query for information that is indexed on a server. .sp @@ -76,7 +76,7 @@ and is the same search as: .sp .nf .ft C -$ knife node search \(aq*:*" \-i +$ knife search node \(aq*:*" \-i .ft P .fi .sp @@ -264,7 +264,7 @@ $ knife search node <query_to_run> \-a <main_attribute>.<nested_attribute> .ft P .fi .sp -To build a search query to use more than one attribute, use an underscore ( _ ) to separate each attribute. For example, the following query will search for all nodes running a specific version of Ruby: +To build a search query to use more than one attribute, use an underscore (\fB_\fP) to separate each attribute. For example, the following query will search for all nodes running a specific version of Ruby: .sp .nf .ft C @@ -284,7 +284,7 @@ To test a search query that will be used in a \fBknife ssh\fP command: .sp .nf .ft C -$ knife search node "role:web AND NOT name:web03" +$ knife search node "role:web NOT name:web03" .ft P .fi .sp diff --git a/distro/common/man/man1/knife-show.1 b/distro/common/man/man1/knife-show.1 index 2723ae431b..6ec1d14f0d 100644 --- a/distro/common/man/man1/knife-show.1 +++ b/distro/common/man/man1/knife-show.1 @@ -1,4 +1,4 @@ -.TH "KNIFE-SHOW" "1" "Chef 11.8.0" "" "knife show" +.TH "KNIFE-SHOW" "1" "Chef 11.10.0" "" "knife show" .SH NAME knife-show \- The man page for the knife show subcommand. . @@ -133,8 +133,6 @@ $ knife show .ft P .fi .sp -To show roles and environments: -.sp .nf .ft C $ knife show roles/ environments/ diff --git a/distro/common/man/man1/knife-ssh.1 b/distro/common/man/man1/knife-ssh.1 index 1c4b2adf54..e50e7ebdb8 100644 --- a/distro/common/man/man1/knife-ssh.1 +++ b/distro/common/man/man1/knife-ssh.1 @@ -1,4 +1,4 @@ -.TH "KNIFE-SSH" "1" "Chef 11.8.0" "" "knife ssh" +.TH "KNIFE-SSH" "1" "Chef 11.10.0" "" "knife ssh" .SH NAME knife-ssh \- The man page for the knife ssh subcommand. . @@ -161,8 +161,6 @@ ec2\-184\-73\-60\-141.compute\-1.amazonaws.com 13:50:48 up 1 day, 23:30, 1 u .ft P .fi .sp -To run the chef\-client on all nodes, enter: -.sp .nf .ft C $ knife ssh \(aqname:*\(aq \(aqsudo chef\-client\(aq @@ -217,8 +215,6 @@ $ knife ssh "role:webserver" "sudo chef\-client" .ft P .fi .sp -To upgrade all nodes, enter: -.sp .nf .ft C $ knife ssh name:* "sudo aptitude upgrade \-y" diff --git a/distro/common/man/man1/knife-status.1 b/distro/common/man/man1/knife-status.1 index 8036e5588e..544129e2f8 100644 --- a/distro/common/man/man1/knife-status.1 +++ b/distro/common/man/man1/knife-status.1 @@ -1,4 +1,4 @@ -.TH "KNIFE-STATUS" "1" "Chef 11.8.0" "" "knife status" +.TH "KNIFE-STATUS" "1" "Chef 11.10.0" "" "knife status" .SH NAME knife-status \- The man page for the knife status subcommand. . diff --git a/distro/common/man/man1/knife-tag.1 b/distro/common/man/man1/knife-tag.1 index f2cb86dcfc..b9e9343b73 100644 --- a/distro/common/man/man1/knife-tag.1 +++ b/distro/common/man/man1/knife-tag.1 @@ -1,4 +1,4 @@ -.TH "KNIFE-TAG" "1" "Chef 11.8.0" "" "knife tag" +.TH "KNIFE-TAG" "1" "Chef 11.10.0" "" "knife tag" .SH NAME knife-tag \- The man page for the knife tag subcommand. . @@ -34,14 +34,6 @@ level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] A tag is a custom description that is applied to a node. A tag, once applied, can be helpful when managing nodes using Knife or when building recipes by providing alternate methods of grouping similar types of information. .sp The \fBknife tag\fP subcommand is used to apply tags to nodes on a server. -.sp -This subcommand has the following syntax: -.sp -.nf -.ft C -$ knife tag [ARGUMENT] -.ft P -.fi .SH COMMON OPTIONS .sp The following options may be used with any of the arguments available to the \fBknife tag\fP subcommand: diff --git a/distro/common/man/man1/knife-upload.1 b/distro/common/man/man1/knife-upload.1 index 7cd0fb5fdf..e51c9ebcbe 100644 --- a/distro/common/man/man1/knife-upload.1 +++ b/distro/common/man/man1/knife-upload.1 @@ -1,4 +1,4 @@ -.TH "KNIFE-UPLOAD" "1" "Chef 11.8.0" "" "knife upload" +.TH "KNIFE-UPLOAD" "1" "Chef 11.10.0" "" "knife upload" .SH NAME knife-upload \- The man page for the knife upload subcommand. . @@ -129,7 +129,7 @@ Indicates that the chef\-client will be run in local mode, which allows all comm .sp \fBExamples\fP .sp -To upload the entire chef\-repo to the server, browse to the top level of the chef\-repo and enter: +Browse to the top level of the chef\-repo and enter: .sp .nf .ft C @@ -145,7 +145,7 @@ $ knife upload / .ft P .fi .sp -To upload the \fBcookbooks/\fP directory to the server, browse to the top level of the chef\-repo and enter: +Browse to the top level of the chef\-repo and enter: .sp .nf .ft C @@ -161,7 +161,7 @@ $ knife upload /cookbooks .ft P .fi .sp -To upload the \fBenvironments/\fP directory to the server, browse to the top level of the chef\-repo and enter: +Browse to the top level of the chef\-repo and enter: .sp .nf .ft C @@ -177,7 +177,7 @@ $ knife upload /environments .ft P .fi .sp -To upload an environment named "production" to the server, browse to the top level of the chef\-repo and enter: +Browse to the top level of the chef\-repo and enter: .sp .nf .ft C @@ -193,7 +193,7 @@ $ knife upload production.json .ft P .fi .sp -To upload the \fBroles/\fP directory to the server, browse to the top level of the chef\-repo and enter: +Browse to the top level of the chef\-repo and enter: .sp .nf .ft C @@ -209,7 +209,7 @@ $ knife upload /roles .ft P .fi .sp -To upload all cookbooks that start with "apache" and belong to the "webserver" role, browse to the top level of the chef\-repo and enter: +Browse to the top level of the chef\-repo and enter: .sp .nf .ft C @@ -217,8 +217,6 @@ $ knife upload cookbooks/apache\e* roles/webserver.json .ft P .fi .sp -Use the output of \fBknife deps\fP to pass a command to \fBknife upload\fP. For example: -.sp .nf .ft C $ knife upload \(gaknife deps nodes/*.json\(ga diff --git a/distro/common/man/man1/knife-user.1 b/distro/common/man/man1/knife-user.1 index 344fa55029..978a0e7d43 100644 --- a/distro/common/man/man1/knife-user.1 +++ b/distro/common/man/man1/knife-user.1 @@ -1,4 +1,4 @@ -.TH "KNIFE-USER" "1" "Chef 11.8.0" "" "knife user" +.TH "KNIFE-USER" "1" "Chef 11.10.0" "" "knife user" .SH NAME knife-user \- The man page for the knife user subcommand. . @@ -33,16 +33,8 @@ level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] .sp The \fBknife user\fP subcommand is used to manage the list of users and their associated RSA public key\-pairs. .IP Note -This subcommand ONLY works when run against the open source server and will not run against Enterprise Chef (including hosted Enterprise Chef), or Private Chef. +This subcommand ONLY works when run against the open source server version 10.x. This subcommand will NOT run against open source server 11, Enterprise Chef (including hosted Enterprise Chef), or Private Chef. .RE -.sp -This subcommand has the following syntax: -.sp -.nf -.ft C -$ knife user [ARGUMENT] (options) -.ft P -.fi .SH COMMON OPTIONS .sp The following options may be used with any of the arguments available to the \fBknife user\fP subcommand: @@ -139,8 +131,6 @@ All users are assigned a public key. Use to write the public key to a file. .sp \fBExamples\fP .sp -To create a new user named "Radio Birdman" with a private key saved to "/keys/user_name", enter: -.sp .nf .ft C $ knife user create "Radio Birdman" \-f /keys/user_name @@ -166,8 +156,6 @@ This command does not have any specific options. .sp \fBExamples\fP .sp -To delete a user named "Steve Danno", enter: -.sp .nf .ft C $ knife user delete "Steve Danno" @@ -248,8 +236,6 @@ Indicates that the private key will be saved to a specified file name. .sp \fBExamples\fP .sp -To regenerate the RSA key pair for a user named "Robert Younger", enter: -.sp .nf .ft C $ knife user reregister "Robert Younger" @@ -307,7 +293,7 @@ $ knife user show "Dennis Teck" \-F json .ft P .fi .sp -Other formats available include \fBtext\fP, \fByaml\fP, and \fBpp\fP. +(Other formats available include \fBtext\fP, \fByaml\fP, and \fBpp\fP, e.g. \fB\-F yaml\fP for YAML.) .SH AUTHOR Chef .\" Generated by docutils manpage writer. diff --git a/distro/common/man/man1/knife-xargs.1 b/distro/common/man/man1/knife-xargs.1 index ead1c680d9..b0e8f0b22d 100644 --- a/distro/common/man/man1/knife-xargs.1 +++ b/distro/common/man/man1/knife-xargs.1 @@ -1,4 +1,4 @@ -.TH "KNIFE-XARGS" "1" "Chef 11.8.0" "" "knife xargs" +.TH "KNIFE-XARGS" "1" "Chef 11.10.0" "" "knife xargs" .SH NAME knife-xargs \- The man page for the knife xargs subcommand. . @@ -144,8 +144,6 @@ Indicates that the chef\-client will be run in local mode, which allows all comm .sp \fBExamples\fP .sp -To use the output of \fBknife deps\fP to pass a command to \fBknife xargs\fP. For example: -.sp .nf .ft C $ knife deps nodes/*.json | xargs knife upload diff --git a/distro/common/man/man8/chef-client.8 b/distro/common/man/man8/chef-client.8 index ffe6fdbb28..ff10522772 100644 --- a/distro/common/man/man8/chef-client.8 +++ b/distro/common/man/man8/chef-client.8 @@ -1,4 +1,4 @@ -.TH "CHEF-CLIENT" "8" "Chef 11.8.0" "" "chef-client" +.TH "CHEF-CLIENT" "8" "Chef 11.10.0" "" "chef-client" .SH NAME chef-client \- The man page for the chef-client command line tool. . @@ -67,20 +67,17 @@ This command has the following options: .B \fB\-A\fP, \fB\-\-fatal\-windows\-admin\-check\fP Indicates that a chef\-client run should fail if the chef\-client does not have administrator privileges in Microsoft Windows. .TP -.B \fB\-c CONFIG\fP, \fB\-\-config CONFIG\fP -The configuration file to use. -.TP -.B \fB\-d\fP, \fB\-\-daemonize\fP -Indicates that the executable will be run as a daemon. This option is only available on machines that run in UNIX or Linux environments. For machines that are running Microsoft Windows that require similar functionality, use the \fBchef\-client::service\fP recipe in the \fBchef\-client\fP cookbook: \fI\%http://community.opscode.com/cookbooks/chef-client\fP. This will install a chef\-client service under Microsoft Windows using the Windows Service Wrapper. -.TP -.B \fB\-E ENVIRONMENT_NAME\fP, \fB\-\-environment ENVIRONMENT_NAME\fP -The name of the environment. -.TP -.B \fB\-f\fP, \fB\-\-fork\fP -Indicates that a chef\-client run will be contained in a secondary process with dedicated RAM. When the chef\-client run is complete the RAM will be returned to the master process. This option helps ensure that a chef\-client will use a steady amount of RAM over time because the master process will not run recipes. This option will also help prevent memory leaks (such as those that can be introduced by the code contained within a poorly designed cookbook). Use \fB\-\-no\-fork\fP to disable running the chef\-client in fork node. Default value: \fB\-\-fork\fP. +.B \fB\-\-chef\-zero\-port PORT\fP +The port on which chef\-zero will listen. .TP .B \fB\-F FORMAT\fP, \fB\-\-format FORMAT\fP -The output format: \fBdoc\fP (default) or \fBmin\fP. Other formatting options are available by using 3rd party formatters. +The output format: \fBdoc\fP (default) or \fBmin\fP. +.sp +Use \fBdoc\fP to print the progress of the chef\-client run using full strings that display a summary of updates as they occur. +.sp +Use \fBmin\fP to print the progress of the chef\-client run using single characters. A summary of updates is printed at the end of the chef\-client run. A dot (\fB.\fP) is printed for events that do not have meaningful status information, such as loading a file or synchronizing a cookbook. For resources, a dot (\fB.\fP) is printed when the resource is up to date, an \fBS\fP is printed when the resource is skipped by \fBnot_if\fP or \fBonly_if\fP, and a \fBU\fP is printed when the resource is updated. +.sp +Other formatting options are available when those formatters are configured in the client.rb file using the \fBadd_formatter\fP option. .TP .B \fB\-\-force\-formatter\fP Indicates that formatter output will be used instead of logger output. @@ -98,7 +95,7 @@ Shows help for the command. The frequency (in seconds) at which the chef\-client runs. Default value: \fB1800\fP. .TP .B \fB\-j PATH\fP, \fB\-\-json\-attributes PATH\fP -The path to a file that contains JSON data. Use this option to override attributes that are set from other locations, such as from within a cookbook or by a role. +The path to a file that contains JSON data. .TP .B \fB\-k KEY_FILE\fP, \fB\-\-client_key KEY_FILE\fP The location of the file which contains the client key. Default value: \fB/etc/chef/client.pem\fP. @@ -107,13 +104,13 @@ The location of the file which contains the client key. Default value: \fB/etc/c The location of the file which contains the key used when a chef\-client is registered with a server. A validation key is signed using the \fBvalidation_client_name\fP for authentication. Default value: \fB/etc/chef/validation.pem\fP. .TP .B \fB\-l LEVEL\fP, \fB\-\-log_level LEVEL\fP -The level of logging that will be stored in a log file: \fBdebug\fP, \fBinfo\fP, \fBwarn\fP, \fBerror\fP, or \fBfatal\fP. +The level of logging that will be stored in a log file. .TP .B \fB\-L LOGLOCATION\fP, \fB\-\-logfile c\fP The location in which log file output files will be saved. If this location is set to something other than \fBSTDOUT\fP, standard output logging will still be performed (otherwise there would be no output other than to a file). This is recommended when starting any executable as a daemon. Default value: \fBSTDOUT\fP. .TP .B \fB\-\-[no\-]color\fP -Indicates that color will not be used in the output. Default setting: \fB\-\-color\fP. +Indicates whether colored output will be used. Default setting: \fB\-\-color\fP. .TP .B \fB\-N NODE_NAME\fP, \fB\-\-node\-name NODE_NAME\fP The name of the node. @@ -130,6 +127,9 @@ The location in which a process identification number (pid) is saved. An executa .B \fB\-R\fP, \fB\-\-enable\-reporting\fP Indicates that data collection reporting is enabled during a chef\-client run. .TP +.B \fBRECIPE_FILE\fP +The path to a recipe. For example, if a recipe file is in the current directory, use \fBrecipe_file.rb\fP. This is typically used with the \fB\-\-local\-mode\fP option. +.TP .B \fB\-s SECONDS\fP, \fB\-\-splay SECONDS\fP A number (in seconds) to add to the \fBinterval\fP that is used to determine the frequency of chef\-client runs. This number can help prevent server load when there are many clients running at the same time. .TP @@ -146,7 +146,7 @@ The version of the chef\-client. Indicates that the executable will be run in why\-run mode, which is a type of chef\-client run that does everything except modify the system. Use why\-run mode to understand why the chef\-client makes the decisions that it makes and to learn more about the current and proposed state of the system. .TP .B \fB\-z\fP, \fB\-\-local\-mode\fP -Indicates that the chef\-client will be run in local mode, which allows all commands that work against the server to also work against the local chef\-repo. +Indicates that the chef\-client will be run in local mode, which allows all commands that work against the server to also work against the local chef\-repo.. .UNINDENT .SH RUN WITH ELEVATED PRIVILEGES .sp @@ -268,6 +268,6 @@ $ sudo kill \-USR1 66066 .ft P .fi .SH AUTHOR -Opscode +Chef .\" Generated by docutils manpage writer. . diff --git a/distro/common/man/man8/chef-solo.8 b/distro/common/man/man8/chef-solo.8 index 96225627a1..5c56608fba 100644 --- a/distro/common/man/man8/chef-solo.8 +++ b/distro/common/man/man8/chef-solo.8 @@ -1,4 +1,4 @@ -.TH "CHEF-SOLO" "8" "Chef 11.8.0" "" "chef-solo" +.TH "CHEF-SOLO" "8" "Chef 11.10.0" "" "chef-solo" .SH NAME chef-solo \- The man page for the chef-solo command line tool. . @@ -74,7 +74,13 @@ The name of the environment. Indicates that a chef\-client run will be contained in a secondary process with dedicated RAM. When the chef\-client run is complete the RAM will be returned to the master process. This option helps ensure that a chef\-client will use a steady amount of RAM over time because the master process will not run recipes. This option will also help prevent memory leaks (such as those that can be introduced by the code contained within a poorly designed cookbook). Use \fB\-\-no\-fork\fP to disable running the chef\-client in fork node. Default value: \fB\-\-fork\fP. .TP .B \fB\-F FORMAT\fP, \fB\-\-format FORMAT\fP -The output format: \fBdoc\fP (default) or \fBmin\fP. Other formatting options are available by using 3rd party formatters. +The output format: \fBdoc\fP (default) or \fBmin\fP. +.sp +Use \fBdoc\fP to print the progress of the chef\-client run using full strings that display a summary of updates as they occur. +.sp +Use \fBmin\fP to print the progress of the chef\-client run using single characters. A summary of updates is printed at the end of the chef\-client run. A dot (\fB.\fP) is printed for events that do not have meaningful status information, such as loading a file or synchronizing a cookbook. For resources, a dot (\fB.\fP) is printed when the resource is up to date, an \fBS\fP is printed when the resource is skipped by \fBnot_if\fP or \fBonly_if\fP, and a \fBU\fP is printed when the resource is updated. +.sp +Other formatting options are available when those formatters are configured in the client.rb file using the \fBadd_formatter\fP option. .TP .B \fB\-\-force\-formatter\fP Indicates that formatter output will be used instead of logger output. @@ -92,16 +98,16 @@ Shows help for the command. The frequency (in seconds) at which the chef\-client runs. .TP .B \fB\-j PATH\fP, \fB\-\-json\-attributes PATH\fP -The path to a file that contains JSON data. Use this option to override attributes that are set from other locations, such as from within a cookbook or by a role. +The path to a file that contains JSON data. Use this option to override \fBnormal\fP attributes set elsewhere. .TP .B \fB\-l LEVEL\fP, \fB\-\-log_level LEVEL\fP -The level of logging that will be stored in a log file: \fBdebug\fP, \fBinfo\fP, \fBwarn\fP, \fBerror\fP, or \fBfatal\fP. +The level of logging that will be stored in a log file. .TP .B \fB\-L LOGLOCATION\fP, \fB\-\-logfile c\fP The location in which log file output files will be saved. If this location is set to something other than \fBSTDOUT\fP, standard output logging will still be performed (otherwise there would be no output other than to a file). This is recommended when starting any executable as a daemon. .TP .B \fB\-\-[no\-]color\fP -Indicates that color will not be used in the output. Default setting: \fB\-\-color\fP. +Indicates whether colored output will be used. Default setting: \fB\-\-color\fP. .TP .B \fB\-N NODE_NAME\fP, \fB\-\-node\-name NODE_NAME\fP The name of the node. @@ -156,6 +162,6 @@ $ chef\-solo \-c ~/solo.rb \-j http://www.example.com/node.json \-r http://www.e .sp where \fB\-r\fP corresponds to \fBrecipe_url\fP and \fB\-j\fP corresponds to \fBjson_attribs\fP, both of which are configuration options in solo.rb. .SH AUTHOR -Opscode +Chef .\" Generated by docutils manpage writer. . diff --git a/lib/chef/api_client.rb b/lib/chef/api_client.rb index 66cbd3f30e..7b7fd99ff7 100644 --- a/lib/chef/api_client.rb +++ b/lib/chef/api_client.rb @@ -162,9 +162,7 @@ class Chef if response.kind_of?(Chef::ApiClient) response else - client = Chef::ApiClient.new - client.name(response['clientname']) - client + json_create(response) end end diff --git a/lib/chef/application.rb b/lib/chef/application.rb index 98bdedff7f..601bbd91f1 100644 --- a/lib/chef/application.rb +++ b/lib/chef/application.rb @@ -118,11 +118,13 @@ class Chef::Application configure_stdout_logger end Chef::Log.level = resolve_log_level + rescue StandardError => error + Chef::Log.fatal("Failed to open or create log file at #{Chef::Config[:log_location]}: #{error.class} (#{error.message})") + Chef::Application.fatal!("Aborting due to invalid 'log_location' configuration", 2) end def configure_stdout_logger stdout_logger = MonoLogger.new(STDOUT) - STDOUT.sync = true stdout_logger.formatter = Chef::Log.logger.formatter Chef::Log.loggers << stdout_logger end @@ -206,7 +208,8 @@ class Chef::Application @chef_client = Chef::Client.new( @chef_client_json, :override_runlist => config[:override_runlist], - :specific_recipes => specific_recipes + :specific_recipes => specific_recipes, + :runlist => config[:runlist] ) @chef_client_json = nil diff --git a/lib/chef/application/client.rb b/lib/chef/application/client.rb index de644b5f31..e14266d82a 100644 --- a/lib/chef/application/client.rb +++ b/lib/chef/application/client.rb @@ -170,7 +170,7 @@ class Chef::Application::Client < Chef::Application option :override_runlist, :short => "-o RunlistItem,RunlistItem...", :long => "--override-runlist RunlistItem,RunlistItem...", - :description => "Replace current run list with specified items", + :description => "Replace current run list with specified items for a single run", :proc => lambda{|items| items = items.split(',') items.compact.map{|item| @@ -178,6 +178,16 @@ class Chef::Application::Client < Chef::Application } } + option :runlist, + :short => "-r RunlistItem,RunlistItem...", + :long => "--runlist RunlistItem,RunlistItem...", + :description => "Permanently replace current run list with specified items", + :proc => lambda{|items| + items = items.split(',') + items.compact.map{|item| + Chef::RunList::RunListItem.new(item) + } + } option :why_run, :short => '-W', :long => '--why-run', diff --git a/lib/chef/application/windows_service.rb b/lib/chef/application/windows_service.rb index 4c99e50b0e..bea5e9fcdc 100644 --- a/lib/chef/application/windows_service.rb +++ b/lib/chef/application/windows_service.rb @@ -233,7 +233,6 @@ class Chef def configure_stdout_logger stdout_logger = MonoLogger.new(STDOUT) - STDOUT.sync = true stdout_logger.formatter = Chef::Log.logger.formatter Chef::Log.loggers << stdout_logger end diff --git a/lib/chef/client.rb b/lib/chef/client.rb index 31def49a3d..ac814333b4 100644 --- a/lib/chef/client.rb +++ b/lib/chef/client.rb @@ -43,6 +43,8 @@ require 'chef/formatters/minimal' require 'chef/version' require 'chef/resource_reporter' require 'chef/run_lock' +require 'chef/policy_builder' +require 'chef/request_id' require 'ohai' require 'rbconfig' @@ -53,6 +55,16 @@ class Chef class Client include Chef::Mixin::PathSanity + # IO stream that will be used as 'STDOUT' for formatters. Formatters are + # configured during `initialize`, so this provides a convenience for + # setting alternative IO stream during tests. + STDOUT_FD = STDOUT + + # IO stream that will be used as 'STDERR' for formatters. Formatters are + # configured during `initialize`, so this provides a convenience for + # setting alternative IO stream during tests. + STDERR_FD = STDERR + # Clears all notifications for client run status events. # Primarily for testing purposes. def self.clear_notifications @@ -127,15 +139,13 @@ class Chef attr_accessor :rest attr_accessor :runner - #-- - # TODO: timh/cw: 5-19-2010: json_attribs should be moved to RunContext? attr_reader :json_attribs attr_reader :run_status attr_reader :events # Creates a new Chef::Client. def initialize(json_attribs=nil, args={}) - @json_attribs = json_attribs + @json_attribs = json_attribs || {} @node = nil @run_status = nil @runner = nil @@ -147,13 +157,16 @@ class Chef @events = EventDispatch::Dispatcher.new(*event_handlers) @override_runlist = args.delete(:override_runlist) @specific_recipes = args.delete(:specific_recipes) - runlist_override_sanity_check! + + if new_runlist = args.delete(:runlist) + @json_attribs["run_list"] = new_runlist + end end def configure_formatters formatters_for_run.map do |formatter_name, output_path| if output_path.nil? - Chef::Formatters.new(formatter_name, STDOUT, STDERR) + Chef::Formatters.new(formatter_name, STDOUT_FD, STDERR_FD) else io = File.open(output_path, "a+") io.sync = true @@ -226,45 +239,51 @@ class Chef raise Exceptions::ChildConvergeError, message end + # Instantiates a Chef::Node object, possibly loading the node's prior state + # when using chef-client. Delegates to policy_builder + # + # + # === Returns + # Chef::Node:: The node object for this chef run + def load_node + policy_builder.load_node + @node = policy_builder.node + end + # Mutates the `node` object to prepare it for the chef run. Delegates to + # policy_builder + # + # === Returns + # Chef::Node:: The updated node object + def build_node + policy_builder.build_node + @run_status = Chef::RunStatus.new(node, events) + node + end - # Configures the Chef::Cookbook::FileVendor class to fetch file from the - # server or disk as appropriate, creates the run context for this run, and - # sanity checks the cookbook collection. - #===Returns - # Chef::RunContext:: the run context for this run. def setup_run_context - if Chef::Config[:solo] - Chef::Cookbook::FileVendor.on_create { |manifest| Chef::Cookbook::FileSystemFileVendor.new(manifest, Chef::Config[:cookbook_path]) } - cl = Chef::CookbookLoader.new(Chef::Config[:cookbook_path]) - cl.load_cookbooks - cookbook_collection = Chef::CookbookCollection.new(cl) - run_context = Chef::RunContext.new(node, cookbook_collection, @events) - else - Chef::Cookbook::FileVendor.on_create { |manifest| Chef::Cookbook::RemoteFileVendor.new(manifest, rest) } - cookbook_hash = sync_cookbooks - cookbook_collection = Chef::CookbookCollection.new(cookbook_hash) - run_context = Chef::RunContext.new(node, cookbook_collection, @events) - end - run_status.run_context = run_context - - run_context.load(@run_list_expansion) - if @specific_recipes - @specific_recipes.each do |recipe_file| - run_context.load_recipe_file(recipe_file) - end - end + run_context = policy_builder.setup_run_context(@specific_recipes) assert_cookbook_path_not_empty(run_context) + run_status.run_context = run_context run_context end + def sync_cookbooks + policy_builder.sync_cookbooks + end + + def policy_builder + @policy_builder ||= Chef::PolicyBuilder.strategy.new(node_name, ohai.data, json_attribs, @override_runlist, events) + end + + def save_updated_node - unless Chef::Config[:solo] + if Chef::Config[:solo] + # nothing to do + elsif policy_builder.temporary_policy? + Chef::Log.warn("Skipping final node save because override_runlist was given") + else Chef::Log.debug("Saving the current state of node #{node_name}") - if(@original_runlist) - @node.run_list(*@original_runlist) - @node.automatic_attrs[:runlist_override_history] = {Time.now.to_i => @override_runlist.inspect} - end @node.save end end @@ -274,13 +293,10 @@ class Chef end def node_name - name = Chef::Config[:node_name] || ohai[:fqdn] || ohai[:hostname] + name = Chef::Config[:node_name] || ohai[:fqdn] || ohai[:machinename] || ohai[:hostname] Chef::Config[:node_name] = name - unless name - msg = "Unable to determine node name: configure node_name or configure the system's hostname and fqdn" - raise Chef::Exceptions::CannotDetermineNodeName, msg - end + raise Chef::Exceptions::CannotDetermineNodeName unless name # node names > 90 bytes only work with authentication protocol >= 1.1 # see discussion in config.rb. @@ -291,85 +307,6 @@ class Chef name end - # Applies environment, external JSON attributes, and override run list to - # the node, Then expands the run_list. - # - # === Returns - # node<Chef::Node>:: The modified @node object. @node is modified in place. - def build_node - # Allow user to override the environment of a node by specifying - # a config parameter. - if Chef::Config[:environment] && !Chef::Config[:environment].chop.empty? - @node.chef_environment(Chef::Config[:environment]) - end - - # consume_external_attrs may add items to the run_list. Save the - # expanded run_list, which we will pass to the server later to - # determine which versions of cookbooks to use. - @node.reset_defaults_and_overrides - @node.consume_external_attrs(ohai.data, @json_attribs) - - unless(@override_runlist.empty?) - @original_runlist = @node.run_list.run_list_items.dup - runlist_override_sanity_check! - @node.run_list(*@override_runlist) - Chef::Log.warn "Run List override has been provided." - Chef::Log.warn "Original Run List: [#{@original_runlist.join(', ')}]" - Chef::Log.warn "Overridden Run List: [#{@node.run_list}]" - end - - @run_list_expansion = expand_run_list - - # @run_list_expansion is a RunListExpansion. - # - # Convert @expanded_run_list, which is an - # Array of Hashes of the form - # {:name => NAME, :version_constraint => Chef::VersionConstraint }, - # into @expanded_run_list_with_versions, an - # Array of Strings of the form - # "#{NAME}@#{VERSION}" - @expanded_run_list_with_versions = @run_list_expansion.recipes.with_version_constraints_strings - - Chef::Log.info("Run List is [#{@node.run_list}]") - Chef::Log.info("Run List expands to [#{@expanded_run_list_with_versions.join(', ')}]") - - @run_status = Chef::RunStatus.new(@node, @events) - - @events.node_load_completed(node, @expanded_run_list_with_versions, Chef::Config) - - @node - end - - # In client-server operation, loads the node state from the server. In - # chef-solo operation, builds a new node object. - def load_node - @events.node_load_start(node_name, Chef::Config) - Chef::Log.debug("Building node object for #{node_name}") - - if Chef::Config[:solo] - @node = Chef::Node.build(node_name) - else - @node = Chef::Node.find_or_create(node_name) - end - rescue Exception => e - # TODO: wrap this exception so useful error info can be given to the - # user. - @events.node_load_failed(node_name, e, Chef::Config) - raise - end - - def expand_run_list - if Chef::Config[:solo] - @node.expand!('disk') - else - @node.expand!('server') - end - rescue Exception => e - # TODO: wrap/munge exception with useful error output. - @events.run_list_expand_failed(node, e) - raise - end - # # === Returns # rest<Chef::REST>:: returns Chef::REST connection object @@ -397,37 +334,6 @@ class Chef raise end - # Sync_cookbooks eagerly loads all files except files and - # templates. It returns the cookbook_hash -- the return result - # from /environments/#{node.chef_environment}/cookbook_versions, - # which we will use for our run_context. - # - # === Returns - # Hash:: The hash of cookbooks with download URLs as given by the server - def sync_cookbooks - Chef::Log.debug("Synchronizing cookbooks") - - begin - @events.cookbook_resolution_start(@expanded_run_list_with_versions) - cookbook_hash = rest.post_rest("environments/#{@node.chef_environment}/cookbook_versions", - {:run_list => @expanded_run_list_with_versions}) - rescue Exception => e - # TODO: wrap/munge exception to provide helpful error output - @events.cookbook_resolution_failed(@expanded_run_list_with_versions, e) - raise - else - @events.cookbook_resolution_complete(cookbook_hash) - end - - synchronizer = Chef::CookbookSynchronizer.new(cookbook_hash, @events) - synchronizer.sync_cookbooks - - # register the file cache path in the cookbook path so that CookbookLoader actually picks up the synced cookbooks - Chef::Config[:cookbook_path] = File.join(Chef::Config[:file_cache_path], "cookbooks") - - cookbook_hash - end - # Converges the node. # # === Returns @@ -445,6 +351,19 @@ class Chef raise end + # Expands the run list. Delegates to the policy_builder. + # + # Normally this does not need to be called from here, it will be called by + # build_node. This is provided so external users (like the chefspec + # project) can inject custom behavior into the run process. + # + # === Returns + # RunListExpansion: A RunListExpansion or API compatible object. + def expanded_run_list + policy_builder.expand_run_list + end + + def do_windows_admin_check if Chef::Platform.windows? Chef::Log.debug("Checking for administrator privileges....") @@ -482,10 +401,12 @@ class Chef # don't add code that may fail before entering this section to be sure to release lock begin runlock.save_pid + request_id = Chef::RequestID.instance.request_id run_context = nil @events.run_start(Chef::VERSION) Chef::Log.info("*** Chef #{Chef::VERSION} ***") Chef::Log.info "Chef-client pid: #{Process.pid}" + Chef::Log.debug("Chef-client request_id: #{request_id}") enforce_path_sanity run_ohai @events.ohai_completed(node) @@ -495,6 +416,7 @@ class Chef build_node + run_status.run_id = request_id run_status.start_clock Chef::Log.info("Starting Chef Run for #{node.name}") run_started @@ -525,6 +447,8 @@ class Chef @events.run_failed(e) raise ensure + Chef::RequestID.instance.reset_request_id + request_id = nil @run_status = nil run_context = nil runlock.release @@ -533,22 +457,6 @@ class Chef true end - # Ensures runlist override contains RunListItem instances - def runlist_override_sanity_check! - # Convert to array and remove whitespace - if @override_runlist.is_a?(String) - @override_runlist = @override_runlist.split(',').map { |e| e.strip } - end - @override_runlist = [@override_runlist].flatten.compact - @override_runlist.map! do |item| - if(item.is_a?(Chef::RunList::RunListItem)) - item - else - Chef::RunList::RunListItem.new(item) - end - end - end - def empty_directory?(path) !File.exists?(path) || (Dir.entries(path).size <= 2) end diff --git a/lib/chef/config.rb b/lib/chef/config.rb index f8bfa3ac21..da3f3790f6 100644 --- a/lib/chef/config.rb +++ b/lib/chef/config.rb @@ -127,26 +127,6 @@ class Chef # properly. configurable(:daemonize).writes_value { |v| v } - # Override the config dispatch to set the value of log_location configuration option - # - # === Parameters - # location<IO||String>:: Logging location as either an IO stream or string representing log file path - # - config_attr_writer :log_location do |location| - if location.respond_to? :sync= - location.sync = true - location - elsif location.respond_to? :to_str - begin - f = File.new(location.to_str, "a") - f.sync = true - rescue Errno::ENOENT - raise Chef::Exceptions::ConfigurationError, "Failed to open or create log file at #{location.to_str}" - end - f - end - end - # The root where all local chef object data is stored. cookbooks, data bags, # environments are all assumed to be in separate directories under this. # chef-solo uses these directories for input data. knife commands @@ -299,6 +279,9 @@ class Chef # logger is the primary mode of output, and the log level is set to :info default :log_level, :auto + # Logging location as either an IO stream or string representing log file path + default :log_location, STDOUT + # Using `force_formatter` causes chef to default to formatter output when STDOUT is not a tty default :force_formatter, false @@ -310,7 +293,6 @@ class Chef default :interval, nil default :once, nil default :json_attribs, nil - default :log_location, STDOUT # toggle info level log items that can create a lot of output default :verbose_logging, true default :node_name, nil @@ -338,6 +320,16 @@ class Chef default :enable_reporting, true default :enable_reporting_url_fatals, false + # Policyfile is an experimental feature where a node gets its run list and + # cookbook version set from a single document on the server instead of + # expanding the run list and having the server compute the cookbook version + # set based on environment constraints. + # + # Because this feature is experimental, it is not recommended for + # production use. Developent/release of this feature may not adhere to + # semver guidelines. + default :use_policyfile, false + # Set these to enable SSL authentication / mutual-authentication # with the server diff --git a/lib/chef/cookbook/syntax_check.rb b/lib/chef/cookbook/syntax_check.rb index 59888e2ba3..4f8dcff6dc 100644 --- a/lib/chef/cookbook/syntax_check.rb +++ b/lib/chef/cookbook/syntax_check.rb @@ -17,6 +17,8 @@ # require 'pathname' +require 'stringio' +require 'erubis' require 'chef/mixin/shell_out' require 'chef/mixin/checksum' @@ -161,28 +163,127 @@ class Chef def validate_template(erb_file) Chef::Log.debug("Testing template #{erb_file} for syntax errors...") - result = shell_out("erubis -x #{erb_file} | ruby -c") + if validate_inline? + validate_erb_file_inline(erb_file) + else + validate_erb_via_subcommand(erb_file) + end + end + + def validate_ruby_file(ruby_file) + Chef::Log.debug("Testing #{ruby_file} for syntax errors...") + if validate_inline? + validate_ruby_file_inline(ruby_file) + else + validate_ruby_by_subcommand(ruby_file) + end + end + + # Whether or not we're running on a version of ruby that can support + # inline validation. Inline validation relies on the `RubyVM` features + # introduced with ruby 1.9, so 1.8 cannot be supported. + def validate_inline? + defined?(RubyVM::InstructionSequence) + end + + # Validate the ruby code in an erb template. Uses RubyVM to do syntax + # checking, so callers should check #validate_inline? before calling. + def validate_erb_file_inline(erb_file) + old_stderr = $stderr + + engine = Erubis::Eruby.new + engine.convert!(IO.read(erb_file)) + + ruby_code = engine.src + + # Even when we're compiling the code w/ RubyVM, syntax errors just + # print to $stderr. We want to capture this and handle the printing + # ourselves, so we must temporarily swap $stderr to capture the output. + tmp_stderr = $stderr = StringIO.new + + abs_path = File.expand_path(erb_file) + RubyVM::InstructionSequence.new(ruby_code, erb_file, abs_path, 0) + + true + rescue SyntaxError + $stderr = old_stderr + invalid_erb_file(erb_file, tmp_stderr.string) + false + ensure + # be paranoid about setting stderr back to the old value. + $stderr = old_stderr if defined?(old_stderr) && old_stderr + end + + # Validate the ruby code in an erb template. Pipes the output of `erubis + # -x` to `ruby -c`, so it works with any ruby version, but is much slower + # than the inline version. + # -- + # TODO: This can be removed when ruby 1.8 support is dropped. + def validate_erb_via_subcommand(erb_file) + result = shell_out("erubis -x #{erb_file} | #{ruby} -c") result.error! true rescue Mixlib::ShellOut::ShellCommandFailed + invalid_erb_file(erb_file, result.stderr) + false + end + + # Debug a syntax error in a template. + def invalid_erb_file(erb_file, error_message) file_relative_path = erb_file[/^#{Regexp.escape(cookbook_path+File::Separator)}(.*)/, 1] Chef::Log.fatal("Erb template #{file_relative_path} has a syntax error:") - result.stderr.each_line { |l| Chef::Log.fatal(l.chomp) } + error_message.each_line { |l| Chef::Log.fatal(l.chomp) } + nil + end + + # Validate the syntax of a ruby file. Uses (Ruby 1.9+ only) RubyVM to + # compile the code without evaluating it or spawning a new process. + # Callers should check #validate_inline? before calling. + def validate_ruby_file_inline(ruby_file) + # Even when we're compiling the code w/ RubyVM, syntax errors just + # print to $stderr. We want to capture this and handle the printing + # ourselves, so we must temporarily swap $stderr to capture the output. + old_stderr = $stderr + tmp_stderr = $stderr = StringIO.new + abs_path = File.expand_path(ruby_file) + file_content = IO.read(abs_path) + RubyVM::InstructionSequence.new(file_content, ruby_file, abs_path, 0) + true + rescue SyntaxError + $stderr = old_stderr + invalid_ruby_file(ruby_file, tmp_stderr.string) false + ensure + # be paranoid about setting stderr back to the old value. + $stderr = old_stderr if defined?(old_stderr) && old_stderr end - def validate_ruby_file(ruby_file) - Chef::Log.debug("Testing #{ruby_file} for syntax errors...") - result = shell_out("ruby -c #{ruby_file}") + # Validate the syntax of a ruby file by shelling out to `ruby -c`. Should + # work for all ruby versions, but is slower and uses more resources than + # the inline strategy. + def validate_ruby_by_subcommand(ruby_file) + result = shell_out("#{ruby} -c #{ruby_file}") result.error! true rescue Mixlib::ShellOut::ShellCommandFailed + invalid_ruby_file(ruby_file, result.stderr) + false + end + + # Debugs ruby syntax errors by printing the path to the file and any + # diagnostic info given in +error_message+ + def invalid_ruby_file(ruby_file, error_message) file_relative_path = ruby_file[/^#{Regexp.escape(cookbook_path+File::Separator)}(.*)/, 1] Chef::Log.fatal("Cookbook file #{file_relative_path} has a ruby syntax error:") - result.stderr.each_line { |l| Chef::Log.fatal(l.chomp) } + error_message.each_line { |l| Chef::Log.fatal(l.chomp) } false end + # Returns the full path to the running ruby. + def ruby + Gem.ruby + end + end end end diff --git a/lib/chef/cookbook_uploader.rb b/lib/chef/cookbook_uploader.rb index 2ae4703f01..6524eed3e5 100644 --- a/lib/chef/cookbook_uploader.rb +++ b/lib/chef/cookbook_uploader.rb @@ -20,7 +20,7 @@ class Chef def self.setup_worker_threads(concurrency=10) @worker_threads ||= begin work_queue - (1...concurrency).map do + (1..concurrency).map do Thread.new do loop do work_queue.pop.call diff --git a/lib/chef/dsl/reboot_pending.rb b/lib/chef/dsl/reboot_pending.rb new file mode 100644 index 0000000000..9f80d38c61 --- /dev/null +++ b/lib/chef/dsl/reboot_pending.rb @@ -0,0 +1,61 @@ +# Author:: Bryan McLellan <btm@loftninjas.org> +# Author:: Seth Chisamore <schisamo@opscode.com> +# Copyright:: Copyright (c) 2011,2014, Chef Software, Inc. +# License:: Apache License, Version 2.0 +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +require 'chef/dsl/platform_introspection' +require 'chef/dsl/registry_helper' + +class Chef + module DSL + module RebootPending + + include Chef::DSL::RegistryHelper + include Chef::DSL::PlatformIntrospection + + # Returns true if the system needs a reboot or is expected to reboot + # Raises UnsupportedPlatform if this functionality isn't provided yet + def reboot_pending? + + if platform?("windows") + # PendingFileRenameOperations contains pairs (REG_MULTI_SZ) of filenames that cannot be updated + # due to a file being in use (usually a temporary file and a system file) + # \??\c:\temp\test.sys!\??\c:\winnt\system32\test.sys + # http://technet.microsoft.com/en-us/library/cc960241.aspx + registry_value_exists?('HKLM\SYSTEM\CurrentControlSet\Control\Session Manager', { :name => 'PendingFileRenameOperations' }) || + + # RebootRequired key contains Update IDs with a value of 1 if they require a reboot. + # The existence of RebootRequired alone is sufficient on my Windows 8.1 workstation in Windows Update + registry_key_exists?('HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update\RebootRequired') || + + # Vista + Server 2008 and newer may have reboots pending from CBS + registry_key_exists?('HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Component Based Servicing\RebootRequired') || + + # The mere existance of the UpdateExeVolatile key should indicate a pending restart for certain updates + # http://support.microsoft.com/kb/832475 + (registry_key_exists?('HKLM\SOFTWARE\Microsoft\Updates\UpdateExeVolatile') && + !registry_get_values('HKLM\SOFTWARE\Microsoft\Updates\UpdateExeVolatile').select { |v| v[:name] == "Flags" }[0].nil? && + [1,2,3].include?(registry_get_values('HKLM\SOFTWARE\Microsoft\Updates\UpdateExeVolatile').select { |v| v[:name] == "Flags" }[0][:data])) + elsif platform?("ubuntu") + # This should work for Debian as well if update-notifier-common happens to be installed. We need an API for that. + File.exists?('/var/run/reboot-required') + else + raise Chef::Exceptions::UnsupportedPlatform.new(node[:platform]) + end + end + end + end +end diff --git a/lib/chef/dsl/recipe.rb b/lib/chef/dsl/recipe.rb index f3507a8031..ebf19c7f23 100644 --- a/lib/chef/dsl/recipe.rb +++ b/lib/chef/dsl/recipe.rb @@ -35,46 +35,116 @@ class Chef # If we have a definition that matches, we want to use that instead. This should # let you do some really crazy over-riding of "native" types, if you really want # to. - if run_context.definitions.has_key?(method_symbol) - # This dupes the high level object, but we still need to dup the params - new_def = run_context.definitions[method_symbol].dup - new_def.params = new_def.params.dup - new_def.node = run_context.node - # This sets up the parameter overrides - new_def.instance_eval(&block) if block - new_recipe = Chef::Recipe.new(cookbook_name, @recipe_name, run_context) - new_recipe.params = new_def.params - new_recipe.params[:name] = args[0] - new_recipe.instance_eval(&new_def.recipe) - else + if has_resource_definition?(method_symbol) + evaluate_resource_definition(method_symbol, *args, &block) + elsif have_resource_class_for?(method_symbol) # Otherwise, we're rocking the regular resource call route. + declare_resource(method_symbol, args[0], caller[0], &block) + else + begin + super + rescue NoMethodError + raise NoMethodError, "No resource or method named `#{method_symbol}' for #{describe_self_for_error}" + rescue NameError + raise NameError, "No resource, method, or local variable named `#{method_symbol}' for #{describe_self_for_error}" + end + end + end + + def has_resource_definition?(name) + yes_or_no = run_context.definitions.has_key?(name) + + yes_or_no + end + + # Processes the arguments and block as a resource definition. + def evaluate_resource_definition(definition_name, *args, &block) - # Checks the new platform => short_name => resource mapping initially - # then fall back to the older approach (Chef::Resource.const_get) for - # backward compatibility - resource_class = Chef::Resource.resource_for_node(method_symbol, run_context.node) - - super unless resource_class - raise ArgumentError, "You must supply a name when declaring a #{method_symbol} resource" unless args.size > 0 - - # If we have a resource like this one, we want to steal its state - args << run_context - resource = resource_class.new(*args) - resource.source_line = caller[0] - resource.load_prior_resource - resource.cookbook_name = cookbook_name - resource.recipe_name = @recipe_name - resource.params = @params - # Determine whether this resource is being created in the context of an enclosing Provider - resource.enclosing_provider = self.is_a?(Chef::Provider) ? self : nil - # Evaluate resource attribute DSL - resource.instance_eval(&block) if block - - # Run optional resource hook - resource.after_created - - run_context.resource_collection.insert(resource) - resource + # This dupes the high level object, but we still need to dup the params + new_def = run_context.definitions[definition_name].dup + + new_def.params = new_def.params.dup + new_def.node = run_context.node + # This sets up the parameter overrides + new_def.instance_eval(&block) if block + + + new_recipe = Chef::Recipe.new(cookbook_name, recipe_name, run_context) + new_recipe.params = new_def.params + new_recipe.params[:name] = args[0] + new_recipe.instance_eval(&new_def.recipe) + new_recipe + end + + # Instantiates a resource (via #build_resource), then adds it to the + # resource collection. Note that resource classes are looked up directly, + # so this will create the resource you intended even if the method name + # corresponding to that resource has been overridden. + def declare_resource(type, name, created_at=nil, &resource_attrs_block) + created_at ||= caller[0] + + resource = build_resource(type, name, created_at, &resource_attrs_block) + + run_context.resource_collection.insert(resource) + resource + end + + # Instantiate a resource of the given +type+ with the given +name+ and + # attributes as given in the +resource_attrs_block+. + # + # The resource is NOT added to the resource collection. + def build_resource(type, name, created_at=nil, &resource_attrs_block) + created_at ||= caller[0] + + # Checks the new platform => short_name => resource mapping initially + # then fall back to the older approach (Chef::Resource.const_get) for + # backward compatibility + resource_class = resource_class_for(type) + + raise ArgumentError, "You must supply a name when declaring a #{type} resource" if name.nil? + + resource = resource_class.new(name, run_context) + resource.source_line = created_at + # If we have a resource like this one, we want to steal its state + # This behavior is very counter-intuitive and should be removed. + # See CHEF-3694, https://tickets.opscode.com/browse/CHEF-3694 + # Moved to this location to resolve CHEF-5052, https://tickets.opscode.com/browse/CHEF-5052 + resource.load_prior_resource + resource.cookbook_name = cookbook_name + resource.recipe_name = recipe_name + # Determine whether this resource is being created in the context of an enclosing Provider + resource.enclosing_provider = self.is_a?(Chef::Provider) ? self : nil + + # XXX: This is very crufty, but it's required for resource definitions + # to work properly :( + resource.params = @params + + # Evaluate resource attribute DSL + resource.instance_eval(&resource_attrs_block) if block_given? + + # Run optional resource hook + resource.after_created + + resource + end + + def resource_class_for(snake_case_name) + Chef::Resource.resource_for_node(snake_case_name, run_context.node) + end + + def have_resource_class_for?(snake_case_name) + not resource_class_for(snake_case_name).nil? + rescue NameError + false + end + + def describe_self_for_error + if respond_to?(:name) + %Q[`#{self.class.name} "#{name}"'] + elsif respond_to?(:recipe_name) + %Q[`#{self.class.name} "#{recipe_name}"'] + else + to_s end end diff --git a/lib/chef/exceptions.rb b/lib/chef/exceptions.rb index 1c952318f1..f976263188 100644 --- a/lib/chef/exceptions.rb +++ b/lib/chef/exceptions.rb @@ -50,7 +50,13 @@ class Chef class Override < RuntimeError; end class UnsupportedAction < RuntimeError; end class MissingLibrary < RuntimeError; end - class CannotDetermineNodeName < RuntimeError; end + + class CannotDetermineNodeName < RuntimeError + def initialize + super "Unable to determine node name: configure node_name or configure the system's hostname and fqdn" + end + end + class User < RuntimeError; end class Group < RuntimeError; end class Link < RuntimeError; end @@ -80,6 +86,10 @@ class Chef class ConflictingMembersInGroup < ArgumentError; end class InvalidResourceReference < RuntimeError; end class ResourceNotFound < RuntimeError; end + + # Can't find a Resource of this type that is valid on this platform. + class NoSuchResourceType < NameError; end + class InvalidResourceSpecification < ArgumentError; end class SolrConnectionError < RuntimeError; end class IllegalChecksumRevert < RuntimeError; end @@ -297,5 +307,18 @@ class Chef # non-GET and non-HEAD request will thus raise an InvalidRedirect. class InvalidRedirect < StandardError; end + # Raised when the content length of a download does not match the content + # length declared in the http response. + class ContentLengthMismatch < RuntimeError + def initialize(response_length, content_length) + super "Response body length #{response_length} does not match HTTP Content-Length header #{content_length}." + end + end + + class UnsupportedPlatform < RuntimeError + def initialize(platform) + super "This functionality is not supported on platform #{platform}." + end + end end end diff --git a/lib/chef/formatters/error_descriptor.rb b/lib/chef/formatters/error_descriptor.rb index 3f0756df73..c2e656f167 100644 --- a/lib/chef/formatters/error_descriptor.rb +++ b/lib/chef/formatters/error_descriptor.rb @@ -31,7 +31,7 @@ class Chef end def section(heading, text) - @sections << {heading => text} + @sections << {heading => (text or "")} end def display(out) diff --git a/lib/chef/formatters/error_inspectors/api_error_formatting.rb b/lib/chef/formatters/error_inspectors/api_error_formatting.rb index cb64955961..1e4e258906 100644 --- a/lib/chef/formatters/error_inspectors/api_error_formatting.rb +++ b/lib/chef/formatters/error_inspectors/api_error_formatting.rb @@ -52,7 +52,8 @@ chef_server_url "#{server_url}" node_name "#{username}" client_key "#{api_key}" -If these settings are correct, your client_key may be invalid. +If these settings are correct, your client_key may be invalid, or +you may have a chef user with the same client name as this node. E end end diff --git a/lib/chef/http.rb b/lib/chef/http.rb index 2b2466843e..78c47735d2 100644 --- a/lib/chef/http.rb +++ b/lib/chef/http.rb @@ -165,18 +165,22 @@ class Chef response, rest_request, return_value = send_http_request(method, url, headers, data) do |http_response| if http_response.kind_of?(Net::HTTPSuccess) tempfile = stream_to_tempfile(url, http_response) - if block_given? - begin - yield tempfile - ensure - tempfile && tempfile.close! - end - end end + apply_stream_complete_middleware(http_response, rest_request, return_value) end - unless response.kind_of?(Net::HTTPSuccess) or response.kind_of?(Net::HTTPRedirection) + + return nil if response.kind_of?(Net::HTTPRedirection) + unless response.kind_of?(Net::HTTPSuccess) response.error! end + + if block_given? + begin + yield tempfile + ensure + tempfile && tempfile.close! + end + end tempfile rescue Exception => e log_failed_request(response, return_value) unless response.nil? @@ -216,6 +220,12 @@ class Chef end end + def apply_stream_complete_middleware(response, rest_request, return_value) + middlewares.reverse.inject([response, rest_request, return_value]) do |res_data, middleware| + middleware.handle_stream_complete(*res_data) + end + end + def log_failed_request(response, return_value) return_value ||= {} error_message = "HTTP Request Returned #{response.code} #{response.message}: " diff --git a/lib/chef/http/authenticator.rb b/lib/chef/http/authenticator.rb index 489675ad66..4255f18cbd 100644 --- a/lib/chef/http/authenticator.rb +++ b/lib/chef/http/authenticator.rb @@ -52,6 +52,10 @@ class Chef nil end + def handle_stream_complete(http_response, rest_request, return_value) + [http_response, rest_request, return_value] + end + def sign_requests? auth_credentials.sign_requests? && @sign_request end diff --git a/lib/chef/http/cookie_manager.rb b/lib/chef/http/cookie_manager.rb index f6dcf9aa32..e9cb7aa4f7 100644 --- a/lib/chef/http/cookie_manager.rb +++ b/lib/chef/http/cookie_manager.rb @@ -50,6 +50,9 @@ class Chef nil end + def handle_stream_complete(http_response, rest_request, return_value) + [http_response, rest_request, return_value] + end end end diff --git a/lib/chef/http/decompressor.rb b/lib/chef/http/decompressor.rb index 6010ffa698..78af47798c 100644 --- a/lib/chef/http/decompressor.rb +++ b/lib/chef/http/decompressor.rb @@ -69,6 +69,10 @@ class Chef [http_response, rest_request, return_value] end + def handle_stream_complete(http_response, rest_request, return_value) + [http_response, rest_request, return_value] + end + def decompress_body(response) if gzip_disabled? || response.body.nil? response.body diff --git a/lib/chef/http/json_input.rb b/lib/chef/http/json_input.rb index 741c48f5f6..1e4e736030 100644 --- a/lib/chef/http/json_input.rb +++ b/lib/chef/http/json_input.rb @@ -48,6 +48,10 @@ class Chef nil end + def handle_stream_complete(http_response, rest_request, return_value) + [http_response, rest_request, return_value] + end + end end end diff --git a/lib/chef/http/json_output.rb b/lib/chef/http/json_output.rb index 7c1502fd79..ae164c6aed 100644 --- a/lib/chef/http/json_output.rb +++ b/lib/chef/http/json_output.rb @@ -60,6 +60,10 @@ class Chef end end + def handle_stream_complete(http_response, rest_request, return_value) + [http_response, rest_request, return_value] + end + def stream_response_handler(response) nil end diff --git a/lib/chef/http/remote_request_id.rb b/lib/chef/http/remote_request_id.rb new file mode 100644 index 0000000000..6bec5dba4f --- /dev/null +++ b/lib/chef/http/remote_request_id.rb @@ -0,0 +1,46 @@ +# Author:: Prajakta Purohit (<prajakta@opscode.com>) +# Copyright:: Copyright (c) 2009, 2010, 2013, 2014 Opscode, Inc. +# License:: Apache License, Version 2.0 +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +require 'chef/request_id' + +class Chef + class HTTP + class RemoteRequestID + + def initialize(opts={}) + end + + def handle_request(method, url, headers={}, data=false) + headers.merge!({'X-REMOTE-REQUEST-ID' => Chef::RequestID.instance.request_id}) + [method, url, headers, data] + end + + def handle_response(http_response, rest_request, return_value) + [http_response, rest_request, return_value] + end + + def stream_response_handler(response) + nil + end + + def handle_stream_complete(http_response, rest_request, return_value) + [http_response, rest_request, return_value] + end + + end + end +end diff --git a/lib/chef/http/validate_content_length.rb b/lib/chef/http/validate_content_length.rb new file mode 100644 index 0000000000..49f1738d42 --- /dev/null +++ b/lib/chef/http/validate_content_length.rb @@ -0,0 +1,94 @@ +#-- +# Author:: Lamont Granquist (<lamont@getchef.com>) +# Copyright:: Copyright (c) 2013 Chef Software, Inc. +# License:: Apache License, Version 2.0 +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +require 'pp' +require 'chef/log' + +class Chef + class HTTP + + # Middleware that validates the Content-Length header against the downloaded number of bytes. + # + # This must run before the decompressor middleware, since otherwise we will count the uncompressed + # streamed bytes, rather than the on-the-wire compressed bytes. + class ValidateContentLength + + class ContentLengthCounter + attr_accessor :content_length + + def initialize + @content_length = 0 + end + + def handle_chunk(chunk) + @content_length += chunk.bytesize + chunk + end + end + + def initialize(opts={}) + end + + def handle_request(method, url, headers={}, data=false) + [method, url, headers, data] + end + + def handle_response(http_response, rest_request, return_value) + unless http_response['content-length'] + Chef::Log.debug("HTTP server did not include a Content-Length header in response, cannot identify truncated downloads.") + return [http_response, rest_request, return_value] + end + validate(response_content_length(http_response), http_response.body.bytesize) + return [http_response, rest_request, return_value] + end + + def handle_stream_complete(http_response, rest_request, return_value) + if http_response['content-length'].nil? + Chef::Log.debug("HTTP server did not include a Content-Length header in response, cannot idenfity streamed download.") + elsif @content_length_counter.nil? + Chef::Log.debug("No content-length information collected for the streamed download, cannot identify streamed download.") + else + validate(response_content_length(http_response), @content_length_counter.content_length) + end + return [http_response, rest_request, return_value] + end + + def stream_response_handler(response) + @content_length_counter = ContentLengthCounter.new + end + + private + def response_content_length(response) + if response['content-length'].is_a?(Array) + response['content-length'].first.to_i + else + response['content-length'].to_i + end + end + + def validate(content_length, response_length) + Chef::Log.debug "Content-Length header = #{content_length}" + Chef::Log.debug "Response body length = #{response_length}" + if response_length != content_length + raise Chef::Exceptions::ContentLengthMismatch.new(response_length, content_length) + end + true + end + end + end +end diff --git a/lib/chef/knife/bootstrap.rb b/lib/chef/knife/bootstrap.rb index 14dccb3892..a7c10fc608 100644 --- a/lib/chef/knife/bootstrap.rb +++ b/lib/chef/knife/bootstrap.rb @@ -201,7 +201,7 @@ class Chef $stdout.sync = true - ui.info("Bootstrapping Chef on #{ui.color(@node_name, :bold)}") + ui.info("Connecting to #{ui.color(@node_name, :bold)}") begin knife_ssh.run diff --git a/lib/chef/knife/bootstrap/README.md b/lib/chef/knife/bootstrap/README.md new file mode 100644 index 0000000000..13a0fe7ada --- /dev/null +++ b/lib/chef/knife/bootstrap/README.md @@ -0,0 +1,12 @@ +This directory contains bootstrap templates which can be used with the -d flag +to 'knife bootstrap' to install Chef in different ways. To simplify installation, +and reduce the matrix of common installation patterns to support, we have +standardized on the [Omnibus](https://github.com/opscode/omnibus-ruby) built installation +packages. + +The 'chef-full' template downloads a script which is used to determine the correct +Omnibus package for this system from the [Omnitruck](https://github.com/opscode/opscode-omnitruck) API. All other templates in this directory are deprecated and will be removed +in the future. + +You can still utilize custom bootstrap templates on your system if your installation +needs are unique. Additional information can be found on the [docs site](http://docs.opscode.com/knife_bootstrap.html#custom-templates).
\ No newline at end of file diff --git a/lib/chef/knife/bootstrap/chef-full.erb b/lib/chef/knife/bootstrap/chef-full.erb index 24ffca2c69..1d75117b72 100644 --- a/lib/chef/knife/bootstrap/chef-full.erb +++ b/lib/chef/knife/bootstrap/chef-full.erb @@ -23,6 +23,7 @@ install_sh="https://www.opscode.com/chef/install.sh" version_string="-v <%= chef_version %>" if ! exists /usr/bin/chef-client; then + echo "Installing Chef Client..." if exists wget; then bash <(wget <%= "--proxy=on " if knife_config[:bootstrap_proxy] %> ${install_sh} -O -) ${version_string} elif exists curl; then @@ -66,4 +67,6 @@ cat > /etc/chef/first-boot.json <<'EOP' <%= first_boot.to_json %> EOP +echo "Starting first Chef Client run..." + <%= start_chef %>' diff --git a/lib/chef/knife/client_create.rb b/lib/chef/knife/client_create.rb index 285254aef0..b2bac36081 100644 --- a/lib/chef/knife/client_create.rb +++ b/lib/chef/knife/client_create.rb @@ -38,6 +38,11 @@ class Chef :description => "Create the client as an admin", :boolean => true + option :validator, + :long => "--validator", + :description => "Create the client as a validator", + :boolean => true + banner "knife client create CLIENT (options)" def run @@ -52,6 +57,7 @@ class Chef client = Chef::ApiClient.new client.name(@client_name) client.admin(config[:admin]) + client.validator(config[:validator]) output = edit_data(client) diff --git a/lib/chef/knife/client_delete.rb b/lib/chef/knife/client_delete.rb index 6a6fae7ea0..56814de1b2 100644 --- a/lib/chef/knife/client_delete.rb +++ b/lib/chef/knife/client_delete.rb @@ -27,6 +27,11 @@ class Chef require 'chef/json_compat' end + option :force, + :short => "-f", + :long => "--force", + :description => "Force deletion of client if it's a validator" + banner "knife client delete CLIENT (options)" def run @@ -38,7 +43,16 @@ class Chef exit 1 end - delete_object(Chef::ApiClient, @client_name) + delete_object(Chef::ApiClient, @client_name, 'client') { + object = Chef::ApiClient.load(@client_name) + if object.validator + unless config[:force] + ui.fatal("You must specify --force to delete the validator client #{@client_name}") + exit 2 + end + end + object.destroy + } end end diff --git a/lib/chef/knife/configure.rb b/lib/chef/knife/configure.rb index 3ad4fac970..6af3d4ea1d 100644 --- a/lib/chef/knife/configure.rb +++ b/lib/chef/knife/configure.rb @@ -35,29 +35,29 @@ class Chef option :repository, :short => "-r REPO", :long => "--repository REPO", - :description => "The path to your chef-repo" + :description => "The path to the chef-repo" option :initial, :short => "-i", :long => "--initial", :boolean => true, - :description => "Create an initial API User" + :description => "Use to create a API client, typically an administrator client on a freshly-installed server" option :admin_client_name, :long => "--admin-client-name NAME", - :description => "The existing admin clientname (usually admin)" + :description => "The name of the client, typically the name of the admin client" option :admin_client_key, :long => "--admin-client-key PATH", - :description => "The path to the admin client's private key (usually a file named admin.pem)" + :description => "The path to the private key used by the client, typically a file named admin.pem" option :validation_client_name, :long => "--validation-client-name NAME", - :description => "The validation clientname (usually chef-validator)" + :description => "The name of the validation client, typically a client named chef-validator" option :validation_key, :long => "--validation-key PATH", - :description => "The location of the validation key (usually a file named validation.pem)" + :description => "The path to the validation key used by the client, typically a file named validation.pem" def configure_chef # We are just faking out the system so that you can do this without a key specified diff --git a/lib/chef/knife/raw.rb b/lib/chef/knife/raw.rb index 2756de1a5a..954d46beee 100644 --- a/lib/chef/knife/raw.rb +++ b/lib/chef/knife/raw.rb @@ -42,6 +42,7 @@ class Chef use Chef::HTTP::CookieManager use Chef::HTTP::Decompressor use Chef::HTTP::Authenticator + use Chef::HTTP::RemoteRequestID end def run diff --git a/lib/chef/knife/ssh.rb b/lib/chef/knife/ssh.rb index 837710b932..83c1735b4a 100644 --- a/lib/chef/knife/ssh.rb +++ b/lib/chef/knife/ssh.rb @@ -64,12 +64,12 @@ class Chef :long => "--ssh-user USERNAME", :description => "The ssh username" - option :ssh_password, + option :ssh_password_ng, :short => "-P [PASSWORD]", :long => "--ssh-password [PASSWORD]", :description => "The ssh password - will prompt if flag is specified but no password is given", - # default to a value that can not be a password (boolean) - # so we can effectively test if this parameter was specified + # default to a value that can not be a password (boolean) + # so we can effectively test if this parameter was specified # without a vlaue :default => false @@ -436,16 +436,27 @@ class Chef Chef::Config[:knife][:ssh_user]) end + # This is a bit overly complicated because of the way we want knife ssh to work with -P causing a password prompt for + # the user, but we have to be conscious that this code gets included in knife bootstrap and knife * server create as + # well. We want to change the semantics so that the default is false and 'nil' means -P without an argument on the + # command line. But the other utilities expect nil to be the default and we can't prompt in that case. So we effectively + # use ssh_password_ng to determine if we're coming from knife ssh or from the other utilities. The other utilties can + # also be patched to use ssh_password_ng easily as long they follow the convention that the default is false. def configure_password - if config[:ssh_password].nil? + if config.has_key?(:ssh_password_ng) && config[:ssh_password_ng].nil? # If the parameter is called on the command line with no value - # it will set :ssh_password = nil + # it will set :ssh_password_ng = nil # This is where we want to trigger a prompt for password config[:ssh_password] = get_password else + # if ssh_password_ng is false then it has not been set at all, and we may be in knife ec2 and still + # using an old config[:ssh_password]. this is backwards compatibility. all knife cloud plugins should + # be updated to use ssh_password_ng with a default of false and ssh_password should be retired, (but + # we'll still need to use the ssh_password out of knife.rb if we find that). + ssh_password = config.has_key?(:ssh_password_ng) ? config[:ssh_password_ng] : config[:ssh_password] # Otherwise, the password has either been specified on the command line, # in knife.rb, or key based auth will be attempted - config[:ssh_password] = get_stripped_unfrozen_value(config[:ssh_password] || + config[:ssh_password] = get_stripped_unfrozen_value(ssh_password || Chef::Config[:knife][:ssh_password]) end end diff --git a/lib/chef/monologger.rb b/lib/chef/monologger.rb index fed60514d7..464b21bdd3 100644 --- a/lib/chef/monologger.rb +++ b/lib/chef/monologger.rb @@ -48,9 +48,9 @@ class MonoLogger < Logger @dev = log else @dev = open_logfile(log) - @dev.sync = true @filename = log end + @dev.sync = true end def write(message) @@ -75,7 +75,6 @@ class MonoLogger < Logger def create_logfile(filename) logdev = open(filename, (File::WRONLY | File::APPEND | File::CREAT)) - logdev.sync = true add_log_header(logdev) logdev end diff --git a/lib/chef/node.rb b/lib/chef/node.rb index 007bd3c560..a7fc033080 100644 --- a/lib/chef/node.rb +++ b/lib/chef/node.rb @@ -247,6 +247,13 @@ class Chef run_list.include?(recipe_name) || Array(self[:recipes]).include?(recipe_name) end + # used by include_recipe to add recipes to the expanded run_list to be + # saved back to the node and be searchable + def loaded_recipe(cookbook, recipe) + fully_qualified_recipe = "#{cookbook}::#{recipe}" + automatic_attrs[:recipes] << fully_qualified_recipe unless Array(self[:recipes]).include?(fully_qualified_recipe) + end + # Returns true if this Node expects a given role, false if not. def role?(role_name) run_list.include?("role[#{role_name}]") @@ -305,7 +312,7 @@ class Chef if attrs.key?("recipes") || attrs.key?("run_list") raise Chef::Exceptions::AmbiguousRunlistSpecification, "please set the node's run list using the 'run_list' attribute only." end - Chef::Log.info("Setting the run_list to #{new_run_list.inspect} from JSON") + Chef::Log.info("Setting the run_list to #{new_run_list.inspect} from CLI options") run_list(new_run_list) end attrs diff --git a/lib/chef/node/attribute_collections.rb b/lib/chef/node/attribute_collections.rb index d5d496fd60..f09b02b106 100644 --- a/lib/chef/node/attribute_collections.rb +++ b/lib/chef/node/attribute_collections.rb @@ -76,8 +76,15 @@ class Chef super(data) end + # For elements like Fixnums, true, nil... + def safe_dup(e) + e.dup + rescue TypeError + e + end + def dup - Array.new(map {|e| e.dup}) + Array.new(map {|e| safe_dup(e)}) end end diff --git a/lib/chef/node/immutable_collections.rb b/lib/chef/node/immutable_collections.rb index f5b3a5121d..63ac2b4c6b 100644 --- a/lib/chef/node/immutable_collections.rb +++ b/lib/chef/node/immutable_collections.rb @@ -85,8 +85,15 @@ class Chef METHOD_DEFN end + # For elements like Fixnums, true, nil... + def safe_dup(e) + e.dup + rescue TypeError + e + end + def dup - Array.new(map {|e| e.dup }) + Array.new(map {|e| safe_dup(e)}) end end diff --git a/lib/chef/policy_builder.rb b/lib/chef/policy_builder.rb new file mode 100644 index 0000000000..136b2853b0 --- /dev/null +++ b/lib/chef/policy_builder.rb @@ -0,0 +1,49 @@ +# +# Author:: Daniel DeLeo (<dan@getchef.com>) +# Copyright:: Copyright 2008-2014 Chef Software, Inc. +# License:: Apache License, Version 2.0 +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +require 'chef/policy_builder/expand_node_object' +require 'chef/policy_builder/policyfile' + +class Chef + + # PolicyBuilder contains classes that handles fetching policy from server or + # disk and resolving any indirection (e.g. expanding run_list). + # + # INPUTS + # * event stream object + # * node object/run_list + # * json_attribs + # * override_runlist + # + # OUTPUTS + # * mutated node object (implicit) + # * a new RunStatus (probably doesn't need to be here) + # * cookbooks sync'd to disk + # * cookbook_hash is stored in run_context + module PolicyBuilder + + def self.strategy + if Chef::Config[:use_policyfile] + Policyfile + else + ExpandNodeObject + end + end + + end +end diff --git a/lib/chef/policy_builder/expand_node_object.rb b/lib/chef/policy_builder/expand_node_object.rb new file mode 100644 index 0000000000..38b8b7551b --- /dev/null +++ b/lib/chef/policy_builder/expand_node_object.rb @@ -0,0 +1,237 @@ +# +# Author:: Adam Jacob (<adam@opscode.com>) +# Author:: Tim Hinderliter (<tim@opscode.com>) +# Author:: Christopher Walters (<cw@opscode.com>) +# Author:: Daniel DeLeo (<dan@getchef.com>) +# Copyright:: Copyright 2008-2014 Chef Software, Inc. +# License:: Apache License, Version 2.0 +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +require 'chef/log' +require 'chef/rest' +require 'chef/run_context' +require 'chef/config' +require 'chef/node' + +class Chef + module PolicyBuilder + + # ExpandNodeObject is the "classic" policy builder implementation. It + # expands the run_list on a node object and then queries the chef-server + # to find the correct set of cookbooks, given version constraints of the + # node's environment. + class ExpandNodeObject + + attr_reader :events + attr_reader :node + attr_reader :node_name + attr_reader :ohai_data + attr_reader :json_attribs + attr_reader :override_runlist + attr_reader :original_runlist + attr_reader :run_context + attr_reader :run_list_expansion + + def initialize(node_name, ohai_data, json_attribs, override_runlist, events) + @node_name = node_name + @ohai_data = ohai_data + @json_attribs = json_attribs + @override_runlist = override_runlist + @events = events + + @node = nil + @original_runlist = nil + @run_list_expansion = nil + end + + def setup_run_context(specific_recipes=nil) + if Chef::Config[:solo] + Chef::Cookbook::FileVendor.on_create { |manifest| Chef::Cookbook::FileSystemFileVendor.new(manifest, Chef::Config[:cookbook_path]) } + cl = Chef::CookbookLoader.new(Chef::Config[:cookbook_path]) + cl.load_cookbooks + cookbook_collection = Chef::CookbookCollection.new(cl) + run_context = Chef::RunContext.new(node, cookbook_collection, @events) + else + Chef::Cookbook::FileVendor.on_create { |manifest| Chef::Cookbook::RemoteFileVendor.new(manifest, api_service) } + cookbook_hash = sync_cookbooks + cookbook_collection = Chef::CookbookCollection.new(cookbook_hash) + run_context = Chef::RunContext.new(node, cookbook_collection, @events) + end + + # TODO: this is not the place for this. It should be in Runner or + # CookbookCompiler or something. + run_context.load(@run_list_expansion) + if specific_recipes + specific_recipes.each do |recipe_file| + run_context.load_recipe_file(recipe_file) + end + end + run_context + end + + + # In client-server operation, loads the node state from the server. In + # chef-solo operation, builds a new node object. + def load_node + events.node_load_start(node_name, Chef::Config) + Chef::Log.debug("Building node object for #{node_name}") + + if Chef::Config[:solo] + @node = Chef::Node.build(node_name) + else + @node = Chef::Node.find_or_create(node_name) + end + rescue Exception => e + # TODO: wrap this exception so useful error info can be given to the + # user. + events.node_load_failed(node_name, e, Chef::Config) + raise + end + + + # Applies environment, external JSON attributes, and override run list to + # the node, Then expands the run_list. + # + # === Returns + # node<Chef::Node>:: The modified node object. node is modified in place. + def build_node + # Allow user to override the environment of a node by specifying + # a config parameter. + if Chef::Config[:environment] && !Chef::Config[:environment].chop.empty? + node.chef_environment(Chef::Config[:environment]) + end + + # consume_external_attrs may add items to the run_list. Save the + # expanded run_list, which we will pass to the server later to + # determine which versions of cookbooks to use. + node.reset_defaults_and_overrides + node.consume_external_attrs(ohai_data, @json_attribs) + + setup_run_list_override + + expand_run_list + + Chef::Log.info("Run List is [#{node.run_list}]") + Chef::Log.info("Run List expands to [#{@expanded_run_list_with_versions.join(', ')}]") + + events.node_load_completed(node, @expanded_run_list_with_versions, Chef::Config) + + node + end + + # Expands the node's run list. Stores the run_list_expansion object for later use. + def expand_run_list + @run_list_expansion = if Chef::Config[:solo] + node.expand!('disk') + else + node.expand!('server') + end + + # @run_list_expansion is a RunListExpansion. + # + # Convert @expanded_run_list, which is an + # Array of Hashes of the form + # {:name => NAME, :version_constraint => Chef::VersionConstraint }, + # into @expanded_run_list_with_versions, an + # Array of Strings of the form + # "#{NAME}@#{VERSION}" + @expanded_run_list_with_versions = @run_list_expansion.recipes.with_version_constraints_strings + @run_list_expansion + rescue Exception => e + # TODO: wrap/munge exception with useful error output. + events.run_list_expand_failed(node, e) + raise + end + + # Sync_cookbooks eagerly loads all files except files and + # templates. It returns the cookbook_hash -- the return result + # from /environments/#{node.chef_environment}/cookbook_versions, + # which we will use for our run_context. + # + # === Returns + # Hash:: The hash of cookbooks with download URLs as given by the server + def sync_cookbooks + Chef::Log.debug("Synchronizing cookbooks") + + begin + events.cookbook_resolution_start(@expanded_run_list_with_versions) + cookbook_hash = api_service.post("environments/#{node.chef_environment}/cookbook_versions", + {:run_list => @expanded_run_list_with_versions}) + rescue Exception => e + # TODO: wrap/munge exception to provide helpful error output + events.cookbook_resolution_failed(@expanded_run_list_with_versions, e) + raise + else + events.cookbook_resolution_complete(cookbook_hash) + end + + synchronizer = Chef::CookbookSynchronizer.new(cookbook_hash, events) + synchronizer.sync_cookbooks + + # register the file cache path in the cookbook path so that CookbookLoader actually picks up the synced cookbooks + Chef::Config[:cookbook_path] = File.join(Chef::Config[:file_cache_path], "cookbooks") + + cookbook_hash + end + + # Indicates whether the policy is temporary, which means an + # override_runlist was provided. Chef::Client uses this to decide whether + # to do the final node save at the end of the run or not. + def temporary_policy? + !!@original_runlist + end + + ######################################## + # Internal public API + ######################################## + + def setup_run_list_override + runlist_override_sanity_check! + unless(override_runlist.empty?) + @original_runlist = node.run_list.run_list_items.dup + node.run_list(*override_runlist) + Chef::Log.warn "Run List override has been provided." + Chef::Log.warn "Original Run List: [#{original_runlist.join(', ')}]" + Chef::Log.warn "Overridden Run List: [#{node.run_list}]" + end + end + + # Ensures runlist override contains RunListItem instances + def runlist_override_sanity_check! + # Convert to array and remove whitespace + if override_runlist.is_a?(String) + @override_runlist = override_runlist.split(',').map { |e| e.strip } + end + @override_runlist = [override_runlist].flatten.compact + override_runlist.map! do |item| + if(item.is_a?(Chef::RunList::RunListItem)) + item + else + Chef::RunList::RunListItem.new(item) + end + end + end + + def api_service + @api_service ||= Chef::REST.new(config[:chef_server_url]) + end + + def config + Chef::Config + end + + end + end +end diff --git a/lib/chef/policy_builder/policyfile.rb b/lib/chef/policy_builder/policyfile.rb new file mode 100644 index 0000000000..19b9aaf542 --- /dev/null +++ b/lib/chef/policy_builder/policyfile.rb @@ -0,0 +1,344 @@ +# +# Author:: Adam Jacob (<adam@opscode.com>) +# Author:: Tim Hinderliter (<tim@opscode.com>) +# Author:: Christopher Walters (<cw@opscode.com>) +# Author:: Daniel DeLeo (<dan@getchef.com>) +# Copyright:: Copyright 2008-2014 Chef Software, Inc. +# License:: Apache License, Version 2.0 +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +require 'chef/log' +require 'chef/rest' +require 'chef/run_context' +require 'chef/config' +require 'chef/node' + +class Chef + module PolicyBuilder + + # Policyfile is an experimental policy builder implementation that gets run + # list and cookbook version information from a single document. + # + # == WARNING + # This implementation is experimental. It may be changed in incompatible + # ways in minor or even patch releases, or even abandoned altogether. If + # using this with other tools, you may be forced to upgrade those tools in + # lockstep with chef-client because of incompatible behavior changes. + # + # == Unsupported Options: + # * override_runlist:: This could potentially be integrated into the + # policyfile, or replaced with a similar feature that has different + # semantics. + # * specific_recipes:: put more design thought into this use case. + # * run_list in json_attribs:: would be ignored anyway, so it raises an error. + # * chef-solo:: not currently supported. Need more design thought around + # how this should work. + class Policyfile + + class UnsupportedFeature < StandardError; end + + class PolicyfileError < StandardError; end + + RunListExpansionIsh = Struct.new(:recipes, :roles) + + attr_reader :events + attr_reader :node + attr_reader :node_name + attr_reader :ohai_data + attr_reader :json_attribs + attr_reader :run_context + + def initialize(node_name, ohai_data, json_attribs, override_runlist, events) + @node_name = node_name + @ohai_data = ohai_data + @json_attribs = json_attribs + @events = events + + @node = nil + + Chef::Log.warn("Using experimental Policyfile feature") + + if Chef::Config[:solo] + raise UnsupportedFeature, "Policyfile does not support chef-solo at this time." + end + + if override_runlist + raise UnsupportedFeature, "Policyfile does not support override run lists at this time" + end + + if json_attribs && json_attribs.key?("run_list") + raise UnsupportedFeature, "Policyfile does not support setting the run_list in json data at this time" + end + + if Chef::Config[:environment] && !Chef::Config[:environment].chop.empty? + raise UnsupportedFeature, "Policyfile does not work with Chef Environments" + end + end + + ## API Compat ## + # Methods related to unsupported features + + # Override run_list is not supported. + def original_runlist + nil + end + + # Override run_list is not supported. + def override_runlist + nil + end + + # Policyfile gives you the run_list already expanded, but users of this + # class may expect to get a run_list expansion compatible object by + # calling this method. + # + # === Returns + # RunListExpansionIsh:: A RunListExpansion duck type + def run_list_expansion + run_list_expansion_ish + end + + ## PolicyBuilder API ## + + # Loads the node state from the server. + def load_node + events.node_load_start(node_name, Chef::Config) + Chef::Log.debug("Building node object for #{node_name}") + + @node = Chef::Node.find_or_create(node_name) + validate_policyfile + node + rescue Exception => e + events.node_load_failed(node_name, e, Chef::Config) + raise + end + + # Applies environment, external JSON attributes, and override run list to + # the node, Then expands the run_list. + # + # === Returns + # node<Chef::Node>:: The modified node object. node is modified in place. + def build_node + # consume_external_attrs may add items to the run_list. Save the + # expanded run_list, which we will pass to the server later to + # determine which versions of cookbooks to use. + node.reset_defaults_and_overrides + + node.consume_external_attrs(ohai_data, json_attribs) + + expand_run_list + apply_policyfile_attributes + + Chef::Log.info("Run List is [#{run_list}]") + Chef::Log.info("Run List expands to [#{run_list_with_versions_for_display.join(', ')}]") + + + events.node_load_completed(node, run_list_with_versions_for_display, Chef::Config) + + node + rescue Exception => e + events.node_load_failed(node_name, e, Chef::Config) + raise + end + + def setup_run_context(specific_recipes=nil) + # TODO: This file vendor stuff is duplicated and initializing it with a + # block traps a reference to this object in a global context which will + # prevent it from getting GC'd. Simplify it. + Chef::Cookbook::FileVendor.on_create { |manifest| Chef::Cookbook::RemoteFileVendor.new(manifest, api_service) } + sync_cookbooks + cookbook_collection = Chef::CookbookCollection.new(cookbooks_to_sync) + run_context = Chef::RunContext.new(node, cookbook_collection, events) + + run_context.load(run_list_expansion_ish) + + run_context + end + + def expand_run_list + node.run_list(run_list) + node.automatic_attrs[:roles] = [] + node.automatic_attrs[:recipes] = run_list_expansion_ish.recipes + run_list_expansion_ish + end + + + def sync_cookbooks + Chef::Log.debug("Synchronizing cookbooks") + synchronizer = Chef::CookbookSynchronizer.new(cookbooks_to_sync, events) + synchronizer.sync_cookbooks + + # register the file cache path in the cookbook path so that CookbookLoader actually picks up the synced cookbooks + Chef::Config[:cookbook_path] = File.join(Chef::Config[:file_cache_path], "cookbooks") + + cookbooks_to_sync + end + + # Whether or not this is a temporary policy. Since PolicyBuilder doesn't + # support override_runlist, this is always false. + def temporary_policy? + false + end + + ## Internal Public API ## + + def run_list_with_versions_for_display + run_list.map do |recipe_spec| + cookbook, recipe = parse_recipe_spec(recipe_spec) + lock_data = cookbook_lock_for(cookbook) + display = "#{cookbook}::#{recipe}@#{lock_data["version"]} (#{lock_data["identifier"][0...7]})" + display + end + end + + def run_list_expansion_ish + recipes = run_list.map do |recipe_spec| + cookbook, recipe = parse_recipe_spec(recipe_spec) + "#{cookbook}::#{recipe}" + end + RunListExpansionIsh.new(recipes, []) + end + + def apply_policyfile_attributes + node.attributes.role_default = policy["default_attributes"] + node.attributes.role_override = policy["override_attributes"] + end + + def parse_recipe_spec(recipe_spec) + rmatch = recipe_spec.match(/recipe\[([^:]+)::([^:]+)\]/) + if rmatch.nil? + raise PolicyfileError, "invalid recipe specification #{recipe_spec} in Policyfile from #{policyfile_location}" + else + [rmatch[1], rmatch[2]] + end + end + + def cookbook_lock_for(cookbook_name) + cookbook_locks[cookbook_name] + end + + def run_list + policy["run_list"] + end + + def policy + @policy ||= http_api.get(policyfile_location) + rescue Net::HTTPServerException => e + raise ConfigurationError, "Error loading policyfile from `#{policyfile_location}': #{e.class} - #{e.message}" + end + + def policyfile_location + "data/policyfiles/#{deployment_group}" + end + + # Do some mimimal validation of the policyfile we fetched from the + # server. Compatibility mode relies on using data bags to store policy + # files; therefore no real validation will be performed server-side and + # we need to make additional checks to ensure the data will be formatted + # correctly. + def validate_policyfile + errors = [] + unless run_list + errors << "Policyfile is missing run_list element" + end + unless policy.key?("cookbook_locks") + errors << "Policyfile is missing cookbook_locks element" + end + if run_list.kind_of?(Array) + run_list_errors = run_list.select do |maybe_recipe_spec| + validate_recipe_spec(maybe_recipe_spec) + end + errors += run_list_errors + else + errors << "Policyfile run_list is malformed, must be an array of `recipe[cb_name::recipe_name]` items: #{policy["run_list"]}" + end + + unless errors.empty? + raise PolicyfileError, "Policyfile fetched from #{policyfile_location} was invalid:\n#{errors.join("\n")}" + end + end + + def validate_recipe_spec(recipe_spec) + parse_recipe_spec(recipe_spec) + nil + rescue PolicyfileError => e + e.message + end + + class ConfigurationError < StandardError; end + + def deployment_group + Chef::Config[:deployment_group] or + raise ConfigurationError, "Setting `deployment_group` is not configured." + end + + # Builds a 'cookbook_hash' map of the form + # "COOKBOOK_NAME" => "IDENTIFIER" + # + # This can be passed to a Chef::CookbookSynchronizer object to + # synchronize the cookbooks. + # + # TODO: Currently this makes N API calls to the server to get the + # cookbook objects. With server support (bulk API or the like), this + # should be reduced to a single call. + def cookbooks_to_sync + @cookbook_to_sync ||= begin + events.cookbook_resolution_start(run_list_with_versions_for_display) + + cookbook_versions_by_name = cookbook_locks.inject({}) do |cb_map, (name, lock_data)| + cb_map[name] = manifest_for(name, lock_data) + cb_map + end + events.cookbook_resolution_complete(cookbook_versions_by_name) + + cookbook_versions_by_name + end + rescue Exception => e + # TODO: wrap/munge exception to provide helpful error output + events.cookbook_resolution_failed(run_list_with_versions_for_display, e) + raise + end + + # Fetches the CookbookVersion object for the given name and identifer + # specified in the lock_data. + # TODO: This only implements Chef 11 compatibility mode, which means that + # cookbooks are fetched by the "dotted_decimal_identifier": a + # representation of a SHA1 in the traditional x.y.z version format. + def manifest_for(cookbook_name, lock_data) + xyz_version = lock_data["dotted_decimal_identifier"] + http_api.get("cookbooks/#{cookbook_name}/#{xyz_version}") + rescue Exception => e + message = "Error loading cookbook #{cookbook_name} at version #{xyz_version}: #{e.class} - #{e.message}" + err = Chef::Exceptions::CookbookNotFound.new(message) + err.set_backtrace(e.backtrace) + raise err + end + + def cookbook_locks + policy["cookbook_locks"] + end + + def http_api + @api_service ||= Chef::REST.new(config[:chef_server_url]) + end + + def config + Chef::Config + end + + end + end +end + diff --git a/lib/chef/provider.rb b/lib/chef/provider.rb index 3fb86d72c0..152a067f03 100644 --- a/lib/chef/provider.rb +++ b/lib/chef/provider.rb @@ -31,6 +31,9 @@ class Chef attr_accessor :current_resource attr_accessor :run_context + attr_reader :recipe_name + attr_reader :cookbook_name + #-- # TODO: this should be a reader, and the action should be passed in the # constructor; however, many/most subclasses override the constructor so @@ -44,6 +47,9 @@ class Chef @current_resource = nil @run_context = run_context @converge_actions = nil + + @recipe_name = nil + @cookbook_name = nil end def whyrun_mode? diff --git a/lib/chef/provider/deploy.rb b/lib/chef/provider/deploy.rb index d1017dba62..516aee6159 100644 --- a/lib/chef/provider/deploy.rb +++ b/lib/chef/provider/deploy.rb @@ -266,7 +266,7 @@ class Chef def copy_cached_repo target_dir_path = @new_resource.deploy_to + "/releases" - converge_by("deploy from repo to #{@target_dir_path} ") do + converge_by("deploy from repo to #{target_dir_path} ") do FileUtils.rm_rf(release_path) if ::File.exist?(release_path) FileUtils.mkdir_p(target_dir_path) FileUtils.cp_r(::File.join(@new_resource.destination, "."), release_path, :preserve => true) diff --git a/lib/chef/provider/file.rb b/lib/chef/provider/file.rb index b2127d7c87..b6a20fe9b7 100644 --- a/lib/chef/provider/file.rb +++ b/lib/chef/provider/file.rb @@ -352,17 +352,29 @@ class Chef if tempfile.path.nil? || !::File.exists?(tempfile.path) raise "chef-client is confused, trying to deploy a file that has no path or does not exist..." end + # the file? on the next line suppresses the case in why-run when we have a not-file here that would have otherwise been removed if ::File.file?(@new_resource.path) && contents_changed? - diff.diff(@current_resource.path, tempfile.path) - @new_resource.diff( diff.for_reporting ) unless file_created? - description = [ "update content in file #{@new_resource.path} from #{short_cksum(@current_resource.checksum)} to #{short_cksum(checksum(tempfile.path))}" ] - description << diff.for_output + description = [ "update content in file #{@new_resource.path} from \ +#{short_cksum(@current_resource.checksum)} to #{short_cksum(checksum(tempfile.path))}" ] + + # Hide the diff output if the resource is marked as a sensitive resource + if @new_resource.sensitive + @new_resource.diff("suppressed sensitive resource") + description << "suppressed sensitive resource" + else + diff.diff(@current_resource.path, tempfile.path) + @new_resource.diff( diff.for_reporting ) unless file_created? + description << diff.for_output + end + converge_by(description) do update_file_contents end end + # unlink necessary to clean up in why-run mode + tempfile.close tempfile.unlink end @@ -420,4 +432,3 @@ class Chef end end end - diff --git a/lib/chef/provider/group.rb b/lib/chef/provider/group.rb index 09c2a0052d..35a16c870c 100644 --- a/lib/chef/provider/group.rb +++ b/lib/chef/provider/group.rb @@ -84,14 +84,14 @@ class Chef # <false>:: If a change is not required def compare_group @change_desc = [ ] - if @new_resource.gid != @current_resource.gid + if @new_resource.gid.to_s != @current_resource.gid.to_s @change_desc << "change gid #{@current_resource.gid} to #{@new_resource.gid}" end if(@new_resource.append) missing_members = [] @new_resource.members.each do |member| - next if @current_resource.members.include?(member) + next if has_current_group_member?(member) missing_members << member end if missing_members.length > 0 @@ -100,7 +100,7 @@ class Chef members_to_be_removed = [] @new_resource.excluded_members.each do |member| - if @current_resource.members.include?(member) + if has_current_group_member?(member) members_to_be_removed << member end end @@ -116,6 +116,10 @@ class Chef !@change_desc.empty? end + def has_current_group_member?(member) + @current_resource.members.include?(member) + end + def action_create case @group_exists when false diff --git a/lib/chef/provider/group/windows.rb b/lib/chef/provider/group/windows.rb index cb0ab76927..c9c3da29e0 100644 --- a/lib/chef/provider/group/windows.rb +++ b/lib/chef/provider/group/windows.rb @@ -59,7 +59,7 @@ class Chef if @new_resource.append members_to_be_added = [ ] @new_resource.members.each do |member| - members_to_be_added << member if !@current_resource.members.include?(member) + members_to_be_added << member if ! has_current_group_member?(member) end # local_add_members will raise ERROR_MEMBER_IN_ALIAS if a @@ -68,7 +68,8 @@ class Chef members_to_be_removed = [ ] @new_resource.excluded_members.each do |member| - members_to_be_removed << member if @current_resource.members.include?(member) + member_sid = local_group_name_to_sid(member) + members_to_be_removed << member if has_current_group_member?(member) end @net_group.local_delete_members(members_to_be_removed) unless members_to_be_removed.empty? else @@ -76,10 +77,19 @@ class Chef end end + def has_current_group_member?(member) + member_sid = local_group_name_to_sid(member) + @current_resource.members.include?(member_sid) + end + def remove_group @net_group.local_delete end + def local_group_name_to_sid(group_name) + locally_qualified_name = group_name.include?("\\") ? group_name : "#{ENV['COMPUTERNAME']}\\#{group_name}" + Chef::ReservedNames::Win32::Security.lookup_account_name(locally_qualified_name)[1].to_s + end end end end diff --git a/lib/chef/provider/http_request.rb b/lib/chef/provider/http_request.rb index 1e0aa8b4a0..2bbd20aa2c 100644 --- a/lib/chef/provider/http_request.rb +++ b/lib/chef/provider/http_request.rb @@ -36,7 +36,8 @@ class Chef # Send a HEAD request to @new_resource.url, with ?message=@new_resource.message def action_head message = check_message(@new_resource.message) - # returns true from Chef::REST if returns 2XX (Net::HTTPSuccess) + # CHEF-4762: we expect a nil return value from Chef::HTTP for a "200 Success" response + # and false for a "304 Not Modified" response modified = @http.head( "#{@new_resource.url}?message=#{message}", @new_resource.headers @@ -44,7 +45,7 @@ class Chef Chef::Log.info("#{@new_resource} HEAD to #{@new_resource.url} successful") Chef::Log.debug("#{@new_resource} HEAD request response: #{modified}") # :head is usually used to trigger notifications, which converge_by now does - if modified + if modified != false converge_by("#{@new_resource} HEAD to #{@new_resource.url} returned modified, trigger notifications") {} end end diff --git a/lib/chef/provider/ifconfig/debian.rb b/lib/chef/provider/ifconfig/debian.rb index 821f4fe924..7589971143 100644 --- a/lib/chef/provider/ifconfig/debian.rb +++ b/lib/chef/provider/ifconfig/debian.rb @@ -24,6 +24,9 @@ class Chef class Ifconfig class Debian < Chef::Provider::Ifconfig + INTERFACES_FILE = "/etc/network/interfaces" + INTERFACES_DOT_D_DIR = "/etc/network/interfaces.d" + def initialize(new_resource, run_context) super(new_resource, run_context) @config_template = %{ @@ -46,22 +49,30 @@ iface <%= @new_resource.device %> inet static <% end %> <% end %> } - @config_path = "/etc/network/interfaces.d/ifcfg-#{@new_resource.device}" + @config_path = "#{INTERFACES_DOT_D_DIR}/ifcfg-#{@new_resource.device}" end def generate_config - check_interfaces_config + enforce_interfaces_dot_d_sanity super end protected - def check_interfaces_config - converge_by ('modify configuration file : /etc/network/interfaces') do - Dir.mkdir('/etc/network/interfaces.d') unless ::File.directory?('/etc/network/interfaces.d') - conf = Chef::Util::FileEdit.new('/etc/network/interfaces') - conf.insert_line_if_no_match('^\s*source\s+/etc/network/interfaces[.]d/[*]\s*$', 'source /etc/network/interfaces.d/*') - conf.write_file + def enforce_interfaces_dot_d_sanity + # create /etc/network/interfaces.d via dir resource (to get reporting, etc) + dir = Chef::Resource::Directory.new(INTERFACES_DOT_D_DIR, run_context) + dir.run_action(:create) + new_resource.updated_by_last_action(true) if dir.updated_by_last_action? + # roll our own file_edit resource, this will not get reported until we have a file_edit resource + interfaces_dot_d_for_regexp = INTERFACES_DOT_D_DIR.gsub(/\./, '\.') # escape dots for the regexp + regexp = %r{^\s*source\s+#{interfaces_dot_d_for_regexp}/\*\s*$} + unless ::File.exists?(INTERFACES_FILE) && regexp.match(IO.read(INTERFACES_FILE)) + converge_by("modifying #{INTERFACES_FILE} to source #{INTERFACES_DOT_D_DIR}") do + conf = Chef::Util::FileEdit.new(INTERFACES_FILE) + conf.insert_line_if_no_match(regexp, "source #{INTERFACES_DOT_D_DIR}/*") + conf.write_file + end end end diff --git a/lib/chef/provider/ohai.rb b/lib/chef/provider/ohai.rb index c686f67450..a6b5ab5daa 100644 --- a/lib/chef/provider/ohai.rb +++ b/lib/chef/provider/ohai.rb @@ -33,11 +33,12 @@ class Chef def action_reload converge_by("re-run ohai and merge results into node attributes") do ohai = ::Ohai::System.new - if @new_resource.plugin - ohai.require_plugin @new_resource.plugin - else - ohai.all_plugins - end + + # If @new_resource.plugin is nil, ohai will reload all the plugins + # Otherwise it will only reload the specified plugin + # Note that any changes to plugins, or new plugins placed on + # the path are picked up by ohai. + ohai.all_plugins @new_resource.plugin node.automatic_attrs.merge! ohai.data Chef::Log.info("#{@new_resource} reloaded") end diff --git a/lib/chef/provider/service/macosx.rb b/lib/chef/provider/service/macosx.rb index 4f2de2ccbf..ca78c2eaee 100644 --- a/lib/chef/provider/service/macosx.rb +++ b/lib/chef/provider/service/macosx.rb @@ -17,6 +17,7 @@ # require 'chef/provider/service' +require 'rexml/document' class Chef class Provider @@ -41,6 +42,7 @@ class Chef @current_resource.service_name(@new_resource.service_name) @plist_size = 0 @plist = find_service_plist + @service_label = find_service_label set_service_status @current_resource @@ -48,14 +50,6 @@ class Chef def define_resource_requirements #super - requirements.assert(:enable) do |a| - a.failure_message Chef::Exceptions::UnsupportedAction, "#{self.to_s} does not support :enable" - end - - requirements.assert(:disable) do |a| - a.failure_message Chef::Exceptions::UnsupportedAction, "#{self.to_s} does not support :disable" - end - requirements.assert(:reload) do |a| a.failure_message Chef::Exceptions::UnsupportedAction, "#{self.to_s} does not support :reload" end @@ -66,6 +60,12 @@ class Chef end requirements.assert(:all_actions) do |a| + a.assertion { !@service_label.to_s.empty? } + a.failure_message Chef::Exceptions::Service, + "Could not find service's label in plist file '#{@plist}'!" + end + + requirements.assert(:all_actions) do |a| a.assertion { @plist_size > 0 } # No failrue here in original code - so we also will not # fail. Instead warn that the service is potentially missing @@ -74,7 +74,6 @@ class Chef @current_resource.running(false) end end - end def start_service @@ -111,19 +110,56 @@ class Chef end end + # On OS/X, enabling a service has the side-effect of starting it, + # and disabling a service has the side-effect of stopping it. + # + # This makes some sense on OS/X since launchctl is an "init"-style + # supervisor that will restart daemons that are crashing, etc. + def enable_service + if @current_resource.enabled + Chef::Log.debug("#{@new_resource} already enabled, not enabling") + else + shell_out!( + "launchctl load -w '#{@plist}'", + :user => @owner_uid, :group => @owner_gid + ) + end + end + + def disable_service + unless @current_resource.enabled + Chef::Log.debug("#{@new_resource} not enabled, not disabling") + else + shell_out!( + "launchctl unload -w '#{@plist}'", + :user => @owner_uid, :group => @owner_gid + ) + end + end def set_service_status - return if @plist == nil + return if @plist == nil or @service_label.to_s.empty? - @current_resource.enabled(!@plist.nil?) + cmd = shell_out( + "launchctl list #{@service_label}", + :user => @owner_uid, :group => @owner_gid + ) + + if cmd.exitstatus == 0 + @current_resource.enabled(true) + else + @current_resource.enabled(false) + end if @current_resource.enabled @owner_uid = ::File.stat(@plist).uid @owner_gid = ::File.stat(@plist).gid - shell_out!("launchctl list", :user => @owner_uid, :group => @owner_gid).stdout.each_line do |line| + shell_out!( + "launchctl list", :user => @owner_uid, :group => @owner_gid + ).stdout.each_line do |line| case line - when /(\d+|-)\s+(?:\d+|-)\s+(.*\.?)#{@current_resource.service_name}/ + when /(\d+|-)\s+(?:\d+|-)\s+(.*\.?)#{@service_label}/ pid = $1 @current_resource.running(!pid.to_i.zero?) end @@ -135,9 +171,27 @@ class Chef private + def find_service_label + # Most services have the same internal label as the name of the + # plist file. However, there is no rule saying that *has* to be + # the case, and some core services (notably, ssh) do not follow + # this rule. + + # plist files can come in XML or Binary formats. this command + # will make sure we get XML every time. + plist_xml = shell_out!("plutil -convert xml1 -o - #{@plist}").stdout + + plist_doc = REXML::Document.new(plist_xml) + plist_doc.elements[ + "/plist/dict/key[text()='Label']/following::string[1]/text()"] + end + def find_service_plist plists = PLIST_DIRS.inject([]) do |results, dir| - entries = Dir.glob("#{::File.expand_path(dir)}/*#{@current_resource.service_name}*.plist") + edir = ::File.expand_path(dir) + entries = Dir.glob( + "#{edir}/*#{@current_resource.service_name}*.plist" + ) entries.any? ? results << entries : results end plists.flatten! diff --git a/lib/chef/recipe.rb b/lib/chef/recipe.rb index 0c688cb5f8..5b95d80590 100644 --- a/lib/chef/recipe.rb +++ b/lib/chef/recipe.rb @@ -23,6 +23,7 @@ require 'chef/dsl/data_query' require 'chef/dsl/platform_introspection' require 'chef/dsl/include_recipe' require 'chef/dsl/registry_helper' +require 'chef/dsl/reboot_pending' require 'chef/mixin/from_file' @@ -38,6 +39,7 @@ class Chef include Chef::DSL::IncludeRecipe include Chef::DSL::Recipe include Chef::DSL::RegistryHelper + include Chef::DSL::RebootPending include Chef::Mixin::FromFile include Chef::Mixin::Deprecation diff --git a/lib/chef/request_id.rb b/lib/chef/request_id.rb new file mode 100644 index 0000000000..7fc177c633 --- /dev/null +++ b/lib/chef/request_id.rb @@ -0,0 +1,37 @@ +# Author:: Prajakta Purohit (<prajakta@opscode.com>) +# Copyright:: Copyright (c) 2009, 2010, 2013, 2014 Opscode, Inc. +# License:: Apache License, Version 2.0 +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +require 'chef/monkey_patches/securerandom' +require 'singleton' + +class Chef + class RequestID + include Singleton + + def reset_request_id + @request_id = nil + end + + def request_id + @request_id ||= generate_request_id + end + + def generate_request_id + SecureRandom.uuid + end + end +end diff --git a/lib/chef/resource.rb b/lib/chef/resource.rb index 997c614171..e015a9eaf5 100644 --- a/lib/chef/resource.rb +++ b/lib/chef/resource.rb @@ -21,6 +21,7 @@ require 'chef/mixin/params_validate' require 'chef/dsl/platform_introspection' require 'chef/dsl/data_query' require 'chef/dsl/registry_helper' +require 'chef/dsl/reboot_pending' require 'chef/mixin/convert_to_class_name' require 'chef/resource/conditional' require 'chef/resource/conditional_action_not_nothing' @@ -125,6 +126,7 @@ F include Chef::Mixin::ParamsValidate include Chef::DSL::PlatformIntrospection include Chef::DSL::RegistryHelper + include Chef::DSL::RebootPending include Chef::Mixin::ConvertToClassName include Chef::Mixin::Deprecation diff --git a/lib/chef/resource/file.rb b/lib/chef/resource/file.rb index 676cbf200a..3db88dcda0 100644 --- a/lib/chef/resource/file.rb +++ b/lib/chef/resource/file.rb @@ -52,9 +52,9 @@ class Chef @force_unlink = false @manage_symlink_source = nil @diff = nil + @sensitive = false end - def content(arg=nil) set_or_return( :content, @@ -119,6 +119,13 @@ class Chef ) end + def sensitive(arg=nil) + set_or_return( + :sensitive, + arg, + :kind_of => [ TrueClass, FalseClass ] + ) + end end end end diff --git a/lib/chef/resource_platform_map.rb b/lib/chef/resource_platform_map.rb index ad27aa91c1..a678f5be4b 100644 --- a/lib/chef/resource_platform_map.rb +++ b/lib/chef/resource_platform_map.rb @@ -123,7 +123,7 @@ class Chef resource_klass = platform_resource(short_name, platform, version) || resource_matching_short_name(short_name) - raise NameError, "Cannot find a resource for #{short_name} on #{platform} version #{version}" if resource_klass.nil? + raise Exceptions::NoSuchResourceType, "Cannot find a resource for #{short_name} on #{platform} version #{version}" if resource_klass.nil? resource_klass end diff --git a/lib/chef/resource_reporter.rb b/lib/chef/resource_reporter.rb index d29949086e..d191710cb4 100644 --- a/lib/chef/resource_reporter.rb +++ b/lib/chef/resource_reporter.rb @@ -50,8 +50,8 @@ class Chef def for_json as_hash = {} as_hash["type"] = new_resource.class.dsl_name - as_hash["name"] = new_resource.name - as_hash["id"] = new_resource.identity + as_hash["name"] = new_resource.name.to_s + as_hash["id"] = new_resource.identity.to_s as_hash["after"] = state(new_resource) as_hash["before"] = current_resource ? state(current_resource) : {} as_hash["duration"] = (elapsed_time * 1000).to_i.to_s @@ -107,7 +107,6 @@ class Chef @pending_update = nil @status = "success" @exception = nil - @run_id = SecureRandom.uuid @rest_client = rest_client @error_descriptions = {} end @@ -118,7 +117,7 @@ class Chef if reporting_enabled? begin resource_history_url = "reports/nodes/#{node_name}/runs" - server_response = @rest_client.post_rest(resource_history_url, {:action => :start, :run_id => @run_id, + server_response = @rest_client.post_rest(resource_history_url, {:action => :start, :run_id => run_id, :start_time => start_time.to_s}, headers) rescue Timeout::Error, Errno::EINVAL, Errno::ECONNRESET, EOFError, Net::HTTPBadResponse, Net::HTTPHeaderSyntaxError, Net::ProtocolError => e handle_error_starting_run(e, resource_history_url) @@ -158,6 +157,10 @@ class Chef @reporting_enabled = false end + def run_id + @run_status.run_id + end + def resource_current_state_loaded(new_resource, action, current_resource) unless nested_resource?(new_resource) @pending_update = ResourceReport.new_with_current_state(new_resource, action, current_resource) @@ -214,8 +217,8 @@ class Chef def post_reporting_data if reporting_enabled? run_data = prepare_run_data - resource_history_url = "reports/nodes/#{node_name}/runs/#{@run_id}" - Chef::Log.info("Sending resource update report (run-id: #{@run_id})") + resource_history_url = "reports/nodes/#{node_name}/runs/#{run_id}" + Chef::Log.info("Sending resource update report (run-id: #{run_id})") Chef::Log.debug run_data.inspect compressed_data = encode_gzip(run_data.to_json) begin diff --git a/lib/chef/rest.rb b/lib/chef/rest.rb index 04ee0b0cb2..73ca4b3293 100644 --- a/lib/chef/rest.rb +++ b/lib/chef/rest.rb @@ -32,9 +32,11 @@ require 'chef/http/decompressor' require 'chef/http/json_input' require 'chef/http/json_to_model_output' require 'chef/http/cookie_manager' +require 'chef/http/validate_content_length' require 'chef/config' require 'chef/exceptions' require 'chef/platform/query_helpers' +require 'chef/http/remote_request_id' class Chef # == Chef::REST @@ -61,12 +63,16 @@ class Chef @decompressor = Decompressor.new(options) @authenticator = Authenticator.new(options) + @request_id = RemoteRequestID.new(options) + @middlewares << ValidateContentLength.new(options) @middlewares << JSONInput.new(options) @middlewares << JSONToModelOutput.new(options) @middlewares << CookieManager.new(options) @middlewares << @decompressor @middlewares << @authenticator + @middlewares << @request_id + end def signing_key_filename @@ -130,7 +136,7 @@ class Chef def raw_http_request(method, path, headers, data) url = create_url(path) method, url, headers, data = @authenticator.handle_request(method, url, headers, data) - + method, url, headers, data = @request_id.handle_request(method, url, headers, data) response, rest_request, return_value = send_http_request(method, url, headers, data) response.error! unless success_response?(response) return_value diff --git a/lib/chef/run_context.rb b/lib/chef/run_context.rb index 2ed29a2e34..05a954ad15 100644 --- a/lib/chef/run_context.rb +++ b/lib/chef/run_context.rb @@ -146,7 +146,7 @@ class Chef false else loaded_recipe(cookbook_name, recipe_short_name) - + node.loaded_recipe(cookbook_name, recipe_short_name) cookbook = cookbook_collection[cookbook_name] cookbook.load_recipe(recipe_short_name, self) end diff --git a/lib/chef/run_status.rb b/lib/chef/run_status.rb index 9354f7872a..0f181426b0 100644 --- a/lib/chef/run_status.rb +++ b/lib/chef/run_status.rb @@ -37,6 +37,8 @@ class Chef::RunStatus attr_writer :exception + attr_accessor :run_id + def initialize(node, events) @node = node @events = events @@ -112,7 +114,8 @@ class Chef::RunStatus :all_resources => all_resources, :updated_resources => updated_resources, :exception => formatted_exception, - :backtrace => backtrace} + :backtrace => backtrace, + :run_id => run_id} end # Returns a string of the format "ExceptionClass: message" or +nil+ if no diff --git a/lib/chef/server_api.rb b/lib/chef/server_api.rb index e9e7593dd6..8cdcd7a09d 100644 --- a/lib/chef/server_api.rb +++ b/lib/chef/server_api.rb @@ -22,6 +22,7 @@ require 'chef/http/cookie_manager' require 'chef/http/decompressor' require 'chef/http/json_input' require 'chef/http/json_output' +require 'chef/http/remote_request_id' class Chef class ServerAPI < Chef::HTTP @@ -37,5 +38,6 @@ class Chef use Chef::HTTP::CookieManager use Chef::HTTP::Decompressor use Chef::HTTP::Authenticator + use Chef::HTTP::RemoteRequestID end -end
\ No newline at end of file +end diff --git a/lib/chef/util/file_edit.rb b/lib/chef/util/file_edit.rb index 3f354124b3..bb19435a12 100644 --- a/lib/chef/util/file_edit.rb +++ b/lib/chef/util/file_edit.rb @@ -33,7 +33,7 @@ class Chef @file_edited = false raise ArgumentError, "File doesn't exist" unless File.exist? @original_pathname - @contents = File.new(@original_pathname){ |f| f.readlines } + @contents = File.open(@original_pathname) { |f| f.readlines } end #search the file line by line and match each line with the given regex diff --git a/lib/chef/util/windows/net_group.rb b/lib/chef/util/windows/net_group.rb index e5d78614db..924bd392f9 100644 --- a/lib/chef/util/windows/net_group.rb +++ b/lib/chef/util/windows/net_group.rb @@ -55,19 +55,20 @@ class Chef::Util::Windows::NetGroup < Chef::Util::Windows nread = 0.chr * PTR_SIZE total = 0.chr * PTR_SIZE - rc = NetLocalGroupGetMembers.call(nil, @name, 1, ptr, -1, + rc = NetLocalGroupGetMembers.call(nil, @name, 0, ptr, -1, nread, total, handle) if (rc == NERR_Success) || (rc == ERROR_MORE_DATA) ptr = ptr.unpack('L')[0] nread = nread.unpack('i')[0] - members = 0.chr * (nread * (PTR_SIZE * 3)) #nread * sizeof(LOCALGROUP_MEMBERS_INFO_1) + members = 0.chr * (nread * PTR_SIZE ) #nread * sizeof(LOCALGROUP_MEMBERS_INFO_0) memcpy(members, ptr, members.size) - # 3 pointer fields in LOCALGROUP_MEMBERS_INFO_1, offset 2*PTR_SIZE is lgrmi1_name + # 1 pointer field in LOCALGROUP_MEMBERS_INFO_0, offset 0 is lgrmi0_sid nread.times do |i| - offset = (i * 3) + 2 - member = lpwstr_to_s(members, offset) - group_members << member + sid_address = members[i * PTR_SIZE, PTR_SIZE].unpack('L')[0] + sid_ptr = FFI::Pointer.new(sid_address) + member_sid = Chef::ReservedNames::Win32::Security::SID.new(sid_ptr) + group_members << member_sid.to_s end NetApiBufferFree(ptr) else diff --git a/lib/chef/version.rb b/lib/chef/version.rb index 31a9ba0f65..25f4a5307d 100644 --- a/lib/chef/version.rb +++ b/lib/chef/version.rb @@ -17,7 +17,7 @@ class Chef CHEF_ROOT = File.dirname(File.expand_path(File.dirname(__FILE__))) - VERSION = '11.10.0.alpha.1' + VERSION = '11.12.0.alpha.0' end # NOTE: the Chef::Version class is defined in version_class.rb diff --git a/lib/chef/win32/version.rb b/lib/chef/win32/version.rb index 62f817503e..e008ff15e8 100644 --- a/lib/chef/win32/version.rb +++ b/lib/chef/win32/version.rb @@ -35,20 +35,25 @@ class Chef Win32API.new('user32', 'GetSystemMetrics', 'I', 'I').call(n_index) end + def self.method_name_from_marketing_name(marketing_name) + "#{marketing_name.gsub(/\s/, '_').gsub(/\./, '_').downcase}?" + # "#{marketing_name.gsub(/\s/, '_').gsub(//, '_').downcase}?" + end + public WIN_VERSIONS = { - "Windows 8.1" => {:major => 6, :minor => 3, :callable => lambda{ @product_type == VER_NT_WORKSTATION }}, - "Windows Server 2012 R2" => {:major => 6, :minor => 3, :callable => lambda{ @product_type != VER_NT_WORKSTATION }}, - "Windows 8" => {:major => 6, :minor => 2, :callable => lambda{ @product_type == VER_NT_WORKSTATION }}, - "Windows Server 2012" => {:major => 6, :minor => 2, :callable => lambda{ @product_type != VER_NT_WORKSTATION }}, - "Windows 7" => {:major => 6, :minor => 1, :callable => lambda{ @product_type == VER_NT_WORKSTATION }}, - "Windows Server 2008 R2" => {:major => 6, :minor => 1, :callable => lambda{ @product_type != VER_NT_WORKSTATION }}, - "Windows Server 2008" => {:major => 6, :minor => 0, :callable => lambda{ @product_type != VER_NT_WORKSTATION }}, - "Windows Vista" => {:major => 6, :minor => 0, :callable => lambda{ @product_type == VER_NT_WORKSTATION }}, - "Windows Server 2003 R2" => {:major => 5, :minor => 2, :callable => lambda{ get_system_metrics(SM_SERVERR2) != 0 }}, - "Windows Home Server" => {:major => 5, :minor => 2, :callable => lambda{ (@suite_mask & VER_SUITE_WH_SERVER) == VER_SUITE_WH_SERVER }}, - "Windows Server 2003" => {:major => 5, :minor => 2, :callable => lambda{ get_system_metrics(SM_SERVERR2) == 0 }}, + "Windows 8.1" => {:major => 6, :minor => 3, :callable => lambda{ |product_type, suite_mask| product_type == VER_NT_WORKSTATION }}, + "Windows Server 2012 R2" => {:major => 6, :minor => 3, :callable => lambda {|product_type, suite_mask| product_type != VER_NT_WORKSTATION }}, + "Windows 8" => {:major => 6, :minor => 2, :callable => lambda{ |product_type, suite_mask| product_type == VER_NT_WORKSTATION }}, + "Windows Server 2012" => {:major => 6, :minor => 2, :callable => lambda{ |product_type, suite_mask| product_type != VER_NT_WORKSTATION }}, + "Windows 7" => {:major => 6, :minor => 1, :callable => lambda{ |product_type, suite_mask| product_type == VER_NT_WORKSTATION }}, + "Windows Server 2008 R2" => {:major => 6, :minor => 1, :callable => lambda{ |product_type, suite_mask| product_type != VER_NT_WORKSTATION }}, + "Windows Server 2008" => {:major => 6, :minor => 0, :callable => lambda{ |product_type, suite_mask| product_type != VER_NT_WORKSTATION }}, + "Windows Vista" => {:major => 6, :minor => 0, :callable => lambda{ |product_type, suite_mask| product_type == VER_NT_WORKSTATION }}, + "Windows Server 2003 R2" => {:major => 5, :minor => 2, :callable => lambda{ |product_type, suite_mask| get_system_metrics(SM_SERVERR2) != 0 }}, + "Windows Home Server" => {:major => 5, :minor => 2, :callable => lambda{ |product_type, suite_mask| (suite_mask & VER_SUITE_WH_SERVER) == VER_SUITE_WH_SERVER }}, + "Windows Server 2003" => {:major => 5, :minor => 2, :callable => lambda{ |product_type, suite_mask| get_system_metrics(SM_SERVERR2) == 0 }}, "Windows XP" => {:major => 5, :minor => 1}, "Windows 2000" => {:major => 5, :minor => 0} } @@ -77,11 +82,11 @@ class Chef # General Windows checks WIN_VERSIONS.each do |k,v| - method_name = "#{k.gsub(/\s/, '_').downcase}?" + method_name = method_name_from_marketing_name(k) define_method(method_name) do (@major_version == v[:major]) && (@minor_version == v[:minor]) && - (v[:callable] ? v[:callable].call : true) + (v[:callable] ? v[:callable].call(@product_type, @suite_mask) : true) end marketing_names << [k, method_name] end @@ -105,11 +110,19 @@ class Chef private def get_version - version = GetVersion() - major = LOBYTE(LOWORD(version)) - minor = HIBYTE(LOWORD(version)) - build = version < 0x80000000 ? HIWORD(version) : 0 - [major, minor, build] + # Use WMI here because API's like GetVersion return faked + # version numbers on Windows Server 2012 R2 and Windows 8.1 -- + # WMI always returns the truth. See article at + # http://msdn.microsoft.com/en-us/library/windows/desktop/ms724439(v=vs.85).aspx + require 'ruby-wmi' + + os_info = WMI::Win32_OperatingSystem.find(:first) + os_version = os_info.send('Version') + + # The operating system version is a string in the following form + # that can be split into components based on the '.' delimiter: + # MajorVersionNumber.MinorVersionNumber.BuildNumber + os_version.split('.').collect { | version_string | version_string.to_i } end def get_version_ex diff --git a/spec/functional/dsl/reboot_pending_spec.rb b/spec/functional/dsl/reboot_pending_spec.rb new file mode 100644 index 0000000000..10d667f7bd --- /dev/null +++ b/spec/functional/dsl/reboot_pending_spec.rb @@ -0,0 +1,118 @@ +# +# Author:: Bryan McLellan <btm@loftninjas.org> +# Copyright:: Copyright (c) 2014 Chef Software, Inc. +# License:: Apache License, Version 2.0 +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +require "chef/dsl/reboot_pending" +require "chef/win32/registry" +require "spec_helper" + +describe Chef::DSL::RebootPending, :windows_only do + def run_ohai + ohai = Ohai::System.new + # Would be nice to limit this to platform/kernel/arch etc for Ohai 7 + ohai.all_plugins + node.consume_external_attrs(ohai.data,{}) + + ohai + end + + def registry_safe? + !registry.value_exists?('HKLM\SYSTEM\CurrentControlSet\Control\Session Manager', { :name => 'PendingFileRenameOperations' }) || + !registry.key_exists?('HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update\RebootRequired') || + !registry.key_exists?('HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Component Based Servicing\RebootRequired') || + !registry.key_exists?('HKLM\SOFTWARE\Microsoft\Updates\UpdateExeVolatile') + end + + let(:node) { Chef::Node.new } + let(:events) { Chef::EventDispatch::Dispatcher.new } + let!(:ohai) { run_ohai } # Ensure we have necessary node data + let(:run_context) { Chef::RunContext.new(node, {}, events) } + let(:recipe) { Chef::Recipe.new("a windows cookbook", "the windows recipe", run_context) } + let(:registry) { Chef::Win32::Registry.new(run_context) } + + describe "reboot_pending?" do + + context "when there is nothing to indicate a reboot is pending" do + it { expect(recipe.reboot_pending?).to be_false } + end + + describe 'HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\PendingFileRenameOperations' do + it "returns true if the registry value exists" do + pending "Found existing registry keys" unless registry_safe? + registry.set_value('HKLM\SYSTEM\CurrentControlSet\Control\Session Manager', + { :name => 'PendingFileRenameOperations', :type => :multi_string, :data => ['\??\C:\foo.txt|\??\C:\bar.txt'] }) + + expect(recipe.reboot_pending?).to be_true + end + + after do + if registry_safe? + registry.delete_value('HKLM\SYSTEM\CurrentControlSet\Control\Session Manager', { :name => 'PendingFileRenameOperations' }) + end + end + end + + describe 'HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update\RebootRequired' do + it "returns true if the registry key exists" do + pending "Found existing registry keys" unless registry_safe? + registry.create_key('HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update\RebootRequired', false) + + expect(recipe.reboot_pending?).to be_true + end + + after do + if registry_safe? + registry.delete_key('HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update\RebootRequired', false) + end + end + end + + describe 'HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Component Based Servicing\RebootRequired' do + it "returns true if the registry key exists" do + pending "Permissions are limited to 'TrustedInstaller' by default" + pending "Found existing registry keys" unless registry_safe? + registry.create_key('HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Component Based Servicing\RebootRequired', false) + + expect(recipe.reboot_pending?).to be_true + end + + after do + if registry_safe? + registry.delete_key('HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Component Based Servicing\RebootRequired', false) + end + end + end + + describe 'HKLM\SOFTWARE\Microsoft\Updates\UpdateExeVolatile\Flags' do + it "returns true if the registry key exists" do + pending "Found existing registry keys" unless registry_safe? + registry.create_key('HKLM\SOFTWARE\Microsoft\Updates\UpdateExeVolatile', true) + registry.set_value('HKLM\SOFTWARE\Microsoft\Updates\UpdateExeVolatile', + { :name => 'Flags', :type => :dword, :data => 3 }) + + expect(recipe.reboot_pending?).to be_true + end + + after do + if registry_safe? + registry.delete_value('HKLM\SOFTWARE\Microsoft\Updates\UpdateExeVolatile', { :name => 'Flags' }) + registry.delete_key('HKLM\SOFTWARE\Microsoft\Updates\UpdateExeVolatile', false) + end + end + end + end +end diff --git a/spec/functional/knife/cookbook_delete_spec.rb b/spec/functional/knife/cookbook_delete_spec.rb index 2d52fb91a3..ee620bf165 100644 --- a/spec/functional/knife/cookbook_delete_spec.rb +++ b/spec/functional/knife/cookbook_delete_spec.rb @@ -51,7 +51,7 @@ describe Chef::Knife::CookbookDelete do end it "logs an error and exits" do - @knife.ui.stub!(:stderr).and_return(@log_output) + @knife.ui.stub(:stderr).and_return(@log_output) lambda {@knife.run}.should raise_error(SystemExit) @log_output.string.should match(/Cannot find a cookbook named no-such-cookbook to delete/) end @@ -67,8 +67,8 @@ describe Chef::Knife::CookbookDelete do it "asks for confirmation, then deletes the cookbook" do stdin, stdout = StringIO.new("y\n"), StringIO.new - @knife.ui.stub!(:stdin).and_return(stdin) - @knife.ui.stub!(:stdout).and_return(stdout) + @knife.ui.stub(:stdin).and_return(stdin) + @knife.ui.stub(:stdout).and_return(stdout) cb100_deleted = false @api.delete("/cookbooks/obsolete-cookbook/1.0.0", 200) { cb100_deleted = true; "[\"true\"]" } @@ -83,8 +83,8 @@ describe Chef::Knife::CookbookDelete do @knife.config[:purge] = true stdin, stdout = StringIO.new("y\ny\n"), StringIO.new - @knife.ui.stub!(:stdin).and_return(stdin) - @knife.ui.stub!(:stdout).and_return(stdout) + @knife.ui.stub(:stdin).and_return(stdin) + @knife.ui.stub(:stdout).and_return(stdout) cb100_deleted = false @api.delete("/cookbooks/obsolete-cookbook/1.0.0?purge=true", 200) { cb100_deleted = true; "[\"true\"]" } @@ -126,8 +126,8 @@ describe Chef::Knife::CookbookDelete do cb100_deleted = cb110_deleted = cb120_deleted = nil @api.delete("/cookbooks/obsolete-cookbook/1.0.0", 200) { cb100_deleted = true; "[\"true\"]" } stdin, stdout = StringIO.new, StringIO.new - @knife.ui.stub!(:stdin).and_return(stdin) - @knife.ui.stub!(:stdout).and_return(stdout) + @knife.ui.stub(:stdin).and_return(stdin) + @knife.ui.stub(:stdout).and_return(stdout) stdin << "1\n" stdin.rewind @knife.run @@ -142,8 +142,8 @@ describe Chef::Knife::CookbookDelete do @api.delete("/cookbooks/obsolete-cookbook/1.2.0", 200) { cb120_deleted = true; "[\"true\"]" } stdin, stdout = StringIO.new("4\n"), StringIO.new - @knife.ui.stub!(:stdin).and_return(stdin) - @knife.ui.stub!(:stdout).and_return(stdout) + @knife.ui.stub(:stdin).and_return(stdin) + @knife.ui.stub(:stdout).and_return(stdout) @knife.run diff --git a/spec/functional/knife/ssh_spec.rb b/spec/functional/knife/ssh_spec.rb index fd8cfe0f7e..40d71859c7 100644 --- a/spec/functional/knife/ssh_spec.rb +++ b/spec/functional/knife/ssh_spec.rb @@ -252,7 +252,7 @@ describe Chef::Knife::Ssh do # if available, but #merge_configs (which is called by #configure_chef) is # necessary to have default options merged in. @knife.merge_configs - @knife.stub!(:ssh_command).and_return { 0 } + @knife.stub(:ssh_command).and_return { 0 } @api = TinyServer::API.instance @api.clear diff --git a/spec/functional/resource/base.rb b/spec/functional/resource/base.rb index 13438c1759..056db39877 100644 --- a/spec/functional/resource/base.rb +++ b/spec/functional/resource/base.rb @@ -22,9 +22,7 @@ def ohai # provider is platform-dependent, we need platform ohai data: @OHAI_SYSTEM ||= begin ohai = Ohai::System.new - ohai.require_plugin("os") - ohai.require_plugin("platform") - ohai.require_plugin("passwd") + ohai.all_plugins("platform") ohai end end diff --git a/spec/functional/resource/deploy_revision_spec.rb b/spec/functional/resource/deploy_revision_spec.rb index 14e6e69d6d..9ff1391e35 100644 --- a/spec/functional/resource/deploy_revision_spec.rb +++ b/spec/functional/resource/deploy_revision_spec.rb @@ -45,7 +45,7 @@ describe Chef::Resource::DeployRevision, :unix_only => true do before(:all) do @ohai = Ohai::System.new - @ohai.require_plugin("os") + @ohai.all_plugins("os") end let(:node) do @@ -78,6 +78,9 @@ describe Chef::Resource::DeployRevision, :unix_only => true do # This is the third version let(:previous_rev) { "6d19a6dbecc8e37f5b2277345885c0c783eb8fb1" } + # This is the second version + let(:second_rev) { "0827e1b0e5043608ac0a824da5c558e252154ad0" } + # This is the sixth version, it is on the "with-deploy-scripts" branch let(:rev_with_in_repo_callbacks) { "2404d015882659754bdb93ad6e4b4d3d02691a82" } @@ -100,6 +103,7 @@ describe Chef::Resource::DeployRevision, :unix_only => true do let(:basic_deploy_resource) do Chef::Resource::DeployRevision.new(deploy_directory, run_context).tap do |r| + r.name "deploy-revision-unit-test" r.repo git_bundle_repo r.symlink_before_migrate({}) r.symlinks({}) @@ -127,6 +131,34 @@ describe Chef::Resource::DeployRevision, :unix_only => true do end end + let(:deploy_to_previous_rev_again) do + basic_deploy_resource.dup.tap do |r| + r.revision(previous_rev) + r.restart_command shell_restart_command(:deploy_to_previous_rev_again) + end + end + + let(:deploy_to_second_rev) do + basic_deploy_resource.dup.tap do |r| + r.revision(second_rev) + r.restart_command shell_restart_command(:deploy_to_second_rev) + end + end + + let(:deploy_to_second_rev_again) do + basic_deploy_resource.dup.tap do |r| + r.revision(second_rev) + r.restart_command shell_restart_command(:deploy_to_second_rev_again) + end + end + + let(:deploy_to_second_rev_again_again) do + basic_deploy_resource.dup.tap do |r| + r.revision(second_rev) + r.restart_command shell_restart_command(:deploy_to_second_rev_again_again) + end + end + # Computes the full path for +path+ relative to the deploy directory def rel_path(path) File.expand_path(path, deploy_directory) @@ -306,6 +338,165 @@ describe Chef::Resource::DeployRevision, :unix_only => true do end end + describe "back to a previously deployed revision where resource rev == latest revision (explicit rollback)" do + before do + deploy_to_previous_rev.run_action(:deploy) + @previous_rev_all_releases = deploy_to_previous_rev.provider_for_action(:deploy).all_releases + deploy_to_latest_rev.run_action(:deploy) + @latest_rev_all_releases = deploy_to_latest_rev.provider_for_action(:deploy).all_releases + deploy_to_latest_rev_again.run_action(:rollback) + @previous_rev_again_all_releases = deploy_to_latest_rev_again.provider_for_action(:deploy).all_releases + end + + the_app_is_deployed_at_revision(:previous_rev) + + it "restarts the application after rolling back" do + actual_operations_order.should == %w[deploy_to_previous_rev deploy_to_latest_rev deploy_to_latest_rev_again] + end + + it "is marked updated" do + deploy_to_latest_rev_again.should be_updated_by_last_action + end + + it "deploys the right code" do + IO.read(rel_path("current/app/app.rb")).should include("this is the third version of the app") + end + + it "all_releases after first deploy should have one entry" do + @previous_rev_all_releases.length.should == 1 + end + + it "all_releases after second deploy should have two entries" do + @latest_rev_all_releases.length.should == 2 + end + + it "all_releases after rollback should have one entry" do + @previous_rev_again_all_releases.length.should == 1 + end + + it "all_releases after rollback should be the same as after the first deploy" do + @previous_rev_again_all_releases.should == @previous_rev_all_releases + end + + end + + describe "back to a previously deployed revision where resource rev == previous revision (explicit rollback)" do + before do + deploy_to_previous_rev.run_action(:deploy) + @previous_rev_all_releases = deploy_to_previous_rev.provider_for_action(:deploy).all_releases + deploy_to_latest_rev.run_action(:deploy) + @latest_rev_all_releases = deploy_to_latest_rev.provider_for_action(:deploy).all_releases + deploy_to_previous_rev_again.run_action(:rollback) + # FIXME: only difference with previous test is using latest_rev_again insetad of previous_rev_again + @previous_rev_again_all_releases = deploy_to_latest_rev_again.provider_for_action(:deploy).all_releases + end + + the_app_is_deployed_at_revision(:previous_rev) + + it "restarts the application after rolling back" do + actual_operations_order.should == %w[deploy_to_previous_rev deploy_to_latest_rev deploy_to_previous_rev_again] + end + + it "is marked updated" do + deploy_to_previous_rev_again.should be_updated_by_last_action + end + + it "deploys the right code" do + IO.read(rel_path("current/app/app.rb")).should include("this is the third version of the app") + end + + it "all_releases after first deploy should have one entry" do + @previous_rev_all_releases.length.should == 1 + end + + it "all_releases after second deploy should have two entries" do + @latest_rev_all_releases.length.should == 2 + end + + it "all_releases after rollback should have one entry" do + @previous_rev_again_all_releases.length.should == 1 + end + + it "all_releases after rollback should be the same as after the first deploy" do + @previous_rev_again_all_releases.should == @previous_rev_all_releases + end + end + + describe "back to a previously deployed revision where resource rev == latest revision (explicit rollback)" do + before do + deploy_to_second_rev.run_action(:deploy) + @first_deploy_all_releases = deploy_to_second_rev.provider_for_action(:deploy).all_releases + deploy_to_previous_rev.run_action(:deploy) + @second_deploy_all_releases = deploy_to_previous_rev.provider_for_action(:deploy).all_releases + deploy_to_previous_rev_again.run_action(:rollback) + @third_deploy_all_releases = deploy_to_previous_rev_again.provider_for_action(:deploy).all_releases + deploy_to_latest_rev.run_action(:deploy) + @fourth_deploy_all_releases = deploy_to_latest_rev.provider_for_action(:deploy).all_releases + deploy_to_latest_rev_again.run_action(:rollback) + @fifth_deploy_all_releases = deploy_to_latest_rev_again.provider_for_action(:deploy).all_releases + end + + the_app_is_deployed_at_revision(:second_rev) + + it "restarts the application after rolling back" do + actual_operations_order.should == %w[deploy_to_second_rev deploy_to_previous_rev deploy_to_previous_rev_again deploy_to_latest_rev deploy_to_latest_rev_again] + end + + it "is marked updated" do + deploy_to_latest_rev_again.should be_updated_by_last_action + end + + it "deploys the right code" do + IO.read(rel_path("current/app/app.rb")).should include("this is the second version of the app") + end + + it "all_releases after rollback should have one entry" do + @fifth_deploy_all_releases.length.should == 1 + end + + it "all_releases after rollback should be the same as after the first deploy" do + @fifth_deploy_all_releases.should == @first_deploy_all_releases + end + end + + describe "back to a previously deployed revision where resource rev == latest revision (explicit rollback)" do + before do + deploy_to_second_rev.run_action(:deploy) + @first_deploy_all_releases = deploy_to_second_rev.provider_for_action(:deploy).all_releases + deploy_to_previous_rev.run_action(:deploy) + @second_deploy_all_releases = deploy_to_previous_rev.provider_for_action(:deploy).all_releases + deploy_to_second_rev_again.run_action(:rollback) + @third_deploy_all_releases = deploy_to_second_rev_again.provider_for_action(:deploy).all_releases + deploy_to_latest_rev.run_action(:deploy) + @fourth_deploy_all_releases = deploy_to_latest_rev.provider_for_action(:deploy).all_releases + deploy_to_second_rev_again_again.run_action(:rollback) + @fifth_deploy_all_releases = deploy_to_second_rev_again_again.provider_for_action(:deploy).all_releases + end + + the_app_is_deployed_at_revision(:second_rev) + + it "restarts the application after rolling back" do + actual_operations_order.should == %w[deploy_to_second_rev deploy_to_previous_rev deploy_to_second_rev_again deploy_to_latest_rev deploy_to_second_rev_again_again] + end + + it "is marked updated" do + deploy_to_second_rev_again_again.should be_updated_by_last_action + end + + it "deploys the right code" do + IO.read(rel_path("current/app/app.rb")).should include("this is the second version of the app") + end + + it "all_releases after rollback should have one entry" do + @fifth_deploy_all_releases.length.should == 1 + end + + it "all_releases after rollback should be the same as after the first deploy" do + @fifth_deploy_all_releases.should == @first_deploy_all_releases + end + + end + # CHEF-3435 describe "to a deploy_to path that does not yet exist" do diff --git a/spec/functional/resource/file_spec.rb b/spec/functional/resource/file_spec.rb index f688bae434..d6f56db3e9 100644 --- a/spec/functional/resource/file_spec.rb +++ b/spec/functional/resource/file_spec.rb @@ -115,5 +115,4 @@ describe Chef::Resource::File do end end end - end diff --git a/spec/functional/resource/git_spec.rb b/spec/functional/resource/git_spec.rb index 7ade6eea21..f0bd94b0c0 100644 --- a/spec/functional/resource/git_spec.rb +++ b/spec/functional/resource/git_spec.rb @@ -92,7 +92,7 @@ E before(:all) do @ohai = Ohai::System.new - @ohai.require_plugin("os") + @ohai.all_plugins("os") end context "working with pathes with special characters" do diff --git a/spec/functional/resource/group_spec.rb b/spec/functional/resource/group_spec.rb index b8369d087b..3c2c1a86ba 100644 --- a/spec/functional/resource/group_spec.rb +++ b/spec/functional/resource/group_spec.rb @@ -38,7 +38,8 @@ describe Chef::Resource::Group, :requires_root_or_running_windows, :not_supporte def user_exist_in_group?(user) case ohai[:platform_family] when "windows" - Chef::Util::Windows::NetGroup.new(group_name).local_get_members.include?(user) + user_sid = sid_string_from_user(user) + user_sid.nil? ? false : Chef::Util::Windows::NetGroup.new(group_name).local_get_members.include?(user_sid) else Etc::getgrnam(group_name).mem.include?(user) end @@ -57,6 +58,25 @@ describe Chef::Resource::Group, :requires_root_or_running_windows, :not_supporte return resource.gid == Etc::getgrnam(resource.name).gid if unix? end + def sid_string_from_user(user) + begin + sid = Chef::ReservedNames::Win32::Security.lookup_account_name(user) + rescue Chef::Exceptions::Win32APIError + sid = nil + end + + sid.nil? ? nil : sid[1].to_s + end + + def windows_domain_user?(user_name) + domain, user = user_name.split('\\') + + if user && domain != '.' + computer_name = ENV['computername'] + domain.downcase != computer_name.downcase + end + end + def user(username) usr = Chef::Resource::User.new("#{username}", run_context) if ohai[:platform_family] == "windows" @@ -66,12 +86,12 @@ describe Chef::Resource::Group, :requires_root_or_running_windows, :not_supporte end def create_user(username) - user(username).run_action(:create) + user(username).run_action(:create) if ! windows_domain_user?(username) # TODO: User shouldn't exist end def remove_user(username) - user(username).run_action(:remove) + user(username).run_action(:remove) if ! windows_domain_user?(username) # TODO: User shouldn't exist end @@ -108,24 +128,24 @@ describe Chef::Resource::Group, :requires_root_or_running_windows, :not_supporte end describe "when append is not set" do - let(:included_members) { ["spec-Eric"] } + let(:included_members) { [spec_members[1]] } before do - create_user("spec-Eric") - create_user("spec-Gordon") - add_members_to_group(["spec-Gordon"]) + create_user(spec_members[1]) + create_user(spec_members[0]) + add_members_to_group([spec_members[0]]) end after do - remove_user("spec-Eric") - remove_user("spec-Gordon") + remove_user(spec_members[1]) + remove_user(spec_members[0]) end it "should remove the existing users and add the new users to the group" do group_resource.run_action(tested_action) - user_exist_in_group?("spec-Eric").should == true - user_exist_in_group?("spec-Gordon").should == false + user_exist_in_group?(spec_members[1]).should == true + user_exist_in_group?(spec_members[0]).should == false end end @@ -160,7 +180,7 @@ describe Chef::Resource::Group, :requires_root_or_running_windows, :not_supporte describe "when group contains some users" do before(:each) do - add_members_to_group([ "spec-Gordon", "spec-Anthony" ]) + add_members_to_group([ spec_members[0], spec_members[2] ]) end it "should add the included users and remove excluded users" do @@ -192,6 +212,42 @@ describe Chef::Resource::Group, :requires_root_or_running_windows, :not_supporte end end + shared_examples_for "an expected invalid domain error case" do + let(:invalid_domain_user_name) { "no space\\administrator" } + let(:nonexistent_domain_user_name) { "xxfakedom\\administrator" } + before(:each) do + group_resource.members [] + group_resource.excluded_members [] + group_resource.append(true) + group_resource.run_action(:create) + group_should_exist(group_name) + end + + describe "when updating membership" do + it "raises an error for a non well-formed domain name" do + group_resource.members [invalid_domain_user_name] + lambda { group_resource.run_action(tested_action) }.should raise_error Chef::Exceptions::Win32APIError + end + + it "raises an error for a nonexistent domain" do + group_resource.members [nonexistent_domain_user_name] + lambda { group_resource.run_action(tested_action) }.should raise_error Chef::Exceptions::Win32APIError + end + end + + describe "when removing members" do + it "raises an error for a non well-formed domain name" do + group_resource.excluded_members [invalid_domain_user_name] + lambda { group_resource.run_action(tested_action) }.should raise_error Chef::Exceptions::Win32APIError + end + + it "raises an error for a nonexistent domain" do + group_resource.excluded_members [nonexistent_domain_user_name] + lambda { group_resource.run_action(tested_action) }.should raise_error Chef::Exceptions::Win32APIError + end + end + end + let(:group_name) { "cheftest-#{SecureRandom.random_number(9999)}" } let(:included_members) { nil } let(:excluded_members) { nil } @@ -274,8 +330,9 @@ downthestreetalwayshadagoodsmileonhisfacetheoldmanwalkingdownthestreeQQQQQQ" } end describe "group modify action", :not_supported_on_solaris do - let(:included_members) { ["spec-Gordon", "spec-Eric"] } - let(:excluded_members) { ["spec-Anthony"] } + let(:spec_members){ ["spec-Gordon", "spec-Eric", "spec-Anthony"] } + let(:included_members) { [spec_members[0], spec_members[1]] } + let(:excluded_members) { [spec_members[2]] } let(:tested_action) { :modify } describe "when there is no group" do @@ -287,11 +344,23 @@ downthestreetalwayshadagoodsmileonhisfacetheoldmanwalkingdownthestreeQQQQQQ" } describe "when there is a group" do it_behaves_like "correct group management" end + + describe "when running on Windows", :windows_only do + describe "when members are Active Directory domain identities", :windows_domain_joined_only do + let(:computer_domain) { ohai[:kernel]['cs_info']['domain'].split('.')[0] } + let(:spec_members){ ["#{computer_domain}\\Domain Admins", "#{computer_domain}\\Domain Users", "#{computer_domain}\\Domain Computers"] } + + include_examples "correct group management" + end + + it_behaves_like "an expected invalid domain error case" + end end describe "group manage action", :not_supported_on_solaris do - let(:included_members) { ["spec-Gordon", "spec-Eric"] } - let(:excluded_members) { ["spec-Anthony"] } + let(:spec_members){ ["spec-Gordon", "spec-Eric", "spec-Anthony"] } + let(:included_members) { [spec_members[0], spec_members[1]] } + let(:excluded_members) { [spec_members[2]] } let(:tested_action) { :manage } describe "when there is no group" do @@ -304,6 +373,17 @@ downthestreetalwayshadagoodsmileonhisfacetheoldmanwalkingdownthestreeQQQQQQ" } describe "when there is a group" do it_behaves_like "correct group management" end + + describe "running on windows", :windows_only do + describe "when members are Windows domain identities", :windows_domain_joined_only do + let(:computer_domain) { ohai[:kernel]['cs_info']['domain'].split('.')[0] } + let(:spec_members){ ["#{computer_domain}\\Domain Admins", "#{computer_domain}\\Domain Users", "#{computer_domain}\\Domain Computers"] } + + include_examples "correct group management" + end + + it_behaves_like "an expected invalid domain error case" + end end describe "group resource with Usermod provider", :solaris_only do diff --git a/spec/functional/resource/link_spec.rb b/spec/functional/resource/link_spec.rb index 36bc858a74..9dc0afca06 100644 --- a/spec/functional/resource/link_spec.rb +++ b/spec/functional/resource/link_spec.rb @@ -132,7 +132,7 @@ describe Chef::Resource::Link do describe 'the :delete action' do before(:each) do @info = [] - Chef::Log.stub!(:info) { |msg| @info << msg } + Chef::Log.stub(:info) { |msg| @info << msg } resource.run_action(:delete) end @@ -153,7 +153,7 @@ describe Chef::Resource::Link do describe 'the :delete action' do before(:each) do @info = [] - Chef::Log.stub!(:info) { |msg| @info << msg } + Chef::Log.stub(:info) { |msg| @info << msg } resource.run_action(:delete) end @@ -174,7 +174,7 @@ describe Chef::Resource::Link do describe 'the :create action' do before(:each) do @info = [] - Chef::Log.stub!(:info) { |msg| @info << msg } + Chef::Log.stub(:info) { |msg| @info << msg } resource.run_action(:create) end @@ -195,7 +195,7 @@ describe Chef::Resource::Link do describe 'the :create action' do before(:each) do @info = [] - Chef::Log.stub!(:info) { |msg| @info << msg } + Chef::Log.stub(:info) { |msg| @info << msg } resource.run_action(:create) end @@ -216,7 +216,7 @@ describe Chef::Resource::Link do describe 'the :create action' do before(:each) do @info = [] - Chef::Log.stub!(:info) { |msg| @info << msg } + Chef::Log.stub(:info) { |msg| @info << msg } resource.run_action(:create) end it 'preserves the hard link' do @@ -241,7 +241,7 @@ describe Chef::Resource::Link do describe 'the :create action' do before(:each) do @info = [] - Chef::Log.stub!(:info) { |msg| @info << msg } + Chef::Log.stub(:info) { |msg| @info << msg } resource.run_action(:create) end it 'links to the target file' do diff --git a/spec/functional/resource/ohai_spec.rb b/spec/functional/resource/ohai_spec.rb new file mode 100644 index 0000000000..b1e4891293 --- /dev/null +++ b/spec/functional/resource/ohai_spec.rb @@ -0,0 +1,65 @@ +# +# Author:: Serdar Sutay (<serdar@opscode.com>) +# Copyright:: Copyright (c) 2014 Opscode, Inc. +# License:: Apache License, Version 2.0 +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +require 'spec_helper' + +describe Chef::Resource::Ohai do + let(:ohai) { + o = Ohai::System.new + o.all_plugins + o + } + + let(:node) { Chef::Node.new } + + let(:run_context) { + node.default[:platform] = ohai[:platform] + node.default[:platform_version] = ohai[:platform_version] + events = Chef::EventDispatch::Dispatcher.new + Chef::RunContext.new(node, {}, events) + } + + shared_examples_for "reloaded :uptime" do + it "should reload :uptime" do + initial_uptime = ohai[:uptime] + + # Sleep for a second so the uptime gets updated. + sleep 1 + + ohai_resource.run_action(:reload) + node[:uptime].should_not == initial_uptime + end + end + + describe "when reloading all plugins" do + let(:ohai_resource) { Chef::Resource::Ohai.new("reload all", run_context)} + + it_behaves_like "reloaded :uptime" + end + + describe "when reloading only uptime" do + let(:ohai_resource) { + r = Chef::Resource::Ohai.new("reload all", run_context) + r.plugin("uptime") + r + } + + + it_behaves_like "reloaded :uptime" + end +end diff --git a/spec/functional/resource/registry_spec.rb b/spec/functional/resource/registry_spec.rb index 8f3cfa9a8a..2d24eee6a3 100644 --- a/spec/functional/resource/registry_spec.rb +++ b/spec/functional/resource/registry_spec.rb @@ -111,21 +111,21 @@ describe Chef::Resource::RegistryKey, :windows_only do before do @node.name("windowsbox") - @rest_client = mock("Chef::REST (mock)") - @rest_client.stub!(:create_url).and_return("reports/nodes/windowsbox/runs/#{@run_id}"); - @rest_client.stub!(:raw_http_request).and_return({"result"=>"ok"}); - @rest_client.stub!(:post_rest).and_return({"uri"=>"https://example.com/reports/nodes/windowsbox/runs/#{@run_id}"}); + @rest_client = double("Chef::REST (mock)") + @rest_client.stub(:create_url).and_return("reports/nodes/windowsbox/runs/#{@run_id}"); + @rest_client.stub(:raw_http_request).and_return({"result"=>"ok"}); + @rest_client.stub(:post_rest).and_return({"uri"=>"https://example.com/reports/nodes/windowsbox/runs/#{@run_id}"}); @resource_reporter = Chef::ResourceReporter.new(@rest_client) @events.register(@resource_reporter) - @run_id = @resource_reporter.run_id @run_status = Chef::RunStatus.new(@node, @events) - @resource_reporter.run_started(@run_status) + @run_id = @resource_reporter.run_id + @new_resource.cookbook_name = "monkey" - @cookbook_version = mock("Cookbook::Version", :version => "1.2.3") - @new_resource.stub!(:cookbook_version).and_return(@cookbook_version) + @cookbook_version = double("Cookbook::Version", :version => "1.2.3") + @new_resource.stub(:cookbook_version).and_return(@cookbook_version) end after (:all) do @@ -265,7 +265,7 @@ describe Chef::Resource::RegistryKey, :windows_only do @new_resource.key(reg_child + '\Slitheen\Raxicoricofallapatorius') @new_resource.values([{:name=>"BriskWalk",:type=>:string,:data=>"is good for health"}]) @new_resource.recursive(false) - lambda{@new_resource.run_action(:create)}.should_not raise_error + @new_resource.run_action(:create) # should not raise_error @registry.key_exists?(reg_child + '\Slitheen').should == false @registry.key_exists?(reg_child + '\Slitheen\Raxicoricofallapatorius').should == false end @@ -376,7 +376,7 @@ describe Chef::Resource::RegistryKey, :windows_only do @new_resource.key(reg_child + '\Zygons\Zygor') @new_resource.values([{:name=>"BriskWalk",:type=>:string,:data=>"is good for health"}]) @new_resource.recursive(false) - lambda{@new_resource.run_action(:create_if_missing)}.should_not raise_error + @new_resource.run_action(:create_if_missing) # should not raise_error @registry.key_exists?(reg_child + '\Zygons').should == false @registry.key_exists?(reg_child + '\Zygons\Zygor').should == false end @@ -547,7 +547,6 @@ describe Chef::Resource::RegistryKey, :windows_only do @new_resource.values([{:name=>"BriskWalk",:type=>:string,:data=>"is good for health"}]) @new_resource.recursive(false) @new_resource.run_action(:delete_key) - @new_resource.should_not raise_error(ArgumentError) end it "does nothing if the action is delete_key" do @new_resource.key(reg_parent + '\OpscodeWhyRun') diff --git a/spec/functional/resource/user_spec.rb b/spec/functional/resource/user_spec.rb index 92248a95bb..434faec408 100644 --- a/spec/functional/resource/user_spec.rb +++ b/spec/functional/resource/user_spec.rb @@ -196,7 +196,7 @@ describe Chef::Resource::User, metadata do pw_entry.home.should == "/home/#{username}" end - if OHAI_SYSTEM["platform_family"] == "rhel" + if %w{rhel fedora}.include?(OHAI_SYSTEM["platform_family"]) # Inconsistent behavior. See: CHEF-2205 it "creates the home dir when not explicitly asked to on RHEL (XXX)" do File.should exist("/home/#{username}") @@ -340,7 +340,7 @@ describe Chef::Resource::User, metadata do let(:existing_manage_home) { false } let(:manage_home) { true } - if OHAI_SYSTEM["platform_family"] == "rhel" + if %w{rhel fedora}.include?(OHAI_SYSTEM["platform_family"]) # Inconsistent behavior. See: CHEF-2205 it "created the home dir b/c of CHEF-2205 so it still exists" do # This behavior seems contrary to expectation and non-convergent. diff --git a/spec/functional/run_lock_spec.rb b/spec/functional/run_lock_spec.rb index 51645c0ae3..3fe77ff7ff 100644 --- a/spec/functional/run_lock_spec.rb +++ b/spec/functional/run_lock_spec.rb @@ -163,7 +163,7 @@ describe Chef::RunLock do let!(:run_lock) { Chef::RunLock.new(lockfile) } it "creates the full path to the lockfile" do - lambda { run_lock.acquire }.should_not raise_error(Errno::ENOENT) + lambda { run_lock.acquire }.should_not raise_error File.should exist(lockfile) end diff --git a/spec/functional/win32/versions_spec.rb b/spec/functional/win32/versions_spec.rb index acb8bb126d..0b8a65114c 100644 --- a/spec/functional/win32/versions_spec.rb +++ b/spec/functional/win32/versions_spec.rb @@ -50,6 +50,45 @@ describe "Chef::ReservedNames::Win32::Version", :windows_only do @version = Chef::ReservedNames::Win32::Version.new end + def for_each_windows_version(&block) + @version.methods.each do |method_name| + if Chef::ReservedNames::Win32::Version::WIN_VERSIONS.keys.find { | key | method_name.to_s == Chef::ReservedNames::Win32::Version.send(:method_name_from_marketing_name,key) } + yield method_name + end + end + end + + context "Win32 version object" do + it "should have have one method for each marketing version" do + versions = 0 + for_each_windows_version { versions += 1 } + versions.should > 0 + versions.should == Chef::ReservedNames::Win32::Version::WIN_VERSIONS.length + end + + it "should only contain version methods with legal method names" do + method_name_pattern = /[a-z]+([a-z]|[0-9]|_)*\?{0,1}/ + + for_each_windows_version do |method_name| + method_match = method_name_pattern.match(method_name.to_s) + method_match.should_not be_nil + method_name.to_s.should == method_match[0] + end + end + + it "should have exactly one method that returns true" do + true_versions = 0 + for_each_windows_version do |method_name| + true_versions += 1 if @version.send(method_name) + end + true_versions.should == 1 + end + + it "should successfully execute all version methods" do + for_each_windows_version { |method_name| @version.send(method_name.to_sym) } + end + end + context "Windows Operating System version" do it "should match the version from WMI" do @current_os_version.should include(@version.marketing_name) diff --git a/spec/integration/client/client_spec.rb b/spec/integration/client/client_spec.rb index bca9ed4854..6357f1e2c0 100644 --- a/spec/integration/client/client_spec.rb +++ b/spec/integration/client/client_spec.rb @@ -215,5 +215,19 @@ EOM result = shell_out("#{chef_client} -c \"#{path_to('config/client.rb')}\" -o 'x::default' -z", :cwd => chef_dir) result.error! end + + it "should complete with success when setting the run list with -r" do + file 'config/client.rb', <<EOM +chef_server_url 'http://omg.com/blah' +cookbook_path "#{path_to('cookbooks')}" +EOM + + result = shell_out("#{chef_client} -c \"#{path_to('config/client.rb')}\" -r 'x::default' -z", :cwd => chef_dir) + result.stdout.should_not include("Overridden Run List") + result.stdout.should include("Run List is [recipe[x::default]]") + #puts result.stdout + result.error! + end + end end diff --git a/spec/integration/knife/download_spec.rb b/spec/integration/knife/download_spec.rb index ce8df38bd8..f266b47b1b 100644 --- a/spec/integration/knife/download_spec.rb +++ b/spec/integration/knife/download_spec.rb @@ -973,7 +973,7 @@ EOM cookbook 'x', '1.0.0', { 'metadata.rb' => 'version "1.0.0"' } when_the_repository 'is empty' do - it 'knife download /cookbooks/x signs all requests' do + it 'knife download /cookbooks/x signs all requests', :ruby_gte_19_only do # Check that BasicClient.request() always gets called with X-OPS-USERID original_new = Chef::HTTP::BasicClient.method(:new) diff --git a/spec/integration/solo/solo_spec.rb b/spec/integration/solo/solo_spec.rb index 94d279c726..cd4678f94d 100644 --- a/spec/integration/solo/solo_spec.rb +++ b/spec/integration/solo/solo_spec.rb @@ -79,7 +79,7 @@ EOM Process.waitpid(s1) Process.waitpid(s2) end - }.should_not raise_error(Timeout::Error) + }.should_not raise_error # Unfortunately file / directory helpers in integration tests # are implemented using before(:each) so we need to do all below diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index e60bdfd434..88e38bdc4b 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -33,6 +33,7 @@ end # Ruby 1.9 Compat $:.unshift File.expand_path("../..", __FILE__) + require 'rubygems' require 'rspec/mocks' @@ -85,10 +86,8 @@ Dir["spec/support/**/*.rb"]. map { |f| f.gsub(%r[spec/], '')}. each { |f| require f } - OHAI_SYSTEM = Ohai::System.new -OHAI_SYSTEM.require_plugin("os") -OHAI_SYSTEM.require_plugin("platform") +OHAI_SYSTEM.all_plugins("platform") TEST_PLATFORM = OHAI_SYSTEM["platform"].dup.freeze TEST_PLATFORM_VERSION = OHAI_SYSTEM["platform_version"].dup.freeze @@ -108,6 +107,7 @@ RSpec.configure do |config| config.filter_run_excluding :win2k3_only => true unless windows_win2k3? config.filter_run_excluding :windows64_only => true unless windows64? config.filter_run_excluding :windows32_only => true unless windows32? + config.filter_run_excluding :windows_domain_joined_only => true unless windows_domain_joined? config.filter_run_excluding :solaris_only => true unless solaris? config.filter_run_excluding :system_windows_service_gem_only => true unless system_windows_service_gem? config.filter_run_excluding :unix_only => true unless unix? diff --git a/spec/stress/win32/file_spec.rb b/spec/stress/win32/file_spec.rb index ef01aa632c..22de7ecd03 100644 --- a/spec/stress/win32/file_spec.rb +++ b/spec/stress/win32/file_spec.rb @@ -25,10 +25,16 @@ describe 'Chef::ReservedNames::Win32::File', :windows_only do end it "should not leak memory" do + pending "Fix required for CHEF-5004" test = lambda { Chef::ReservedNames::Win32::File.symlink?(@path) } test.should_not leak_memory(:warmup => 50, :iterations => 100) end + it "should not leak significant memory" do + test = lambda { Chef::ReservedNames::Win32::File.symlink?(@path) } + test.should_not leak_memory(:warmup => 50000, :iterations => 100) + end + it "should not leak handles" do test = lambda { Chef::ReservedNames::Win32::File.symlink?(@path) } test.should_not leak_handles(:warmup => 50, :iterations => 100) diff --git a/spec/support/lib/chef/resource/zen_master.rb b/spec/support/lib/chef/resource/zen_master.rb index 7a7076ca4b..d47d174e28 100644 --- a/spec/support/lib/chef/resource/zen_master.rb +++ b/spec/support/lib/chef/resource/zen_master.rb @@ -27,6 +27,7 @@ class Chef def initialize(name, run_context=nil) @resource_name = :zen_master super + allowed_actions << :win << :score end def peace(tf) @@ -34,7 +35,7 @@ class Chef end def something(arg=nil) - if arg == true or arg == false + if !arg.nil? @something = arg end @something diff --git a/spec/support/mock/platform.rb b/spec/support/mock/platform.rb index 78b704ea9b..df90d1eda2 100644 --- a/spec/support/mock/platform.rb +++ b/spec/support/mock/platform.rb @@ -6,7 +6,7 @@ # testing code that mixes in platform specific modules like +Chef::Mixin::Securable+ # or +Chef::FileAccessControl+ def platform_mock(platform = :unix, &block) - Chef::Platform.stub!(:windows?).and_return(platform == :windows ? true : false) + Chef::Platform.stub(:windows?).and_return(platform == :windows ? true : false) ENV['SYSTEMDRIVE'] = (platform == :windows ? 'C:' : nil) if block_given? mock_constants({"RUBY_PLATFORM" => (platform == :windows ? 'i386-mingw32' : 'x86_64-darwin11.2.0'), diff --git a/spec/support/platform_helpers.rb b/spec/support/platform_helpers.rb index 66f1fd4b25..884893865f 100644 --- a/spec/support/platform_helpers.rb +++ b/spec/support/platform_helpers.rb @@ -27,9 +27,15 @@ def windows? !!(RUBY_PLATFORM =~ /mswin|mingw|windows/) end +require 'ruby-wmi' if windows? + +def windows_domain_joined? + return false unless windows? + WMI::Win32_ComputerSystem.find(:first).PartOfDomain +end + def windows_win2k3? return false unless windows? - require 'ruby-wmi' host = WMI::Win32_OperatingSystem.find(:first) (host.version && host.version.start_with?("5.2")) diff --git a/spec/support/shared/functional/file_resource.rb b/spec/support/shared/functional/file_resource.rb index 44048598c7..ccb224ab71 100644 --- a/spec/support/shared/functional/file_resource.rb +++ b/spec/support/shared/functional/file_resource.rb @@ -54,25 +54,62 @@ shared_examples_for "a file with the wrong content" do sha256_checksum(path).should == @expected_checksum end - include_context "diff disabled" + describe "when diff is disabled" do - context "when running action :create" do - context "with backups enabled" do - before do - resource.run_action(:create) + include_context "diff disabled" + + context "when running action :create" do + context "with backups enabled" do + before do + resource.run_action(:create) + end + + it "overwrites the file with the updated content when the :create action is run" do + File.stat(path).mtime.should > @expected_mtime + sha256_checksum(path).should_not == @expected_checksum + end + + it "backs up the existing file" do + Dir.glob(backup_glob).size.should equal(1) + end + + it "is marked as updated by last action" do + resource.should be_updated_by_last_action + end + + it "should restore the security contexts on selinux", :selinux_only do + selinux_security_context_restored?(path).should be_true + end + end + + context "with backups disabled" do + before do + resource.backup(0) + resource.run_action(:create) + end + + it "should not attempt to backup the existing file if :backup == 0" do + Dir.glob(backup_glob).size.should equal(0) + end + + it "should restore the security contexts on selinux", :selinux_only do + selinux_security_context_restored?(path).should be_true + end end + end - it "overwrites the file with the updated content when the :create action is run" do - File.stat(path).mtime.should > @expected_mtime - sha256_checksum(path).should_not == @expected_checksum + describe "when running action :create_if_missing" do + before do + resource.run_action(:create_if_missing) end - it "backs up the existing file" do - Dir.glob(backup_glob).size.should equal(1) + it "doesn't overwrite the file when the :create_if_missing action is run" do + File.stat(path).mtime.should == @expected_mtime + sha256_checksum(path).should == @expected_checksum end - it "is marked as updated by last action" do - resource.should be_updated_by_last_action + it "is not marked as updated" do + resource.should_not be_updated_by_last_action end it "should restore the security contexts on selinux", :selinux_only do @@ -80,52 +117,53 @@ shared_examples_for "a file with the wrong content" do end end - context "with backups disabled" do + describe "when running action :delete" do before do - resource.backup(0) - resource.run_action(:create) + resource.run_action(:delete) end - it "should not attempt to backup the existing file if :backup == 0" do - Dir.glob(backup_glob).size.should equal(0) + it "deletes the file" do + File.should_not exist(path) end - it "should restore the security contexts on selinux", :selinux_only do - selinux_security_context_restored?(path).should be_true + it "is marked as updated by last action" do + resource.should be_updated_by_last_action end end + end - describe "when running action :create_if_missing" do - before do - resource.run_action(:create_if_missing) - end + context "when diff is enabled" do + describe 'sensitive attribute' do + context "should be insensitive by default" do + it { expect(resource.sensitive).to(be_false) } + end - it "doesn't overwrite the file when the :create_if_missing action is run" do - File.stat(path).mtime.should == @expected_mtime - sha256_checksum(path).should == @expected_checksum - end + context "when set" do + before { resource.sensitive(true) } - it "is not marked as updated" do - resource.should_not be_updated_by_last_action - end + it "should be set on the resource" do + expect(resource.sensitive).to(be_true) + end - it "should restore the security contexts on selinux", :selinux_only do - selinux_security_context_restored?(path).should be_true - end - end + context "when running :create action" do + let(:provider) { resource.provider_for_action(:create) } + let(:reporter_messages) { provider.instance_variable_get("@converge_actions").actions[0][0] } - describe "when running action :delete" do - before do - resource.run_action(:delete) - end + before do + provider.run_action + end - it "deletes the file" do - File.should_not exist(path) - end + it "should suppress the diff" do + expect(resource.diff).to(include('suppressed sensitive resource')) + expect(reporter_messages[1]).to eq("suppressed sensitive resource") + end - it "is marked as updated by last action" do - resource.should be_updated_by_last_action + it "should still include the updated checksums" do + expect(reporter_messages[0]).to include("update content in file") + end + end + end end end end diff --git a/spec/support/shared/functional/securable_resource.rb b/spec/support/shared/functional/securable_resource.rb index 3952b783dc..48daf78ae3 100644 --- a/spec/support/shared/functional/securable_resource.rb +++ b/spec/support/shared/functional/securable_resource.rb @@ -482,7 +482,7 @@ shared_examples_for "a securable resource without existing target" do it 'warns when mode tries to set owner bits but owner is not specified' do @warn = [] - Chef::Log.stub!(:warn) { |msg| @warn << msg } + Chef::Log.stub(:warn) { |msg| @warn << msg } resource.mode 0400 resource.run_action(:create) @@ -492,7 +492,7 @@ shared_examples_for "a securable resource without existing target" do it 'warns when mode tries to set group bits but group is not specified' do @warn = [] - Chef::Log.stub!(:warn) { |msg| @warn << msg } + Chef::Log.stub(:warn) { |msg| @warn << msg } resource.mode 0040 resource.run_action(:create) diff --git a/spec/support/shared/functional/windows_script.rb b/spec/support/shared/functional/windows_script.rb index afeb4c029c..db2882e1a1 100644 --- a/spec/support/shared/functional/windows_script.rb +++ b/spec/support/shared/functional/windows_script.rb @@ -23,8 +23,7 @@ shared_context Chef::Resource::WindowsScript do before(:all) do ohai_reader = Ohai::System.new - ohai_reader.require_plugin("os") - ohai_reader.require_plugin("windows::platform") + ohai_reader.all_plugins("platform") new_node = Chef::Node.new new_node.consume_external_attrs(ohai_reader.data,{}) diff --git a/spec/support/shared/unit/api_error_inspector.rb b/spec/support/shared/unit/api_error_inspector.rb index 8231ceb195..b59fbce2c7 100644 --- a/spec/support/shared/unit/api_error_inspector.rb +++ b/spec/support/shared/unit/api_error_inspector.rb @@ -72,7 +72,7 @@ shared_examples_for "an api error inspector" do before do @response_body = "synchronize the clock on your host" @response = Net::HTTPUnauthorized.new("1.1", "401", "(response) unauthorized") - @response.stub!(:body).and_return(@response_body) + @response.stub(:body).and_return(@response_body) @exception = Net::HTTPServerException.new("(exception) unauthorized", @response) @inspector = described_class.new(@node_name, @exception, @config) @inspector.add_explanation(@description) @@ -88,7 +88,7 @@ shared_examples_for "an api error inspector" do before do @response_body = "check your key and node name" @response = Net::HTTPUnauthorized.new("1.1", "401", "(response) unauthorized") - @response.stub!(:body).and_return(@response_body) + @response.stub(:body).and_return(@response_body) @exception = Net::HTTPServerException.new("(exception) unauthorized", @response) @inspector = described_class.new(@node_name, @exception, @config) @inspector.add_explanation(@description) @@ -104,7 +104,7 @@ shared_examples_for "an api error inspector" do before do @response_body = "forbidden" @response = Net::HTTPForbidden.new("1.1", "403", "(response) forbidden") - @response.stub!(:body).and_return(@response_body) + @response.stub(:body).and_return(@response_body) @exception = Net::HTTPServerException.new("(exception) forbidden", @response) @inspector = described_class.new(@node_name, @exception, @config) @inspector.add_explanation(@description) @@ -120,7 +120,7 @@ shared_examples_for "an api error inspector" do before do @response_body = "didn't like your data" @response = Net::HTTPBadRequest.new("1.1", "400", "(response) bad request") - @response.stub!(:body).and_return(@response_body) + @response.stub(:body).and_return(@response_body) @exception = Net::HTTPServerException.new("(exception) bad request", @response) @inspector = described_class.new(@node_name, @exception, @config) @inspector.add_explanation(@description) @@ -136,7 +136,7 @@ shared_examples_for "an api error inspector" do before do @response_body = "probably caused by a redirect to a get" @response = Net::HTTPNotFound.new("1.1", "404", "(response) not found") - @response.stub!(:body).and_return(@response_body) + @response.stub(:body).and_return(@response_body) @exception = Net::HTTPServerException.new("(exception) not found", @response) @inspector = described_class.new(@node_name, @exception, @config) @inspector.add_explanation(@description) @@ -151,7 +151,7 @@ shared_examples_for "an api error inspector" do before do @response_body = "sad trombone" @response = Net::HTTPInternalServerError.new("1.1", "500", "(response) internal server error") - @response.stub!(:body).and_return(@response_body) + @response.stub(:body).and_return(@response_body) @exception = Net::HTTPFatalError.new("(exception) internal server error", @response) @inspector = described_class.new(@node_name, @exception, @config) @inspector.add_explanation(@description) @@ -166,7 +166,7 @@ shared_examples_for "an api error inspector" do before do @response_body = "sad trombone orchestra" @response = Net::HTTPBadGateway.new("1.1", "502", "(response) bad gateway") - @response.stub!(:body).and_return(@response_body) + @response.stub(:body).and_return(@response_body) @exception = Net::HTTPFatalError.new("(exception) bad gateway", @response) @inspector = described_class.new(@node_name, @exception, @config) @inspector.add_explanation(@description) diff --git a/spec/support/shared/unit/provider/file.rb b/spec/support/shared/unit/provider/file.rb index 72dda3c07a..02f68e0acc 100644 --- a/spec/support/shared/unit/provider/file.rb +++ b/spec/support/shared/unit/provider/file.rb @@ -106,8 +106,46 @@ def setup_missing_enclosing_directory File.stub(:directory?).with(enclosing_directory).and_return(false) end +# A File subclass that we use as a replacement for Tempfile. Some versions of +# Tempfile call `File.exist?()` internally which will cause test failures if +# `File.exist?()` has been stubbed. +class BasicTempfile < ::File + + def self.make_tmp_path(basename) + slug = "#{basename}-#{rand(1 << 128)}" + File.join(Dir.tmpdir, slug) + end + + def self.new(basename) + super(make_tmp_path(basename), File::RDWR|File::CREAT|File::EXCL, 0600) + end + + def unlink + self.class.unlink(path) + end + +end + shared_examples_for Chef::Provider::File do + let(:tempfile_path) do + end + + let!(:tempfile) do + BasicTempfile.new("rspec-shared-file-provider") + end + + before(:each) do + content.stub(:tempfile).and_return(tempfile) + File.stub(:exist?).with(tempfile.path).and_call_original + File.stub(:exists?).with(tempfile.path).and_call_original + end + + after do + tempfile.close if (tempfile && !tempfile.closed?) + File.unlink(tempfile.path) rescue nil + end + it "should return a #{described_class}" do provider.should be_a_kind_of(described_class) end @@ -220,11 +258,11 @@ shared_examples_for Chef::Provider::File do Chef::Platform.stub(:windows?).and_return(false) # mock up the filesystem to behave like unix setup_normal_file - stat_struct = mock("::File.stat", :mode => 0600, :uid => 0, :gid => 0, :mtime => 10000) + stat_struct = double("::File.stat", :mode => 0600, :uid => 0, :gid => 0, :mtime => 10000) resource_real_path = File.realpath(resource.path) File.should_receive(:stat).with(resource_real_path).at_least(:once).and_return(stat_struct) - Etc.stub(:getgrgid).with(0).and_return(mock("Group Ent", :name => "wheel")) - Etc.stub(:getpwuid).with(0).and_return(mock("User Ent", :name => "root")) + Etc.stub(:getgrgid).with(0).and_return(double("Group Ent", :name => "wheel")) + Etc.stub(:getpwuid).with(0).and_return(double("User Ent", :name => "root")) end context "when the new_resource does not specify any state" do @@ -345,11 +383,11 @@ shared_examples_for Chef::Provider::File do Chef::Platform.stub(:windows?).and_return(false) # mock up the filesystem to behave like unix setup_normal_file - stat_struct = mock("::File.stat", :mode => 0600, :uid => 0, :gid => 0, :mtime => 10000) + stat_struct = double("::File.stat", :mode => 0600, :uid => 0, :gid => 0, :mtime => 10000) resource_real_path = File.realpath(resource.path) File.stub(:stat).with(resource_real_path).and_return(stat_struct) - Etc.stub(:getgrgid).with(0).and_return(mock("Group Ent", :name => "wheel")) - Etc.stub(:getpwuid).with(0).and_return(mock("User Ent", :name => "root")) + Etc.stub(:getgrgid).with(0).and_return(double("Group Ent", :name => "wheel")) + Etc.stub(:getpwuid).with(0).and_return(double("User Ent", :name => "root")) provider.send(:load_resource_attributes_from_file, resource) end @@ -386,7 +424,7 @@ shared_examples_for Chef::Provider::File do it "does not raise an exception in why-run mode" do Chef::Config[:why_run] = true - lambda {provider.run_action(action)}.should_not raise_error(Chef::Exceptions::EnclosingDirectoryDoesNotExist) + lambda {provider.run_action(action)}.should_not raise_error Chef::Config[:why_run] = false end end @@ -445,6 +483,7 @@ shared_examples_for Chef::Provider::File do tempfile = double('Tempfile', :path => "/tmp/foo-bar-baz") content.stub(:tempfile).and_return(tempfile) File.should_receive(:exists?).with("/tmp/foo-bar-baz").and_return(true) + tempfile.should_receive(:close).once tempfile.should_receive(:unlink).once end @@ -635,7 +674,7 @@ shared_examples_for Chef::Provider::File do it "should not try to backup or delete the file, and should not be updated by last action" do provider.should_not_receive(:do_backup) File.should_not_receive(:delete) - lambda { provider.run_action(:delete) }.should_not raise_error() + lambda { provider.run_action(:delete) }.should_not raise_error resource.should_not be_updated_by_last_action end end diff --git a/spec/support/shared/unit/provider/useradd_based_user_provider.rb b/spec/support/shared/unit/provider/useradd_based_user_provider.rb index e9fe06dfd7..a95d19d33c 100644 --- a/spec/support/shared/unit/provider/useradd_based_user_provider.rb +++ b/spec/support/shared/unit/provider/useradd_based_user_provider.rb @@ -57,21 +57,21 @@ shared_examples_for "a useradd-based user provider" do |supported_useradd_option end it "should set the option for #{attribute} if the new resources #{attribute} is not nil" do - @new_resource.stub!(attribute).and_return("hola") + @new_resource.stub(attribute).and_return("hola") provider.universal_options.should eql([option, 'hola']) end it "should set the option for #{attribute} if the new resources #{attribute} is not nil, without homedir management" do - @new_resource.stub!(:supports).and_return({:manage_home => false, + @new_resource.stub(:supports).and_return({:manage_home => false, :non_unique => false}) - @new_resource.stub!(attribute).and_return("hola") + @new_resource.stub(attribute).and_return("hola") provider.universal_options.should eql([option, 'hola']) end it "should set the option for #{attribute} if the new resources #{attribute} is not nil, without homedir management (using real attributes)" do - @new_resource.stub!(:manage_home).and_return(false) - @new_resource.stub!(:non_unique).and_return(false) - @new_resource.stub!(attribute).and_return("hola") + @new_resource.stub(:manage_home).and_return(false) + @new_resource.stub(:non_unique).and_return(false) + @new_resource.stub(attribute).and_return("hola") provider.universal_options.should eql([option, 'hola']) end end @@ -79,7 +79,7 @@ shared_examples_for "a useradd-based user provider" do |supported_useradd_option it "should combine all the possible options" do combined_opts = [] supported_useradd_options.sort{ |a,b| a[0] <=> b[0] }.each do |attribute, option| - @new_resource.stub!(attribute).and_return("hola") + @new_resource.stub(attribute).and_return("hola") combined_opts << option << 'hola' end provider.universal_options.should eql(combined_opts) @@ -99,8 +99,8 @@ shared_examples_for "a useradd-based user provider" do |supported_useradd_option describe "when the resource has a different home directory and supports home directory management" do before do - @new_resource.stub!(:home).and_return("/wowaweea") - @new_resource.stub!(:supports).and_return({:manage_home => true, + @new_resource.stub(:home).and_return("/wowaweea") + @new_resource.stub(:supports).and_return({:manage_home => true, :non_unique => false}) end @@ -112,9 +112,9 @@ shared_examples_for "a useradd-based user provider" do |supported_useradd_option describe "when the resource has a different home directory and supports home directory management (using real attributes)" do before do - @new_resource.stub!(:home).and_return("/wowaweea") - @new_resource.stub!(:manage_home).and_return(true) - @new_resource.stub!(:non_unique).and_return(false) + @new_resource.stub(:home).and_return("/wowaweea") + @new_resource.stub(:manage_home).and_return(true) + @new_resource.stub(:non_unique).and_return(false) end it "should set -m -d /homedir" do @@ -125,7 +125,7 @@ shared_examples_for "a useradd-based user provider" do |supported_useradd_option describe "when the resource supports non_unique ids" do before do - @new_resource.stub!(:supports).and_return({:manage_home => false, + @new_resource.stub(:supports).and_return({:manage_home => false, :non_unique => true}) end @@ -136,8 +136,8 @@ shared_examples_for "a useradd-based user provider" do |supported_useradd_option describe "when the resource supports non_unique ids (using real attributes)" do before do - @new_resource.stub!(:manage_home).and_return(false) - @new_resource.stub!(:non_unique).and_return(true) + @new_resource.stub(:manage_home).and_return(false) + @new_resource.stub(:non_unique).and_return(true) end it "should set -m -o" do @@ -260,12 +260,12 @@ shared_examples_for "a useradd-based user provider" do |supported_useradd_option describe "when checking the lock" do # lazy initialize so we can modify stdout and stderr strings let(:passwd_s_status) do - mock("Mixlib::ShellOut command", :exitstatus => 0, :stdout => @stdout, :stderr => @stderr) + double("Mixlib::ShellOut command", :exitstatus => 0, :stdout => @stdout, :stderr => @stderr) end before(:each) do # @node = Chef::Node.new - # @new_resource = mock("Chef::Resource::User", + # @new_resource = double("Chef::Resource::User", # :nil_object => true, # :username => "adam" # ) @@ -313,9 +313,9 @@ shared_examples_for "a useradd-based user provider" do |supported_useradd_option provider.should_receive(:shell_out!). with("passwd", "-S", @new_resource.username, {:returns=>[0, 1]}). and_return(passwd_s_status) - rpm_status = mock("Mixlib::ShellOut command", :exitstatus => 0, :stdout => "passwd-0.73-1\n", :stderr => "") + rpm_status = double("Mixlib::ShellOut command", :exitstatus => 0, :stdout => "passwd-0.73-1\n", :stderr => "") provider.should_receive(:shell_out!).with("rpm -q passwd").and_return(rpm_status) - lambda { provider.check_lock }.should_not raise_error(Chef::Exceptions::User) + lambda { provider.check_lock }.should_not raise_error end it "should raise a Chef::Exceptions::User if passwd -S exits with 1 on #{os} and the passwd package is not version 0.73-1" do @@ -324,7 +324,7 @@ shared_examples_for "a useradd-based user provider" do |supported_useradd_option provider.should_receive(:shell_out!). with("passwd", "-S", @new_resource.username, {:returns=>[0, 1]}). and_return(passwd_s_status) - rpm_status = mock("Mixlib::ShellOut command", :exitstatus => 0, :stdout => "passwd-0.73-2\n", :stderr => "") + rpm_status = double("Mixlib::ShellOut command", :exitstatus => 0, :stdout => "passwd-0.73-2\n", :stderr => "") provider.should_receive(:shell_out!).with("rpm -q passwd").and_return(rpm_status) lambda { provider.check_lock }.should raise_error(Chef::Exceptions::User) end @@ -338,7 +338,7 @@ shared_examples_for "a useradd-based user provider" do |supported_useradd_option context "when in why run mode" do before do - passwd_status = mock("Mixlib::ShellOut command", :exitstatus => 0, :stdout => "", :stderr => "passwd: user 'chef-test' does not exist\n") + passwd_status = double("Mixlib::ShellOut command", :exitstatus => 0, :stdout => "", :stderr => "passwd: user 'chef-test' does not exist\n") provider.should_receive(:shell_out!). with("passwd", "-S", @new_resource.username, {:returns=>[0, 1]}). and_return(passwd_status) @@ -398,9 +398,9 @@ shared_examples_for "a useradd-based user provider" do |supported_useradd_option ].each do |home_check| it home_check["action"] do provider.current_resource.home home_check["current_resource_home"].first - @current_home_mock = mock("Pathname") + @current_home_mock = double("Pathname") provider.new_resource.home home_check["new_resource_home"].first - @new_home_mock = mock("Pathname") + @new_home_mock = double("Pathname") Pathname.should_receive(:new).with(@current_resource.home).and_return(@current_home_mock) @current_home_mock.should_receive(:cleanpath).and_return(home_check["current_resource_home"].last) diff --git a/spec/unit/api_client/registration_spec.rb b/spec/unit/api_client/registration_spec.rb index 0d21730664..845c217f72 100644 --- a/spec/unit/api_client/registration_spec.rb +++ b/spec/unit/api_client/registration_spec.rb @@ -50,10 +50,10 @@ describe Chef::ApiClient::Registration do end describe "when creating/updating the client on the server" do - let(:http_mock) { mock("Chef::REST mock") } + let(:http_mock) { double("Chef::REST mock") } before do - registration.stub!(:http_api).and_return(http_mock) + registration.stub(:http_api).and_return(http_mock) end it "creates a new ApiClient on the server using the validator identity" do @@ -103,7 +103,7 @@ describe Chef::ApiClient::Registration do describe "when writing the private key to disk" do before do - registration.stub!(:private_key).and_return('--begin rsa key etc--') + registration.stub(:private_key).and_return('--begin rsa key etc--') end # Permission read via File.stat is busted on windows, though creating the @@ -125,10 +125,10 @@ describe Chef::ApiClient::Registration do describe "when registering a client" do - let(:http_mock) { mock("Chef::REST mock") } + let(:http_mock) { double("Chef::REST mock") } before do - registration.stub!(:http_api).and_return(http_mock) + registration.stub(:http_api).and_return(http_mock) end it "creates the client on the server and writes the key" do diff --git a/spec/unit/api_client_spec.rb b/spec/unit/api_client_spec.rb index 0df863cb78..8657fa59a8 100644 --- a/spec/unit/api_client_spec.rb +++ b/spec/unit/api_client_spec.rb @@ -164,6 +164,52 @@ describe Chef::ApiClient do end + describe "when loading from JSON" do + before do + end + + before(:each) do + client = { + "name" => "black", + "clientname" => "black", + "public_key" => "crowes", + "private_key" => "monkeypants", + "admin" => true, + "validator" => true, + "json_class" => "Chef::ApiClient" + } + @http_client = double("Chef::REST mock") + Chef::REST.stub(:new).and_return(@http_client) + @http_client.should_receive(:get).with("clients/black").and_return(client) + @client = Chef::ApiClient.load(client['name']) + end + + it "should deserialize to a Chef::ApiClient object" do + @client.should be_a_kind_of(Chef::ApiClient) + end + + it "preserves the name" do + @client.name.should == "black" + end + + it "preserves the public key" do + @client.public_key.should == "crowes" + end + + it "preserves the admin status" do + @client.admin.should be_a_kind_of(Chef::TrueClass) + end + + it "preserves the 'validator' status" do + @client.validator.should be_a_kind_of(Chef::TrueClass) + end + + it "includes the private key if present" do + @client.private_key.should == "monkeypants" + end + + end + describe "with correctly configured API credentials" do before do Chef::Config[:node_name] = "silent-bob" @@ -189,8 +235,8 @@ describe Chef::ApiClient do describe "when requesting a new key" do before do - @http_client = mock("Chef::REST mock") - Chef::REST.stub!(:new).and_return(@http_client) + @http_client = double("Chef::REST mock") + Chef::REST.stub(:new).and_return(@http_client) end context "and the client does not exist on the server" do diff --git a/spec/unit/application/apply.rb b/spec/unit/application/apply.rb index 0dc24544b0..32c98c6ed6 100644 --- a/spec/unit/application/apply.rb +++ b/spec/unit/application/apply.rb @@ -21,7 +21,7 @@ describe Chef::Application::Apply do before do @app = Chef::Application::Recipe.new - @app.stub!(:configure_logging).and_return(true) + @app.stub(:configure_logging).and_return(true) @recipe_text = "package 'nyancat'" Chef::Config[:solo] = true end @@ -36,10 +36,10 @@ describe Chef::Application::Apply do before do @recipe_file_name = "foo.rb" @recipe_path = File.expand_path("foo.rb") - @recipe_file = mock("Tempfile (mock)", :read => @recipe_text) - @app.stub!(:open).with(@recipe_path).and_return(@recipe_file) - File.stub!(:exist?).with("foo.rb").and_return(true) - Chef::Application.stub!(:fatal!).and_return(true) + @recipe_file = double("Tempfile (mock)", :read => @recipe_text) + @app.stub(:open).with(@recipe_path).and_return(@recipe_file) + File.stub(:exist?).with("foo.rb").and_return(true) + Chef::Application.stub(:fatal!).and_return(true) end it "should read text properly" do @app.read_recipe_file(@recipe_file_name)[0].should == @recipe_text @@ -49,7 +49,7 @@ describe Chef::Application::Apply do end describe "when recipe doesn't exist" do before do - File.stub!(:exist?).with(@recipe_file_name).and_return(false) + File.stub(:exist?).with(@recipe_file_name).and_return(false) end it "should raise a fatal" do Chef::Application.should_receive(:fatal!) diff --git a/spec/unit/application/client_spec.rb b/spec/unit/application/client_spec.rb index 219a894cc6..f84932073f 100644 --- a/spec/unit/application/client_spec.rb +++ b/spec/unit/application/client_spec.rb @@ -23,9 +23,9 @@ describe Chef::Application::Client, "reconfigure" do ARGV.clear @app = Chef::Application::Client.new - @app.stub!(:configure_opt_parser).and_return(true) - @app.stub!(:configure_chef).and_return(true) - @app.stub!(:configure_logging).and_return(true) + @app.stub(:configure_opt_parser).and_return(true) + @app.stub(:configure_chef).and_return(true) + @app.stub(:configure_logging).and_return(true) @app.cli_arguments = [] Chef::Config[:interval] = 10 @@ -91,9 +91,9 @@ describe Chef::Application::Client, "setup_application" do before do @app = Chef::Application::Client.new # this is all stuff the reconfigure method needs - @app.stub!(:configure_opt_parser).and_return(true) - @app.stub!(:configure_chef).and_return(true) - @app.stub!(:configure_logging).and_return(true) + @app.stub(:configure_opt_parser).and_return(true) + @app.stub(:configure_chef).and_return(true) + @app.stub(:configure_logging).and_return(true) end it "should change privileges" do diff --git a/spec/unit/application/knife_spec.rb b/spec/unit/application/knife_spec.rb index 16f94c7786..1baaad110d 100644 --- a/spec/unit/application/knife_spec.rb +++ b/spec/unit/application/knife_spec.rb @@ -35,8 +35,8 @@ describe Chef::Application::Knife do before(:each) do @knife = Chef::Application::Knife.new - @knife.stub!(:puts) - Chef::Knife.stub!(:list_commands) + @knife.stub(:puts) + Chef::Knife.stub(:list_commands) end it "should exit 1 and print the options if no arguments are given at all" do @@ -54,7 +54,7 @@ describe Chef::Application::Knife do it "should run a sub command with the applications command line option prototype" do with_argv(*%w{noop knife command with some args}) do - knife = mock(Chef::Knife) + knife = double(Chef::Knife) Chef::Knife.should_receive(:run).with(ARGV, @knife.options).and_return(knife) @knife.should_receive(:exit).with(0) @knife.run @@ -76,7 +76,7 @@ describe Chef::Application::Knife do describe "when given a path to the client key" do it "expands a relative path relative to the CWD" do relative_path = '.chef/client.pem' - Dir.stub!(:pwd).and_return(CHEF_SPEC_DATA) + Dir.stub(:pwd).and_return(CHEF_SPEC_DATA) with_argv(*%W{noop knife command -k #{relative_path}}) do @knife.should_receive(:exit).with(0) @knife.run @@ -158,7 +158,7 @@ describe Chef::Application::Knife do it "should run a sub command with the applications command line option prototype" do with_argv(*%w{noop knife command with some args}) do - knife = mock(Chef::Knife) + knife = double(Chef::Knife) Chef::Knife.should_receive(:run).with(ARGV, @knife.options).and_return(knife) @knife.should_receive(:exit).with(0) @knife.run diff --git a/spec/unit/application/solo_spec.rb b/spec/unit/application/solo_spec.rb index 41e0cf3b2b..d2f8b93169 100644 --- a/spec/unit/application/solo_spec.rb +++ b/spec/unit/application/solo_spec.rb @@ -20,9 +20,9 @@ require 'spec_helper' describe Chef::Application::Solo do before do @app = Chef::Application::Solo.new - @app.stub!(:configure_opt_parser).and_return(true) - @app.stub!(:configure_chef).and_return(true) - @app.stub!(:configure_logging).and_return(true) + @app.stub(:configure_opt_parser).and_return(true) + @app.stub(:configure_chef).and_return(true) + @app.stub(:configure_logging).and_return(true) Chef::Config[:recipe_url] = false Chef::Config[:json_attribs] = false Chef::Config[:solo] = true @@ -70,14 +70,14 @@ describe Chef::Application::Solo do before do Chef::Config[:cookbook_path] = "#{Dir.tmpdir}/chef-solo/cookbooks" Chef::Config[:recipe_url] = "http://junglist.gen.nz/recipes.tgz" - FileUtils.stub!(:mkdir_p).and_return(true) + FileUtils.stub(:mkdir_p).and_return(true) @tarfile = StringIO.new("remote_tarball_content") - @app.stub!(:open).with("http://junglist.gen.nz/recipes.tgz").and_yield(@tarfile) + @app.stub(:open).with("http://junglist.gen.nz/recipes.tgz").and_yield(@tarfile) @target_file = StringIO.new - File.stub!(:open).with("#{Dir.tmpdir}/chef-solo/recipes.tgz", "wb").and_yield(@target_file) + File.stub(:open).with("#{Dir.tmpdir}/chef-solo/recipes.tgz", "wb").and_yield(@target_file) - Chef::Mixin::Command.stub!(:run_command).and_return(true) + Chef::Mixin::Command.stub(:run_command).and_return(true) end it "should create the recipes path based on the parent of the cookbook path" do @@ -107,14 +107,14 @@ describe Chef::Application::Solo do before do Chef::Config[:solo] = true - Chef::Daemon.stub!(:change_privilege) - @chef_client = mock("Chef::Client") - Chef::Client.stub!(:new).and_return(@chef_client) + Chef::Daemon.stub(:change_privilege) + @chef_client = double("Chef::Client") + Chef::Client.stub(:new).and_return(@chef_client) @app = Chef::Application::Solo.new # this is all stuff the reconfigure method needs - @app.stub!(:configure_opt_parser).and_return(true) - @app.stub!(:configure_chef).and_return(true) - @app.stub!(:configure_logging).and_return(true) + @app.stub(:configure_opt_parser).and_return(true) + @app.stub(:configure_chef).and_return(true) + @app.stub(:configure_logging).and_return(true) end it "should change privileges" do diff --git a/spec/unit/application_spec.rb b/spec/unit/application_spec.rb index 1606c82531..6110a8a3c5 100644 --- a/spec/unit/application_spec.rb +++ b/spec/unit/application_spec.rb @@ -24,8 +24,8 @@ describe Chef::Application do ARGV.clear Chef::Log.logger = Logger.new(StringIO.new) @app = Chef::Application.new - Dir.stub!(:chdir).and_return(0) - @app.stub!(:reconfigure) + Dir.stub(:chdir).and_return(0) + @app.stub(:reconfigure) Chef::Log.init(STDERR) end @@ -36,8 +36,8 @@ describe Chef::Application do describe "reconfigure" do before do @app = Chef::Application.new - @app.stub!(:configure_chef).and_return(true) - @app.stub!(:configure_logging).and_return(true) + @app.stub(:configure_chef).and_return(true) + @app.stub(:configure_logging).and_return(true) end it "should configure chef" do @@ -59,10 +59,10 @@ describe Chef::Application do describe "run" do before do - @app.stub!(:setup_application).and_return(true) - @app.stub!(:run_application).and_return(true) - @app.stub!(:configure_chef).and_return(true) - @app.stub!(:configure_logging).and_return(true) + @app.stub(:setup_application).and_return(true) + @app.stub(:run_application).and_return(true) + @app.stub(:configure_chef).and_return(true) + @app.stub(:configure_logging).and_return(true) end it "should reconfigure the application before running" do @@ -85,8 +85,8 @@ describe Chef::Application do describe "configure_chef" do before do @app = Chef::Application.new - #Chef::Config.stub!(:merge!).and_return(true) - @app.stub!(:parse_options).and_return(true) + #Chef::Config.stub(:merge!).and_return(true) + @app.stub(:parse_options).and_return(true) end it "should parse the commandline options" do @@ -152,21 +152,28 @@ describe Chef::Application do describe "when configuring the logger" do before do @app = Chef::Application.new - Chef::Log.stub!(:init) + Chef::Log.stub(:init) end it "should initialise the chef logger" do - Chef::Log.stub!(:level=) - @monologger = mock("Monologger") + Chef::Log.stub(:level=) + @monologger = double("Monologger") MonoLogger.should_receive(:new).with(Chef::Config[:log_location]).and_return(@monologger) Chef::Log.should_receive(:init).with(@monologger) @app.configure_logging end + it "should raise fatals if log location is invalid" do + Chef::Config[:log_location] = "/tmp/non-existing-dir/logfile" + Chef::Log.should_receive(:fatal).at_least(:once) + Process.should_receive(:exit) + @app.configure_logging + end + shared_examples_for "log_level_is_auto" do context "when STDOUT is to a tty" do before do - STDOUT.stub!(:tty?).and_return(true) + STDOUT.stub(:tty?).and_return(true) end it "configures the log level to :warn" do @@ -188,7 +195,7 @@ describe Chef::Application do context "when STDOUT is not to a tty" do before do - STDOUT.stub!(:tty?).and_return(false) + STDOUT.stub(:tty?).and_return(false) end it "configures the log level to :info" do @@ -223,9 +230,9 @@ describe Chef::Application do describe "class method: fatal!" do before do - STDERR.stub!(:puts).with("FATAL: blah").and_return(true) - Chef::Log.stub!(:fatal).with("blah").and_return(true) - Process.stub!(:exit).and_return(true) + STDERR.stub(:puts).with("FATAL: blah").and_return(true) + Chef::Log.stub(:fatal).and_return(true) + Process.stub(:exit).and_return(true) end it "should log an error message to the logger" do @@ -274,7 +281,7 @@ describe Chef::Application do @app.config[:config_file] = "/tmp/non-existing-dir/file" config_file_regexp = Regexp.new @app.config[:config_file] Chef::Log.should_receive(:warn).at_least(:once).with(config_file_regexp).and_return(true) - Chef::Log.should_receive(:warn).any_number_of_times.and_return(true) + Chef::Log.stub(:warn).and_return(true) @app.configure_chef end end @@ -306,11 +313,6 @@ describe Chef::Application do @config_file.unlink end - it "should raise informative fatals for missing log file dir" do - create_config_file('log_location "/tmp/non-existing-dir/logfile"') - raises_informative_fatals_on_configure_chef - end - it "should raise informative fatals for badly written config" do create_config_file("text that should break the config parsing") raises_informative_fatals_on_configure_chef diff --git a/spec/unit/checksum/storage/filesystem_spec.rb b/spec/unit/checksum/storage/filesystem_spec.rb index 144dc69ff1..755a64fe07 100644 --- a/spec/unit/checksum/storage/filesystem_spec.rb +++ b/spec/unit/checksum/storage/filesystem_spec.rb @@ -26,8 +26,8 @@ describe Chef::Checksum::Storage::Filesystem do @now = Time.now - Time.stub!(:now).and_return(@now) - Chef::Config.stub!(:checksum_path).and_return("/var/chef/checksums") + Time.stub(:now).and_return(@now) + Chef::Config.stub(:checksum_path).and_return("/var/chef/checksums") @checksum_of_the_file = "3fafecfb15585ede6b840158cbc2f399" @storage = Chef::Checksum::Storage::Filesystem.new("/not/used/path", @checksum_of_the_file) diff --git a/spec/unit/client_spec.rb b/spec/unit/client_spec.rb index eb705e0386..9688cce2f4 100644 --- a/spec/unit/client_spec.rb +++ b/spec/unit/client_spec.rb @@ -24,29 +24,54 @@ require 'chef/run_context' require 'chef/rest' require 'rbconfig' -shared_examples_for Chef::Client do +describe Chef::Client do + + let(:hostname) { "hostname" } + let(:machinename) { "machinename.example.org" } + let(:fqdn) { "hostname.example.org" } + + let(:ohai_data) do + { :fqdn => fqdn, + :hostname => hostname, + :machinename => machinename, + :platform => 'example-platform', + :platform_version => 'example-platform-1.0', + :data => {} + } + end + + let(:ohai_system) do + ohai_system = double( "Ohai::System", + :all_plugins => true, + :data => ohai_data) + ohai_system.stub(:[]) do |key| + ohai_data[key] + end + ohai_system + end + + let(:node) do + Chef::Node.new.tap do |n| + n.name(fqdn) + n.chef_environment("_default") + end + end + + let(:json_attribs) { nil } + let(:client_opts) { {} } + + let(:client) do + Chef::Client.new(json_attribs, client_opts).tap do |c| + c.node = node + end + end + before do Chef::Log.logger = Logger.new(StringIO.new) # Node/Ohai data - @hostname = "hostname" - @fqdn = "hostname.example.org" - Chef::Config[:node_name] = @fqdn - ohai_data = { :fqdn => @fqdn, - :hostname => @hostname, - :platform => 'example-platform', - :platform_version => 'example-platform-1.0', - :data => {} } - ohai_data.stub!(:all_plugins).and_return(true) - ohai_data.stub!(:data).and_return(ohai_data) - Ohai::System.stub!(:new).and_return(ohai_data) - - @node = Chef::Node.new - @node.name(@fqdn) - @node.chef_environment("_default") - - @client = Chef::Client.new - @client.node = @node + #Chef::Config[:node_name] = fqdn + Ohai::System.stub(:new).and_return(ohai_system) end describe "authentication protocol selection" do @@ -58,7 +83,7 @@ shared_examples_for Chef::Client do it "does not force the authentication protocol to 1.1" do Chef::Config[:node_name] = ("f" * 90) # ugly that this happens as a side effect of a getter :( - @client.node_name + client.node_name Chef::Config[:authentication_protocol_version].should == "1.0" end end @@ -67,7 +92,7 @@ shared_examples_for Chef::Client do it "sets the authentication protocol to version 1.1" do Chef::Config[:node_name] = ("f" * 91) # ugly that this happens as a side effect of a getter :( - @client.node_name + client.node_name Chef::Config[:authentication_protocol_version].should == "1.1" end end @@ -75,17 +100,14 @@ shared_examples_for Chef::Client do describe "configuring output formatters" do context "when no formatter has been configured" do - before do - @client = Chef::Client.new - end context "and STDOUT is a TTY" do before do - STDOUT.stub!(:tty?).and_return(true) + STDOUT.stub(:tty?).and_return(true) end it "configures the :doc formatter" do - @client.formatters_for_run.should == [[:doc]] + client.formatters_for_run.should == [[:doc]] end context "and force_logger is set" do @@ -95,7 +117,7 @@ shared_examples_for Chef::Client do it "configures the :null formatter" do Chef::Config[:force_logger].should be_true - @client.formatters_for_run.should == [[:null]] + client.formatters_for_run.should == [[:null]] end end @@ -104,11 +126,11 @@ shared_examples_for Chef::Client do context "and STDOUT is not a TTY" do before do - STDOUT.stub!(:tty?).and_return(false) + STDOUT.stub(:tty?).and_return(false) end it "configures the :null formatter" do - @client.formatters_for_run.should == [[:null]] + client.formatters_for_run.should == [[:null]] end context "and force_formatter is set" do @@ -116,7 +138,7 @@ shared_examples_for Chef::Client do Chef::Config[:force_formatter] = true end it "it configures the :doc formatter" do - @client.formatters_for_run.should == [[:doc]] + client.formatters_for_run.should == [[:doc]] end end end @@ -126,16 +148,15 @@ shared_examples_for Chef::Client do context "when a formatter is configured" do context "with no output path" do before do - @client = Chef::Client.new Chef::Config.add_formatter(:min) end it "does not configure a default formatter" do - @client.formatters_for_run.should == [[:min, nil]] + client.formatters_for_run.should == [[:min, nil]] end it "configures the formatter for STDOUT/STDERR" do - configured_formatters = @client.configure_formatters + configured_formatters = client.configure_formatters min_formatter = configured_formatters[0] min_formatter.output.out.should == STDOUT min_formatter.output.err.should == STDERR @@ -144,7 +165,6 @@ shared_examples_for Chef::Client do context "with an output path" do before do - @client = Chef::Client.new @tmpout = Tempfile.open("rspec-for-client-formatter-selection-#{Process.pid}") Chef::Config.add_formatter(:min, @tmpout.path) end @@ -155,7 +175,7 @@ shared_examples_for Chef::Client do end it "configures the formatter for the file path" do - configured_formatters = @client.configure_formatters + configured_formatters = client.configure_formatters min_formatter = configured_formatters[0] min_formatter.output.out.path.should == @tmpout.path min_formatter.output.err.path.should == @tmpout.path @@ -165,195 +185,320 @@ shared_examples_for Chef::Client do end end - describe "run" do - - it "should identify the node and run ohai, then register the client" do - mock_chef_rest_for_node = mock("Chef::REST (node)") - mock_chef_rest_for_node_save = mock("Chef::REST (node save)") - mock_chef_runner = mock("Chef::Runner") - - # --Client.register - # Make sure Client#register thinks the client key doesn't - # exist, so it tries to register and create one. - File.should_receive(:exists?).with(Chef::Config[:client_key]).exactly(1).times.and_return(false) - - # Client.register will register with the validation client name. - Chef::ApiClient::Registration.any_instance.should_receive(:run) - # Client.register will then turn around create another - # Chef::REST object, this time with the client key it got from the - # previous step. - Chef::REST.should_receive(:new).with(Chef::Config[:chef_server_url], @fqdn, Chef::Config[:client_key]).exactly(1).and_return(mock_chef_rest_for_node) - - # --Client#build_node - # looks up the node, which we will return, then later saves it. - Chef::Node.should_receive(:find_or_create).with(@fqdn).and_return(@node) - - # --ResourceReporter#node_load_completed - # gets a run id from the server for storing resource history - # (has its own tests, so stubbing it here.) - Chef::ResourceReporter.any_instance.should_receive(:node_load_completed) - - # --ResourceReporter#run_completed - # updates the server with the resource history - # (has its own tests, so stubbing it here.) - Chef::ResourceReporter.any_instance.should_receive(:run_completed) - # --Client#setup_run_context - # ---Client#sync_cookbooks -- downloads the list of cookbooks to sync - # - Chef::CookbookSynchronizer.any_instance.should_receive(:sync_cookbooks) - mock_chef_rest_for_node.should_receive(:post_rest).with("environments/_default/cookbook_versions", {:run_list => []}).and_return({}) - - # --Client#converge - Chef::Runner.should_receive(:new).and_return(mock_chef_runner) - mock_chef_runner.should_receive(:converge).and_return(true) - - # --Client#save_updated_node - Chef::REST.should_receive(:new).with(Chef::Config[:chef_server_url]).and_return(mock_chef_rest_for_node_save) - mock_chef_rest_for_node_save.should_receive(:put_rest).with("nodes/#{@fqdn}", @node).and_return(true) - - Chef::RunLock.any_instance.should_receive(:acquire) - Chef::RunLock.any_instance.should_receive(:save_pid) - Chef::RunLock.any_instance.should_receive(:release) - - # Post conditions: check that node has been filled in correctly - @client.should_receive(:run_started) - @client.should_receive(:run_completed_successfully) + describe "a full client run" do + shared_examples_for "a successful client run" do + let(:http_node_load) { double("Chef::REST (node)") } + let(:http_cookbook_sync) { double("Chef::REST (cookbook sync)") } + let(:http_node_save) { double("Chef::REST (node save)") } + let(:runner) { double("Chef::Runner") } - if(Chef::Config[:client_fork] && !windows?) - require 'stringio' - if(Chef::Config[:pipe_node]) - pipe_sim = StringIO.new - pipe_sim.should_receive(:close).exactly(4).and_return(nil) - res = '' - pipe_sim.should_receive(:puts) do |string| - res.replace(string) - end - pipe_sim.should_receive(:gets).and_return(res) - IO.should_receive(:pipe).and_return([pipe_sim, pipe_sim]) - IO.should_receive(:select).and_return(true) + let(:api_client_exists?) { false } + + let(:stdout) { StringIO.new } + let(:stderr) { StringIO.new } + + let(:enable_fork) { false } + + def stub_for_register + # --Client.register + # Make sure Client#register thinks the client key doesn't + # exist, so it tries to register and create one. + File.should_receive(:exists?).with(Chef::Config[:client_key]).exactly(1).times.and_return(api_client_exists?) + + unless api_client_exists? + # Client.register will register with the validation client name. + Chef::ApiClient::Registration.any_instance.should_receive(:run) end - proc_ret = Class.new.new - proc_ret.should_receive(:success?).and_return(true) - Process.should_receive(:waitpid2).and_return([1, proc_ret]) - @client.should_receive(:exit).and_return(nil) - @client.should_receive(:fork) do |&block| - block.call + end + + def stub_for_node_load + # Client.register will then turn around create another + # Chef::REST object, this time with the client key it got from the + # previous step. + Chef::REST.should_receive(:new). + with(Chef::Config[:chef_server_url], fqdn, Chef::Config[:client_key]). + exactly(1). + and_return(http_node_load) + + # --Client#build_node + # looks up the node, which we will return, then later saves it. + Chef::Node.should_receive(:find_or_create).with(fqdn).and_return(node) + + # --ResourceReporter#node_load_completed + # gets a run id from the server for storing resource history + # (has its own tests, so stubbing it here.) + Chef::ResourceReporter.any_instance.should_receive(:node_load_completed) + end + + def stub_for_sync_cookbooks + # --Client#setup_run_context + # ---Client#sync_cookbooks -- downloads the list of cookbooks to sync + # + Chef::CookbookSynchronizer.any_instance.should_receive(:sync_cookbooks) + Chef::REST.should_receive(:new).with(Chef::Config[:chef_server_url]).and_return(http_cookbook_sync) + http_cookbook_sync.should_receive(:post). + with("environments/_default/cookbook_versions", {:run_list => []}). + and_return({}) + end + + def stub_for_converge + # --Client#converge + Chef::Runner.should_receive(:new).and_return(runner) + runner.should_receive(:converge).and_return(true) + + # --ResourceReporter#run_completed + # updates the server with the resource history + # (has its own tests, so stubbing it here.) + Chef::ResourceReporter.any_instance.should_receive(:run_completed) + end + + def stub_for_node_save + # --Client#save_updated_node + Chef::REST.should_receive(:new).with(Chef::Config[:chef_server_url]).and_return(http_node_save) + http_node_save.should_receive(:put_rest).with("nodes/#{fqdn}", node).and_return(true) + end + + def stub_for_run + Chef::RunLock.any_instance.should_receive(:acquire) + Chef::RunLock.any_instance.should_receive(:save_pid) + Chef::RunLock.any_instance.should_receive(:release) + + # Post conditions: check that node has been filled in correctly + client.should_receive(:run_started) + client.should_receive(:run_completed_successfully) + end + + before do + Chef::Config[:client_fork] = enable_fork + + stub_const("Chef::Client::STDOUT_FD", stdout) + stub_const("Chef::Client::STDERR_FD", stderr) + + stub_for_register + stub_for_node_load + stub_for_sync_cookbooks + stub_for_converge + stub_for_node_save + stub_for_run + end + + it "runs ohai, sets up authentication, loads node state, synchronizes policy, and converges" do + # This is what we're testing. + client.run + + # fork is stubbed, so we can see the outcome of the run + node.automatic_attrs[:platform].should == "example-platform" + node.automatic_attrs[:platform_version].should == "example-platform-1.0" + end + end + + + describe "when running chef-client without fork" do + + include_examples "a successful client run" + end + + describe "when running chef-client with forking enabled", :unix_only do + include_examples "a successful client run" do + let(:process_status) do + double("Process::Status") + end + + let(:enable_fork) { true } + + before do + Process.should_receive(:waitpid2).and_return([1, process_status]) + + process_status.should_receive(:success?).and_return(true) + client.should_receive(:exit).and_return(nil) + client.should_receive(:fork).and_yield end end - # This is what we're testing. - @client.run + end + + describe "when the client key already exists" do + + let(:api_client_exists?) { true } + + include_examples "a successful client run" + end + + describe "when an override run list is given" do + let(:client_opts) { {:override_runlist => "recipe[override_recipe]"} } + + it "should permit spaces in overriding run list" do + Chef::Client.new(nil, :override_runlist => 'role[a], role[b]') + end + + describe "when running the client" do + include_examples "a successful client run" do + + before do + # Client will try to compile and run override_recipe + Chef::RunContext::CookbookCompiler.any_instance.should_receive(:compile) + end + + def stub_for_sync_cookbooks + # --Client#setup_run_context + # ---Client#sync_cookbooks -- downloads the list of cookbooks to sync + # + Chef::CookbookSynchronizer.any_instance.should_receive(:sync_cookbooks) + Chef::REST.should_receive(:new).with(Chef::Config[:chef_server_url]).and_return(http_cookbook_sync) + http_cookbook_sync.should_receive(:post). + with("environments/_default/cookbook_versions", {:run_list => ["override_recipe"]}). + and_return({}) + end + + def stub_for_node_save + # Expect NO node save + node.should_not_receive(:save) + end + end + end + end + + describe "when a permanent run list is passed as an option" do + + include_examples "a successful client run" do + + let(:new_runlist) { "recipe[new_run_list_recipe]" } + let(:client_opts) { {:runlist => new_runlist} } + + def stub_for_sync_cookbooks + # --Client#setup_run_context + # ---Client#sync_cookbooks -- downloads the list of cookbooks to sync + # + Chef::CookbookSynchronizer.any_instance.should_receive(:sync_cookbooks) + Chef::REST.should_receive(:new).with(Chef::Config[:chef_server_url]).and_return(http_cookbook_sync) + http_cookbook_sync.should_receive(:post). + with("environments/_default/cookbook_versions", {:run_list => ["new_run_list_recipe"]}). + and_return({}) + end + + before do + # Client will try to compile and run the new_run_list_recipe, but we + # do not create a fixture for this. + Chef::RunContext::CookbookCompiler.any_instance.should_receive(:compile) + end + + it "sets the new run list on the node" do + client.run + node.run_list.should == Chef::RunList.new(new_runlist) + end - if(!Chef::Config[:client_fork] || Chef::Config[:pipe_node]) - @node.automatic_attrs[:platform].should == "example-platform" - @node.automatic_attrs[:platform_version].should == "example-platform-1.0" end end + end + + + describe "when handling run failures" do + it "should remove the run_lock on failure of #load_node" do - @run_lock = mock("Chef::RunLock", :acquire => true) - Chef::RunLock.stub!(:new).and_return(@run_lock) + @run_lock = double("Chef::RunLock", :acquire => true) + Chef::RunLock.stub(:new).and_return(@run_lock) - @events = mock("Chef::EventDispatch::Dispatcher").as_null_object - Chef::EventDispatch::Dispatcher.stub!(:new).and_return(@events) + @events = double("Chef::EventDispatch::Dispatcher").as_null_object + Chef::EventDispatch::Dispatcher.stub(:new).and_return(@events) # @events is created on Chef::Client.new, so we need to recreate it after mocking - @client = Chef::Client.new - @client.stub!(:load_node).and_raise(Exception) + client = Chef::Client.new + client.stub(:load_node).and_raise(Exception) @run_lock.should_receive(:release) if(Chef::Config[:client_fork] && !windows?) - @client.should_receive(:fork) do |&block| + client.should_receive(:fork) do |&block| block.call end end - lambda { @client.run }.should raise_error(Exception) + lambda { client.run }.should raise_error(Exception) end + end - describe "when notifying other objects of the status of the chef run" do - before do - Chef::Client.clear_notifications - Chef::Node.stub!(:find_or_create).and_return(@node) - @node.stub!(:save) - @client.build_node - end - - it "notifies observers that the run has started" do - notified = false - Chef::Client.when_run_starts do |run_status| - run_status.node.should == @node - notified = true - end + describe "when notifying other objects of the status of the chef run" do + before do + Chef::Client.clear_notifications + Chef::Node.stub(:find_or_create).and_return(node) + node.stub(:save) + client.load_node + client.build_node + end - @client.run_started - notified.should be_true + it "notifies observers that the run has started" do + notified = false + Chef::Client.when_run_starts do |run_status| + run_status.node.should == node + notified = true end - it "notifies observers that the run has completed successfully" do - notified = false - Chef::Client.when_run_completes_successfully do |run_status| - run_status.node.should == @node - notified = true - end + client.run_started + notified.should be_true + end - @client.run_completed_successfully - notified.should be_true + it "notifies observers that the run has completed successfully" do + notified = false + Chef::Client.when_run_completes_successfully do |run_status| + run_status.node.should == node + notified = true end - it "notifies observers that the run failed" do - notified = false - Chef::Client.when_run_fails do |run_status| - run_status.node.should == @node - notified = true - end + client.run_completed_successfully + notified.should be_true + end - @client.run_failed - notified.should be_true + it "notifies observers that the run failed" do + notified = false + Chef::Client.when_run_fails do |run_status| + run_status.node.should == node + notified = true end + + client.run_failed + notified.should be_true end end describe "build_node" do it "should expand the roles and recipes for the node" do - @node.run_list << "role[role_containing_cookbook1]" + node.run_list << "role[role_containing_cookbook1]" role_containing_cookbook1 = Chef::Role.new role_containing_cookbook1.name("role_containing_cookbook1") role_containing_cookbook1.run_list << "cookbook1" # build_node will call Node#expand! with server, which will # eventually hit the server to expand the included role. - mock_chef_rest = mock("Chef::REST") + mock_chef_rest = double("Chef::REST") mock_chef_rest.should_receive(:get_rest).with("roles/role_containing_cookbook1").and_return(role_containing_cookbook1) Chef::REST.should_receive(:new).and_return(mock_chef_rest) # check pre-conditions. - @node[:roles].should be_nil - @node[:recipes].should be_nil + node[:roles].should be_nil + node[:recipes].should be_nil + + client.policy_builder.stub(:node).and_return(node) - @client.build_node + # chefspec and possibly others use the return value of this method + client.build_node.should == node # check post-conditions. - @node[:roles].should_not be_nil - @node[:roles].length.should == 1 - @node[:roles].should include("role_containing_cookbook1") - @node[:recipes].should_not be_nil - @node[:recipes].length.should == 1 - @node[:recipes].should include("cookbook1") + node[:roles].should_not be_nil + node[:roles].length.should == 1 + node[:roles].should include("role_containing_cookbook1") + node[:recipes].should_not be_nil + node[:recipes].length.should == 1 + node[:recipes].should include("cookbook1") end end describe "windows_admin_check" do - before do - @client = Chef::Client.new - end - context "platform is not windows" do before do Chef::Platform.stub(:windows?).and_return(false) end it "shouldn't be called" do - @client.should_not_receive(:has_admin_privileges?) - @client.do_windows_admin_check + client.should_not_receive(:has_admin_privileges?) + client.do_windows_admin_check end end @@ -363,90 +508,46 @@ shared_examples_for Chef::Client do end it "should be called" do - @client.should_receive(:has_admin_privileges?) - @client.do_windows_admin_check + client.should_receive(:has_admin_privileges?) + client.do_windows_admin_check end context "admin privileges exist" do before do - @client.should_receive(:has_admin_privileges?).and_return(true) + client.should_receive(:has_admin_privileges?).and_return(true) end it "should not log a warning message" do Chef::Log.should_not_receive(:warn) - @client.do_windows_admin_check + client.do_windows_admin_check end context "fatal admin check is configured" do it "should not raise an exception" do - @client.do_windows_admin_check.should_not raise_error(Chef::Exceptions::WindowsNotAdmin) + client.do_windows_admin_check #should not raise end end end context "admin privileges doesn't exist" do before do - @client.should_receive(:has_admin_privileges?).and_return(false) + client.should_receive(:has_admin_privileges?).and_return(false) end it "should log a warning message" do Chef::Log.should_receive(:warn) - @client.do_windows_admin_check + client.do_windows_admin_check end context "fatal admin check is configured" do it "should raise an exception" do - @client.do_windows_admin_check.should_not raise_error(Chef::Exceptions::WindowsNotAdmin) + client.do_windows_admin_check # should not raise end end end end end - describe "when a run list override is provided" do - before do - @node = Chef::Node.new - @node.name(@fqdn) - @node.chef_environment("_default") - @node.automatic_attrs[:platform] = "example-platform" - @node.automatic_attrs[:platform_version] = "example-platform-1.0" - end - - it "should permit spaces in overriding run list" do - @client = Chef::Client.new(nil, :override_runlist => 'role[a], role[b]') - end - - it "should override the run list and save original runlist" do - @client = Chef::Client.new(nil, :override_runlist => 'role[test_role]') - @client.node = @node - - @node.run_list << "role[role_containing_cookbook1]" - - override_role = Chef::Role.new - override_role.name 'test_role' - override_role.run_list << 'cookbook1' - - original_runlist = @node.run_list.dup - - mock_chef_rest = mock("Chef::REST") - mock_chef_rest.should_receive(:get_rest).with("roles/test_role").and_return(override_role) - Chef::REST.should_receive(:new).and_return(mock_chef_rest) - - @node.should_receive(:save).and_return(nil) - - @client.build_node - - @node[:roles].should_not be_nil - @node[:roles].should eql(['test_role']) - @node[:recipes].should eql(['cookbook1']) - - @client.save_updated_node - - @node.run_list.should == original_runlist - - end - end - describe "assert_cookbook_path_not_empty" do before do Chef::Config[:solo] = true @@ -455,24 +556,46 @@ shared_examples_for Chef::Client do context "when any directory of cookbook_path contains no cookbook" do it "raises CookbookNotFound error" do expect do - @client.send(:assert_cookbook_path_not_empty, nil) + client.send(:assert_cookbook_path_not_empty, nil) end.to raise_error(Chef::Exceptions::CookbookNotFound, 'None of the cookbook paths set in Chef::Config[:cookbook_path], ["/path/to/invalid/cookbook_path"], contain any cookbooks') end end end -end + describe "setting node name" do + context "when machinename, hostname and fqdn are all set" do + it "favors the fqdn" do + expect(client.node_name).to eql(fqdn) + end + end -describe Chef::Client do - Chef::Config[:client_fork] = false - it_behaves_like Chef::Client -end + context "when fqdn is missing" do + # ohai 7 should always have machinename == return of hostname + let(:fqdn) { nil } + it "favors the machinename" do + expect(client.node_name).to eql(machinename) + end + end -describe "Chef::Client Forked" do - before do - Chef::Config[:client_fork] = true - end + context "when fqdn and machinename are missing" do + # ohai 6 will not have machinename, return the short hostname + let(:fqdn) { nil } + let(:machinename) { nil } + it "falls back to hostname" do + expect(client.node_name).to eql(hostname) + end + end + + context "when they're all missing" do + let(:machinename) { nil } + let(:hostname) { nil } + let(:fqdn) { nil } - it_behaves_like Chef::Client + it "throws an exception" do + expect { client.node_name }.to raise_error(Chef::Exceptions::CannotDetermineNodeName) + end + end + end end + diff --git a/spec/unit/config_spec.rb b/spec/unit/config_spec.rb index 77870e84d8..0f9bfce4aa 100644 --- a/spec/unit/config_spec.rb +++ b/spec/unit/config_spec.rb @@ -99,8 +99,8 @@ describe Chef::Config do describe "class method: manage_secret_key" do before do - Chef::FileCache.stub!(:load).and_return(true) - Chef::FileCache.stub!(:has_key?).with("chef_server_cookie_id").and_return(false) + Chef::FileCache.stub(:load).and_return(true) + Chef::FileCache.stub(:has_key?).with("chef_server_cookie_id").and_return(false) end it "should generate and store a chef server cookie id" do @@ -110,7 +110,7 @@ describe Chef::Config do describe "when the filecache has a chef server cookie id key" do before do - Chef::FileCache.stub!(:has_key?).with("chef_server_cookie_id").and_return(true) + Chef::FileCache.stub(:has_key?).with("chef_server_cookie_id").and_return(true) end it "should not generate and store a chef server cookie id" do @@ -121,29 +121,6 @@ describe Chef::Config do end - describe "config attribute writer: log_method=" do - describe "when given an object that responds to sync= e.g. IO" do - it "should configure itself to use the IO as log_location" do - Chef::Config.log_location = STDOUT - Chef::Config.log_location.should == STDOUT - end - end - - describe "when given an object that is stringable (to_str)" do - before do - @mockfile = mock("File", :path => "/var/log/chef/client.log", :sync= => true) - File.should_receive(:new). - with("/var/log/chef/client.log", "a"). - and_return(@mockfile) - end - - it "should configure itself to use a File object based upon the String" do - Chef::Config.log_location = "/var/log/chef/client.log" - Chef::Config.log_location.path.should == "/var/log/chef/client.log" - end - end - end - describe "class method: plaform_specific_path" do it "should return given path on non-windows systems" do platform_mock :unix do @@ -155,7 +132,7 @@ describe Chef::Config do it "should return a windows path on windows systems" do platform_mock :windows do path = "/etc/chef/cookbooks" - ENV.stub!(:[]).with('SYSTEMDRIVE').and_return('C:') + ENV.stub(:[]).with('SYSTEMDRIVE').and_return('C:') # match on a regex that looks for the base path with an optional # system drive at the beginning (c:) # system drive is not hardcoded b/c it can change and b/c it is not present on linux systems @@ -354,13 +331,6 @@ describe Chef::Config do end end - describe "Chef::Config[:log_location]" do - it "raises ConfigurationError when log_location directory is missing" do - missing_path = "/tmp/non-existing-dir/file" - expect{Chef::Config.log_location = missing_path}.to raise_error Chef::Exceptions::ConfigurationError - end - end - describe "Chef::Config[:event_handlers]" do it "sets a event_handlers to an empty array by default" do Chef::Config[:event_handlers].should eq([]) diff --git a/spec/unit/cookbook/metadata_spec.rb b/spec/unit/cookbook/metadata_spec.rb index 9822146131..cba2aff5da 100644 --- a/spec/unit/cookbook/metadata_spec.rb +++ b/spec/unit/cookbook/metadata_spec.rb @@ -247,7 +247,7 @@ describe Chef::Cookbook::Metadata do it "should not accept anything but a string for display_name" do lambda { @meta.grouping("db/mysql/databases", :title => "foo") - }.should_not raise_error(ArgumentError) + }.should_not raise_error lambda { @meta.grouping("db/mysql/databases", :title => Hash.new) }.should raise_error(ArgumentError) @@ -256,7 +256,7 @@ describe Chef::Cookbook::Metadata do it "should not accept anything but a string for the description" do lambda { @meta.grouping("db/mysql/databases", :description => "foo") - }.should_not raise_error(ArgumentError) + }.should_not raise_error lambda { @meta.grouping("db/mysql/databases", :description => Hash.new) }.should raise_error(ArgumentError) @@ -281,7 +281,7 @@ describe Chef::Cookbook::Metadata do it "should not accept anything but a string for display_name" do lambda { @meta.attribute("db/mysql/databases", :display_name => "foo") - }.should_not raise_error(ArgumentError) + }.should_not raise_error lambda { @meta.attribute("db/mysql/databases", :display_name => Hash.new) }.should raise_error(ArgumentError) @@ -290,7 +290,7 @@ describe Chef::Cookbook::Metadata do it "should not accept anything but a string for the description" do lambda { @meta.attribute("db/mysql/databases", :description => "foo") - }.should_not raise_error(ArgumentError) + }.should_not raise_error lambda { @meta.attribute("db/mysql/databases", :description => Hash.new) }.should raise_error(ArgumentError) @@ -299,7 +299,7 @@ describe Chef::Cookbook::Metadata do it "should not accept anything but an array of strings for choice" do lambda { @meta.attribute("db/mysql/databases", :choice => ['dedicated', 'shared']) - }.should_not raise_error(ArgumentError) + }.should_not raise_error lambda { @meta.attribute("db/mysql/databases", :choice => [10, 'shared']) }.should raise_error(ArgumentError) @@ -316,10 +316,10 @@ describe Chef::Cookbook::Metadata do it "should let calculated be true or false" do lambda { @meta.attribute("db/mysql/databases", :calculated => true) - }.should_not raise_error(ArgumentError) + }.should_not raise_error lambda { @meta.attribute("db/mysql/databases", :calculated => false) - }.should_not raise_error(ArgumentError) + }.should_not raise_error lambda { @meta.attribute("db/mysql/databases", :calculated => Hash.new) }.should raise_error(ArgumentError) @@ -333,13 +333,13 @@ describe Chef::Cookbook::Metadata do it "accepts String for the attribute type" do lambda { @meta.attribute("db/mysql/databases", :type => "string") - }.should_not raise_error(ArgumentError) + }.should_not raise_error end it "accepts Array for the attribute type" do lambda { @meta.attribute("db/mysql/databases", :type => "array") - }.should_not raise_error(ArgumentError) + }.should_not raise_error lambda { @meta.attribute("db/mysql/databases", :type => Array.new) }.should raise_error(ArgumentError) @@ -348,38 +348,38 @@ describe Chef::Cookbook::Metadata do it "accepts symbol for the attribute type" do lambda { @meta.attribute("db/mysql/databases", :type => "symbol") - }.should_not raise_error(ArgumentError) + }.should_not raise_error end it "should let type be hash (backwards compatability only)" do lambda { @meta.attribute("db/mysql/databases", :type => "hash") - }.should_not raise_error(ArgumentError) + }.should_not raise_error end it "should let required be required, recommended or optional" do lambda { @meta.attribute("db/mysql/databases", :required => 'required') - }.should_not raise_error(ArgumentError) + }.should_not raise_error lambda { @meta.attribute("db/mysql/databases", :required => 'recommended') - }.should_not raise_error(ArgumentError) + }.should_not raise_error lambda { @meta.attribute("db/mysql/databases", :required => 'optional') - }.should_not raise_error(ArgumentError) + }.should_not raise_error end it "should convert required true to required" do lambda { @meta.attribute("db/mysql/databases", :required => true) - }.should_not raise_error(ArgumentError) + }.should_not raise_error #attrib = @meta.attributes["db/mysql/databases"][:required].should == "required" end it "should convert required false to optional" do lambda { @meta.attribute("db/mysql/databases", :required => false) - }.should_not raise_error(ArgumentError) + }.should_not raise_error #attrib = @meta.attributes["db/mysql/databases"][:required].should == "optional" end @@ -391,7 +391,7 @@ describe Chef::Cookbook::Metadata do it "should make sure recipes is an array" do lambda { @meta.attribute("db/mysql/databases", :recipes => []) - }.should_not raise_error(ArgumentError) + }.should_not raise_error lambda { @meta.attribute("db/mysql/databases", :required => Hash.new) }.should raise_error(ArgumentError) @@ -405,13 +405,13 @@ describe Chef::Cookbook::Metadata do it "should allow the default value to be a string, array, or hash" do lambda { @meta.attribute("db/mysql/databases", :default => []) - }.should_not raise_error(ArgumentError) + }.should_not raise_error lambda { @meta.attribute("db/mysql/databases", :default => {}) - }.should_not raise_error(ArgumentError) + }.should_not raise_error lambda { @meta.attribute("db/mysql/databases", :default => "alice in chains") - }.should_not raise_error(ArgumentError) + }.should_not raise_error lambda { @meta.attribute("db/mysql/databases", :required => :not_gonna_do_it) }.should raise_error(ArgumentError) @@ -441,14 +441,14 @@ describe Chef::Cookbook::Metadata do :default => "b" } @meta.attribute("db/mysql/databases", attrs) - }.should_not raise_error(ArgumentError) + }.should_not raise_error lambda { attrs = { :choice => [ "a", "b", "c", "d", "e"], :default => ["b", "d"] } @meta.attribute("db/mysql/databases", attrs) - }.should_not raise_error(ArgumentError) + }.should_not raise_error end it "should error if default is not a choice" do diff --git a/spec/unit/cookbook/synchronizer_spec.rb b/spec/unit/cookbook/synchronizer_spec.rb index 31f30c5bf4..c52593287a 100644 --- a/spec/unit/cookbook/synchronizer_spec.rb +++ b/spec/unit/cookbook/synchronizer_spec.rb @@ -14,7 +14,7 @@ describe Chef::CookbookCacheCleaner do end it "removes all files not validated during the chef run" do - file_cache = mock("Chef::FileCache with files from unused cookbooks") + file_cache = double("Chef::FileCache with files from unused cookbooks") unused_template_files = %w{cookbooks/unused/templates/default/foo.conf.erb cookbooks/unused/tempaltes/default/bar.conf.erb} valid_cached_cb_files = %w{cookbooks/valid1/recipes/default.rb cookbooks/valid2/recipes/default.rb} @cleaner.mark_file_as_valid('cookbooks/valid1/recipes/default.rb') @@ -23,7 +23,7 @@ describe Chef::CookbookCacheCleaner do file_cache.should_receive(:delete).with('cookbooks/unused/templates/default/foo.conf.erb') file_cache.should_receive(:delete).with('cookbooks/unused/tempaltes/default/bar.conf.erb') cookbook_hash = {"valid1"=> {}, "valid2" => {}} - @cleaner.stub!(:cache).and_return(file_cache) + @cleaner.stub(:cache).and_return(file_cache) @cleaner.cleanup_file_cache end @@ -37,7 +37,7 @@ describe Chef::CookbookCacheCleaner do end it "does not remove anything" do - @cleaner.cache.stub!(:find).and_return(%w{cookbooks/valid1/recipes/default.rb cookbooks/valid2/recipes/default.rb}) + @cleaner.cache.stub(:find).and_return(%w{cookbooks/valid1/recipes/default.rb cookbooks/valid2/recipes/default.rb}) @cleaner.cache.should_not_receive(:delete) @cleaner.cleanup_file_cache end @@ -81,7 +81,7 @@ describe Chef::CookbookSynchronizer do context "when the cache contains unneeded cookbooks" do before do - @file_cache = mock("Chef::FileCache with files from unused cookbooks") + @file_cache = double("Chef::FileCache with files from unused cookbooks") @valid_cached_cb_files = %w{cookbooks/valid1/recipes/default.rb cookbooks/valid2/recipes/default.rb} @obsolete_cb_files = %w{cookbooks/old1/recipes/default.rb cookbooks/old2/recipes/default.rb} @@ -94,7 +94,7 @@ describe Chef::CookbookSynchronizer do @file_cache.should_receive(:find).with(File.join(%w{cookbooks ** *})).and_return(@valid_cached_cb_files + @obsolete_cb_files) @file_cache.should_receive(:delete).with('cookbooks/old1/recipes/default.rb') @file_cache.should_receive(:delete).with('cookbooks/old2/recipes/default.rb') - @synchronizer.stub!(:cache).and_return(@file_cache) + @synchronizer.stub(:cache).and_return(@file_cache) @synchronizer.clear_obsoleted_cookbooks end end @@ -103,18 +103,18 @@ describe Chef::CookbookSynchronizer do before do # Would rather not stub out methods on the test subject, but setting up # the state is a PITA and tests for this behavior are above. - @synchronizer.stub!(:clear_obsoleted_cookbooks) + @synchronizer.stub(:clear_obsoleted_cookbooks) - @server_api = mock("Chef::REST (mock)") - @file_cache = mock("Chef::FileCache (mock)") - @synchronizer.stub!(:server_api).and_return(@server_api) - @synchronizer.stub!(:cache).and_return(@file_cache) + @server_api = double("Chef::REST (mock)") + @file_cache = double("Chef::FileCache (mock)") + @synchronizer.stub(:server_api).and_return(@server_api) + @synchronizer.stub(:cache).and_return(@file_cache) - @cookbook_a_default_recipe_tempfile = mock("Tempfile for cookbook_a default.rb recipe", + @cookbook_a_default_recipe_tempfile = double("Tempfile for cookbook_a default.rb recipe", :path => "/tmp/cookbook_a_recipes_default_rb") - @cookbook_a_default_attribute_tempfile = mock("Tempfile for cookbook_a default.rb attr file", + @cookbook_a_default_attribute_tempfile = double("Tempfile for cookbook_a default.rb attr file", :path => "/tmp/cookbook_a_attributes_default_rb") end @@ -167,13 +167,13 @@ describe Chef::CookbookSynchronizer do before do Chef::Config[:no_lazy_load] = true @synchronizer = Chef::CookbookSynchronizer.new(@cookbook_manifest, @events) - @synchronizer.stub!(:server_api).and_return(@server_api) - @synchronizer.stub!(:cache).and_return(@file_cache) - @synchronizer.stub!(:clear_obsoleted_cookbooks) + @synchronizer.stub(:server_api).and_return(@server_api) + @synchronizer.stub(:cache).and_return(@file_cache) + @synchronizer.stub(:clear_obsoleted_cookbooks) - @cookbook_a_file_default_tempfile = mock("Tempfile for cookbook_a megaman.conf file", + @cookbook_a_file_default_tempfile = double("Tempfile for cookbook_a megaman.conf file", :path => "/tmp/cookbook_a_file_default_tempfile") - @cookbook_a_template_default_tempfile = mock("Tempfile for cookbook_a apache.conf.erb template", + @cookbook_a_template_default_tempfile = double("Tempfile for cookbook_a apache.conf.erb template", :path => "/tmp/cookbook_a_template_default_tempfile") end diff --git a/spec/unit/cookbook/syntax_check_spec.rb b/spec/unit/cookbook/syntax_check_spec.rb index 85d6950a45..40a89c99a4 100644 --- a/spec/unit/cookbook/syntax_check_spec.rb +++ b/spec/unit/cookbook/syntax_check_spec.rb @@ -28,7 +28,6 @@ describe Chef::Cookbook::SyntaxCheck do Chef::Log.logger = Logger.new(StringIO.new) Chef::Log.level = :warn # suppress "Syntax OK" messages - @attr_files = %w{default.rb smokey.rb}.map { |f| File.join(cookbook_path, 'attributes', f) } @defn_files = %w{client.rb server.rb}.map { |f| File.join(cookbook_path, 'definitions', f)} @recipes = %w{default.rb gigantor.rb one.rb}.map { |f| File.join(cookbook_path, 'recipes', f) } diff --git a/spec/unit/cookbook_spec.rb b/spec/unit/cookbook_spec.rb index c28a5c7a2a..ca4f4adc08 100644 --- a/spec/unit/cookbook_spec.rb +++ b/spec/unit/cookbook_spec.rb @@ -70,6 +70,7 @@ describe Chef::CookbookVersion do it "should allow you to include a fully-qualified recipe using the DSL" do # DSL method include_recipe allows multiple arguments, so extract the first + @node.should_receive(:loaded_recipe).with(:openldap, "gigantor") recipe = @run_context.include_recipe("openldap::gigantor").first recipe.recipe_name.should == "gigantor" diff --git a/spec/unit/daemon_spec.rb b/spec/unit/daemon_spec.rb index 8d66e08511..9132dae389 100644 --- a/spec/unit/daemon_spec.rb +++ b/spec/unit/daemon_spec.rb @@ -23,12 +23,12 @@ describe Chef::Daemon do if windows? mock_struct = #Struct::Passwd.new(nil, nil, 111, 111) mock_struct = OpenStruct.new(:uid => 2342, :gid => 2342) - Etc.stub!(:getpwnam).and_return mock_struct - Etc.stub!(:getgrnam).and_return mock_struct + Etc.stub(:getpwnam).and_return mock_struct + Etc.stub(:getgrnam).and_return mock_struct # mock unimplemented methods - Process.stub!(:initgroups).and_return nil - Process::GID.stub!(:change_privilege).and_return 11 - Process::UID.stub!(:change_privilege).and_return 11 + Process.stub(:initgroups).and_return nil + Process::GID.stub(:change_privilege).and_return 11 + Process::UID.stub(:change_privilege).and_return 11 end end @@ -73,13 +73,12 @@ describe Chef::Daemon do describe ".change_privilege" do before do - Chef::Application.stub!(:fatal!).and_return(true) + Chef::Application.stub(:fatal!).and_return(true) Chef::Config[:user] = 'aj' - Dir.stub!(:chdir) + Dir.stub(:chdir) end it "changes the working directory to root" do - Dir.rspec_reset Dir.should_receive(:chdir).with("/").and_return(0) Chef::Daemon.change_privilege end @@ -117,25 +116,25 @@ describe Chef::Daemon do describe "._change_privilege" do before do - Process.stub!(:euid).and_return(0) - Process.stub!(:egid).and_return(0) + Process.stub(:euid).and_return(0) + Process.stub(:egid).and_return(0) - Process::UID.stub!(:change_privilege).and_return(nil) - Process::GID.stub!(:change_privilege).and_return(nil) + Process::UID.stub(:change_privilege).and_return(nil) + Process::GID.stub(:change_privilege).and_return(nil) - @pw_user = mock("Struct::Passwd", :uid => 501) - @pw_group = mock("Struct::Group", :gid => 20) + @pw_user = double("Struct::Passwd", :uid => 501) + @pw_group = double("Struct::Group", :gid => 20) - Process.stub!(:initgroups).and_return(true) + Process.stub(:initgroups).and_return(true) - Etc.stub!(:getpwnam).and_return(@pw_user) - Etc.stub!(:getgrnam).and_return(@pw_group) + Etc.stub(:getpwnam).and_return(@pw_user) + Etc.stub(:getgrnam).and_return(@pw_group) end describe "with sufficient privileges" do before do - Process.stub!(:euid).and_return(0) - Process.stub!(:egid).and_return(0) + Process.stub(:euid).and_return(0) + Process.stub(:egid).and_return(0) end it "should initialize the supplemental group list" do @@ -156,12 +155,12 @@ describe Chef::Daemon do describe "with insufficient privileges" do before do - Process.stub!(:euid).and_return(999) - Process.stub!(:egid).and_return(999) + Process.stub(:euid).and_return(999) + Process.stub(:egid).and_return(999) end it "should log an appropriate error message and fail miserably" do - Process.stub!(:initgroups).and_raise(Errno::EPERM) + Process.stub(:initgroups).and_raise(Errno::EPERM) error = "Operation not permitted" if RUBY_PLATFORM.match("solaris2") || RUBY_PLATFORM.match("aix") error = "Not owner" diff --git a/spec/unit/data_bag_item_spec.rb b/spec/unit/data_bag_item_spec.rb index 4f017ebb60..ead0dadfa2 100644 --- a/spec/unit/data_bag_item_spec.rb +++ b/spec/unit/data_bag_item_spec.rb @@ -67,15 +67,15 @@ describe Chef::DataBagItem do end it "should accept alphanum/-/_ for the id" do - lambda { @data_bag_item.raw_data = { "id" => "h1-_" } }.should_not raise_error(ArgumentError) + lambda { @data_bag_item.raw_data = { "id" => "h1-_" } }.should_not raise_error end it "should accept alphanum.alphanum for the id" do - lambda { @data_bag_item.raw_data = { "id" => "foo.bar" } }.should_not raise_error(ArgumentError) + lambda { @data_bag_item.raw_data = { "id" => "foo.bar" } }.should_not raise_error end it "should accept .alphanum for the id" do - lambda { @data_bag_item.raw_data = { "id" => ".bozo" } }.should_not raise_error(ArgumentError) + lambda { @data_bag_item.raw_data = { "id" => ".bozo" } }.should_not raise_error end it "should raise an exception if the id contains anything but alphanum/-/_" do @@ -203,8 +203,8 @@ describe Chef::DataBagItem do describe "save" do before do - @rest = mock("Chef::REST") - Chef::REST.stub!(:new).and_return(@rest) + @rest = double("Chef::REST") + Chef::REST.stub(:new).and_return(@rest) @data_bag_item['id'] = "heart of darkness" raw_data = {"id" => "heart_of_darkness", "author" => "Conrad"} @data_bag_item.raw_data = raw_data @@ -216,7 +216,7 @@ describe Chef::DataBagItem do end it "should create if the item is not found" do - exception = mock("404 error", :code => "404") + exception = double("404 error", :code => "404") @rest.should_receive(:put_rest).and_raise(Net::HTTPServerException.new("foo", exception)) @rest.should_receive(:post_rest).with("data/books", @data_bag_item) @data_bag_item.save @@ -247,8 +247,8 @@ describe Chef::DataBagItem do describe "from an API call" do before do - @http_client = mock("Chef::REST") - Chef::REST.stub!(:new).and_return(@http_client) + @http_client = double("Chef::REST") + Chef::REST.stub(:new).and_return(@http_client) end it "converts raw data to a data bag item" do diff --git a/spec/unit/data_bag_spec.rb b/spec/unit/data_bag_spec.rb index 8c9465caf7..4ac843c869 100644 --- a/spec/unit/data_bag_spec.rb +++ b/spec/unit/data_bag_spec.rb @@ -78,12 +78,12 @@ describe Chef::DataBag do describe "when saving" do before do @data_bag.name('piggly_wiggly') - @rest = mock("Chef::REST") - Chef::REST.stub!(:new).and_return(@rest) + @rest = double("Chef::REST") + Chef::REST.stub(:new).and_return(@rest) end it "should silently proceed when the data bag already exists" do - exception = mock("409 error", :code => "409") + exception = double("409 error", :code => "409") @rest.should_receive(:post_rest).and_raise(Net::HTTPServerException.new("foo", exception)) @data_bag.save end @@ -111,7 +111,7 @@ describe Chef::DataBag do describe "from an API call" do before do Chef::Config[:chef_server_url] = 'https://myserver.example.com' - @http_client = mock('Chef::REST') + @http_client = double('Chef::REST') end it "should get the data bag from the server" do @@ -121,7 +121,7 @@ describe Chef::DataBag do end it "should return the data bag" do - Chef::REST.stub!(:new).and_return(@http_client) + Chef::REST.stub(:new).and_return(@http_client) @http_client.should_receive(:get_rest).with('data/foo').and_return({'bar' => 'https://myserver.example.com/data/foo/bar'}) data_bag = Chef::DataBag.load('foo') data_bag.should == {'bar' => 'https://myserver.example.com/data/foo/bar'} @@ -152,7 +152,7 @@ describe Chef::DataBag do it "should return the data bag" do File.should_receive(:directory?).with('/var/chef/data_bags').and_return(true) - Dir.stub!(:glob).and_return(["/var/chef/data_bags/foo/bar.json", "/var/chef/data_bags/foo/baz.json"]) + Dir.stub(:glob).and_return(["/var/chef/data_bags/foo/bar.json", "/var/chef/data_bags/foo/baz.json"]) IO.should_receive(:read).with('/var/chef/data_bags/foo/bar.json').and_return('{"id": "bar", "name": "Bob Bar" }') IO.should_receive(:read).with('/var/chef/data_bags/foo/baz.json').and_return('{"id": "baz", "name": "John Baz" }') data_bag = Chef::DataBag.load('foo') diff --git a/spec/unit/deprecation_spec.rb b/spec/unit/deprecation_spec.rb index 58db295067..8617cb3cb3 100644 --- a/spec/unit/deprecation_spec.rb +++ b/spec/unit/deprecation_spec.rb @@ -62,7 +62,7 @@ describe Chef::Deprecation do context 'deprecation warning messages' do before(:each) do @warning_output = [ ] - Chef::Log.stub!(:warn) { |msg| @warning_output << msg } + Chef::Log.stub(:warn) { |msg| @warning_output << msg } end it 'should be enabled for deprecated methods' do diff --git a/spec/unit/dsl/data_query_spec.rb b/spec/unit/dsl/data_query_spec.rb index 8960ad9957..e31c0725d6 100644 --- a/spec/unit/dsl/data_query_spec.rb +++ b/spec/unit/dsl/data_query_spec.rb @@ -27,7 +27,7 @@ describe Chef::DSL::DataQuery do before(:each) do @language = DataQueryDSLTester.new @node = Hash.new - @language.stub!(:node).and_return(@node) + @language.stub(:node).and_return(@node) end describe "when loading data bags and items" do diff --git a/spec/unit/dsl/reboot_pending_spec.rb b/spec/unit/dsl/reboot_pending_spec.rb new file mode 100644 index 0000000000..8576ae168a --- /dev/null +++ b/spec/unit/dsl/reboot_pending_spec.rb @@ -0,0 +1,100 @@ +# +# Author:: Bryan McLellan <btm@loftninjas.org> +# Copyright:: Copyright (c) 2014 Chef Software, Inc. +# License:: Apache License, Version 2.0 +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +require "chef/dsl/reboot_pending" +require "spec_helper" + +describe Chef::DSL::RebootPending do + describe "reboot_pending?" do + describe "in isoloation" do + let(:recipe) { Object.new.extend(Chef::DSL::RebootPending) } + + before do + recipe.stub(:platform?).and_return(false) + end + + context "platform is windows" do + before do + recipe.stub(:platform?).with('windows').and_return(true) + recipe.stub(:registry_key_exists?).and_return(false) + recipe.stub(:registry_value_exists?).and_return(false) + end + + it 'should return true if "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\PendingFileRenameOperations" exists' do + recipe.stub(:registry_value_exists?).with('HKLM\SYSTEM\CurrentControlSet\Control\Session Manager', { :name => 'PendingFileRenameOperations' }).and_return(true) + expect(recipe.reboot_pending?).to be_true + end + + it 'should return true if "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update\RebootRequired" exists' do + recipe.stub(:registry_key_exists?).with('HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update\RebootRequired').and_return(true) + expect(recipe.reboot_pending?).to be_true + end + + it 'should return true if key "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Component Based Servicing\RebootRequired" exists' do + recipe.stub(:registry_key_exists?).with('HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Component Based Servicing\RebootRequired').and_return(true) + expect(recipe.reboot_pending?).to be_true + end + + it 'should return true if value "HKLM\SOFTWARE\Microsoft\Updates\UpdateExeVolatile" contains specific data' do + recipe.stub(:registry_key_exists?).with('HKLM\SOFTWARE\Microsoft\Updates\UpdateExeVolatile').and_return(true) + recipe.stub(:registry_get_values).with('HKLM\SOFTWARE\Microsoft\Updates\UpdateExeVolatile').and_return( + [{:name => "Flags", :type => :dword, :data => 3}]) + expect(recipe.reboot_pending?).to be_true + end + end + + context "platform is ubuntu" do + before do + recipe.stub(:platform?).with('ubuntu').and_return(true) + end + + it 'should return true if /var/run/reboot-required exists' do + File.stub(:exists?).with('/var/run/reboot-required').and_return(true) + expect(recipe.reboot_pending?).to be_true + end + + it 'should return false if /var/run/reboot-required does not exist' do + File.stub(:exists?).with('/var/run/reboot-required').and_return(false) + expect(recipe.reboot_pending?).to be_false + end + end + + context "platform is not supported" do + it 'should raise an exception' do + recipe.stub_chain(:node, :[]).with(:platform).and_return('msdos') + expect { recipe.reboot_pending? }.to raise_error(Chef::Exceptions::UnsupportedPlatform) + end + end + end # describe in isolation + + describe "in a recipe" do + it "responds to reboot_pending?" do + # Chef::Recipe.new(cookbook_name, recipe_name, run_context(node, cookbook_collection, events)) + recipe = Chef::Recipe.new(nil,nil,Chef::RunContext.new(Chef::Node.new, {}, nil)) + expect(recipe).to respond_to(:reboot_pending?) + end + end # describe in a recipe + + describe "in a resource" do + it "responds to reboot_pending?" do + resource = Chef::Resource::new("Crackerjack::Timing", nil) + expect(resource).to respond_to(:reboot_pending?) + end + end # describe in a resource + end +end diff --git a/spec/unit/dsl/recipe_spec.rb b/spec/unit/dsl/recipe_spec.rb new file mode 100644 index 0000000000..14ee30be44 --- /dev/null +++ b/spec/unit/dsl/recipe_spec.rb @@ -0,0 +1,70 @@ +# +# Author:: Daniel DeLeo (<dan@getchef.com>) +# Copyright:: Copyright (c) 2014 Chef Software, Inc. +# License:: Apache License, Version 2.0 +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +require 'spec_helper' +require 'chef/dsl/recipe' + + +RecipeDSLExampleClass = Struct.new(:cookbook_name, :recipe_name) +class RecipeDSLExampleClass + include Chef::DSL::Recipe +end + +RecipeDSLBaseAPI = Struct.new(:cookbook_name, :recipe_name) +class RecipeDSLExampleSubclass < RecipeDSLBaseAPI + include Chef::DSL::Recipe +end + +# TODO: most of DSL::Recipe's implementation is tested in Chef::Recipe's tests, +# move those to here. +describe Chef::DSL::Recipe do + + let(:cookbook_name) { "example_cb" } + let(:recipe_name) { "example_recipe" } + + shared_examples_for "A Recipe DSL Implementation" do + + it "responds to cookbook_name" do + expect(recipe.cookbook_name).to eq(cookbook_name) + end + + it "responds to recipe_name" do + expect(recipe.recipe_name).to eq(recipe_name) + end + end + + context "when included in a class that defines the required interface directly" do + + let(:recipe) { RecipeDSLExampleClass.new(cookbook_name, recipe_name) } + + include_examples "A Recipe DSL Implementation" + + end + + # This is the situation that occurs when the Recipe DSL gets mixed in to a + # resource, for example. + context "when included in a class that defines the required interface in a superclass" do + + let(:recipe) { RecipeDSLExampleSubclass.new(cookbook_name, recipe_name) } + + include_examples "A Recipe DSL Implementation" + + end + +end + diff --git a/spec/unit/environment_spec.rb b/spec/unit/environment_spec.rb index 5f9675a307..ebbcdd9861 100644 --- a/spec/unit/environment_spec.rb +++ b/spec/unit/environment_spec.rb @@ -355,16 +355,16 @@ describe Chef::Environment do describe "api model" do before(:each) do - @rest = mock("Chef::REST") - Chef::REST.stub!(:new).and_return(@rest) - @query = mock("Chef::Search::Query") - Chef::Search::Query.stub!(:new).and_return(@query) + @rest = double("Chef::REST") + Chef::REST.stub(:new).and_return(@rest) + @query = double("Chef::Search::Query") + Chef::Search::Query.stub(:new).and_return(@query) end describe "list" do describe "inflated" do it "should return a hash of environment names and objects" do - e1 = mock("Chef::Environment", :name => "one") + e1 = double("Chef::Environment", :name => "one") @query.should_receive(:search).with(:environment).and_yield(e1) r = Chef::Environment.list(true) r["one"].should == e1 diff --git a/spec/unit/file_access_control_spec.rb b/spec/unit/file_access_control_spec.rb index 609bd826b6..4e257c2a22 100644 --- a/spec/unit/file_access_control_spec.rb +++ b/spec/unit/file_access_control_spec.rb @@ -36,7 +36,7 @@ describe Chef::FileAccessControl do @run_context = Chef::RunContext.new(@node, {}, @events) @current_resource = Chef::Resource::File.new('/tmp/different_file.txt') @provider_requirements = Chef::Provider::ResourceRequirements.new(@resource, @run_context) - @provider = mock("File provider", :requirements => @provider_requirements, :manage_symlink_access? => false) + @provider = double("File provider", :requirements => @provider_requirements, :manage_symlink_access? => false) @fac = Chef::FileAccessControl.new(@current_resource, @resource, @provider) end @@ -217,7 +217,7 @@ describe Chef::FileAccessControl do @resource.group(2342) @current_resource.group(2342) - # @fac.stub!(:stat).and_return(OpenStruct.new(:gid => 2342)) + # @fac.stub(:stat).and_return(OpenStruct.new(:gid => 2342)) File.should_not_receive(:chown) @fac.set_group @fac.should_not be_modified @@ -267,7 +267,7 @@ describe Chef::FileAccessControl do it "sets the file's mode as specified in the resource when the current modes are incorrect" do # stat returns modes like 0100644 (octal) => 33188 (decimal) - #@fac.stub!(:stat).and_return(OpenStruct.new(:mode => 33188)) + #@fac.stub(:stat).and_return(OpenStruct.new(:mode => 33188)) @current_resource.mode("0644") File.should_receive(:chmod).with(256, '/tmp/different_file.txt') @fac.set_mode @@ -280,7 +280,7 @@ describe Chef::FileAccessControl do end it "does not set the file's mode when the current modes are correct" do - #@fac.stub!(:stat).and_return(OpenStruct.new(:mode => 0100400)) + #@fac.stub(:stat).and_return(OpenStruct.new(:mode => 0100400)) @current_resource.mode("0400") File.should_not_receive(:chmod) @fac.set_mode @@ -288,7 +288,7 @@ describe Chef::FileAccessControl do end it "sets all access controls on a file" do - @fac.stub!(:stat).and_return(OpenStruct.new(:owner => 99, :group => 99, :mode => 0100444)) + @fac.stub(:stat).and_return(OpenStruct.new(:owner => 99, :group => 99, :mode => 0100444)) @resource.mode(0400) @resource.owner(0) @resource.group(0) diff --git a/spec/unit/file_cache_spec.rb b/spec/unit/file_cache_spec.rb index 7680852cb9..f57f11dcc2 100644 --- a/spec/unit/file_cache_spec.rb +++ b/spec/unit/file_cache_spec.rb @@ -44,7 +44,7 @@ describe Chef::FileCache do describe "when storing a file" do before do - File.stub!(:open).and_yield(@io) + File.stub(:open).and_yield(@io) end it "should print the contents to the file" do diff --git a/spec/unit/file_content_management/deploy/mv_unix_spec.rb b/spec/unit/file_content_management/deploy/mv_unix_spec.rb index 2be0abe7bb..0e8662b8ec 100644 --- a/spec/unit/file_content_management/deploy/mv_unix_spec.rb +++ b/spec/unit/file_content_management/deploy/mv_unix_spec.rb @@ -37,7 +37,7 @@ describe Chef::FileContentManagement::Deploy::MvUnix do let(:target_file_mode) { 0644 } let(:target_file_stat) do - mock "File::Stat struct for target file", + double "File::Stat struct for target file", :mode => target_file_mode, :uid => target_file_uid, :gid => target_file_gid diff --git a/spec/unit/file_content_management/deploy/mv_windows_spec.rb b/spec/unit/file_content_management/deploy/mv_windows_spec.rb index 0a0b1f899a..7c2a2d7e71 100644 --- a/spec/unit/file_content_management/deploy/mv_windows_spec.rb +++ b/spec/unit/file_content_management/deploy/mv_windows_spec.rb @@ -51,11 +51,11 @@ describe Chef::FileContentManagement::Deploy::MvWindows do let(:staging_file_path) { "/tmp/random-dir/staging-file.tmp" } let(:target_file_security_object) do - mock "Securable Object for target file" + double "Securable Object for target file" end let(:updated_target_security_object) do - mock "Securable Object for target file after staging file deploy" + double "Securable Object for target file after staging file deploy" end before do @@ -79,17 +79,17 @@ describe Chef::FileContentManagement::Deploy::MvWindows do context "when run with administrator privileges" do - let(:original_target_file_owner) { mock("original target file owner") } - let(:original_target_file_group) { mock("original target file group") } + let(:original_target_file_owner) { double("original target file owner") } + let(:original_target_file_group) { double("original target file group") } let(:target_file_security_descriptor) do - mock "security descriptor for target file", + double "security descriptor for target file", :group => original_target_file_group, :owner => original_target_file_owner end let(:updated_target_security_descriptor) do - mock "security descriptor for target file" + double "security descriptor for target file" end @@ -116,17 +116,17 @@ describe Chef::FileContentManagement::Deploy::MvWindows do end context "and the target has a dacl and sacl" do - let(:inherited_dacl_ace) { mock("Windows dacl ace (inherited)", :inherited? => true) } - let(:not_inherited_dacl_ace) { mock("Windows dacl ace (not inherited)", :inherited? => false) } + let(:inherited_dacl_ace) { double("Windows dacl ace (inherited)", :inherited? => true) } + let(:not_inherited_dacl_ace) { double("Windows dacl ace (not inherited)", :inherited? => false) } let(:original_target_file_dacl) { [inherited_dacl_ace, not_inherited_dacl_ace] } - let(:inherited_sacl_ace) { mock("Windows sacl ace (inherited)", :inherited? => true) } - let(:not_inherited_sacl_ace) { mock("Windows sacl ace (not inherited)", :inherited? => false) } + let(:inherited_sacl_ace) { double("Windows sacl ace (inherited)", :inherited? => true) } + let(:not_inherited_sacl_ace) { double("Windows sacl ace (not inherited)", :inherited? => false) } let(:original_target_file_sacl) { [inherited_sacl_ace, not_inherited_sacl_ace] } - let(:custom_dacl) { mock("Windows ACL for non-inherited dacl aces") } - let(:custom_sacl) { mock("Windows ACL for non-inherited sacl aces") } + let(:custom_dacl) { double("Windows ACL for non-inherited dacl aces") } + let(:custom_sacl) { double("Windows ACL for non-inherited sacl aces") } before do target_file_security_descriptor.stub(:dacl_present?).and_return(true) diff --git a/spec/unit/formatters/error_inspectors/compile_error_inspector_spec.rb b/spec/unit/formatters/error_inspectors/compile_error_inspector_spec.rb index 0b20b0ef86..bea7eeed21 100644 --- a/spec/unit/formatters/error_inspectors/compile_error_inspector_spec.rb +++ b/spec/unit/formatters/error_inspectors/compile_error_inspector_spec.rb @@ -51,7 +51,7 @@ describe Chef::Formatters::ErrorInspectors::CompileErrorInspector do # Error inspector originally used file_cache_path which is incorrect on # chef-solo. Using cookbook_path should do the right thing for client and # solo. - Chef::Config.stub!(:cookbook_path).and_return([ "/home/someuser/dev-laptop/cookbooks" ]) + Chef::Config.stub(:cookbook_path).and_return([ "/home/someuser/dev-laptop/cookbooks" ]) @trace = [ "/home/someuser/dev-laptop/cookbooks/syntax-err/recipes/default.rb:14:in `from_file'", "/home/someuser/dev-laptop/cookbooks/syntax-err/recipes/default.rb:11:in `from_file'", @@ -71,7 +71,7 @@ describe Chef::Formatters::ErrorInspectors::CompileErrorInspector do describe "when explaining an error in the compile phase" do before do - Chef::Config.stub!(:cookbook_path).and_return([ "/var/chef/cache/cookbooks" ]) + Chef::Config.stub(:cookbook_path).and_return([ "/var/chef/cache/cookbooks" ]) recipe_lines = BAD_RECIPE.split("\n").map {|l| l << "\n" } IO.should_receive(:readlines).with("/var/chef/cache/cookbooks/syntax-err/recipes/default.rb").and_return(recipe_lines) @trace = [ @@ -96,7 +96,7 @@ describe Chef::Formatters::ErrorInspectors::CompileErrorInspector do describe "when explaining an error on windows" do before do - Chef::Config.stub!(:cookbook_path).and_return([ "C:/opscode/chef/var/cache/cookbooks" ]) + Chef::Config.stub(:cookbook_path).and_return([ "C:/opscode/chef/var/cache/cookbooks" ]) recipe_lines = BAD_RECIPE.split("\n").map {|l| l << "\n" } IO.should_receive(:readlines).at_least(1).times.with(/:\/opscode\/chef\/var\/cache\/cookbooks\/foo\/recipes\/default.rb/).and_return(recipe_lines) @trace = [ @@ -154,7 +154,7 @@ describe Chef::Formatters::ErrorInspectors::CompileErrorInspector do describe "when explaining an error on windows, and the backtrace lowercases the drive letter" do before do - Chef::Config.stub!(:cookbook_path).and_return([ "C:/opscode/chef/var/cache/cookbooks" ]) + Chef::Config.stub(:cookbook_path).and_return([ "C:/opscode/chef/var/cache/cookbooks" ]) recipe_lines = BAD_RECIPE.split("\n").map {|l| l << "\n" } IO.should_receive(:readlines).with("c:/opscode/chef/var/cache/cookbooks/foo/recipes/default.rb").and_return(recipe_lines) @trace = [ diff --git a/spec/unit/formatters/error_inspectors/cookbook_resolve_error_inspector_spec.rb b/spec/unit/formatters/error_inspectors/cookbook_resolve_error_inspector_spec.rb index 93129eadb8..c573dc016b 100644 --- a/spec/unit/formatters/error_inspectors/cookbook_resolve_error_inspector_spec.rb +++ b/spec/unit/formatters/error_inspectors/cookbook_resolve_error_inspector_spec.rb @@ -34,7 +34,7 @@ describe Chef::Formatters::ErrorInspectors::CookbookResolveErrorInspector do @response_body = %Q({"error": [{"message": "gtfo"}]) @response = Net::HTTPForbidden.new("1.1", "403", "(response) forbidden") - @response.stub!(:body).and_return(@response_body) + @response.stub(:body).and_return(@response_body) @exception = Net::HTTPServerException.new("(exception) forbidden", @response) @inspector = Chef::Formatters::ErrorInspectors::CookbookResolveErrorInspector.new(@expanded_run_list, @exception) @@ -55,7 +55,7 @@ describe Chef::Formatters::ErrorInspectors::CookbookResolveErrorInspector do @response_body = "{\"error\":[\"{\\\"non_existent_cookbooks\\\":[\\\"apache2\\\"],\\\"cookbooks_with_no_versions\\\":[\\\"users\\\"],\\\"message\\\":\\\"Run list contains invalid items: no such cookbook nope.\\\"}\"]}" @response = Net::HTTPPreconditionFailed.new("1.1", "412", "(response) unauthorized") - @response.stub!(:body).and_return(@response_body) + @response.stub(:body).and_return(@response_body) @exception = Net::HTTPServerException.new("(exception) precondition failed", @response) @inspector = Chef::Formatters::ErrorInspectors::CookbookResolveErrorInspector.new(@expanded_run_list, @exception) @@ -83,7 +83,7 @@ describe Chef::Formatters::ErrorInspectors::CookbookResolveErrorInspector do @response_body = "{\"error\":[{\"non_existent_cookbooks\":[],\"cookbooks_with_no_versions\":[],\"message\":\"unable to solve dependencies in alotted time.\"}]}" @response = Net::HTTPPreconditionFailed.new("1.1", "412", "(response) unauthorized") - @response.stub!(:body).and_return(@response_body) + @response.stub(:body).and_return(@response_body) @exception = Net::HTTPServerException.new("(exception) precondition failed", @response) @inspector = Chef::Formatters::ErrorInspectors::CookbookResolveErrorInspector.new(@expanded_run_list, @exception) @@ -106,7 +106,7 @@ describe Chef::Formatters::ErrorInspectors::CookbookResolveErrorInspector do @response_body = "{\"error\":[{\"non_existent_cookbooks\":[\"apache2\"],\"cookbooks_with_no_versions\":[\"users\"],\"message\":\"Run list contains invalid items: no such cookbook nope.\"}]}" @response = Net::HTTPPreconditionFailed.new("1.1", "412", "(response) unauthorized") - @response.stub!(:body).and_return(@response_body) + @response.stub(:body).and_return(@response_body) @exception = Net::HTTPServerException.new("(exception) precondition failed", @response) @inspector = Chef::Formatters::ErrorInspectors::CookbookResolveErrorInspector.new(@expanded_run_list, @exception) diff --git a/spec/unit/formatters/error_inspectors/cookbook_sync_error_inspector_spec.rb b/spec/unit/formatters/error_inspectors/cookbook_sync_error_inspector_spec.rb index eb8d302e5b..e586f5e3b3 100644 --- a/spec/unit/formatters/error_inspectors/cookbook_sync_error_inspector_spec.rb +++ b/spec/unit/formatters/error_inspectors/cookbook_sync_error_inspector_spec.rb @@ -29,7 +29,7 @@ describe Chef::Formatters::ErrorInspectors::CookbookSyncErrorInspector do before do @response_body = "sad trombone orchestra" @response = Net::HTTPBadGateway.new("1.1", "502", "(response) bad gateway") - @response.stub!(:body).and_return(@response_body) + @response.stub(:body).and_return(@response_body) @exception = Net::HTTPFatalError.new("(exception) bad gateway", @response) @inspector = described_class.new({}, @exception) @inspector.add_explanation(@description) diff --git a/spec/unit/formatters/error_inspectors/resource_failure_inspector_spec.rb b/spec/unit/formatters/error_inspectors/resource_failure_inspector_spec.rb index fdbb601005..8cafbcc9d6 100644 --- a/spec/unit/formatters/error_inspectors/resource_failure_inspector_spec.rb +++ b/spec/unit/formatters/error_inspectors/resource_failure_inspector_spec.rb @@ -32,18 +32,21 @@ describe Chef::Formatters::ErrorInspectors::ResourceFailureInspector do "rspec-example" end + def recipe_name + "rspec-example-recipe" + end + before do @description = Chef::Formatters::ErrorDescription.new("Error Converging Resource:") @stdout = StringIO.new @outputter = Chef::Formatters::Outputter.new(@stdout, STDERR) #@outputter = Chef::Formatters::Outputter.new(STDOUT, STDERR) - Chef::Config.stub!(:cookbook_path).and_return([ "/var/chef/cache" ]) + Chef::Config.stub(:cookbook_path).and_return([ "/var/chef/cache" ]) end describe "when explaining an error converging a resource" do before do - source_line = caller(0)[0] @resource = package("non-existing-package") do only_if do @@ -112,8 +115,8 @@ describe Chef::Formatters::ErrorInspectors::ResourceFailureInspector do before do # fake code to run through #recipe_snippet source_file = [ "if true", "var = non_existant", "end" ] - IO.stub!(:readlines).and_return(source_file) - File.stub!(:exists?).and_return(true) + IO.stub(:readlines).and_return(source_file) + File.stub(:exists?).and_return(true) end it "parses a Windows path" do @@ -132,8 +135,8 @@ describe Chef::Formatters::ErrorInspectors::ResourceFailureInspector do context "when the recipe file does not exist" do before do - File.stub!(:exists?).and_return(false) - IO.stub!(:readlines).and_raise(Errno::ENOENT) + File.stub(:exists?).and_return(false) + IO.stub(:readlines).and_raise(Errno::ENOENT) end it "does not try to parse a recipe in chef-shell/irb (CHEF-3411)" do @@ -172,7 +175,7 @@ describe Chef::Formatters::ErrorInspectors::ResourceFailureInspector do end it "does not generate an error" do - lambda { @inspector.add_explanation(@description) }.should_not raise_error(TypeError) + lambda { @inspector.add_explanation(@description) }.should_not raise_error @description.display(@outputter) end end diff --git a/spec/unit/formatters/error_inspectors/run_list_expansion_error_inspector_spec.rb b/spec/unit/formatters/error_inspectors/run_list_expansion_error_inspector_spec.rb index 706ff59c06..56a6eceec3 100644 --- a/spec/unit/formatters/error_inspectors/run_list_expansion_error_inspector_spec.rb +++ b/spec/unit/formatters/error_inspectors/run_list_expansion_error_inspector_spec.rb @@ -55,10 +55,10 @@ describe Chef::Formatters::ErrorInspectors::RunListExpansionErrorInspector do @response_body = "forbidden" @response = Net::HTTPForbidden.new("1.1", "403", "(response) forbidden") - @response.stub!(:body).and_return(@response_body) + @response.stub(:body).and_return(@response_body) @exception = Net::HTTPServerException.new("(exception) forbidden", @response) @inspector = Chef::Formatters::ErrorInspectors::RunListExpansionErrorInspector.new(@node, @exception) - @inspector.stub!(:config).and_return(:node_name => "unit-test.example.com") + @inspector.stub(:config).and_return(:node_name => "unit-test.example.com") @inspector.add_explanation(@description) end @@ -73,11 +73,11 @@ describe Chef::Formatters::ErrorInspectors::RunListExpansionErrorInspector do before do @response_body = "check your key and node name" @response = Net::HTTPUnauthorized.new("1.1", "401", "(response) unauthorized") - @response.stub!(:body).and_return(@response_body) + @response.stub(:body).and_return(@response_body) @exception = Net::HTTPServerException.new("(exception) unauthorized", @response) @inspector = Chef::Formatters::ErrorInspectors::RunListExpansionErrorInspector.new(@node, @exception) - @inspector.stub!(:config).and_return(:node_name => "unit-test.example.com", + @inspector.stub(:config).and_return(:node_name => "unit-test.example.com", :client_key => "/etc/chef/client.pem", :chef_server_url => "http://chef.example.com") diff --git a/spec/unit/handler/json_file_spec.rb b/spec/unit/handler/json_file_spec.rb index 1f47c40937..05270e4731 100644 --- a/spec/unit/handler/json_file_spec.rb +++ b/spec/unit/handler/json_file_spec.rb @@ -46,7 +46,7 @@ describe Chef::Handler::JsonFile do @run_status.run_context = @run_context @run_status.exception = Exception.new("Boy howdy!") @file_mock = StringIO.new - File.stub!(:open).and_yield(@file_mock) + File.stub(:open).and_yield(@file_mock) end diff --git a/spec/unit/handler_spec.rb b/spec/unit/handler_spec.rb index eab98e76a2..80d9df5e82 100644 --- a/spec/unit/handler_spec.rb +++ b/spec/unit/handler_spec.rb @@ -42,7 +42,7 @@ describe Chef::Handler do @run_status.run_context = @run_context @start_time = Time.now @end_time = @start_time + 4.2 - Time.stub!(:now).and_return(@start_time, @end_time) + Time.stub(:now).and_return(@start_time, @end_time) @run_status.start_clock @run_status.stop_clock end @@ -124,7 +124,7 @@ describe Chef::Handler do @run_status.run_context = @run_context @start_time = Time.now @end_time = @start_time + 4.2 - Time.stub!(:now).and_return(@start_time, @end_time) + Time.stub(:now).and_return(@start_time, @end_time) @run_status.start_clock @run_status.stop_clock end @@ -171,7 +171,7 @@ describe Chef::Handler do describe "when running a start handler" do before do @start_time = Time.now - Time.stub!(:now).and_return(@start_time) + Time.stub(:now).and_return(@start_time) @run_status.start_clock end diff --git a/spec/unit/http_spec.rb b/spec/unit/http_spec.rb new file mode 100644 index 0000000000..d747482260 --- /dev/null +++ b/spec/unit/http_spec.rb @@ -0,0 +1,48 @@ +# +# Author:: Xabier de Zuazo (xabier@onddo.com) +# Copyright:: Copyright (c) 2014 Onddo Labs, SL. +# License:: Apache License, Version 2.0 +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +require 'spec_helper' + +require 'chef/http' +require 'chef/http/basic_client' + +describe Chef::HTTP do + + describe "head" do + + it 'should return nil for a "200 Success" response (CHEF-4762)' do + resp = Net::HTTPOK.new("1.1", 200, "OK") + resp.should_receive(:read_body).and_return(nil) + http = Chef::HTTP.new("") + Chef::HTTP::BasicClient.any_instance.should_receive(:request).and_return(["request", resp]) + + http.head("http://www.getchef.com/").should eql(nil) + end + + it 'should return false for a "304 Not Modified" response (CHEF-4762)' do + resp = Net::HTTPNotModified.new("1.1", 304, "Not Modified") + resp.should_receive(:read_body).and_return(nil) + http = Chef::HTTP.new("") + Chef::HTTP::BasicClient.any_instance.should_receive(:request).and_return(["request", resp]) + + http.head("http://www.getchef.com/").should eql(false) + end + + end # head + +end diff --git a/spec/unit/knife/bootstrap_spec.rb b/spec/unit/knife/bootstrap_spec.rb index cc0336d8f6..b055cadcee 100644 --- a/spec/unit/knife/bootstrap_spec.rb +++ b/spec/unit/knife/bootstrap_spec.rb @@ -29,9 +29,9 @@ describe Chef::Knife::Bootstrap do @knife.merge_configs @knife.config[:template_file] = File.expand_path(File.join(CHEF_SPEC_DATA, "bootstrap", "test.erb")) @stdout = StringIO.new - @knife.ui.stub!(:stdout).and_return(@stdout) + @knife.ui.stub(:stdout).and_return(@stdout) @stderr = StringIO.new - @knife.ui.stub!(:stderr).and_return(@stderr) + @knife.ui.stub(:stderr).and_return(@stderr) end it "should return a name of default bootstrap template" do @@ -47,8 +47,8 @@ describe Chef::Knife::Bootstrap do it "should look for templates early in the run" do File.stub(:exists?).and_return(true) @knife.name_args = ['shatner'] - @knife.stub!(:read_template).and_return("") - @knife.stub!(:knife_ssh).and_return(true) + @knife.stub(:read_template).and_return("") + @knife.stub(:knife_ssh).and_return(true) @knife_ssh = @knife.knife_ssh @knife.should_receive(:find_template).ordered @knife.should_receive(:knife_ssh).ordered @@ -110,10 +110,10 @@ describe Chef::Knife::Bootstrap do it "should populate a hint file with JSON when given a file to read" do @knife.stub(:find_template).and_return(true) @knife.config[:template_file] = File.expand_path(File.join(CHEF_SPEC_DATA, "bootstrap", "test-hints.erb")) - ::File.stub!(:read).and_return('{ "foo" : "bar" }') + ::File.stub(:read).and_return('{ "foo" : "bar" }') @knife.instance_variable_set("@template_file", @knife.config[:template_file]) template_string = @knife.read_template - @knife.stub!(:read_template).and_return('{ "foo" : "bar" }') + @knife.stub(:read_template).and_return('{ "foo" : "bar" }') @knife.parse_options(["--hint", "openstack=hints/openstack.json"]) @knife.render_template(template_string).should match /\{\"foo\":\"bar\"\}/ end @@ -214,7 +214,7 @@ describe Chef::Knife::Bootstrap do Chef::Config[:knife][:ssh_port] = nil @knife.config[:forward_agent] = true @knife.config[:identity_file] = "~/.ssh/me.rsa" - @knife.stub!(:read_template).and_return("") + @knife.stub(:read_template).and_return("") @knife_ssh = @knife.knife_ssh end @@ -282,7 +282,7 @@ describe Chef::Knife::Bootstrap do Chef::Config[:knife][:identity_file] = "~/.ssh/you.rsa" Chef::Config[:knife][:ssh_gateway] = "towel.blinkenlights.nl" Chef::Config[:knife][:host_key_verify] = true - @knife.stub!(:read_template).and_return("") + @knife.stub(:read_template).and_return("") @knife_ssh = @knife.knife_ssh end @@ -316,20 +316,20 @@ describe Chef::Knife::Bootstrap do @knife.name_args = ["foo.example.com"] @knife.config[:ssh_user] = "rooty" @knife.config[:identity_file] = "~/.ssh/me.rsa" - @knife.stub!(:read_template).and_return("") + @knife.stub(:read_template).and_return("") @knife_ssh = @knife.knife_ssh end it "prompts the user for a password " do - @knife.stub!(:knife_ssh).and_return(@knife_ssh) - @knife_ssh.stub!(:get_password).and_return('typed_in_password') + @knife.stub(:knife_ssh).and_return(@knife_ssh) + @knife_ssh.stub(:get_password).and_return('typed_in_password') alternate_knife_ssh = @knife.knife_ssh_with_password_auth alternate_knife_ssh.config[:ssh_password].should == 'typed_in_password' end it "configures knife not to use the identity file that didn't work previously" do - @knife.stub!(:knife_ssh).and_return(@knife_ssh) - @knife_ssh.stub!(:get_password).and_return('typed_in_password') + @knife.stub(:knife_ssh).and_return(@knife_ssh) + @knife_ssh.stub(:get_password).and_return('typed_in_password') alternate_knife_ssh = @knife.knife_ssh_with_password_auth alternate_knife_ssh.config[:identity_file].should be_nil end @@ -341,9 +341,9 @@ describe Chef::Knife::Bootstrap do @knife.name_args = ["foo.example.com"] @knife.config[:ssh_user] = "rooty" @knife.config[:identity_file] = "~/.ssh/me.rsa" - @knife.stub!(:read_template).and_return("") + @knife.stub(:read_template).and_return("") @knife_ssh = @knife.knife_ssh - @knife.stub!(:knife_ssh).and_return(@knife_ssh) + @knife.stub(:knife_ssh).and_return(@knife_ssh) end it "verifies that a server to bootstrap was given as a command line arg" do @@ -358,11 +358,11 @@ describe Chef::Knife::Bootstrap do end it "falls back to password based auth when auth fails the first time" do - @knife.stub!(:puts) + @knife.stub(:puts) @fallback_knife_ssh = @knife_ssh.dup @knife_ssh.should_receive(:run).and_raise(Net::SSH::AuthenticationFailed.new("no ssh for you")) - @knife.stub!(:knife_ssh_with_password_auth).and_return(@fallback_knife_ssh) + @knife.stub(:knife_ssh_with_password_auth).and_return(@fallback_knife_ssh) @fallback_knife_ssh.should_receive(:run) @knife.run end diff --git a/spec/unit/knife/client_bulk_delete_spec.rb b/spec/unit/knife/client_bulk_delete_spec.rb index b7864ed098..bedd4911c5 100644 --- a/spec/unit/knife/client_bulk_delete_spec.rb +++ b/spec/unit/knife/client_bulk_delete_spec.rb @@ -26,16 +26,16 @@ describe Chef::Knife::ClientBulkDelete do @knife = Chef::Knife::ClientBulkDelete.new @knife.name_args = ["."] @stdout = StringIO.new - @knife.ui.stub!(:stdout).and_return(@stdout) - @knife.ui.stub!(:confirm).and_return(true) + @knife.ui.stub(:stdout).and_return(@stdout) + @knife.ui.stub(:confirm).and_return(true) @clients = Hash.new %w{tim dan stephen}.each do |client_name| client = Chef::ApiClient.new() client.name(client_name) - client.stub!(:destroy).and_return(true) + client.stub(:destroy).and_return(true) @clients[client_name] = client end - Chef::ApiClient.stub!(:list).and_return(@clients) + Chef::ApiClient.stub(:list).and_return(@clients) end describe "run" do diff --git a/spec/unit/knife/client_create_spec.rb b/spec/unit/knife/client_create_spec.rb index d07b6ceb17..897cee8974 100644 --- a/spec/unit/knife/client_create_spec.rb +++ b/spec/unit/knife/client_create_spec.rb @@ -25,16 +25,18 @@ describe Chef::Knife::ClientCreate do Chef::Config[:node_name] = "webmonkey.example.com" @knife = Chef::Knife::ClientCreate.new @knife.config = { - :file => nil + :file => nil, + :admin => false, + :validator => false } @knife.name_args = [ "adam" ] @client = Chef::ApiClient.new - @client.stub!(:save).and_return({ 'private_key' => '' }) - @knife.stub!(:edit_data).and_return(@client) - @knife.stub!(:puts) - Chef::ApiClient.stub!(:new).and_return(@client) + @client.stub(:save).and_return({ 'private_key' => '' }) + @knife.stub(:edit_data).and_return(@client) + @knife.stub(:puts) + Chef::ApiClient.stub(:new).and_return(@client) @stdout = StringIO.new - @knife.ui.stub!(:stdout).and_return(@stdout) + @knife.ui.stub(:stdout).and_return(@stdout) end describe "run" do @@ -49,6 +51,16 @@ describe Chef::Knife::ClientCreate do @knife.run end + it "by default it is not an admin" do + @client.should_receive(:admin).with(false) + @knife.run + end + + it "by default it is not a validator" do + @client.should_receive(:validator).with(false) + @knife.run + end + it "should allow you to edit the data" do @knife.should_receive(:edit_data).with(@client) @knife.run @@ -62,13 +74,29 @@ describe Chef::Knife::ClientCreate do describe "with -f or --file" do it "should write the private key to a file" do @knife.config[:file] = "/tmp/monkeypants" - @client.stub!(:save).and_return({ 'private_key' => "woot" }) - filehandle = mock("Filehandle") + @client.stub(:save).and_return({ 'private_key' => "woot" }) + filehandle = double("Filehandle") filehandle.should_receive(:print).with('woot') File.should_receive(:open).with("/tmp/monkeypants", "w").and_yield(filehandle) @knife.run end end + describe "with -a or --admin" do + it "should create an admin client" do + @knife.config[:admin] = true + @client.should_receive(:admin).with(true) + @knife.run + end + end + + describe "with --validator" do + it "should create an validator client" do + @knife.config[:validator] = true + @client.should_receive(:validator).with(true) + @knife.run + end + end + end end diff --git a/spec/unit/knife/client_delete_spec.rb b/spec/unit/knife/client_delete_spec.rb index 9ebccbae15..a7ec14ce83 100644 --- a/spec/unit/knife/client_delete_spec.rb +++ b/spec/unit/knife/client_delete_spec.rb @@ -21,12 +21,16 @@ require 'spec_helper' describe Chef::Knife::ClientDelete do before(:each) do @knife = Chef::Knife::ClientDelete.new + # defaults + @knife.config = { + :force => false + } @knife.name_args = [ 'adam' ] end describe 'run' do it 'should delete the client' do - @knife.should_receive(:delete_object).with(Chef::ApiClient, 'adam') + @knife.should_receive(:delete_object).with(Chef::ApiClient, 'adam', 'client') @knife.run end @@ -37,4 +41,43 @@ describe Chef::Knife::ClientDelete do lambda { @knife.run }.should raise_error(SystemExit) end end + + describe 'with a validator' do + before(:each) do + Chef::Knife::UI.stub(:confirm).and_return(true) + @knife.stub(:confirm).and_return(true) + @client = Chef::ApiClient.new + Chef::ApiClient.should_receive(:load).and_return(@client) + end + + it 'should delete non-validator client if --force is not set' do + @knife.config[:force] = false + @client.should_receive(:destroy).and_return(@client) + @knife.should_receive(:msg) + + @knife.run + end + + it 'should delete non-validator client if --force is set' do + @knife.config[:force] = true + @client.should_receive(:destroy).and_return(@client) + @knife.should_receive(:msg) + + @knife.run + end + + it 'should not delete validator client if --force is not set' do + @client.validator(true) + @knife.ui.should_receive(:fatal) + lambda { @knife.run}.should raise_error(SystemExit) + end + + it 'should delete validator client if --force is set' do + @knife.config[:force] = true + @client.should_receive(:destroy).and_return(@client) + @knife.should_receive(:msg) + + @knife.run + end + end end diff --git a/spec/unit/knife/client_reregister_spec.rb b/spec/unit/knife/client_reregister_spec.rb index d84978c497..daf18d5d25 100644 --- a/spec/unit/knife/client_reregister_spec.rb +++ b/spec/unit/knife/client_reregister_spec.rb @@ -22,9 +22,9 @@ describe Chef::Knife::ClientReregister do before(:each) do @knife = Chef::Knife::ClientReregister.new @knife.name_args = [ 'adam' ] - @client_mock = mock('client_mock', :private_key => "foo_key") + @client_mock = double('client_mock', :private_key => "foo_key") @stdout = StringIO.new - @knife.ui.stub!(:stdout).and_return(@stdout) + @knife.ui.stub(:stdout).and_return(@stdout) end context "when no client name is given on the command line" do diff --git a/spec/unit/knife/client_show_spec.rb b/spec/unit/knife/client_show_spec.rb index ce5f93ab5f..b5c95db097 100644 --- a/spec/unit/knife/client_show_spec.rb +++ b/spec/unit/knife/client_show_spec.rb @@ -22,7 +22,7 @@ describe Chef::Knife::ClientShow do before(:each) do @knife = Chef::Knife::ClientShow.new @knife.name_args = [ 'adam' ] - @client_mock = mock('client_mock') + @client_mock = double('client_mock') end describe 'run' do diff --git a/spec/unit/knife/config_file_selection_spec.rb b/spec/unit/knife/config_file_selection_spec.rb index 127e89be9b..0a623714d7 100644 --- a/spec/unit/knife/config_file_selection_spec.rb +++ b/spec/unit/knife/config_file_selection_spec.rb @@ -45,7 +45,7 @@ describe Chef::Knife do end before :each do - Chef::Config.stub!(:from_file).and_return(true) + Chef::Config.stub(:from_file).and_return(true) Chef::ConfigFetcher.stub(:new).and_return(missing_config_fetcher) end @@ -72,7 +72,7 @@ describe Chef::Knife do upward_dir = File.expand_path "#{Dir.pwd}/.chef" upward_config = File.expand_path "#{upward_dir}/knife.rb" have_config_file(upward_config) - Chef::Knife.stub!(:chef_config_dir).and_return(upward_dir) + Chef::Knife.stub(:chef_config_dir).and_return(upward_dir) @knife = Chef::Knife.new @knife.configure_chef @@ -89,7 +89,7 @@ describe Chef::Knife do end it "configure knife from nothing" do - ::File.stub!(:exist?).and_return(false) + ::File.stub(:exist?).and_return(false) @knife = Chef::Knife.new @knife.ui.should_receive(:warn).with("No knife configuration file found") @knife.configure_chef @@ -104,7 +104,7 @@ describe Chef::Knife do home_config = File.expand_path(File.join("#{ENV['HOME']}", "/.chef/knife.rb")) configs = [ env_config, pwd_config, upward_config, home_config ] - Chef::Knife.stub!(:chef_config_dir).and_return(upward_dir) + Chef::Knife.stub(:chef_config_dir).and_return(upward_dir) ENV['KNIFE_HOME'] = Dir.tmpdir @knife = Chef::Knife.new diff --git a/spec/unit/knife/configure_client_spec.rb b/spec/unit/knife/configure_client_spec.rb index ba832103bc..d101780317 100644 --- a/spec/unit/knife/configure_client_spec.rb +++ b/spec/unit/knife/configure_client_spec.rb @@ -26,7 +26,7 @@ describe Chef::Knife::ConfigureClient do Chef::Config[:validation_key] = '/etc/chef/validation.pem' @stdout = StringIO.new - @knife.ui.stub!(:stdout).and_return(@stdout) + @knife.ui.stub(:stdout).and_return(@stdout) end describe 'run' do @@ -56,7 +56,7 @@ describe Chef::Knife::ConfigureClient do end it 'should write out the config file' do - FileUtils.stub!(:mkdir_p) + FileUtils.stub(:mkdir_p) @knife.run @client_file.string.should match /log_level\s+\:info/ @client_file.string.should match /log_location\s+STDOUT/ @@ -65,13 +65,13 @@ describe Chef::Knife::ConfigureClient do end it 'should write out the validation.pem file' do - FileUtils.stub!(:mkdir_p) + FileUtils.stub(:mkdir_p) @knife.run @validation_file.string.should match /foo_bar_baz/ end it 'should print information on what is being configured' do - FileUtils.stub!(:mkdir_p) + FileUtils.stub(:mkdir_p) @knife.run @stdout.string.should match /creating client configuration/i @stdout.string.should match /writing client\.rb/i diff --git a/spec/unit/knife/configure_spec.rb b/spec/unit/knife/configure_spec.rb index 7c48be6727..eab42fadd5 100644 --- a/spec/unit/knife/configure_spec.rb +++ b/spec/unit/knife/configure_spec.rb @@ -6,20 +6,20 @@ describe Chef::Knife::Configure do Chef::Config[:node_name] = "webmonkey.example.com" @knife = Chef::Knife::Configure.new - @rest_client = mock("null rest client", :post_rest => { :result => :true }) - @knife.stub!(:rest).and_return(@rest_client) + @rest_client = double("null rest client", :post_rest => { :result => :true }) + @knife.stub(:rest).and_return(@rest_client) @out = StringIO.new - @knife.ui.stub!(:stdout).and_return(@out) + @knife.ui.stub(:stdout).and_return(@out) @knife.config[:config_file] = '/home/you/.chef/knife.rb' @in = StringIO.new("\n" * 7) - @knife.ui.stub!(:stdin).and_return(@in) + @knife.ui.stub(:stdin).and_return(@in) @err = StringIO.new - @knife.ui.stub!(:stderr).and_return(@err) + @knife.ui.stub(:stderr).and_return(@err) - Ohai::System.stub!(:new).and_return(ohai) + Ohai::System.stub(:new).and_return(ohai) end @@ -49,7 +49,7 @@ describe Chef::Knife::Configure do it "asks the user for the clientname they want for the new client if -i is specified" do @knife.config[:initial] = true - Etc.stub!(:getlogin).and_return("a-new-user") + Etc.stub(:getlogin).and_return("a-new-user") @knife.ask_user_for_config @out.string.should match(Regexp.escape("Please enter a name for the new user: [a-new-user]")) @knife.new_client_name.should == Etc.getlogin @@ -58,14 +58,14 @@ describe Chef::Knife::Configure do it "should not ask the user for the clientname they want for the new client if -i and --node_name are specified" do @knife.config[:initial] = true @knife.config[:node_name] = 'testnode' - Etc.stub!(:getlogin).and_return("a-new-user") + Etc.stub(:getlogin).and_return("a-new-user") @knife.ask_user_for_config @out.string.should_not match(Regexp.escape("Please enter a name for the new user")) @knife.new_client_name.should == 'testnode' end it "asks the user for the existing API username or clientname if -i is not specified" do - Etc.stub!(:getlogin).and_return("a-new-user") + Etc.stub(:getlogin).and_return("a-new-user") @knife.ask_user_for_config @out.string.should match(Regexp.escape("Please enter an existing username or clientname for the API: [a-new-user]")) @knife.new_client_name.should == Etc.getlogin @@ -175,7 +175,7 @@ describe Chef::Knife::Configure do @knife.config[:validation_key] = '/home/you/.chef/my-validation.pem' @knife.config[:repository] = '' @knife.config[:client_key] = '/home/you/a-new-user.pem' - Etc.stub!(:getlogin).and_return('a-new-user') + Etc.stub(:getlogin).and_return('a-new-user') @knife.ask_user_for_config @out.string.should match(/\s*/) @@ -197,10 +197,10 @@ describe Chef::Knife::Configure do end it "writes the new data to a config file" do - File.stub!(:expand_path).with("/home/you/.chef/knife.rb").and_return("/home/you/.chef/knife.rb") - File.stub!(:expand_path).with("/home/you/.chef/#{Etc.getlogin}.pem").and_return("/home/you/.chef/#{Etc.getlogin}.pem") - File.stub!(:expand_path).with(default_validator_key).and_return(default_validator_key) - File.stub!(:expand_path).with(default_admin_key).and_return(default_admin_key) + File.stub(:expand_path).with("/home/you/.chef/knife.rb").and_return("/home/you/.chef/knife.rb") + File.stub(:expand_path).with("/home/you/.chef/#{Etc.getlogin}.pem").and_return("/home/you/.chef/#{Etc.getlogin}.pem") + File.stub(:expand_path).with(default_validator_key).and_return(default_validator_key) + File.stub(:expand_path).with(default_admin_key).and_return(default_admin_key) FileUtils.should_receive(:mkdir_p).with("/home/you/.chef") config_file = StringIO.new ::File.should_receive(:open).with("/home/you/.chef/knife.rb", "w").and_yield config_file @@ -224,9 +224,9 @@ describe Chef::Knife::Configure do user_command = Chef::Knife::UserCreate.new user_command.should_receive(:run) - Etc.stub!(:getlogin).and_return("a-new-user") + Etc.stub(:getlogin).and_return("a-new-user") - Chef::Knife::UserCreate.stub!(:new).and_return(user_command) + Chef::Knife::UserCreate.stub(:new).and_return(user_command) FileUtils.should_receive(:mkdir_p).with("/home/you/.chef") ::File.should_receive(:open).with("/home/you/.chef/knife.rb", "w") @knife.config[:initial] = true diff --git a/spec/unit/knife/cookbook_bulk_delete_spec.rb b/spec/unit/knife/cookbook_bulk_delete_spec.rb index ced2a9a4e4..0cff690bc2 100644 --- a/spec/unit/knife/cookbook_bulk_delete_spec.rb +++ b/spec/unit/knife/cookbook_bulk_delete_spec.rb @@ -27,18 +27,18 @@ describe Chef::Knife::CookbookBulkDelete do @knife.config = {:print_after => nil} @knife.name_args = ["."] @stdout = StringIO.new - @knife.ui.stub!(:stdout).and_return(@stdout) - @knife.ui.stub!(:confirm).and_return(true) + @knife.ui.stub(:stdout).and_return(@stdout) + @knife.ui.stub(:confirm).and_return(true) @cookbooks = Hash.new %w{cheezburger pizza lasagna}.each do |cookbook_name| cookbook = Chef::CookbookVersion.new(cookbook_name) @cookbooks[cookbook_name] = cookbook end - @rest = mock("Chef::REST") - @rest.stub!(:get_rest).and_return(@cookbooks) - @rest.stub!(:delete_rest).and_return(true) - @knife.stub!(:rest).and_return(@rest) - Chef::CookbookVersion.stub!(:list).and_return(@cookbooks) + @rest = double("Chef::REST") + @rest.stub(:get_rest).and_return(@cookbooks) + @rest.stub(:delete_rest).and_return(true) + @knife.stub(:rest).and_return(@rest) + Chef::CookbookVersion.stub(:list).and_return(@cookbooks) end @@ -47,11 +47,11 @@ describe Chef::Knife::CookbookBulkDelete do describe "when there are several cookbooks on the server" do before do @cheezburger = {'cheezburger' => {"url" => "file:///dev/null", "versions" => [{"url" => "file:///dev/null-cheez", "version" => "1.0.0"}]}} - @rest.stub!(:get_rest).with('cookbooks/cheezburger').and_return(@cheezburger) + @rest.stub(:get_rest).with('cookbooks/cheezburger').and_return(@cheezburger) @pizza = {'pizza' => {"url" => "file:///dev/null", "versions" => [{"url" => "file:///dev/null-pizza", "version" => "2.0.0"}]}} - @rest.stub!(:get_rest).with('cookbooks/pizza').and_return(@pizza) + @rest.stub(:get_rest).with('cookbooks/pizza').and_return(@pizza) @lasagna = {'lasagna' => {"url" => "file:///dev/null", "versions" => [{"url" => "file:///dev/null-lasagna", "version" => "3.0.0"}]}} - @rest.stub!(:get_rest).with('cookbooks/lasagna').and_return(@lasagna) + @rest.stub(:get_rest).with('cookbooks/lasagna').and_return(@lasagna) end it "should print the cookbooks you are about to delete" do diff --git a/spec/unit/knife/cookbook_create_spec.rb b/spec/unit/knife/cookbook_create_spec.rb index 7891115285..06475d3ac9 100644 --- a/spec/unit/knife/cookbook_create_spec.rb +++ b/spec/unit/knife/cookbook_create_spec.rb @@ -26,7 +26,7 @@ describe Chef::Knife::CookbookCreate do @knife.config = {} @knife.name_args = ["foobar"] @stdout = StringIO.new - @knife.stub!(:stdout).and_return(@stdout) + @knife.stub(:stdout).and_return(@stdout) end describe "run" do @@ -35,10 +35,10 @@ describe Chef::Knife::CookbookCreate do it "should expand the path of the cookbook directory" do File.should_receive(:expand_path).with("~/tmp/monkeypants") @knife.config = {:cookbook_path => "~/tmp/monkeypants"} - @knife.stub!(:create_cookbook) - @knife.stub!(:create_readme) - @knife.stub!(:create_changelog) - @knife.stub!(:create_metadata) + @knife.stub(:create_cookbook) + @knife.stub(:create_readme) + @knife.stub(:create_changelog) + @knife.stub(:create_metadata) @knife.run end diff --git a/spec/unit/knife/cookbook_delete_spec.rb b/spec/unit/knife/cookbook_delete_spec.rb index afaa3b69a5..f4ba46f513 100644 --- a/spec/unit/knife/cookbook_delete_spec.rb +++ b/spec/unit/knife/cookbook_delete_spec.rb @@ -24,9 +24,9 @@ describe Chef::Knife::CookbookDelete do @knife.name_args = ['foobar'] @knife.cookbook_name = 'foobar' @stdout = StringIO.new - @knife.ui.stub!(:stdout).and_return(@stdout) + @knife.ui.stub(:stdout).and_return(@stdout) @stderr = StringIO.new - @knife.ui.stub!(:stderr).and_return(@stderr) + @knife.ui.stub(:stderr).and_return(@stderr) end describe 'run' do @@ -125,7 +125,7 @@ describe Chef::Knife::CookbookDelete do describe 'available_versions' do before(:each) do - @rest_mock = mock('rest') + @rest_mock = double('rest') @knife.should_receive(:rest).and_return(@rest_mock) @cookbook_data = { 'foobar' => { 'versions' => [{'version' => '1.0.0'}, {'version' => '1.1.0'}, @@ -163,7 +163,7 @@ describe Chef::Knife::CookbookDelete do describe 'ask_which_version_to_delete' do before(:each) do - @knife.stub!(:available_versions).and_return(['1.0.0', '1.1.0', '2.0.0']) + @knife.stub(:available_versions).and_return(['1.0.0', '1.1.0', '2.0.0']) end it 'should prompt the user to select a version' do @@ -202,7 +202,7 @@ describe Chef::Knife::CookbookDelete do end it 'should output that the cookbook was deleted' do - @knife.stub!(:delete_request) + @knife.stub(:delete_request) @knife.delete_version_without_confirmation('1.0.0') @stdout.string.should match /deleted cookbook\[foobar\]\[1.0.0\]/im end @@ -211,7 +211,7 @@ describe Chef::Knife::CookbookDelete do it 'should display the cookbook data' do object = '' @knife.config[:print_after] = true - @knife.stub!(:delete_request).and_return(object) + @knife.stub(:delete_request).and_return(object) @knife.should_receive(:format_for_display).with(object) @knife.delete_version_without_confirmation('1.0.0') end diff --git a/spec/unit/knife/cookbook_download_spec.rb b/spec/unit/knife/cookbook_download_spec.rb index cc3c300fdf..efab98f646 100644 --- a/spec/unit/knife/cookbook_download_spec.rb +++ b/spec/unit/knife/cookbook_download_spec.rb @@ -22,7 +22,7 @@ describe Chef::Knife::CookbookDownload do before(:each) do @knife = Chef::Knife::CookbookDownload.new @stdout = StringIO.new - @knife.ui.stub!(:stdout).and_return(@stdout) + @knife.ui.stub(:stdout).and_return(@stdout) end describe 'run' do @@ -44,7 +44,7 @@ describe Chef::Knife::CookbookDownload do before(:each) do @knife.name_args = ['foobar'] @knife.config[:download_directory] = '/var/tmp/chef' - @rest_mock = mock('rest') + @rest_mock = double('rest') @knife.stub(:rest).and_return(@rest_mock) @manifest_data = { @@ -66,18 +66,18 @@ describe Chef::Knife::CookbookDownload do ] } - @cookbook_mock = mock('cookbook') - @cookbook_mock.stub!(:version).and_return('1.0.0') - @cookbook_mock.stub!(:manifest).and_return(@manifest_data) + @cookbook_mock = double('cookbook') + @cookbook_mock.stub(:version).and_return('1.0.0') + @cookbook_mock.stub(:manifest).and_return(@manifest_data) @rest_mock.should_receive(:get_rest).with('cookbooks/foobar/1.0.0'). and_return(@cookbook_mock) end it 'should determine which version if one was not explicitly specified'do - @cookbook_mock.stub!(:manifest).and_return({}) + @cookbook_mock.stub(:manifest).and_return({}) @knife.should_receive(:determine_version).and_return('1.0.0') File.should_receive(:exists?).with('/var/tmp/chef/foobar-1.0.0').and_return(false) - Chef::CookbookVersion.stub!(:COOKBOOK_SEGEMENTS).and_return([]) + Chef::CookbookVersion.stub(:COOKBOOK_SEGEMENTS).and_return([]) @knife.run end @@ -87,8 +87,8 @@ describe Chef::Knife::CookbookDownload do @files = @manifest_data.values.map { |v| v.map { |i| i['path'] } }.flatten.uniq @files_mocks = {} @files.map { |f| File.basename(f) }.flatten.uniq.each do |f| - @files_mocks[f] = mock("#{f}_mock") - @files_mocks[f].stub!(:path).and_return("/var/tmp/#{f}") + @files_mocks[f] = double("#{f}_mock") + @files_mocks[f].stub(:path).and_return("/var/tmp/#{f}") end end @@ -207,7 +207,7 @@ describe Chef::Knife::CookbookDownload do describe 'ask_which_version' do before(:each) do @knife.cookbook_name = 'foobar' - @knife.stub!(:available_versions).and_return(['1.0.0', '1.1.0', '2.0.0']) + @knife.stub(:available_versions).and_return(['1.0.0', '1.1.0', '2.0.0']) end it 'should prompt the user to select a version' do diff --git a/spec/unit/knife/cookbook_list_spec.rb b/spec/unit/knife/cookbook_list_spec.rb index db6f061bd1..9ff16edb37 100644 --- a/spec/unit/knife/cookbook_list_spec.rb +++ b/spec/unit/knife/cookbook_list_spec.rb @@ -21,8 +21,8 @@ require 'spec_helper' describe Chef::Knife::CookbookList do before do @knife = Chef::Knife::CookbookList.new - @rest_mock = mock('rest') - @knife.stub!(:rest).and_return(@rest_mock) + @rest_mock = double('rest') + @knife.stub(:rest).and_return(@rest_mock) @cookbook_names = ['apache2', 'mysql'] @base_url = 'https://server.example.com/cookbooks' @cookbook_data = {} @@ -32,7 +32,7 @@ describe Chef::Knife::CookbookList do 'url' => "#{@base_url}/#{item}/1.0.1"}]} end @stdout = StringIO.new - @knife.ui.stub!(:stdout).and_return(@stdout) + @knife.ui.stub(:stdout).and_return(@stdout) end describe 'run' do diff --git a/spec/unit/knife/cookbook_metadata_from_file_spec.rb b/spec/unit/knife/cookbook_metadata_from_file_spec.rb index 6f406de6b7..68ab6740ab 100644 --- a/spec/unit/knife/cookbook_metadata_from_file_spec.rb +++ b/spec/unit/knife/cookbook_metadata_from_file_spec.rb @@ -27,10 +27,10 @@ describe Chef::Knife::CookbookMetadataFromFile do @tgt = File.expand_path(File.join(CHEF_SPEC_DATA, "metadata", "quick_start", "metadata.json")) @knife = Chef::Knife::CookbookMetadataFromFile.new @knife.name_args = [ @src ] - @knife.stub!(:to_json_pretty).and_return(true) + @knife.stub(:to_json_pretty).and_return(true) @md = Chef::Cookbook::Metadata.new Chef::Cookbook::Metadata.stub(:new).and_return(@md) - $stdout.stub!(:write) + $stdout.stub(:write) end after do diff --git a/spec/unit/knife/cookbook_metadata_spec.rb b/spec/unit/knife/cookbook_metadata_spec.rb index c664326a3d..92db650435 100644 --- a/spec/unit/knife/cookbook_metadata_spec.rb +++ b/spec/unit/knife/cookbook_metadata_spec.rb @@ -26,8 +26,8 @@ describe Chef::Knife::CookbookMetadata do @json_data = '{ "version": "1.0.0" }' @stdout = StringIO.new @stderr = StringIO.new - @knife.ui.stub!(:stdout).and_return(@stdout) - @knife.ui.stub!(:stderr).and_return(@stderr) + @knife.ui.stub(:stdout).and_return(@stdout) + @knife.ui.stub(:stderr).and_return(@stderr) end describe 'run' do @@ -84,7 +84,7 @@ describe Chef::Knife::CookbookMetadata do describe 'generate_metadata' do before(:each) do @knife.config[:cookbook_path] = @cookbook_dir - File.stub!(:expand_path).with("#{@cookbook_dir}/foobar/metadata.rb"). + File.stub(:expand_path).with("#{@cookbook_dir}/foobar/metadata.rb"). and_return("#{@cookbook_dir}/foobar/metadata.rb") end @@ -105,12 +105,12 @@ describe Chef::Knife::CookbookMetadata do describe 'generate_metadata_from_file' do before(:each) do - @metadata_mock = mock('metadata') - @json_file_mock = mock('json_file') + @metadata_mock = double('metadata') + @json_file_mock = double('json_file') end it 'should generate the metatdata json from metatdata.rb' do - Chef::Cookbook::Metadata.stub!(:new).and_return(@metadata_mock) + Chef::Cookbook::Metadata.stub(:new).and_return(@metadata_mock) @metadata_mock.should_receive(:name).with('foobar') @metadata_mock.should_receive(:from_file).with("#{@cookbook_dir}/foobar/metadata.rb") File.should_receive(:open).with("#{@cookbook_dir}/foobar/metadata.json", 'w'). @@ -127,7 +127,7 @@ describe Chef::Knife::CookbookMetadata do }.each_pair do |klass, description| it "should print an error and exit when an #{description} syntax exception is encountered" do exception = klass.new("#{description} blah") - Chef::Cookbook::Metadata.stub!(:new).and_raise(exception) + Chef::Cookbook::Metadata.stub(:new).and_raise(exception) lambda { @knife.generate_metadata_from_file('foobar', "#{@cookbook_dir}/foobar/metadata.rb") }.should raise_error(SystemExit) @@ -165,7 +165,7 @@ describe Chef::Knife::CookbookMetadata do IO.should_receive(:read).with("#{@cookbook_dir}/foobar/metadata.json"). and_return(@json_data) exception = klass.new("#{description} blah") - Chef::Cookbook::Metadata.stub!(:validate_json).and_raise(exception) + Chef::Cookbook::Metadata.stub(:validate_json).and_raise(exception) lambda { @knife.validate_metadata_json(@cookbook_dir, 'foobar') }.should raise_error(SystemExit) diff --git a/spec/unit/knife/cookbook_show_spec.rb b/spec/unit/knife/cookbook_show_spec.rb index 96fe738b0b..b862c3154c 100644 --- a/spec/unit/knife/cookbook_show_spec.rb +++ b/spec/unit/knife/cookbook_show_spec.rb @@ -25,10 +25,10 @@ describe Chef::Knife::CookbookShow do @knife = Chef::Knife::CookbookShow.new @knife.config = { } @knife.name_args = [ "cookbook_name" ] - @rest = mock(Chef::REST) - @knife.stub!(:rest).and_return(@rest) - @knife.stub!(:pretty_print).and_return(true) - @knife.stub!(:output).and_return(true) + @rest = double(Chef::REST) + @knife.stub(:rest).and_return(@rest) + @knife.stub(:pretty_print).and_return(true) + @knife.stub(:output).and_return(true) end describe "run" do diff --git a/spec/unit/knife/cookbook_site_download_spec.rb b/spec/unit/knife/cookbook_site_download_spec.rb index a3d43c5b4a..faf58f7bc7 100644 --- a/spec/unit/knife/cookbook_site_download_spec.rb +++ b/spec/unit/knife/cookbook_site_download_spec.rb @@ -24,7 +24,7 @@ describe Chef::Knife::CookbookSiteDownload do before do @knife = Chef::Knife::CookbookSiteDownload.new @knife.name_args = ['apache2'] - @noauth_rest = mock 'no auth rest' + @noauth_rest = double('no auth rest') @stdout = StringIO.new @cookbook_api_url = 'http://cookbooks.opscode.com/api/v1/cookbooks' @version = '1.0.2' @@ -58,7 +58,7 @@ describe Chef::Knife::CookbookSiteDownload do before do @cookbook_data = { 'version' => @version, 'file' => "http://example.com/apache2_#{@version_us}.tgz" } - @temp_file = stub :path => "/tmp/apache2_#{@version_us}.tgz" + @temp_file = double( :path => "/tmp/apache2_#{@version_us}.tgz" ) @file = File.join(Dir.pwd, "apache2-#{@version}.tar.gz") @noauth_rest.should_receive(:sign_on_redirect=).with(false) @@ -125,7 +125,7 @@ describe Chef::Knife::CookbookSiteDownload do @version_us = @version.gsub '.', '_' @cookbook_data = { 'version' => @version, 'file' => "http://example.com/apache2_#{@version_us}.tgz" } - @temp_file = stub :path => "/tmp/apache2_#{@version_us}.tgz" + @temp_file = double(:path => "/tmp/apache2_#{@version_us}.tgz") @file = File.join(Dir.pwd, "apache2-#{@version}.tar.gz") @knife.name_args << @version end diff --git a/spec/unit/knife/cookbook_site_install_spec.rb b/spec/unit/knife/cookbook_site_install_spec.rb index f7d7a397e6..3086c817d9 100644 --- a/spec/unit/knife/cookbook_site_install_spec.rb +++ b/spec/unit/knife/cookbook_site_install_spec.rb @@ -32,18 +32,18 @@ describe Chef::Knife::CookbookSiteInstall do @stdout = StringIO.new @stderr = StringIO.new - @knife.stub!(:stderr).and_return(@stdout) - @knife.stub!(:stdout).and_return(@stdout) + @knife.stub(:stderr).and_return(@stdout) + @knife.stub(:stdout).and_return(@stdout) #Assume all external commands would have succeed. :( - File.stub!(:unlink) - File.stub!(:rmtree) - @knife.stub!(:shell_out!).and_return(true) + File.stub(:unlink) + File.stub(:rmtree) + @knife.stub(:shell_out!).and_return(true) #CookbookSiteDownload Stup @downloader = {} - @knife.stub!(:download_cookbook_to).and_return(@downloader) - @downloader.stub!(:version).and_return do + @knife.stub(:download_cookbook_to).and_return(@downloader) + @downloader.stub(:version).and_return do if @knife.name_args.size == 2 @knife.name_args[1] else @@ -55,7 +55,7 @@ describe Chef::Knife::CookbookSiteInstall do @repo = stub(:sanity_check => true, :reset_to_default_state => true, :prepare_to_import => true, :finalize_updates_to => true, :merge_updates_from => true) - Chef::Knife::CookbookSCMRepo.stub!(:new).and_return(@repo) + Chef::Knife::CookbookSCMRepo.stub(:new).and_return(@repo) end diff --git a/spec/unit/knife/cookbook_site_share_spec.rb b/spec/unit/knife/cookbook_site_share_spec.rb index 3b912af0c5..14c4262cb3 100644 --- a/spec/unit/knife/cookbook_site_share_spec.rb +++ b/spec/unit/knife/cookbook_site_share_spec.rb @@ -29,25 +29,25 @@ describe Chef::Knife::CookbookSiteShare do @cookbook = Chef::CookbookVersion.new('cookbook_name') - @cookbook_loader = mock('Chef::CookbookLoader') - @cookbook_loader.stub!(:cookbook_exists?).and_return(true) - @cookbook_loader.stub!(:[]).and_return(@cookbook) - Chef::CookbookLoader.stub!(:new).and_return(@cookbook_loader) + @cookbook_loader = double('Chef::CookbookLoader') + @cookbook_loader.stub(:cookbook_exists?).and_return(true) + @cookbook_loader.stub(:[]).and_return(@cookbook) + Chef::CookbookLoader.stub(:new).and_return(@cookbook_loader) @cookbook_uploader = Chef::CookbookUploader.new('herpderp', File.join(CHEF_SPEC_DATA, 'cookbooks'), :rest => "norest") - Chef::CookbookUploader.stub!(:new).and_return(@cookbook_uploader) - @cookbook_uploader.stub!(:validate_cookbooks).and_return(true) - Chef::CookbookSiteStreamingUploader.stub!(:create_build_dir).and_return(Dir.mktmpdir) + Chef::CookbookUploader.stub(:new).and_return(@cookbook_uploader) + @cookbook_uploader.stub(:validate_cookbooks).and_return(true) + Chef::CookbookSiteStreamingUploader.stub(:create_build_dir).and_return(Dir.mktmpdir) Chef::Mixin::Command.stub(:run_command).and_return(true) @stdout = StringIO.new - @knife.ui.stub!(:stdout).and_return(@stdout) + @knife.ui.stub(:stdout).and_return(@stdout) end describe 'run' do before(:each) do - @knife.stub!(:do_upload).and_return(true) + @knife.stub(:do_upload).and_return(true) end it 'should should print usage and exit when given no arguments' do @@ -83,7 +83,7 @@ describe Chef::Knife::CookbookSiteShare do end it 'should exit and log to error when the tarball creation fails' do - Chef::Mixin::Command.stub!(:run_command).and_raise(Chef::Exceptions::Exec) + Chef::Mixin::Command.stub(:run_command).and_raise(Chef::Exceptions::Exec) @knife.ui.should_receive(:error) lambda { @knife.run }.should raise_error(SystemExit) end @@ -98,44 +98,44 @@ describe Chef::Knife::CookbookSiteShare do describe 'do_upload' do before(:each) do - @upload_response = mock('Net::HTTPResponse') - Chef::CookbookSiteStreamingUploader.stub!(:post).and_return(@upload_response) + @upload_response = double('Net::HTTPResponse') + Chef::CookbookSiteStreamingUploader.stub(:post).and_return(@upload_response) @stdout = StringIO.new @stderr = StringIO.new - @knife.ui.stub!(:stdout).and_return(@stdout) - @knife.ui.stub!(:stderr).and_return(@stderr) + @knife.ui.stub(:stdout).and_return(@stdout) + @knife.ui.stub(:stderr).and_return(@stderr) File.stub(:open).and_return(true) end it 'should post the cookbook to "http://cookbooks.opscode.com"' do response_text = {:uri => 'http://cookbooks.opscode.com/cookbooks/cookbook_name'}.to_json - @upload_response.stub!(:body).and_return(response_text) - @upload_response.stub!(:code).and_return(201) + @upload_response.stub(:body).and_return(response_text) + @upload_response.stub(:code).and_return(201) Chef::CookbookSiteStreamingUploader.should_receive(:post).with(/cookbooks\.opscode\.com/, anything(), anything(), anything()) @knife.run end it 'should alert the user when a version already exists' do response_text = {:error_messages => ['Version already exists']}.to_json - @upload_response.stub!(:body).and_return(response_text) - @upload_response.stub!(:code).and_return(409) + @upload_response.stub(:body).and_return(response_text) + @upload_response.stub(:code).and_return(409) lambda { @knife.run }.should raise_error(SystemExit) @stderr.string.should match(/ERROR(.+)cookbook already exists/) end it 'should pass any errors on to the user' do response_text = {:error_messages => ["You're holding it wrong"]}.to_json - @upload_response.stub!(:body).and_return(response_text) - @upload_response.stub!(:code).and_return(403) + @upload_response.stub(:body).and_return(response_text) + @upload_response.stub(:code).and_return(403) lambda { @knife.run }.should raise_error(SystemExit) @stderr.string.should match("ERROR(.*)You're holding it wrong") end it 'should print the body if no errors are exposed on failure' do response_text = {:system_error => "Your call was dropped", :reason => "There's a map for that"}.to_json - @upload_response.stub!(:body).and_return(response_text) - @upload_response.stub!(:code).and_return(500) + @upload_response.stub(:body).and_return(response_text) + @upload_response.stub(:code).and_return(500) @knife.ui.should_receive(:error).with(/#{Regexp.escape(response_text)}/)#.ordered @knife.ui.should_receive(:error).with(/Unknown error/)#.ordered lambda { @knife.run }.should raise_error(SystemExit) diff --git a/spec/unit/knife/cookbook_site_unshare_spec.rb b/spec/unit/knife/cookbook_site_unshare_spec.rb index ffba2ec664..14cda65b43 100644 --- a/spec/unit/knife/cookbook_site_unshare_spec.rb +++ b/spec/unit/knife/cookbook_site_unshare_spec.rb @@ -24,13 +24,13 @@ describe Chef::Knife::CookbookSiteUnshare do before(:each) do @knife = Chef::Knife::CookbookSiteUnshare.new @knife.name_args = ['cookbook_name'] - @knife.stub!(:confirm).and_return(true) + @knife.stub(:confirm).and_return(true) - @rest = mock('Chef::REST') - @rest.stub!(:delete_rest).and_return(true) - @knife.stub!(:rest).and_return(@rest) + @rest = double('Chef::REST') + @rest.stub(:delete_rest).and_return(true) + @knife.stub(:rest).and_return(@rest) @stdout = StringIO.new - @knife.ui.stub!(:stdout).and_return(@stdout) + @knife.ui.stub(:stdout).and_return(@stdout) end describe 'run' do @@ -55,14 +55,14 @@ describe Chef::Knife::CookbookSiteUnshare do end it 'should log an error and exit when forbidden' do - exception = mock('403 "Forbidden"', :code => '403') - @rest.stub!(:delete_rest).and_raise(Net::HTTPServerException.new('403 "Forbidden"', exception)) + exception = double('403 "Forbidden"', :code => '403') + @rest.stub(:delete_rest).and_raise(Net::HTTPServerException.new('403 "Forbidden"', exception)) @knife.ui.should_receive(:error) lambda { @knife.run }.should raise_error(SystemExit) end it 'should re-raise any non-forbidden errors on delete_rest' do - exception = mock('500 "Application Error"', :code => '500') + exception = double('500 "Application Error"', :code => '500') @rest.stub(:delete_rest).and_raise(Net::HTTPServerException.new('500 "Application Error"', exception)) lambda { @knife.run }.should raise_error(Net::HTTPServerException) end diff --git a/spec/unit/knife/cookbook_test_spec.rb b/spec/unit/knife/cookbook_test_spec.rb index 24c658dc6c..0e261c02a4 100644 --- a/spec/unit/knife/cookbook_test_spec.rb +++ b/spec/unit/knife/cookbook_test_spec.rb @@ -26,25 +26,25 @@ describe Chef::Knife::CookbookTest do Chef::Config[:node_name] = "webmonkey.example.com" @knife = Chef::Knife::CookbookTest.new @knife.config[:cookbook_path] = File.join(CHEF_SPEC_DATA,'cookbooks') - @knife.cookbook_loader.stub!(:cookbook_exists?).and_return(true) + @knife.cookbook_loader.stub(:cookbook_exists?).and_return(true) @cookbooks = [] %w{tats central_market jimmy_johns pho}.each do |cookbook_name| @cookbooks << Chef::CookbookVersion.new(cookbook_name) end @stdout = StringIO.new - @knife.ui.stub!(:stdout).and_return(@stdout) + @knife.ui.stub(:stdout).and_return(@stdout) end describe "run" do it "should test the cookbook" do - @knife.stub!(:test_cookbook).and_return(true) + @knife.stub(:test_cookbook).and_return(true) @knife.name_args = ["italian"] @knife.should_receive(:test_cookbook).with("italian") @knife.run end it "should test multiple cookbooks when provided" do - @knife.stub!(:test_cookbook).and_return(true) + @knife.stub(:test_cookbook).and_return(true) @knife.name_args = ["tats", "jimmy_johns"] @knife.should_receive(:test_cookbook).with("tats") @knife.should_receive(:test_cookbook).with("jimmy_johns") @@ -65,14 +65,14 @@ describe Chef::Knife::CookbookTest do describe "with -a or --all" do it "should test all of the cookbooks" do - @knife.stub!(:test_cookbook).and_return(true) + @knife.stub(:test_cookbook).and_return(true) @knife.config[:all] = true @loader = {} - @loader.stub!(:load_cookbooks).and_return(@loader) + @loader.stub(:load_cookbooks).and_return(@loader) @cookbooks.each do |cookbook| @loader[cookbook.name] = cookbook end - @knife.stub!(:cookbook_loader).and_return(@loader) + @knife.stub(:cookbook_loader).and_return(@loader) @loader.each do |key, cookbook| @knife.should_receive(:test_cookbook).with(cookbook.name) end diff --git a/spec/unit/knife/cookbook_upload_spec.rb b/spec/unit/knife/cookbook_upload_spec.rb index 5572430b50..65331b3952 100644 --- a/spec/unit/knife/cookbook_upload_spec.rb +++ b/spec/unit/knife/cookbook_upload_spec.rb @@ -30,24 +30,24 @@ describe Chef::Knife::CookbookUpload do @cookbook = Chef::CookbookVersion.new('test_cookbook') @cookbook_loader = {} - @cookbook_loader.stub!(:[]).and_return(@cookbook) - @cookbook_loader.stub!(:merged_cookbooks).and_return([]) - @cookbook_loader.stub!(:load_cookbooks).and_return(@cookbook_loader) - Chef::CookbookLoader.stub!(:new).and_return(@cookbook_loader) + @cookbook_loader.stub(:[]).and_return(@cookbook) + @cookbook_loader.stub(:merged_cookbooks).and_return([]) + @cookbook_loader.stub(:load_cookbooks).and_return(@cookbook_loader) + Chef::CookbookLoader.stub(:new).and_return(@cookbook_loader) @output = StringIO.new - @knife.ui.stub!(:stdout).and_return(@output) - @knife.ui.stub!(:stderr).and_return(@output) + @knife.ui.stub(:stdout).and_return(@output) + @knife.ui.stub(:stderr).and_return(@output) end describe 'with --concurrency' do it 'should upload cookbooks with predefined concurrency' do - @cookbook_uploader = stub(:upload_cookbooks => nil) + @cookbook_uploader = double(:upload_cookbooks => nil) Chef::CookbookVersion.stub(:list_all_versions).and_return({}) @knife.config[:concurrency] = 3 @test_cookbook = Chef::CookbookVersion.new('test_cookbook') - @cookbook_loader.stub!(:each).and_yield("test_cookbook", @test_cookbook) - @cookbook_loader.stub!(:cookbook_names).and_return(["test_cookbook"]) + @cookbook_loader.stub(:each).and_yield("test_cookbook", @test_cookbook) + @cookbook_loader.stub(:cookbook_names).and_return(["test_cookbook"]) Chef::CookbookUploader.should_receive(:new).with( kind_of(Array), kind_of(Array), {:force=>nil, :concurrency => 3}).and_return(double("Chef::CookbookUploader", :upload_cookbooks=> true)) @knife.run @@ -56,7 +56,7 @@ describe Chef::Knife::CookbookUpload do describe 'run' do before(:each) do - @cookbook_uploader = stub(:upload_cookbooks => nil) + @cookbook_uploader = double(:upload_cookbooks => nil) Chef::CookbookUploader.stub(:new => @cookbook_uploader) Chef::CookbookVersion.stub(:list_all_versions).and_return({}) end @@ -98,9 +98,9 @@ describe Chef::Knife::CookbookUpload do 'test_cookbook3' => Chef::CookbookVersion.new('test_cookbook3') } @cookbook_loader = {} - @cookbook_loader.stub!(:merged_cookbooks).and_return([]) + @cookbook_loader.stub(:merged_cookbooks).and_return([]) @cookbook_loader.stub(:[]) { |ckbk| @cookbooks[ckbk] } - Chef::CookbookLoader.stub!(:new).and_return(@cookbook_loader) + Chef::CookbookLoader.stub(:new).and_return(@cookbook_loader) end it "should read only one cookbook" do @@ -130,16 +130,16 @@ describe Chef::Knife::CookbookUpload do @test_cookbook2.metadata.depends("test_cookbook3") @test_cookbook3.metadata.depends("test_cookbook1") @test_cookbook3.metadata.depends("test_cookbook2") - @cookbook_loader.stub!(:[]) do |ckbk| + @cookbook_loader.stub(:[]) do |ckbk| { "test_cookbook1" => @test_cookbook1, "test_cookbook2" => @test_cookbook2, "test_cookbook3" => @test_cookbook3 }[ckbk] end - @knife.stub!(:cookbook_names).and_return(["test_cookbook1", "test_cookbook2", "test_cookbook3"]) + @knife.stub(:cookbook_names).and_return(["test_cookbook1", "test_cookbook2", "test_cookbook3"]) @knife.should_receive(:upload).exactly(3).times Timeout::timeout(5) do @knife.run - end.should_not raise_error(Timeout::Error) + end.should_not raise_error end end @@ -154,8 +154,8 @@ describe Chef::Knife::CookbookUpload do @knife.config[:all] = true @test_cookbook1 = Chef::CookbookVersion.new('test_cookbook1') @test_cookbook2 = Chef::CookbookVersion.new('test_cookbook2') - @cookbook_loader.stub!(:each).and_yield("test_cookbook1", @test_cookbook1).and_yield("test_cookbook2", @test_cookbook2) - @cookbook_loader.stub!(:cookbook_names).and_return(["test_cookbook1", "test_cookbook2"]) + @cookbook_loader.stub(:each).and_yield("test_cookbook1", @test_cookbook1).and_yield("test_cookbook2", @test_cookbook2) + @cookbook_loader.stub(:cookbook_names).and_return(["test_cookbook1", "test_cookbook2"]) end it 'should upload all cookbooks' do @@ -170,7 +170,7 @@ describe Chef::Knife::CookbookUpload do end it 'should update the version constraints for an environment' do - @knife.stub!(:assert_environment_valid!).and_return(true) + @knife.stub(:assert_environment_valid!).and_return(true) @knife.config[:environment] = "production" @knife.should_receive(:update_version_constraints).once @knife.run @@ -188,9 +188,9 @@ describe Chef::Knife::CookbookUpload do end it 'should not update the version constraints for an environment' do - @knife.stub!(:assert_environment_valid!).and_return(true) + @knife.stub(:assert_environment_valid!).and_return(true) @knife.config[:environment] = "production" - @knife.stub!(:upload).and_raise(Chef::Exceptions::CookbookFrozen) + @knife.stub(:upload).and_raise(Chef::Exceptions::CookbookFrozen) @knife.ui.should_receive(:error).with(/Failed to upload 1 cookbook/) @knife.ui.should_receive(:warn).with(/Not updating version constraints/) @knife.should_not_receive(:update_version_constraints) diff --git a/spec/unit/knife/core/cookbook_scm_repo_spec.rb b/spec/unit/knife/core/cookbook_scm_repo_spec.rb index 629164ad0a..69da5400b0 100644 --- a/spec/unit/knife/core/cookbook_scm_repo_spec.rb +++ b/spec/unit/knife/core/cookbook_scm_repo_spec.rb @@ -54,17 +54,17 @@ BRANCHES describe "and the repo dir exists" do before do - ::File.stub!(:directory?).with(@repo_path).and_return(true) + ::File.stub(:directory?).with(@repo_path).and_return(true) end it "exits when there is no git repo" do - ::File.stub!(:directory?).with(/.*\.git/).and_return(false) + ::File.stub(:directory?).with(/.*\.git/).and_return(false) lambda {@cookbook_repo.sanity_check}.should raise_error(SystemExit) end describe "and the repo is a git repo" do before do - ::File.stub!(:directory?).with(File.join(@repo_path, '.git')).and_return(true) + ::File.stub(:directory?).with(File.join(@repo_path, '.git')).and_return(true) end it "exits when the default branch doesn't exist" do @@ -92,7 +92,7 @@ DIRTY describe "and the repo is clean" do before do @clean_status = Mixlib::ShellOut.new.tap {|s| s.stdout.replace("\n")} - @cookbook_repo.stub!(:shell_out!).with('git status --porcelain', :cwd => @repo_path).and_return(@clean_status) + @cookbook_repo.stub(:shell_out!).with('git status --porcelain', :cwd => @repo_path).and_return(@clean_status) end it "passes the sanity check" do @@ -143,7 +143,7 @@ DIRTY before do @updates = Mixlib::ShellOut.new @updates.stdout.replace("\n") - @cookbook_repo.stub!(:shell_out!).with('git status --porcelain -- apache2', :cwd => @repo_path).and_return(@updates) + @cookbook_repo.stub(:shell_out!).with('git status --porcelain -- apache2', :cwd => @repo_path).and_return(@updates) end it "shows no changes in the pristine copy" do @@ -159,7 +159,7 @@ DIRTY before do @updates = Mixlib::ShellOut.new @updates.stdout.replace(" M cookbooks/apache2/recipes/default.rb\n") - @cookbook_repo.stub!(:shell_out!).with('git status --porcelain -- apache2', :cwd => @repo_path).and_return(@updates) + @cookbook_repo.stub(:shell_out!).with('git status --porcelain -- apache2', :cwd => @repo_path).and_return(@updates) end it "shows changes in the pristine copy" do diff --git a/spec/unit/knife/core/object_loader_spec.rb b/spec/unit/knife/core/object_loader_spec.rb index b3456e2b15..53a538da91 100644 --- a/spec/unit/knife/core/object_loader_spec.rb +++ b/spec/unit/knife/core/object_loader_spec.rb @@ -24,7 +24,7 @@ describe Chef::Knife::Core::ObjectLoader do before(:each) do @knife = Chef::Knife.new @stdout = StringIO.new - @knife.ui.stub!(:stdout).and_return(@stdout) + @knife.ui.stub(:stdout).and_return(@stdout) Dir.chdir(File.join(CHEF_SPEC_DATA, 'object_loader')) end diff --git a/spec/unit/knife/core/ui_spec.rb b/spec/unit/knife/core/ui_spec.rb index 18e88b6cde..c626747918 100644 --- a/spec/unit/knife/core/ui_spec.rb +++ b/spec/unit/knife/core/ui_spec.rb @@ -24,7 +24,11 @@ require 'spec_helper' describe Chef::Knife::UI do before do @out, @err, @in = StringIO.new, StringIO.new, StringIO.new - @config = {} + @config = { + :verbosity => 0, + :yes => nil, + :format => "summary", + } @ui = Chef::Knife::UI.new(@out, @err, @in, @config) end @@ -62,7 +66,7 @@ describe Chef::Knife::UI do before do @ui.config[:disable_editing] = false @ui.config[:editor] = my_editor - @mock = mock('Tempfile') + @mock = double('Tempfile') @mock.should_receive(:sync=).with(true) @mock.should_receive(:puts).with(json_from_ruby) @mock.should_receive(:close) @@ -168,7 +172,7 @@ describe Chef::Knife::UI do it "should ignore Errno::EPIPE exceptions (CHEF-3516)" do @out.stub(:puts).and_raise(Errno::EPIPE) @err.stub(:puts).and_raise(Errno::EPIPE) - lambda {@ui.send(method, "hi")}.should_not raise_error(Errno::EPIPE) + lambda {@ui.send(method, "hi")}.should raise_error(SystemExit) end it "should throw Errno::EPIPE exceptions with -VV (CHEF-3516)" do @@ -298,15 +302,9 @@ EOM it "formats hashes with nested array values appropriately" do @ui.output({ 'a' => [ [ 'foo', 'bar' ], [ 'baz', 'bjork' ] ], 'b' => 'c' }) - @out.string.should == <<EOM -a: - foo - bar - - baz - bjork -b: c -EOM + # XXX: using a HEREDOC at this point results in a line with required spaces which auto-whitespace removal settings + # on editors will remove and will break this test. + @out.string.should == "a:\n foo\n bar\n \n baz\n bjork\nb: c\n" end it "formats hashes with hash values appropriately" do @@ -412,28 +410,28 @@ EOM @question = "monkeys rule" @stdout = StringIO.new @ui.stub(:stdout).and_return(@stdout) - @ui.stdin.stub!(:readline).and_return("y") + @ui.stdin.stub(:readline).and_return("y") end it "should return true if you answer Y" do - @ui.stdin.stub!(:readline).and_return("Y") + @ui.stdin.stub(:readline).and_return("Y") @ui.confirm(@question).should == true end it "should return true if you answer y" do - @ui.stdin.stub!(:readline).and_return("y") + @ui.stdin.stub(:readline).and_return("y") @ui.confirm(@question).should == true end it "should exit 3 if you answer N" do - @ui.stdin.stub!(:readline).and_return("N") + @ui.stdin.stub(:readline).and_return("N") lambda { @ui.confirm(@question) }.should raise_error(SystemExit) { |e| e.status.should == 3 } end it "should exit 3 if you answer n" do - @ui.stdin.stub!(:readline).and_return("n") + @ui.stdin.stub(:readline).and_return("n") lambda { @ui.confirm(@question) }.should raise_error(SystemExit) { |e| e.status.should == 3 } @@ -449,16 +447,16 @@ EOM describe "when asking for free-form user input" do it "asks a question and returns the answer provided by the user" do out = StringIO.new - @ui.stub!(:stdout).and_return(out) - @ui.stub!(:stdin).and_return(StringIO.new("http://mychefserver.example.com\n")) + @ui.stub(:stdout).and_return(out) + @ui.stub(:stdin).and_return(StringIO.new("http://mychefserver.example.com\n")) @ui.ask_question("your chef server URL?").should == "http://mychefserver.example.com" out.string.should == "your chef server URL?" end it "suggests a default setting and returns the default when the user's response only contains whitespace" do out = StringIO.new - @ui.stub!(:stdout).and_return(out) - @ui.stub!(:stdin).and_return(StringIO.new(" \n")) + @ui.stub(:stdout).and_return(out) + @ui.stub(:stdin).and_return(StringIO.new(" \n")) @ui.ask_question("your chef server URL? ", :default => 'http://localhost:4000').should == "http://localhost:4000" out.string.should == "your chef server URL? [http://localhost:4000] " end diff --git a/spec/unit/knife/data_bag_create_spec.rb b/spec/unit/knife/data_bag_create_spec.rb index b2f24bbb39..984be8e58a 100644 --- a/spec/unit/knife/data_bag_create_spec.rb +++ b/spec/unit/knife/data_bag_create_spec.rb @@ -39,9 +39,9 @@ describe Chef::Knife::DataBagCreate do Chef::Config[:node_name] = "webmonkey.example.com" @knife = Chef::Knife::DataBagCreate.new @rest = ChefSpecs::ChefRest.new - @knife.stub!(:rest).and_return(@rest) + @knife.stub(:rest).and_return(@rest) @stdout = StringIO.new - @knife.ui.stub!(:stdout).and_return(@stdout) + @knife.ui.stub(:stdout).and_return(@stdout) end @@ -101,7 +101,7 @@ describe Chef::Knife::DataBagCreate do end it "creates an encrypted data bag item via --secret" do - @knife.stub!(:config).and_return({:secret => @secret}) + @knife.stub(:config).and_return({:secret => @secret}) @knife.run end @@ -109,7 +109,7 @@ describe Chef::Knife::DataBagCreate do secret_file = Tempfile.new("encrypted_data_bag_secret_file_test") secret_file.puts(@secret) secret_file.flush - @knife.stub!(:config).and_return({:secret_file => secret_file.path}) + @knife.stub(:config).and_return({:secret_file => secret_file.path}) @knife.run end end diff --git a/spec/unit/knife/data_bag_edit_spec.rb b/spec/unit/knife/data_bag_edit_spec.rb index 412a237321..866ca99174 100644 --- a/spec/unit/knife/data_bag_edit_spec.rb +++ b/spec/unit/knife/data_bag_edit_spec.rb @@ -29,11 +29,11 @@ describe Chef::Knife::DataBagEdit do Chef::Config[:node_name] = "webmonkey.example.com" @knife = Chef::Knife::DataBagEdit.new - @rest = mock('chef-rest-mock') - @knife.stub!(:rest).and_return(@rest) + @rest = double('chef-rest-mock') + @knife.stub(:rest).and_return(@rest) @stdout = StringIO.new - @knife.stub!(:stdout).and_return(@stdout) + @knife.stub(:stdout).and_return(@stdout) @log = Chef::Log @knife.name_args = ['bag_name', 'item_name'] end @@ -45,7 +45,7 @@ describe Chef::Knife::DataBagEdit do end it "saves edits on a data bag item" do - Chef::DataBagItem.stub!(:load).with('bag_name', 'item_name').and_return(@plain_data) + Chef::DataBagItem.stub(:load).with('bag_name', 'item_name').and_return(@plain_data) @knife.should_receive(:edit_data).with(@plain_data).and_return(@edited_data) @rest.should_receive(:put_rest).with("data/bag_name/item_name", @edited_data).ordered @knife.run @@ -58,7 +58,7 @@ describe Chef::Knife::DataBagEdit do @secret) @enc_edited_data = Chef::EncryptedDataBagItem.encrypt_data_bag_item(@edited_data, @secret) - Chef::DataBagItem.stub!(:load).with('bag_name', 'item_name').and_return(@enc_data) + Chef::DataBagItem.stub(:load).with('bag_name', 'item_name').and_return(@enc_data) # Random IV is used each time the data bag item is encrypted, so values # will not be equal if we encrypt same value twice. @@ -75,7 +75,7 @@ describe Chef::Knife::DataBagEdit do end it "decrypts and encrypts via --secret" do - @knife.stub!(:config).and_return({:secret => @secret}) + @knife.stub(:config).and_return({:secret => @secret}) @knife.should_receive(:edit_data).with(@plain_data).and_return(@edited_data) @rest.should_receive(:put_rest).with("data/bag_name/item_name", @enc_edited_data).ordered @@ -83,7 +83,7 @@ describe Chef::Knife::DataBagEdit do end it "decrypts and encrypts via --secret_file" do - @knife.stub!(:config).and_return({:secret_file => @secret_file.path}) + @knife.stub(:config).and_return({:secret_file => @secret_file.path}) @knife.should_receive(:edit_data).with(@plain_data).and_return(@edited_data) @rest.should_receive(:put_rest).with("data/bag_name/item_name", @enc_edited_data).ordered diff --git a/spec/unit/knife/data_bag_from_file_spec.rb b/spec/unit/knife/data_bag_from_file_spec.rb index cef1babd0b..8537045164 100644 --- a/spec/unit/knife/data_bag_from_file_spec.rb +++ b/spec/unit/knife/data_bag_from_file_spec.rb @@ -29,10 +29,10 @@ describe Chef::Knife::DataBagFromFile do before :each do Chef::Config[:node_name] = "webmonkey.example.com" @knife = Chef::Knife::DataBagFromFile.new - @rest = mock("Chef::REST") - @knife.stub!(:rest).and_return(@rest) + @rest = double("Chef::REST") + @knife.stub(:rest).and_return(@rest) @stdout = StringIO.new - @knife.ui.stub!(:stdout).and_return(@stdout) + @knife.ui.stub(:stdout).and_return(@stdout) @tmp_dir = Dir.mktmpdir @db_folder = File.join(@tmp_dir, 'data_bags', 'bag_name') FileUtils.mkdir_p(@db_folder) @@ -64,7 +64,7 @@ describe Chef::Knife::DataBagFromFile do it "loads from a file and saves" do @knife.loader.should_receive(:load_from).with("data_bags", 'bag_name', @db_file.path).and_return(@plain_data) dbag = Chef::DataBagItem.new - Chef::DataBagItem.stub!(:new).and_return(dbag) + Chef::DataBagItem.stub(:new).and_return(dbag) dbag.should_receive(:save) @knife.run @@ -77,7 +77,7 @@ describe Chef::Knife::DataBagFromFile do @knife.loader.should_receive(:load_from).with("data_bags", 'bag_name', @db_file.path).and_return(@plain_data) @knife.loader.should_receive(:load_from).with("data_bags", 'bag_name', @db_file2.path).and_return(@plain_data) dbag = Chef::DataBagItem.new - Chef::DataBagItem.stub!(:new).and_return(dbag) + Chef::DataBagItem.stub(:new).and_return(dbag) dbag.should_receive(:save).twice @knife.run @@ -91,7 +91,7 @@ describe Chef::Knife::DataBagFromFile do @knife.loader.should_receive(:load_from).with("data_bags", 'bag_name', @db_file.path).and_return(@plain_data) @knife.loader.should_receive(:load_from).with("data_bags", 'bag_name', @db_file2.path).and_return(@plain_data) dbag = Chef::DataBagItem.new - Chef::DataBagItem.stub!(:new).and_return(dbag) + Chef::DataBagItem.stub(:new).and_return(dbag) dbag.should_receive(:save).twice @knife.run end @@ -109,7 +109,7 @@ describe Chef::Knife::DataBagFromFile do it "loads all data bags when -a or --all options is provided" do @knife.name_args = [] - @knife.stub!(:config).and_return({:all => true}) + @knife.stub(:config).and_return({:all => true}) @knife.loader.should_receive(:load_from).with("data_bags", "bag_name", File.basename(@db_file.path)). and_return(@plain_data) @knife.loader.should_receive(:load_from).with("data_bags", "bag_name", File.basename(@db_file2.path)). @@ -117,18 +117,18 @@ describe Chef::Knife::DataBagFromFile do @knife.loader.should_receive(:load_from).with("data_bags", "bag_name2", File.basename(@db_file3.path)). and_return(@plain_data) dbag = Chef::DataBagItem.new - Chef::DataBagItem.stub!(:new).and_return(dbag) + Chef::DataBagItem.stub(:new).and_return(dbag) dbag.should_receive(:save).exactly(3).times @knife.run end it "loads all data bags items when -a or --all options is provided" do @knife.name_args = ["bag_name2"] - @knife.stub!(:config).and_return({:all => true}) + @knife.stub(:config).and_return({:all => true}) @knife.loader.should_receive(:load_from).with("data_bags", "bag_name2", File.basename(@db_file3.path)). and_return(@plain_data) dbag = Chef::DataBagItem.new - Chef::DataBagItem.stub!(:new).and_return(dbag) + Chef::DataBagItem.stub(:new).and_return(dbag) dbag.should_receive(:save) @knife.run dbag.data_bag.should == 'bag_name2' @@ -158,11 +158,11 @@ describe Chef::Knife::DataBagFromFile do end it "encrypts values when given --secret" do - @knife.stub!(:config).and_return({:secret => @secret}) + @knife.stub(:config).and_return({:secret => @secret}) @knife.loader.should_receive(:load_from).with("data_bags", "bag_name", @db_file.path).and_return(@plain_data) dbag = Chef::DataBagItem.new - Chef::DataBagItem.stub!(:new).and_return(dbag) + Chef::DataBagItem.stub(:new).and_return(dbag) dbag.should_receive(:save) @knife.run dbag.data_bag.should == 'bag_name' @@ -170,11 +170,11 @@ describe Chef::Knife::DataBagFromFile do end it "encrypts values when given --secret_file" do - @knife.stub!(:config).and_return({:secret_file => @secret_file.path}) + @knife.stub(:config).and_return({:secret_file => @secret_file.path}) - @knife.loader.stub!(:load_from).with("data_bags", 'bag_name', @db_file.path).and_return(@plain_data) + @knife.loader.stub(:load_from).with("data_bags", 'bag_name', @db_file.path).and_return(@plain_data) dbag = Chef::DataBagItem.new - Chef::DataBagItem.stub!(:new).and_return(dbag) + Chef::DataBagItem.stub(:new).and_return(dbag) dbag.should_receive(:save) @knife.run dbag.data_bag.should == 'bag_name' diff --git a/spec/unit/knife/data_bag_show_spec.rb b/spec/unit/knife/data_bag_show_spec.rb index d64b4f286d..d8d1077d0d 100644 --- a/spec/unit/knife/data_bag_show_spec.rb +++ b/spec/unit/knife/data_bag_show_spec.rb @@ -29,10 +29,10 @@ describe Chef::Knife::DataBagShow do Chef::Config[:node_name] = "webmonkey.example.com" @knife = Chef::Knife::DataBagShow.new @knife.config[:format] = 'json' - @rest = mock("Chef::REST") - @knife.stub!(:rest).and_return(@rest) + @rest = double("Chef::REST") + @knife.stub(:rest).and_return(@rest) @stdout = StringIO.new - @knife.ui.stub!(:stdout).and_return(@stdout) + @knife.ui.stub(:stdout).and_return(@stdout) end @@ -83,7 +83,7 @@ describe Chef::Knife::DataBagShow do end it "prints the decrypted contents of an item when given --secret" do - @knife.stub!(:config).and_return({:secret => @secret}) + @knife.stub(:config).and_return({:secret => @secret}) Chef::EncryptedDataBagItem.should_receive(:load). with('bag_name', 'item_name', @secret). and_return(Chef::EncryptedDataBagItem.new(@enc_data, @secret)) @@ -92,7 +92,7 @@ describe Chef::Knife::DataBagShow do end it "prints the decrypted contents of an item when given --secret_file" do - @knife.stub!(:config).and_return({:secret_file => @secret_file.path}) + @knife.stub(:config).and_return({:secret_file => @secret_file.path}) Chef::EncryptedDataBagItem.should_receive(:load). with('bag_name', 'item_name', @secret). and_return(Chef::EncryptedDataBagItem.new(@enc_data, @secret)) diff --git a/spec/unit/knife/environment_create_spec.rb b/spec/unit/knife/environment_create_spec.rb index 36f6556682..81bf6731b7 100644 --- a/spec/unit/knife/environment_create_spec.rb +++ b/spec/unit/knife/environment_create_spec.rb @@ -21,16 +21,16 @@ require 'spec_helper' describe Chef::Knife::EnvironmentCreate do before(:each) do @knife = Chef::Knife::EnvironmentCreate.new - @knife.stub!(:msg).and_return true - @knife.stub!(:output).and_return true - @knife.stub!(:show_usage).and_return true + @knife.stub(:msg).and_return true + @knife.stub(:output).and_return true + @knife.stub(:show_usage).and_return true @knife.name_args = [ "production" ] @environment = Chef::Environment.new - @environment.stub!(:save) + @environment.stub(:save) - Chef::Environment.stub!(:new).and_return @environment - @knife.stub!(:edit_data).and_return @environment + Chef::Environment.stub(:new).and_return @environment + @knife.stub(:edit_data).and_return @environment end describe "run" do diff --git a/spec/unit/knife/environment_delete_spec.rb b/spec/unit/knife/environment_delete_spec.rb index 219ae4a923..0f6b5f3272 100644 --- a/spec/unit/knife/environment_delete_spec.rb +++ b/spec/unit/knife/environment_delete_spec.rb @@ -21,17 +21,17 @@ require 'spec_helper' describe Chef::Knife::EnvironmentDelete do before(:each) do @knife = Chef::Knife::EnvironmentDelete.new - @knife.stub!(:msg).and_return true - @knife.stub!(:output).and_return true - @knife.stub!(:show_usage).and_return true - @knife.stub!(:confirm).and_return true + @knife.stub(:msg).and_return true + @knife.stub(:output).and_return true + @knife.stub(:show_usage).and_return true + @knife.stub(:confirm).and_return true @knife.name_args = [ "production" ] @environment = Chef::Environment.new @environment.name("production") @environment.description("Please delete me") - @environment.stub!(:destroy).and_return true - Chef::Environment.stub!(:load).and_return @environment + @environment.stub(:destroy).and_return true + Chef::Environment.stub(:load).and_return @environment end it "should confirm that you want to delete" do diff --git a/spec/unit/knife/environment_edit_spec.rb b/spec/unit/knife/environment_edit_spec.rb index 91f9f5d0f0..a82ead0b6b 100644 --- a/spec/unit/knife/environment_edit_spec.rb +++ b/spec/unit/knife/environment_edit_spec.rb @@ -21,16 +21,16 @@ require 'spec_helper' describe Chef::Knife::EnvironmentEdit do before(:each) do @knife = Chef::Knife::EnvironmentEdit.new - @knife.ui.stub!(:msg).and_return true - @knife.ui.stub!(:output).and_return true - @knife.ui.stub!(:show_usage).and_return true + @knife.ui.stub(:msg).and_return true + @knife.ui.stub(:output).and_return true + @knife.ui.stub(:show_usage).and_return true @knife.name_args = [ "production" ] @environment = Chef::Environment.new @environment.name("production") @environment.description("Please edit me") - @environment.stub!(:save).and_return true - Chef::Environment.stub!(:load).and_return @environment + @environment.stub(:save).and_return true + Chef::Environment.stub(:load).and_return @environment @knife.ui.stub(:edit_data).and_return @environment end diff --git a/spec/unit/knife/environment_from_file_spec.rb b/spec/unit/knife/environment_from_file_spec.rb index 7d028ae3b8..f208320c5d 100644 --- a/spec/unit/knife/environment_from_file_spec.rb +++ b/spec/unit/knife/environment_from_file_spec.rb @@ -25,15 +25,15 @@ describe Chef::Knife::EnvironmentFromFile do before(:each) do @knife = Chef::Knife::EnvironmentFromFile.new @stdout = StringIO.new - @knife.ui.stub!(:stdout).and_return(@stdout) + @knife.ui.stub(:stdout).and_return(@stdout) @knife.name_args = [ "spec.rb" ] @environment = Chef::Environment.new @environment.name("spec") @environment.description("runs the unit tests") @environment.cookbook_versions({"apt" => "= 1.2.3"}) - @environment.stub!(:save).and_return true - @knife.loader.stub!(:load_from).and_return @environment + @environment.stub(:save).and_return true + @knife.loader.stub(:load_from).and_return @environment end describe "run" do @@ -47,7 +47,7 @@ describe Chef::Knife::EnvironmentFromFile do before(:each) do @env_apple = @environment.dup @env_apple.name("apple") - @knife.loader.stub!(:load_from).with("apple.rb").and_return @env_apple + @knife.loader.stub(:load_from).with("apple.rb").and_return @env_apple end it "loads multiple environments if given" do @@ -57,10 +57,10 @@ describe Chef::Knife::EnvironmentFromFile do end it "loads all environments with -a" do - File.stub!(:expand_path).with("./environments/*.{json,rb}").and_return("/tmp/environments") - Dir.stub!(:glob).with("/tmp/environments").and_return(["spec.rb", "apple.rb"]) + File.stub(:expand_path).with("./environments/*.{json,rb}").and_return("/tmp/environments") + Dir.stub(:glob).with("/tmp/environments").and_return(["spec.rb", "apple.rb"]) @knife.name_args = [] - @knife.stub!(:config).and_return({:all => true}) + @knife.stub(:config).and_return({:all => true}) @environment.should_receive(:save).twice @knife.run end diff --git a/spec/unit/knife/environment_list_spec.rb b/spec/unit/knife/environment_list_spec.rb index 05a3ae748a..25d2714d23 100644 --- a/spec/unit/knife/environment_list_spec.rb +++ b/spec/unit/knife/environment_list_spec.rb @@ -21,16 +21,16 @@ require 'spec_helper' describe Chef::Knife::EnvironmentList do before(:each) do @knife = Chef::Knife::EnvironmentList.new - @knife.stub!(:msg).and_return true - @knife.stub!(:output).and_return true - @knife.stub!(:show_usage).and_return true + @knife.stub(:msg).and_return true + @knife.stub(:output).and_return true + @knife.stub(:show_usage).and_return true @environments = { "production" => "http://localhost:4000/environments/production", "development" => "http://localhost:4000/environments/development", "testing" => "http://localhost:4000/environments/testing" } - Chef::Environment.stub!(:list).and_return @environments + Chef::Environment.stub(:list).and_return @environments end it "should make an api call to list the environments" do diff --git a/spec/unit/knife/environment_show_spec.rb b/spec/unit/knife/environment_show_spec.rb index 1e1556f4c3..c7b0c21657 100644 --- a/spec/unit/knife/environment_show_spec.rb +++ b/spec/unit/knife/environment_show_spec.rb @@ -21,15 +21,15 @@ require 'spec_helper' describe Chef::Knife::EnvironmentShow do before(:each) do @knife = Chef::Knife::EnvironmentShow.new - @knife.stub!(:msg).and_return true - @knife.stub!(:output).and_return true - @knife.stub!(:show_usage).and_return true + @knife.stub(:msg).and_return true + @knife.stub(:output).and_return true + @knife.stub(:show_usage).and_return true @knife.name_args = [ "production" ] @environment = Chef::Environment.new @environment.name("production") @environment.description("Look at me!") - Chef::Environment.stub!(:load).and_return @environment + Chef::Environment.stub(:load).and_return @environment end it "should load the environment" do diff --git a/spec/unit/knife/index_rebuild_spec.rb b/spec/unit/knife/index_rebuild_spec.rb index eb4e8020c8..3a8ec00651 100644 --- a/spec/unit/knife/index_rebuild_spec.rb +++ b/spec/unit/knife/index_rebuild_spec.rb @@ -21,7 +21,7 @@ require 'spec_helper' describe Chef::Knife::IndexRebuild do let(:knife){Chef::Knife::IndexRebuild.new} - let(:rest_client){mock(Chef::REST)} + let(:rest_client){double(Chef::REST)} let(:stub_rest!) do knife.should_receive(:rest).and_return(rest_client) @@ -29,7 +29,7 @@ describe Chef::Knife::IndexRebuild do before :each do # This keeps the test output clean - knife.ui.stub!(:stdout).and_return(StringIO.new) + knife.ui.stub(:stdout).and_return(StringIO.new) end context "#grab_api_info" do diff --git a/spec/unit/knife/knife_help.rb b/spec/unit/knife/knife_help.rb index f5753e3d62..e66a44801b 100644 --- a/spec/unit/knife/knife_help.rb +++ b/spec/unit/knife/knife_help.rb @@ -37,10 +37,10 @@ describe Chef::Knife::Help do it "should suggest topics" do @knife.name_args = [ "list" ] - @knife.ui.stub!(:msg) + @knife.ui.stub(:msg) @knife.ui.should_receive(:info).with("Available help topics are: ") @knife.ui.should_receive(:msg).with(/knife/) - @knife.stub!(:exec) + @knife.stub(:exec) @knife.should_receive(:exit).with(1) @knife.run end @@ -57,9 +57,9 @@ describe Chef::Knife::Help do describe "find_manpages_for_query" do it "should error if it does not find a match" do - @knife.ui.stub!(:error) - @knife.ui.stub!(:info) - @knife.ui.stub!(:msg) + @knife.ui.stub(:error) + @knife.ui.stub(:info) + @knife.ui.stub(:msg) @knife.should_receive(:exit).with(1) @knife.ui.should_receive(:error).with("No help found for 'chickens'") @knife.ui.should_receive(:msg).with(/knife/) @@ -69,22 +69,22 @@ describe Chef::Knife::Help do describe "print_help_topics" do it "should print the known help topics" do - @knife.ui.stub!(:msg) - @knife.ui.stub!(:info) + @knife.ui.stub(:msg) + @knife.ui.stub(:info) @knife.ui.should_receive(:msg).with(/knife/) @knife.print_help_topics end it "should shorten topics prefixed by knife-" do - @knife.ui.stub!(:msg) - @knife.ui.stub!(:info) + @knife.ui.stub(:msg) + @knife.ui.stub(:info) @knife.ui.should_receive(:msg).with(/node/) @knife.print_help_topics end it "should not leave topics prefixed by knife-" do - @knife.ui.stub!(:msg) - @knife.ui.stub!(:info) + @knife.ui.stub(:msg) + @knife.ui.stub(:info) @knife.ui.should_not_receive(:msg).with(/knife-node/) @knife.print_help_topics end diff --git a/spec/unit/knife/node_bulk_delete_spec.rb b/spec/unit/knife/node_bulk_delete_spec.rb index 51f707dfcf..3faece5469 100644 --- a/spec/unit/knife/node_bulk_delete_spec.rb +++ b/spec/unit/knife/node_bulk_delete_spec.rb @@ -26,8 +26,8 @@ describe Chef::Knife::NodeBulkDelete do @knife = Chef::Knife::NodeBulkDelete.new @knife.name_args = ["."] @stdout = StringIO.new - @knife.ui.stub!(:stdout).and_return(@stdout) - @knife.ui.stub!(:confirm).and_return(true) + @knife.ui.stub(:stdout).and_return(@stdout) + @knife.ui.stub(:confirm).and_return(true) @nodes = Hash.new %w{adam brent jacob}.each do |node_name| @nodes[node_name] = "http://localhost:4000/nodes/#{node_name}" @@ -53,11 +53,11 @@ describe Chef::Knife::NodeBulkDelete do @inflatedish_list = @nodes.keys.inject({}) do |nodes_by_name, name| node = Chef::Node.new() node.name(name) - node.stub!(:destroy).and_return(true) + node.stub(:destroy).and_return(true) nodes_by_name[name] = node nodes_by_name end - @knife.stub!(:all_nodes).and_return(@inflatedish_list) + @knife.stub(:all_nodes).and_return(@inflatedish_list) end it "should print the nodes you are about to delete" do diff --git a/spec/unit/knife/node_delete_spec.rb b/spec/unit/knife/node_delete_spec.rb index bc30ae7e83..04eca389c6 100644 --- a/spec/unit/knife/node_delete_spec.rb +++ b/spec/unit/knife/node_delete_spec.rb @@ -26,13 +26,13 @@ describe Chef::Knife::NodeDelete do :print_after => nil } @knife.name_args = [ "adam" ] - @knife.stub!(:output).and_return(true) - @knife.stub!(:confirm).and_return(true) + @knife.stub(:output).and_return(true) + @knife.stub(:confirm).and_return(true) @node = Chef::Node.new() - @node.stub!(:destroy).and_return(true) - Chef::Node.stub!(:load).and_return(@node) + @node.stub(:destroy).and_return(true) + Chef::Node.stub(:load).and_return(@node) @stdout = StringIO.new - @knife.ui.stub!(:stdout).and_return(@stdout) + @knife.ui.stub(:stdout).and_return(@stdout) end describe "run" do diff --git a/spec/unit/knife/node_edit_spec.rb b/spec/unit/knife/node_edit_spec.rb index 7fbd8192d1..27db3416f4 100644 --- a/spec/unit/knife/node_edit_spec.rb +++ b/spec/unit/knife/node_edit_spec.rb @@ -45,7 +45,7 @@ describe Chef::Knife::NodeEdit do describe "after loading the node" do before do - @knife.stub!(:node).and_return(@node) + @knife.stub(:node).and_return(@node) @node.automatic_attrs = {:go => :away} @node.default_attrs = {:hide => :me} @node.override_attrs = {:dont => :show} @@ -94,7 +94,7 @@ describe Chef::Knife::NodeEdit do describe "edit_node" do before do - @knife.stub!(:node).and_return(@node) + @knife.stub(:node).and_return(@node) end let(:subject) { @knife.node_editor.edit_node } diff --git a/spec/unit/knife/node_from_file_spec.rb b/spec/unit/knife/node_from_file_spec.rb index c6b9610d9e..56a2a08b68 100644 --- a/spec/unit/knife/node_from_file_spec.rb +++ b/spec/unit/knife/node_from_file_spec.rb @@ -28,13 +28,13 @@ describe Chef::Knife::NodeFromFile do :print_after => nil } @knife.name_args = [ "adam.rb" ] - @knife.stub!(:output).and_return(true) - @knife.stub!(:confirm).and_return(true) + @knife.stub(:output).and_return(true) + @knife.stub(:confirm).and_return(true) @node = Chef::Node.new() - @node.stub!(:save) - @knife.loader.stub!(:load_from).and_return(@node) + @node.stub(:save) + @knife.loader.stub(:load_from).and_return(@node) @stdout = StringIO.new - @knife.ui.stub!(:stdout).and_return(@stdout) + @knife.ui.stub(:stdout).and_return(@stdout) end describe "run" do diff --git a/spec/unit/knife/node_list_spec.rb b/spec/unit/knife/node_list_spec.rb index 3482eab87c..cad2d6482d 100644 --- a/spec/unit/knife/node_list_spec.rb +++ b/spec/unit/knife/node_list_spec.rb @@ -23,13 +23,13 @@ describe Chef::Knife::NodeList do Chef::Config[:node_name] = "webmonkey.example.com" Chef::Config[:environment] = nil # reset this value each time, as it is not reloaded @knife = Chef::Knife::NodeList.new - @knife.stub!(:output).and_return(true) + @knife.stub(:output).and_return(true) @list = { "foo" => "http://example.com/foo", "bar" => "http://example.com/foo" } - Chef::Node.stub!(:list).and_return(@list) - Chef::Node.stub!(:list_by_environment).and_return(@list) + Chef::Node.stub(:list).and_return(@list) + Chef::Node.stub(:list_by_environment).and_return(@list) end describe "run" do diff --git a/spec/unit/knife/node_run_list_add_spec.rb b/spec/unit/knife/node_run_list_add_spec.rb index 80e372c30a..61f2e6af4c 100644 --- a/spec/unit/knife/node_run_list_add_spec.rb +++ b/spec/unit/knife/node_run_list_add_spec.rb @@ -26,10 +26,10 @@ describe Chef::Knife::NodeRunListAdd do :after => nil } @knife.name_args = [ "adam", "role[monkey]" ] - @knife.stub!(:output).and_return(true) + @knife.stub(:output).and_return(true) @node = Chef::Node.new() - @node.stub!(:save).and_return(true) - Chef::Node.stub!(:load).and_return(@node) + @node.stub(:save).and_return(true) + Chef::Node.stub(:load).and_return(@node) end describe "run" do diff --git a/spec/unit/knife/node_run_list_remove_spec.rb b/spec/unit/knife/node_run_list_remove_spec.rb index 90869e8baa..5a008a3e07 100644 --- a/spec/unit/knife/node_run_list_remove_spec.rb +++ b/spec/unit/knife/node_run_list_remove_spec.rb @@ -27,12 +27,12 @@ describe Chef::Knife::NodeRunListRemove do @node = Chef::Node.new() @node.name("knifetest-node") @node.run_list << "role[monkey]" - @node.stub!(:save).and_return(true) + @node.stub(:save).and_return(true) - @knife.ui.stub!(:output).and_return(true) - @knife.ui.stub!(:confirm).and_return(true) + @knife.ui.stub(:output).and_return(true) + @knife.ui.stub(:confirm).and_return(true) - Chef::Node.stub!(:load).and_return(@node) + Chef::Node.stub(:load).and_return(@node) end describe "run" do diff --git a/spec/unit/knife/node_run_list_set_spec.rb b/spec/unit/knife/node_run_list_set_spec.rb index bc102695ee..02281f8385 100644 --- a/spec/unit/knife/node_run_list_set_spec.rb +++ b/spec/unit/knife/node_run_list_set_spec.rb @@ -24,10 +24,10 @@ describe Chef::Knife::NodeRunListSet do @knife = Chef::Knife::NodeRunListSet.new @knife.config = {} @knife.name_args = [ "adam", "role[monkey]" ] - @knife.stub!(:output).and_return(true) + @knife.stub(:output).and_return(true) @node = Chef::Node.new() - @node.stub!(:save).and_return(true) - Chef::Node.stub!(:load).and_return(@node) + @node.stub(:save).and_return(true) + Chef::Node.stub(:load).and_return(@node) end describe "run" do @@ -117,8 +117,8 @@ describe Chef::Knife::NodeRunListSet do @stdout = StringIO.new @stderr = StringIO.new - @knife.ui.stub!(:stdout).and_return(@stdout) - @knife.ui.stub!(:stderr).and_return(@stderr) + @knife.ui.stub(:stdout).and_return(@stdout) + @knife.ui.stub(:stderr).and_return(@stderr) end it "should exit" do diff --git a/spec/unit/knife/node_show_spec.rb b/spec/unit/knife/node_show_spec.rb index eb3593fea1..72a269278e 100644 --- a/spec/unit/knife/node_show_spec.rb +++ b/spec/unit/knife/node_show_spec.rb @@ -28,9 +28,9 @@ describe Chef::Knife::NodeShow do :environment => nil } @knife.name_args = [ "adam" ] - @knife.stub!(:output).and_return(true) + @knife.stub(:output).and_return(true) @node = Chef::Node.new() - Chef::Node.stub!(:load).and_return(@node) + Chef::Node.stub(:load).and_return(@node) end describe "run" do diff --git a/spec/unit/knife/role_bulk_delete_spec.rb b/spec/unit/knife/role_bulk_delete_spec.rb index 0ee84f6455..eb1d3b4cff 100644 --- a/spec/unit/knife/role_bulk_delete_spec.rb +++ b/spec/unit/knife/role_bulk_delete_spec.rb @@ -27,16 +27,16 @@ describe Chef::Knife::RoleBulkDelete do } @knife.name_args = ["."] @stdout = StringIO.new - @knife.ui.stub!(:stdout).and_return(@stdout) - @knife.ui.stub!(:confirm).and_return(true) + @knife.ui.stub(:stdout).and_return(@stdout) + @knife.ui.stub(:confirm).and_return(true) @roles = Hash.new %w{dev staging production}.each do |role_name| role = Chef::Role.new() role.name(role_name) - role.stub!(:destroy).and_return(true) + role.stub(:destroy).and_return(true) @roles[role_name] = role end - Chef::Role.stub!(:list).and_return(@roles) + Chef::Role.stub(:list).and_return(@roles) end describe "run" do diff --git a/spec/unit/knife/role_create_spec.rb b/spec/unit/knife/role_create_spec.rb index 39fed8fb68..a4d7392b68 100644 --- a/spec/unit/knife/role_create_spec.rb +++ b/spec/unit/knife/role_create_spec.rb @@ -26,13 +26,13 @@ describe Chef::Knife::RoleCreate do :description => nil } @knife.name_args = [ "adam" ] - @knife.stub!(:output).and_return(true) + @knife.stub(:output).and_return(true) @role = Chef::Role.new() - @role.stub!(:save) - Chef::Role.stub!(:new).and_return(@role) - @knife.stub!(:edit_data).and_return(@role) + @role.stub(:save) + Chef::Role.stub(:new).and_return(@role) + @knife.stub(:edit_data).and_return(@role) @stdout = StringIO.new - @knife.ui.stub!(:stdout).and_return(@stdout) + @knife.ui.stub(:stdout).and_return(@stdout) end describe "run" do diff --git a/spec/unit/knife/role_delete_spec.rb b/spec/unit/knife/role_delete_spec.rb index 37b16de7df..0771446d49 100644 --- a/spec/unit/knife/role_delete_spec.rb +++ b/spec/unit/knife/role_delete_spec.rb @@ -26,13 +26,13 @@ describe Chef::Knife::RoleDelete do :print_after => nil } @knife.name_args = [ "adam" ] - @knife.stub!(:output).and_return(true) - @knife.stub!(:confirm).and_return(true) + @knife.stub(:output).and_return(true) + @knife.stub(:confirm).and_return(true) @role = Chef::Role.new() - @role.stub!(:destroy).and_return(true) - Chef::Role.stub!(:load).and_return(@role) + @role.stub(:destroy).and_return(true) + Chef::Role.stub(:load).and_return(@role) @stdout = StringIO.new - @knife.ui.stub!(:stdout).and_return(@stdout) + @knife.ui.stub(:stdout).and_return(@stdout) end describe "run" do diff --git a/spec/unit/knife/role_edit_spec.rb b/spec/unit/knife/role_edit_spec.rb index 3a002f348c..f6d3b41d98 100644 --- a/spec/unit/knife/role_edit_spec.rb +++ b/spec/unit/knife/role_edit_spec.rb @@ -24,12 +24,12 @@ describe Chef::Knife::RoleEdit do @knife = Chef::Knife::RoleEdit.new @knife.config[:print_after] = nil @knife.name_args = [ "adam" ] - @knife.ui.stub!(:output).and_return(true) + @knife.ui.stub(:output).and_return(true) @role = Chef::Role.new() - @role.stub!(:save) - Chef::Role.stub!(:load).and_return(@role) - @knife.ui.stub!(:edit_data).and_return(@role) - @knife.ui.stub!(:msg) + @role.stub(:save) + Chef::Role.stub(:load).and_return(@role) + @knife.ui.stub(:edit_data).and_return(@role) + @knife.ui.stub(:msg) end describe "run" do diff --git a/spec/unit/knife/role_from_file_spec.rb b/spec/unit/knife/role_from_file_spec.rb index 9b81bb14af..986414647c 100644 --- a/spec/unit/knife/role_from_file_spec.rb +++ b/spec/unit/knife/role_from_file_spec.rb @@ -28,13 +28,13 @@ describe Chef::Knife::RoleFromFile do :print_after => nil } @knife.name_args = [ "adam.rb" ] - @knife.stub!(:output).and_return(true) - @knife.stub!(:confirm).and_return(true) + @knife.stub(:output).and_return(true) + @knife.stub(:confirm).and_return(true) @role = Chef::Role.new() - @role.stub!(:save) - @knife.loader.stub!(:load_from).and_return(@role) + @role.stub(:save) + @knife.loader.stub(:load_from).and_return(@role) @stdout = StringIO.new - @knife.ui.stub!(:stdout).and_return(@stdout) + @knife.ui.stub(:stdout).and_return(@stdout) end describe "run" do diff --git a/spec/unit/knife/role_list_spec.rb b/spec/unit/knife/role_list_spec.rb index d0cd3b4413..ef9642c04c 100644 --- a/spec/unit/knife/role_list_spec.rb +++ b/spec/unit/knife/role_list_spec.rb @@ -22,12 +22,12 @@ describe Chef::Knife::RoleList do before(:each) do Chef::Config[:node_name] = "webmonkey.example.com" @knife = Chef::Knife::RoleList.new - @knife.stub!(:output).and_return(true) + @knife.stub(:output).and_return(true) @list = { "foo" => "http://example.com/foo", "bar" => "http://example.com/foo" } - Chef::Role.stub!(:list).and_return(@list) + Chef::Role.stub(:list).and_return(@list) end describe "run" do diff --git a/spec/unit/knife/ssh_spec.rb b/spec/unit/knife/ssh_spec.rb index 0d67f33ee7..eff7c9ba5b 100644 --- a/spec/unit/knife/ssh_spec.rb +++ b/spec/unit/knife/ssh_spec.rb @@ -45,8 +45,8 @@ describe Chef::Knife::Ssh do end def configure_query(node_array) - @query.stub!(:search).and_return([node_array]) - Chef::Search::Query.stub!(:new).and_return(@query) + @query.stub(:search).and_return([node_array]) + Chef::Search::Query.stub(:new).and_return(@query) end def self.should_return_specified_attributes @@ -99,10 +99,10 @@ describe Chef::Knife::Ssh do context "when there are some hosts found but they do not have an attribute to connect with" do before do - @query.stub!(:search).and_return([[@node_foo, @node_bar]]) + @query.stub(:search).and_return([[@node_foo, @node_bar]]) @node_foo.automatic_attrs[:fqdn] = nil @node_bar.automatic_attrs[:fqdn] = nil - Chef::Search::Query.stub!(:new).and_return(@query) + Chef::Search::Query.stub(:new).and_return(@query) end it "should raise a specific error (CHEF-3402)" do @@ -175,7 +175,7 @@ describe Chef::Knife::Ssh do before :each do @knife.instance_variable_set(:@longest, 0) ssh_config = {:timeout => 50, :user => "locutus", :port => 23 } - Net::SSH.stub!(:configuration_for).with('the.b.org').and_return(ssh_config) + Net::SSH.stub(:configuration_for).with('the.b.org').and_return(ssh_config) end it "uses the port from an ssh config file" do @@ -257,7 +257,7 @@ describe Chef::Knife::Ssh do before do @query = Chef::Search::Query.new @query.should_receive(:search).and_return([[@node_foo]]) - Chef::Search::Query.stub!(:new).and_return(@query) + Chef::Search::Query.stub(:new).and_return(@query) @knife.stub(:ssh_command).and_return(exit_code) @knife.name_args = ['*:*', 'false'] end @@ -280,4 +280,111 @@ describe Chef::Knife::Ssh do end end end + + describe "#configure_password" do + before do + @knife.config.delete(:ssh_password_ng) + @knife.config.delete(:ssh_password) + end + + context "when setting ssh_password_ng from knife ssh" do + # in this case ssh_password_ng exists, but ssh_password does not + it "should prompt for a password when ssh_passsword_ng is nil" do + @knife.config[:ssh_password_ng] = nil + @knife.should_receive(:get_password).and_return("mysekretpassw0rd") + @knife.configure_password + @knife.config[:ssh_password].should == "mysekretpassw0rd" + end + + it "should set ssh_password to false if ssh_password_ng is false" do + @knife.config[:ssh_password_ng] = false + @knife.should_not_receive(:get_password) + @knife.configure_password + @knife.config[:ssh_password].should be_false + end + + it "should set ssh_password to ssh_password_ng if we set a password" do + @knife.config[:ssh_password_ng] = "mysekretpassw0rd" + @knife.should_not_receive(:get_password) + @knife.configure_password + @knife.config[:ssh_password].should == "mysekretpassw0rd" + end + end + + context "when setting ssh_password from knife bootstrap / knife * server create" do + # in this case ssh_password exists, but ssh_password_ng does not + it "should set ssh_password to nil when ssh_password is nil" do + @knife.config[:ssh_password] = nil + @knife.should_not_receive(:get_password) + @knife.configure_password + @knife.config[:ssh_password].should be_nil + end + + it "should set ssh_password to false when ssh_password is false" do + @knife.config[:ssh_password] = false + @knife.should_not_receive(:get_password) + @knife.configure_password + @knife.config[:ssh_password].should be_false + end + + it "should set ssh_password to ssh_password if we set a password" do + @knife.config[:ssh_password] = "mysekretpassw0rd" + @knife.should_not_receive(:get_password) + @knife.configure_password + @knife.config[:ssh_password].should == "mysekretpassw0rd" + end + end + context "when setting ssh_password in the config variable" do + before(:each) do + Chef::Config[:knife][:ssh_password] = "my_knife_passw0rd" + end + context "when setting ssh_password_ng from knife ssh" do + # in this case ssh_password_ng exists, but ssh_password does not + it "should prompt for a password when ssh_passsword_ng is nil" do + @knife.config[:ssh_password_ng] = nil + @knife.should_receive(:get_password).and_return("mysekretpassw0rd") + @knife.configure_password + @knife.config[:ssh_password].should == "mysekretpassw0rd" + end + + it "should set ssh_password to the configured knife.rb value if ssh_password_ng is false" do + @knife.config[:ssh_password_ng] = false + @knife.should_not_receive(:get_password) + @knife.configure_password + @knife.config[:ssh_password].should == "my_knife_passw0rd" + end + + it "should set ssh_password to ssh_password_ng if we set a password" do + @knife.config[:ssh_password_ng] = "mysekretpassw0rd" + @knife.should_not_receive(:get_password) + @knife.configure_password + @knife.config[:ssh_password].should == "mysekretpassw0rd" + end + end + + context "when setting ssh_password from knife bootstrap / knife * server create" do + # in this case ssh_password exists, but ssh_password_ng does not + it "should set ssh_password to the configured knife.rb value when ssh_password is nil" do + @knife.config[:ssh_password] = nil + @knife.should_not_receive(:get_password) + @knife.configure_password + @knife.config[:ssh_password].should == "my_knife_passw0rd" + end + + it "should set ssh_password to the configured knife.rb value when ssh_password is false" do + @knife.config[:ssh_password] = false + @knife.should_not_receive(:get_password) + @knife.configure_password + @knife.config[:ssh_password].should == "my_knife_passw0rd" + end + + it "should set ssh_password to ssh_password if we set a password" do + @knife.config[:ssh_password] = "mysekretpassw0rd" + @knife.should_not_receive(:get_password) + @knife.configure_password + @knife.config[:ssh_password].should == "mysekretpassw0rd" + end + end + end + end end diff --git a/spec/unit/knife/status_spec.rb b/spec/unit/knife/status_spec.rb index b009997ab1..6d8d9d5b25 100644 --- a/spec/unit/knife/status_spec.rb +++ b/spec/unit/knife/status_spec.rb @@ -25,12 +25,12 @@ describe Chef::Knife::Status do n.automatic_attrs["fqdn"] = "foobar" n.automatic_attrs["ohai_time"] = 1343845969 end - query = mock("Chef::Search::Query") - query.stub!(:search).and_yield(node) - Chef::Search::Query.stub!(:new).and_return(query) + query = double("Chef::Search::Query") + query.stub(:search).and_yield(node) + Chef::Search::Query.stub(:new).and_return(query) @knife = Chef::Knife::Status.new @stdout = StringIO.new - @knife.stub!(:highline).and_return(HighLine.new(StringIO.new, @stdout)) + @knife.stub(:highline).and_return(HighLine.new(StringIO.new, @stdout)) end describe "run" do diff --git a/spec/unit/knife/tag_create_spec.rb b/spec/unit/knife/tag_create_spec.rb index 925d060879..82e3ad68cd 100644 --- a/spec/unit/knife/tag_create_spec.rb +++ b/spec/unit/knife/tag_create_spec.rb @@ -7,10 +7,10 @@ describe Chef::Knife::TagCreate do @knife.name_args = [ Chef::Config[:node_name], "happytag" ] @node = Chef::Node.new - @node.stub! :save - Chef::Node.stub!(:load).and_return @node + @node.stub :save + Chef::Node.stub(:load).and_return @node @stdout = StringIO.new - @knife.ui.stub!(:stdout).and_return(@stdout) + @knife.ui.stub(:stdout).and_return(@stdout) end describe "run" do diff --git a/spec/unit/knife/tag_delete_spec.rb b/spec/unit/knife/tag_delete_spec.rb index ca279033a4..67e3dd3ff0 100644 --- a/spec/unit/knife/tag_delete_spec.rb +++ b/spec/unit/knife/tag_delete_spec.rb @@ -7,11 +7,11 @@ describe Chef::Knife::TagDelete do @knife.name_args = [ Chef::Config[:node_name], "sadtag" ] @node = Chef::Node.new - @node.stub! :save + @node.stub :save @node.tags << "sadtag" << "happytag" - Chef::Node.stub!(:load).and_return @node + Chef::Node.stub(:load).and_return @node @stdout = StringIO.new - @knife.ui.stub!(:stdout).and_return(@stdout) + @knife.ui.stub(:stdout).and_return(@stdout) end describe "run" do diff --git a/spec/unit/knife/tag_list_spec.rb b/spec/unit/knife/tag_list_spec.rb index 0de5d5ebd8..3724a5c0b7 100644 --- a/spec/unit/knife/tag_list_spec.rb +++ b/spec/unit/knife/tag_list_spec.rb @@ -7,9 +7,9 @@ describe Chef::Knife::TagList do @knife.name_args = [ Chef::Config[:node_name], "sadtag" ] @node = Chef::Node.new - @node.stub! :save + @node.stub :save @node.tags << "sadtag" << "happytag" - Chef::Node.stub!(:load).and_return @node + Chef::Node.stub(:load).and_return @node end describe "run" do diff --git a/spec/unit/knife/user_create_spec.rb b/spec/unit/knife/user_create_spec.rb index 0e36e148ac..cc803e99ce 100644 --- a/spec/unit/knife/user_create_spec.rb +++ b/spec/unit/knife/user_create_spec.rb @@ -30,14 +30,14 @@ describe Chef::Knife::UserCreate do @user_with_private_key = Chef::User.new @user_with_private_key.name "a_user" @user_with_private_key.private_key 'private_key' - @user.stub!(:create).and_return(@user_with_private_key) - Chef::User.stub!(:new).and_return(@user) - Chef::User.stub!(:from_hash).and_return(@user) - @knife.stub!(:edit_data).and_return(@user.to_hash) + @user.stub(:create).and_return(@user_with_private_key) + Chef::User.stub(:new).and_return(@user) + Chef::User.stub(:from_hash).and_return(@user) + @knife.stub(:edit_data).and_return(@user.to_hash) @stdout = StringIO.new @stderr = StringIO.new - @knife.ui.stub!(:stdout).and_return(@stdout) - @knife.ui.stub!(:stderr).and_return(@stderr) + @knife.ui.stub(:stdout).and_return(@stdout) + @knife.ui.stub(:stderr).and_return(@stderr) end it "creates a new user" do @@ -78,7 +78,7 @@ describe Chef::Knife::UserCreate do it "writes the private key to a file when --file is specified" do @knife.config[:file] = "/tmp/a_file" - filehandle = mock("filehandle") + filehandle = double("filehandle") filehandle.should_receive(:print).with('private_key') File.should_receive(:open).with("/tmp/a_file", "w").and_yield(filehandle) @knife.run diff --git a/spec/unit/knife/user_reregister_spec.rb b/spec/unit/knife/user_reregister_spec.rb index fddab57467..1cbbdb47d2 100644 --- a/spec/unit/knife/user_reregister_spec.rb +++ b/spec/unit/knife/user_reregister_spec.rb @@ -23,10 +23,10 @@ describe Chef::Knife::UserReregister do Chef::Knife::UserReregister.load_deps @knife = Chef::Knife::UserReregister.new @knife.name_args = [ 'a_user' ] - @user_mock = mock('user_mock', :private_key => "private_key") - Chef::User.stub!(:load).and_return(@user_mock) + @user_mock = double('user_mock', :private_key => "private_key") + Chef::User.stub(:load).and_return(@user_mock) @stdout = StringIO.new - @knife.ui.stub!(:stdout).and_return(@stdout) + @knife.ui.stub(:stdout).and_return(@stdout) end it 'prints usage and exits when a user name is not provided' do diff --git a/spec/unit/knife/user_show_spec.rb b/spec/unit/knife/user_show_spec.rb index f2bd959d15..af8485ad7d 100644 --- a/spec/unit/knife/user_show_spec.rb +++ b/spec/unit/knife/user_show_spec.rb @@ -23,7 +23,7 @@ describe Chef::Knife::UserShow do Chef::Knife::UserShow.load_deps @knife = Chef::Knife::UserShow.new @knife.name_args = [ 'my_user' ] - @user_mock = mock('user_mock') + @user_mock = double('user_mock') end it 'loads and displays the user' do diff --git a/spec/unit/knife_spec.rb b/spec/unit/knife_spec.rb index c6769b182a..8bf85bf604 100644 --- a/spec/unit/knife_spec.rb +++ b/spec/unit/knife_spec.rb @@ -22,6 +22,7 @@ module KnifeSpecs end require 'spec_helper' +require 'uri' describe Chef::Knife do before(:each) do @@ -29,14 +30,14 @@ describe Chef::Knife do Chef::Config[:node_name] = "webmonkey.example.com" @knife = Chef::Knife.new - @knife.ui.stub!(:puts) - @knife.ui.stub!(:print) - Chef::Log.stub!(:init) - Chef::Log.stub!(:level) + @knife.ui.stub(:puts) + @knife.ui.stub(:print) + Chef::Log.stub(:init) + Chef::Log.stub(:level) [:debug, :info, :warn, :error, :crit].each do |level_sym| - Chef::Log.stub!(level_sym) + Chef::Log.stub(level_sym) end - Chef::Knife.stub!(:puts) + Chef::Knife.stub(:puts) @stdout = StringIO.new end @@ -52,7 +53,7 @@ describe Chef::Knife do ENV.should_receive(:[]).with("PWD").and_return("/home/someuser/prod/chef-repo") end - Dir.stub!(:pwd).and_return("/home/someuser/codes/chef-repo") + Dir.stub(:pwd).and_return("/home/someuser/codes/chef-repo") end after do @@ -141,6 +142,60 @@ describe Chef::Knife do end + describe "the headers include X-Remote-Request-Id" do + + let(:headers) {{"Accept"=>"application/json", + "Accept-Encoding"=>"gzip;q=1.0,deflate;q=0.6,identity;q=0.3", + 'X-Chef-Version' => Chef::VERSION, + "Host"=>"api.opscode.piab:443", + "X-REMOTE-REQUEST-ID"=>request_id}} + + let(:request_id) {"1234"} + + let(:request_mock) { {} } + + let(:rest) do + Net::HTTP.stub(:new).and_return(http_client) + Chef::RequestID.instance.stub(:request_id).and_return(request_id) + Chef::Config.stub(:chef_server_url).and_return("https://api.opscode.piab") + command = Chef::Knife.run(%w{test yourself}) + rest = command.noauth_rest + rest + end + + let!(:http_client) do + http_client = Net::HTTP.new(url.host, url.port) + http_client.stub(:request).and_yield(http_response).and_return(http_response) + http_client + end + + let(:url) { URI.parse("https://api.opscode.piab") } + + let(:http_response) do + http_response = Net::HTTPSuccess.new("1.1", "200", "successful rest req") + http_response.stub(:read_body) + http_response.stub(:body).and_return(body) + http_response["Content-Length"] = body.bytesize.to_s + http_response + end + + let(:body) { "ninja" } + + before(:each) do + Chef::Config[:chef_server_url] = "https://api.opscode.piab" + if KnifeSpecs.const_defined?(:TestYourself) + KnifeSpecs.send :remove_const, :TestYourself + end + Kernel.load(File.join(CHEF_SPEC_DATA, 'knife_subcommand', 'test_yourself.rb')) + Chef::Knife.subcommands.each { |name, klass| Chef::Knife.subcommands.delete(name) unless klass.kind_of?(Class) } + end + + it "confirms that the headers include X-Remote-Request-Id" do + Net::HTTP::Get.should_receive(:new).with("/monkey", headers).and_return(request_mock) + rest.get_rest("monkey") + end + end + describe "when running a command" do before(:each) do if KnifeSpecs.const_defined?(:TestYourself) @@ -183,7 +238,7 @@ describe Chef::Knife do end it "exits if no subcommand matches the CLI args" do - Chef::Knife.ui.stub!(:stdout).and_return(@stdout) + Chef::Knife.ui.stub(:stdout).and_return(@stdout) Chef::Knife.ui.should_receive(:fatal) lambda {Chef::Knife.run(%w{fuuu uuuu fuuuu})}.should raise_error(SystemExit) { |e| e.status.should_not == 0 } end @@ -264,8 +319,8 @@ describe Chef::Knife do it "formats 401s nicely" do response = Net::HTTPUnauthorized.new("1.1", "401", "Unauthorized") response.instance_variable_set(:@read, true) # I hate you, net/http. - response.stub!(:body).and_return(Chef::JSONCompat.to_json(:error => "y u no syncronize your clock?")) - @knife.stub!(:run).and_raise(Net::HTTPServerException.new("401 Unauthorized", response)) + response.stub(:body).and_return(Chef::JSONCompat.to_json(:error => "y u no syncronize your clock?")) + @knife.stub(:run).and_raise(Net::HTTPServerException.new("401 Unauthorized", response)) @knife.run_with_pretty_exceptions @stderr.string.should match(/ERROR: Failed to authenticate to/) @stdout.string.should match(/Response: y u no syncronize your clock\?/) @@ -274,9 +329,9 @@ describe Chef::Knife do it "formats 403s nicely" do response = Net::HTTPForbidden.new("1.1", "403", "Forbidden") response.instance_variable_set(:@read, true) # I hate you, net/http. - response.stub!(:body).and_return(Chef::JSONCompat.to_json(:error => "y u no administrator")) - @knife.stub!(:run).and_raise(Net::HTTPServerException.new("403 Forbidden", response)) - @knife.stub!(:username).and_return("sadpanda") + response.stub(:body).and_return(Chef::JSONCompat.to_json(:error => "y u no administrator")) + @knife.stub(:run).and_raise(Net::HTTPServerException.new("403 Forbidden", response)) + @knife.stub(:username).and_return("sadpanda") @knife.run_with_pretty_exceptions @stderr.string.should match(%r[ERROR: You authenticated successfully to http.+ as sadpanda but you are not authorized for this action]) @stdout.string.should match(%r[Response: y u no administrator]) @@ -285,8 +340,8 @@ describe Chef::Knife do it "formats 400s nicely" do response = Net::HTTPBadRequest.new("1.1", "400", "Bad Request") response.instance_variable_set(:@read, true) # I hate you, net/http. - response.stub!(:body).and_return(Chef::JSONCompat.to_json(:error => "y u search wrong")) - @knife.stub!(:run).and_raise(Net::HTTPServerException.new("400 Bad Request", response)) + response.stub(:body).and_return(Chef::JSONCompat.to_json(:error => "y u search wrong")) + @knife.stub(:run).and_raise(Net::HTTPServerException.new("400 Bad Request", response)) @knife.run_with_pretty_exceptions @stderr.string.should match(%r[ERROR: The data in your request was invalid]) @stdout.string.should match(%r[Response: y u search wrong]) @@ -295,8 +350,8 @@ describe Chef::Knife do it "formats 404s nicely" do response = Net::HTTPNotFound.new("1.1", "404", "Not Found") response.instance_variable_set(:@read, true) # I hate you, net/http. - response.stub!(:body).and_return(Chef::JSONCompat.to_json(:error => "nothing to see here")) - @knife.stub!(:run).and_raise(Net::HTTPServerException.new("404 Not Found", response)) + response.stub(:body).and_return(Chef::JSONCompat.to_json(:error => "nothing to see here")) + @knife.stub(:run).and_raise(Net::HTTPServerException.new("404 Not Found", response)) @knife.run_with_pretty_exceptions @stderr.string.should match(%r[ERROR: The object you are looking for could not be found]) @stdout.string.should match(%r[Response: nothing to see here]) @@ -305,8 +360,8 @@ describe Chef::Knife do it "formats 500s nicely" do response = Net::HTTPInternalServerError.new("1.1", "500", "Internal Server Error") response.instance_variable_set(:@read, true) # I hate you, net/http. - response.stub!(:body).and_return(Chef::JSONCompat.to_json(:error => "sad trombone")) - @knife.stub!(:run).and_raise(Net::HTTPFatalError.new("500 Internal Server Error", response)) + response.stub(:body).and_return(Chef::JSONCompat.to_json(:error => "sad trombone")) + @knife.stub(:run).and_raise(Net::HTTPFatalError.new("500 Internal Server Error", response)) @knife.run_with_pretty_exceptions @stderr.string.should match(%r[ERROR: internal server error]) @stdout.string.should match(%r[Response: sad trombone]) @@ -315,8 +370,8 @@ describe Chef::Knife do it "formats 502s nicely" do response = Net::HTTPBadGateway.new("1.1", "502", "Bad Gateway") response.instance_variable_set(:@read, true) # I hate you, net/http. - response.stub!(:body).and_return(Chef::JSONCompat.to_json(:error => "sadder trombone")) - @knife.stub!(:run).and_raise(Net::HTTPFatalError.new("502 Bad Gateway", response)) + response.stub(:body).and_return(Chef::JSONCompat.to_json(:error => "sadder trombone")) + @knife.stub(:run).and_raise(Net::HTTPFatalError.new("502 Bad Gateway", response)) @knife.run_with_pretty_exceptions @stderr.string.should match(%r[ERROR: bad gateway]) @stdout.string.should match(%r[Response: sadder trombone]) @@ -325,8 +380,8 @@ describe Chef::Knife do it "formats 503s nicely" do response = Net::HTTPServiceUnavailable.new("1.1", "503", "Service Unavailable") response.instance_variable_set(:@read, true) # I hate you, net/http. - response.stub!(:body).and_return(Chef::JSONCompat.to_json(:error => "saddest trombone")) - @knife.stub!(:run).and_raise(Net::HTTPFatalError.new("503 Service Unavailable", response)) + response.stub(:body).and_return(Chef::JSONCompat.to_json(:error => "saddest trombone")) + @knife.stub(:run).and_raise(Net::HTTPFatalError.new("503 Service Unavailable", response)) @knife.run_with_pretty_exceptions @stderr.string.should match(%r[ERROR: Service temporarily unavailable]) @stdout.string.should match(%r[Response: saddest trombone]) @@ -335,15 +390,15 @@ describe Chef::Knife do it "formats other HTTP errors nicely" do response = Net::HTTPPaymentRequired.new("1.1", "402", "Payment Required") response.instance_variable_set(:@read, true) # I hate you, net/http. - response.stub!(:body).and_return(Chef::JSONCompat.to_json(:error => "nobugfixtillyoubuy")) - @knife.stub!(:run).and_raise(Net::HTTPServerException.new("402 Payment Required", response)) + response.stub(:body).and_return(Chef::JSONCompat.to_json(:error => "nobugfixtillyoubuy")) + @knife.stub(:run).and_raise(Net::HTTPServerException.new("402 Payment Required", response)) @knife.run_with_pretty_exceptions @stderr.string.should match(%r[ERROR: Payment Required]) @stdout.string.should match(%r[Response: nobugfixtillyoubuy]) end it "formats NameError and NoMethodError nicely" do - @knife.stub!(:run).and_raise(NameError.new("Undefined constant FUUU")) + @knife.stub(:run).and_raise(NameError.new("Undefined constant FUUU")) @knife.run_with_pretty_exceptions @stderr.string.should match(%r[ERROR: knife encountered an unexpected error]) @stdout.string.should match(%r[This may be a bug in the 'knife' knife command or plugin]) @@ -351,15 +406,15 @@ describe Chef::Knife do end it "formats missing private key errors nicely" do - @knife.stub!(:run).and_raise(Chef::Exceptions::PrivateKeyMissing.new('key not there')) - @knife.stub!(:api_key).and_return("/home/root/.chef/no-key-here.pem") + @knife.stub(:run).and_raise(Chef::Exceptions::PrivateKeyMissing.new('key not there')) + @knife.stub(:api_key).and_return("/home/root/.chef/no-key-here.pem") @knife.run_with_pretty_exceptions @stderr.string.should match(%r[ERROR: Your private key could not be loaded from /home/root/.chef/no-key-here.pem]) @stdout.string.should match(%r[Check your configuration file and ensure that your private key is readable]) end it "formats connection refused errors nicely" do - @knife.stub!(:run).and_raise(Errno::ECONNREFUSED.new('y u no shut up')) + @knife.stub(:run).and_raise(Errno::ECONNREFUSED.new('y u no shut up')) @knife.run_with_pretty_exceptions # Errno::ECONNREFUSED message differs by platform # *nix = Errno::ECONNREFUSED: Connection refused diff --git a/spec/unit/lwrp_spec.rb b/spec/unit/lwrp_spec.rb index 19d3504f3c..0e0ea5dbb7 100644 --- a/spec/unit/lwrp_spec.rb +++ b/spec/unit/lwrp_spec.rb @@ -33,7 +33,7 @@ describe "LWRP" do describe "when overriding an existing class" do before :each do - $stderr.stub!(:write) + $stderr.stub(:write) end it "should log if attempting to load resource of same name" do @@ -179,7 +179,7 @@ describe "LWRP" do end it "should create a method for each attribute" do - new_resource = mock("new resource", :null_object=>true) + new_resource = double("new resource").as_null_object Chef::Provider::LwrpBuckPasser.new(nil, new_resource).methods.map{|m|m.to_sym}.should include(:action_pass_buck) Chef::Provider::LwrpThumbTwiddler.new(nil, new_resource).methods.map{|m|m.to_sym}.should include(:action_twiddle_thumbs) end diff --git a/spec/unit/mixin/checksum_spec.rb b/spec/unit/mixin/checksum_spec.rb index c0f0acdeb4..54689c9992 100644 --- a/spec/unit/mixin/checksum_spec.rb +++ b/spec/unit/mixin/checksum_spec.rb @@ -29,8 +29,8 @@ describe Chef::Mixin::Checksum do @checksum_user = Chef::CMCCheck.new @cache = Chef::Digester.instance @file = CHEF_SPEC_DATA + "/checksum/random.txt" - @stat = mock("File::Stat", { :mtime => Time.at(0) }) - File.stub!(:stat).and_return(@stat) + @stat = double("File::Stat", { :mtime => Time.at(0) }) + File.stub(:stat).and_return(@stat) end it "gets the checksum of a file" do diff --git a/spec/unit/mixin/command_spec.rb b/spec/unit/mixin/command_spec.rb index a2a2fef461..96660be436 100644 --- a/spec/unit/mixin/command_spec.rb +++ b/spec/unit/mixin/command_spec.rb @@ -76,7 +76,7 @@ describe Chef::Mixin::Command, :volatile do include Chef::Mixin::Command it "logs the command's stderr and stdout output if the command failed" do - Chef::Log.stub!(:level).and_return(:debug) + Chef::Log.stub(:level).and_return(:debug) begin run_command(:command => "sh -c 'echo hello; echo world >&2; false'") violated "Exception expected, but nothing raised." diff --git a/spec/unit/mixin/enforce_ownership_and_permissions_spec.rb b/spec/unit/mixin/enforce_ownership_and_permissions_spec.rb index cffb1b941d..fe72d53de5 100644 --- a/spec/unit/mixin/enforce_ownership_and_permissions_spec.rb +++ b/spec/unit/mixin/enforce_ownership_and_permissions_spec.rb @@ -56,8 +56,8 @@ describe Chef::Mixin::EnforceOwnershipAndPermissions do Struct::Passwd.new("root", "x", 0, 0, "root", "/root", "/bin/bash") end group_struct = OpenStruct.new(:name => "root", :passwd => "x", :gid => 0) - Etc.stub!(:getpwuid).and_return(passwd_struct) - Etc.stub!(:getgrgid).and_return(group_struct) + Etc.stub(:getpwuid).and_return(passwd_struct) + Etc.stub(:getgrgid).and_return(group_struct) end it "does not set updated_by_last_action on the new resource" do @@ -80,8 +80,8 @@ describe Chef::Mixin::EnforceOwnershipAndPermissions do Struct::Passwd.new("root", "x", 0, 0, "root", "/root", "/bin/bash") end group_struct = OpenStruct.new(:name => "root", :passwd => "x", :gid => 0) - Etc.stub!(:getpwuid).and_return(passwd_struct) - Etc.stub!(:getgrgid).and_return(group_struct) + Etc.stub(:getpwuid).and_return(passwd_struct) + Etc.stub(:getgrgid).and_return(group_struct) end it "sets updated_by_last_action on the new resource" do diff --git a/spec/unit/mixin/params_validate_spec.rb b/spec/unit/mixin/params_validate_spec.rb index 2947ebea4a..cc2fe198ca 100644 --- a/spec/unit/mixin/params_validate_spec.rb +++ b/spec/unit/mixin/params_validate_spec.rb @@ -32,7 +32,7 @@ describe Chef::Mixin::ParamsValidate do end it "should allow a hash and a hash as arguments to validate" do - lambda { @vo.validate({:one => "two"}, {}) }.should_not raise_error(ArgumentError) + lambda { @vo.validate({:one => "two"}, {}) }.should_not raise_error end it "should raise an argument error if validate is called incorrectly" do @@ -40,17 +40,17 @@ describe Chef::Mixin::ParamsValidate do end it "should require validation map keys to be symbols or strings" do - lambda { @vo.validate({:one => "two"}, { :one => true }) }.should_not raise_error(ArgumentError) - lambda { @vo.validate({:one => "two"}, { "one" => true }) }.should_not raise_error(ArgumentError) + lambda { @vo.validate({:one => "two"}, { :one => true }) }.should_not raise_error + lambda { @vo.validate({:one => "two"}, { "one" => true }) }.should_not raise_error lambda { @vo.validate({:one => "two"}, { Hash.new => true }) }.should raise_error(ArgumentError) end it "should allow options to be required with true" do - lambda { @vo.validate({:one => "two"}, { :one => true }) }.should_not raise_error(ArgumentError) + lambda { @vo.validate({:one => "two"}, { :one => true }) }.should_not raise_error end it "should allow options to be optional with false" do - lambda { @vo.validate({}, {:one => false})}.should_not raise_error(ArgumentError) + lambda { @vo.validate({}, {:one => false})}.should_not raise_error end it "should allow you to check what kind_of? thing an argument is with kind_of" do @@ -63,7 +63,7 @@ describe Chef::Mixin::ParamsValidate do } } ) - }.should_not raise_error(ArgumentError) + }.should_not raise_error lambda { @vo.validate( @@ -87,7 +87,7 @@ describe Chef::Mixin::ParamsValidate do } } ) - }.should_not raise_error(ArgumentError) + }.should_not raise_error lambda { @vo.validate( @@ -109,7 +109,7 @@ describe Chef::Mixin::ParamsValidate do } } ) - }.should_not raise_error(ArgumentError) + }.should_not raise_error end it "should allow you to specify whether an object has a method with respond_to" do @@ -122,7 +122,7 @@ describe Chef::Mixin::ParamsValidate do } } ) - }.should_not raise_error(ArgumentError) + }.should_not raise_error lambda { @vo.validate( @@ -146,7 +146,7 @@ describe Chef::Mixin::ParamsValidate do } } ) - }.should_not raise_error(ArgumentError) + }.should_not raise_error lambda { @vo.validate( @@ -180,7 +180,7 @@ describe Chef::Mixin::ParamsValidate do } } ) - }.should_not raise_error(ArgumentError) + }.should_not raise_error lambda { @vo.validate( @@ -208,7 +208,7 @@ describe Chef::Mixin::ParamsValidate do } } ) - }.should_not raise_error(ArgumentError) + }.should_not raise_error lambda { @vo.validate( @@ -250,7 +250,7 @@ describe Chef::Mixin::ParamsValidate do :three => { :default => "neato mosquito" } } ) - }.should_not raise_error(ArgumentError) + }.should_not raise_error args[:three].should == "neato mosquito" lambda { @vo.validate( @@ -292,7 +292,7 @@ describe Chef::Mixin::ParamsValidate do it "should accept keys that are strings in the options" do lambda { @vo.validate({ "one" => "two" }, { :one => { :regex => /^two$/ }}) - }.should_not raise_error(ArgumentError) + }.should_not raise_error end it "should allow an array to kind_of" do @@ -305,7 +305,7 @@ describe Chef::Mixin::ParamsValidate do } } ) - }.should_not raise_error(ArgumentError) + }.should_not raise_error lambda { @vo.validate( {:one => ["string"]}, @@ -315,7 +315,7 @@ describe Chef::Mixin::ParamsValidate do } } ) - }.should_not raise_error(ArgumentError) + }.should_not raise_error lambda { @vo.validate( {:one => Hash.new}, @@ -360,7 +360,7 @@ describe Chef::Mixin::ParamsValidate do it "should not raise an error when argument is nil and required is false" do lambda { @vo.set_or_return(:test, nil, { :required => false }) - }.should_not raise_error(ArgumentError) + }.should_not raise_error end it "should set and return @name, then return @name for foo when argument is nil" do diff --git a/spec/unit/mixin/path_sanity_spec.rb b/spec/unit/mixin/path_sanity_spec.rb index bea2e78ecd..64c667b483 100644 --- a/spec/unit/mixin/path_sanity_spec.rb +++ b/spec/unit/mixin/path_sanity_spec.rb @@ -33,9 +33,9 @@ describe Chef::Mixin::PathSanity do Chef::Config[:enforce_path_sanity] = true @ruby_bindir = '/some/ruby/bin' @gem_bindir = '/some/gem/bin' - Gem.stub!(:bindir).and_return(@gem_bindir) - RbConfig::CONFIG.stub!(:[]).with('bindir').and_return(@ruby_bindir) - Chef::Platform.stub!(:windows?).and_return(false) + Gem.stub(:bindir).and_return(@gem_bindir) + RbConfig::CONFIG.stub(:[]).with('bindir').and_return(@ruby_bindir) + Chef::Platform.stub(:windows?).and_return(false) end it "adds all useful PATHs even if environment is an empty hash" do @@ -65,8 +65,8 @@ describe Chef::Mixin::PathSanity do it "does not create entries for Ruby/Gem bindirs if they exist in SANE_PATH or PATH" do ruby_bindir = '/usr/bin' gem_bindir = '/yo/gabba/gabba' - Gem.stub!(:bindir).and_return(gem_bindir) - RbConfig::CONFIG.stub!(:[]).with('bindir').and_return(ruby_bindir) + Gem.stub(:bindir).and_return(gem_bindir) + RbConfig::CONFIG.stub(:[]).with('bindir').and_return(ruby_bindir) env = {"PATH" => gem_bindir} @sanity.enforce_path_sanity(env) env["PATH"].should == "/yo/gabba/gabba:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" @@ -75,9 +75,9 @@ describe Chef::Mixin::PathSanity do it "builds a valid windows path" do ruby_bindir = 'C:\ruby\bin' gem_bindir = 'C:\gems\bin' - Gem.stub!(:bindir).and_return(gem_bindir) - RbConfig::CONFIG.stub!(:[]).with('bindir').and_return(ruby_bindir) - Chef::Platform.stub!(:windows?).and_return(true) + Gem.stub(:bindir).and_return(gem_bindir) + RbConfig::CONFIG.stub(:[]).with('bindir').and_return(ruby_bindir) + Chef::Platform.stub(:windows?).and_return(true) env = {"PATH" => 'C:\Windows\system32;C:\mr\softie'} @sanity.enforce_path_sanity(env) env["PATH"].should == "C:\\Windows\\system32;C:\\mr\\softie;#{ruby_bindir};#{gem_bindir}" diff --git a/spec/unit/mixin/securable_spec.rb b/spec/unit/mixin/securable_spec.rb index 0a2dba1ead..89916e0039 100644 --- a/spec/unit/mixin/securable_spec.rb +++ b/spec/unit/mixin/securable_spec.rb @@ -28,14 +28,14 @@ describe Chef::Mixin::Securable do end it "should accept a group name or id for group" do - lambda { @securable.group "root" }.should_not raise_error(ArgumentError) - lambda { @securable.group 123 }.should_not raise_error(ArgumentError) + lambda { @securable.group "root" }.should_not raise_error + lambda { @securable.group 123 }.should_not raise_error lambda { @securable.group "+bad:group" }.should raise_error(ArgumentError) end it "should accept a user name or id for owner" do - lambda { @securable.owner "root" }.should_not raise_error(ArgumentError) - lambda { @securable.owner 123 }.should_not raise_error(ArgumentError) + lambda { @securable.owner "root" }.should_not raise_error + lambda { @securable.owner 123 }.should_not raise_error lambda { @securable.owner "+bad:owner" }.should raise_error(ArgumentError) end @@ -55,30 +55,30 @@ describe Chef::Mixin::Securable do end it "should accept group/owner names with spaces and backslashes" do - lambda { @securable.group 'test\ group' }.should_not raise_error(ArgumentError) - lambda { @securable.owner 'test\ group' }.should_not raise_error(ArgumentError) + lambda { @securable.group 'test\ group' }.should_not raise_error + lambda { @securable.owner 'test\ group' }.should_not raise_error end it "should accept group/owner names that are a single character or digit" do - lambda { @securable.group 'v' }.should_not raise_error(ArgumentError) - lambda { @securable.group '1' }.should_not raise_error(ArgumentError) - lambda { @securable.owner 'v' }.should_not raise_error(ArgumentError) - lambda { @securable.owner '1' }.should_not raise_error(ArgumentError) + lambda { @securable.group 'v' }.should_not raise_error + lambda { @securable.group '1' }.should_not raise_error + lambda { @securable.owner 'v' }.should_not raise_error + lambda { @securable.owner '1' }.should_not raise_error end it "should not accept group/owner names starting with '-', '+', or '~'" do lambda { @securable.group '-test' }.should raise_error(ArgumentError) lambda { @securable.group '+test' }.should raise_error(ArgumentError) lambda { @securable.group '~test' }.should raise_error(ArgumentError) - lambda { @securable.group 'te-st' }.should_not raise_error(ArgumentError) - lambda { @securable.group 'te+st' }.should_not raise_error(ArgumentError) - lambda { @securable.group 'te~st' }.should_not raise_error(ArgumentError) + lambda { @securable.group 'te-st' }.should_not raise_error + lambda { @securable.group 'te+st' }.should_not raise_error + lambda { @securable.group 'te~st' }.should_not raise_error lambda { @securable.owner '-test' }.should raise_error(ArgumentError) lambda { @securable.owner '+test' }.should raise_error(ArgumentError) lambda { @securable.owner '~test' }.should raise_error(ArgumentError) - lambda { @securable.owner 'te-st' }.should_not raise_error(ArgumentError) - lambda { @securable.owner 'te+st' }.should_not raise_error(ArgumentError) - lambda { @securable.owner 'te~st' }.should_not raise_error(ArgumentError) + lambda { @securable.owner 'te-st' }.should_not raise_error + lambda { @securable.owner 'te+st' }.should_not raise_error + lambda { @securable.owner 'te~st' }.should_not raise_error end it "should not accept group/owner names containing ':', ',' or non-space whitespace" do @@ -109,11 +109,11 @@ describe Chef::Mixin::Securable do end it "should accept Active Directory-style domain names pulled in via LDAP (on unix hosts)" do - lambda { @securable.owner "domain\@user" }.should_not raise_error(ArgumentError) - lambda { @securable.owner "domain\\user" }.should_not raise_error(ArgumentError) - lambda { @securable.group "domain\@group" }.should_not raise_error(ArgumentError) - lambda { @securable.group "domain\\group" }.should_not raise_error(ArgumentError) - lambda { @securable.group "domain\\group^name" }.should_not raise_error(ArgumentError) + lambda { @securable.owner "domain\@user" }.should_not raise_error + lambda { @securable.owner "domain\\user" }.should_not raise_error + lambda { @securable.group "domain\@group" }.should_not raise_error + lambda { @securable.group "domain\\group" }.should_not raise_error + lambda { @securable.group "domain\\group^name" }.should_not raise_error end it "should not accept group/owner names containing embedded carriage returns" do @@ -125,22 +125,22 @@ describe Chef::Mixin::Securable do end it "should accept group/owner names in UTF-8" do - lambda { @securable.group 'tëst' }.should_not raise_error(ArgumentError) - lambda { @securable.group 'ë' }.should_not raise_error(ArgumentError) - lambda { @securable.owner 'tëst' }.should_not raise_error(ArgumentError) - lambda { @securable.owner 'ë' }.should_not raise_error(ArgumentError) + lambda { @securable.group 'tëst' }.should_not raise_error + lambda { @securable.group 'ë' }.should_not raise_error + lambda { @securable.owner 'tëst' }.should_not raise_error + lambda { @securable.owner 'ë' }.should_not raise_error end it "should accept a unix file mode in string form as an octal number" do - lambda { @securable.mode "0" }.should_not raise_error(ArgumentError) - lambda { @securable.mode "0000" }.should_not raise_error(ArgumentError) - lambda { @securable.mode "0111" }.should_not raise_error(ArgumentError) - lambda { @securable.mode "0444" }.should_not raise_error(ArgumentError) + lambda { @securable.mode "0" }.should_not raise_error + lambda { @securable.mode "0000" }.should_not raise_error + lambda { @securable.mode "0111" }.should_not raise_error + lambda { @securable.mode "0444" }.should_not raise_error - lambda { @securable.mode "111" }.should_not raise_error(ArgumentError) - lambda { @securable.mode "444" }.should_not raise_error(ArgumentError) - lambda { @securable.mode "7777" }.should_not raise_error(ArgumentError) - lambda { @securable.mode "07777" }.should_not raise_error(ArgumentError) + lambda { @securable.mode "111" }.should_not raise_error + lambda { @securable.mode "444" }.should_not raise_error + lambda { @securable.mode "7777" }.should_not raise_error + lambda { @securable.mode "07777" }.should_not raise_error lambda { @securable.mode "-01" }.should raise_error(ArgumentError) lambda { @securable.mode "010000" }.should raise_error(ArgumentError) @@ -156,17 +156,17 @@ describe Chef::Mixin::Securable do end it "should accept a unix file mode in numeric form as a ruby-interpreted integer" do - lambda { @securable.mode 0 }.should_not raise_error(ArgumentError) - lambda { @securable.mode 0000 }.should_not raise_error(ArgumentError) - lambda { @securable.mode 444 }.should_not raise_error(ArgumentError) - lambda { @securable.mode 0444 }.should_not raise_error(ArgumentError) - lambda { @securable.mode 07777 }.should_not raise_error(ArgumentError) + lambda { @securable.mode 0 }.should_not raise_error + lambda { @securable.mode 0000 }.should_not raise_error + lambda { @securable.mode 444 }.should_not raise_error + lambda { @securable.mode 0444 }.should_not raise_error + lambda { @securable.mode 07777 }.should_not raise_error - lambda { @securable.mode 292 }.should_not raise_error(ArgumentError) - lambda { @securable.mode 4095 }.should_not raise_error(ArgumentError) + lambda { @securable.mode 292 }.should_not raise_error + lambda { @securable.mode 4095 }.should_not raise_error - lambda { @securable.mode 0111 }.should_not raise_error(ArgumentError) - lambda { @securable.mode 73 }.should_not raise_error(ArgumentError) + lambda { @securable.mode 0111 }.should_not raise_error + lambda { @securable.mode 73 }.should_not raise_error lambda { @securable.mode -01 }.should raise_error(ArgumentError) lambda { @securable.mode 010000 }.should raise_error(ArgumentError) @@ -193,13 +193,13 @@ describe Chef::Mixin::Securable do end it "should accept a unix file mode in string form as an octal number" do - lambda { @securable.mode "0" }.should_not raise_error(ArgumentError) - lambda { @securable.mode "0000" }.should_not raise_error(ArgumentError) - lambda { @securable.mode "0111" }.should_not raise_error(ArgumentError) - lambda { @securable.mode "0444" }.should_not raise_error(ArgumentError) + lambda { @securable.mode "0" }.should_not raise_error + lambda { @securable.mode "0000" }.should_not raise_error + lambda { @securable.mode "0111" }.should_not raise_error + lambda { @securable.mode "0444" }.should_not raise_error - lambda { @securable.mode "111" }.should_not raise_error(ArgumentError) - lambda { @securable.mode "444" }.should_not raise_error(ArgumentError) + lambda { @securable.mode "111" }.should_not raise_error + lambda { @securable.mode "444" }.should_not raise_error lambda { @securable.mode "7777" }.should raise_error(ArgumentError) lambda { @securable.mode "07777" }.should raise_error(ArgumentError) @@ -217,17 +217,17 @@ describe Chef::Mixin::Securable do end it "should accept a unix file mode in numeric form as a ruby-interpreted integer" do - lambda { @securable.mode 0 }.should_not raise_error(ArgumentError) - lambda { @securable.mode 0000 }.should_not raise_error(ArgumentError) - lambda { @securable.mode 444 }.should_not raise_error(ArgumentError) - lambda { @securable.mode 0444 }.should_not raise_error(ArgumentError) + lambda { @securable.mode 0 }.should_not raise_error + lambda { @securable.mode 0000 }.should_not raise_error + lambda { @securable.mode 444 }.should_not raise_error + lambda { @securable.mode 0444 }.should_not raise_error lambda { @securable.mode 07777 }.should raise_error(ArgumentError) - lambda { @securable.mode 292 }.should_not raise_error(ArgumentError) + lambda { @securable.mode 292 }.should_not raise_error lambda { @securable.mode 4095 }.should raise_error(ArgumentError) - lambda { @securable.mode 0111 }.should_not raise_error(ArgumentError) - lambda { @securable.mode 73 }.should_not raise_error(ArgumentError) + lambda { @securable.mode 0111 }.should_not raise_error + lambda { @securable.mode 73 }.should_not raise_error lambda { @securable.mode -01 }.should raise_error(ArgumentError) lambda { @securable.mode 010000 }.should raise_error(ArgumentError) @@ -236,46 +236,46 @@ describe Chef::Mixin::Securable do end it "should allow you to specify :full_control, :modify, :read_execute, :read, and :write rights" do - lambda { @securable.rights :full_control, "The Dude" }.should_not raise_error(ArgumentError) - lambda { @securable.rights :modify, "The Dude" }.should_not raise_error(ArgumentError) - lambda { @securable.rights :read_execute, "The Dude" }.should_not raise_error(ArgumentError) - lambda { @securable.rights :read, "The Dude" }.should_not raise_error(ArgumentError) - lambda { @securable.rights :write, "The Dude" }.should_not raise_error(ArgumentError) + lambda { @securable.rights :full_control, "The Dude" }.should_not raise_error + lambda { @securable.rights :modify, "The Dude" }.should_not raise_error + lambda { @securable.rights :read_execute, "The Dude" }.should_not raise_error + lambda { @securable.rights :read, "The Dude" }.should_not raise_error + lambda { @securable.rights :write, "The Dude" }.should_not raise_error lambda { @securable.rights :to_party, "The Dude" }.should raise_error(ArgumentError) end it "should allow you to specify :full_control, :modify, :read_execute, :read, and :write deny_rights" do - lambda { @securable.deny_rights :full_control, "The Dude" }.should_not raise_error(ArgumentError) - lambda { @securable.deny_rights :modify, "The Dude" }.should_not raise_error(ArgumentError) - lambda { @securable.deny_rights :read_execute, "The Dude" }.should_not raise_error(ArgumentError) - lambda { @securable.deny_rights :read, "The Dude" }.should_not raise_error(ArgumentError) - lambda { @securable.deny_rights :write, "The Dude" }.should_not raise_error(ArgumentError) + lambda { @securable.deny_rights :full_control, "The Dude" }.should_not raise_error + lambda { @securable.deny_rights :modify, "The Dude" }.should_not raise_error + lambda { @securable.deny_rights :read_execute, "The Dude" }.should_not raise_error + lambda { @securable.deny_rights :read, "The Dude" }.should_not raise_error + lambda { @securable.deny_rights :write, "The Dude" }.should_not raise_error lambda { @securable.deny_rights :to_party, "The Dude" }.should raise_error(ArgumentError) end it "should accept a principal as a string or an array" do - lambda { @securable.rights :read, "The Dude" }.should_not raise_error(ArgumentError) - lambda { @securable.rights :read, ["The Dude","Donny"] }.should_not raise_error(ArgumentError) + lambda { @securable.rights :read, "The Dude" }.should_not raise_error + lambda { @securable.rights :read, ["The Dude","Donny"] }.should_not raise_error lambda { @securable.rights :read, 3 }.should raise_error(ArgumentError) end it "should allow you to specify whether the permissions applies_to_children with true/false/:containers_only/:objects_only" do - lambda { @securable.rights :read, "The Dude", :applies_to_children => false }.should_not raise_error(ArgumentError) - lambda { @securable.rights :read, "The Dude", :applies_to_children => true }.should_not raise_error(ArgumentError) - lambda { @securable.rights :read, "The Dude", :applies_to_children => :containers_only }.should_not raise_error(ArgumentError) - lambda { @securable.rights :read, "The Dude", :applies_to_children => :objects_only }.should_not raise_error(ArgumentError) + lambda { @securable.rights :read, "The Dude", :applies_to_children => false }.should_not raise_error + lambda { @securable.rights :read, "The Dude", :applies_to_children => true }.should_not raise_error + lambda { @securable.rights :read, "The Dude", :applies_to_children => :containers_only }.should_not raise_error + lambda { @securable.rights :read, "The Dude", :applies_to_children => :objects_only }.should_not raise_error lambda { @securable.rights :read, "The Dude", :applies_to_children => 'poop' }.should raise_error(ArgumentError) end it "should allow you to specify whether the permissions applies_to_self with true/false" do - lambda { @securable.rights :read, "The Dude", :applies_to_children => true, :applies_to_self => false }.should_not raise_error(ArgumentError) - lambda { @securable.rights :read, "The Dude", :applies_to_self => true }.should_not raise_error(ArgumentError) + lambda { @securable.rights :read, "The Dude", :applies_to_children => true, :applies_to_self => false }.should_not raise_error + lambda { @securable.rights :read, "The Dude", :applies_to_self => true }.should_not raise_error lambda { @securable.rights :read, "The Dude", :applies_to_self => 'poop' }.should raise_error(ArgumentError) end it "should allow you to specify whether the permissions applies one_level_deep with true/false" do - lambda { @securable.rights :read, "The Dude", :applies_to_children => true, :one_level_deep => false }.should_not raise_error(ArgumentError) - lambda { @securable.rights :read, "The Dude", :applies_to_children => true, :one_level_deep => true }.should_not raise_error(ArgumentError) + lambda { @securable.rights :read, "The Dude", :applies_to_children => true, :one_level_deep => false }.should_not raise_error + lambda { @securable.rights :read, "The Dude", :applies_to_children => true, :one_level_deep => true }.should_not raise_error lambda { @securable.rights :read, "The Dude", :applies_to_children => true, :one_level_deep => 'poop' }.should raise_error(ArgumentError) end @@ -290,26 +290,26 @@ describe Chef::Mixin::Securable do end it "should allow you to specify whether the permission applies_to_self only if you specified applies_to_children" do - lambda { @securable.rights :read, "The Dude", :applies_to_children => true, :applies_to_self => true }.should_not raise_error(ArgumentError) - lambda { @securable.rights :read, "The Dude", :applies_to_children => true, :applies_to_self => false }.should_not raise_error(ArgumentError) - lambda { @securable.rights :read, "The Dude", :applies_to_children => false, :applies_to_self => true }.should_not raise_error(ArgumentError) + lambda { @securable.rights :read, "The Dude", :applies_to_children => true, :applies_to_self => true }.should_not raise_error + lambda { @securable.rights :read, "The Dude", :applies_to_children => true, :applies_to_self => false }.should_not raise_error + lambda { @securable.rights :read, "The Dude", :applies_to_children => false, :applies_to_self => true }.should_not raise_error lambda { @securable.rights :read, "The Dude", :applies_to_children => false, :applies_to_self => false }.should raise_error(ArgumentError) - lambda { @securable.rights :read, "The Dude", :applies_to_self => true }.should_not raise_error(ArgumentError) - lambda { @securable.rights :read, "The Dude", :applies_to_self => false }.should_not raise_error(ArgumentError) + lambda { @securable.rights :read, "The Dude", :applies_to_self => true }.should_not raise_error + lambda { @securable.rights :read, "The Dude", :applies_to_self => false }.should_not raise_error end it "should allow you to specify whether the permission applies one_level_deep only if you specified applies_to_children" do - lambda { @securable.rights :read, "The Dude", :applies_to_children => true, :one_level_deep => true }.should_not raise_error(ArgumentError) - lambda { @securable.rights :read, "The Dude", :applies_to_children => true, :one_level_deep => false }.should_not raise_error(ArgumentError) + lambda { @securable.rights :read, "The Dude", :applies_to_children => true, :one_level_deep => true }.should_not raise_error + lambda { @securable.rights :read, "The Dude", :applies_to_children => true, :one_level_deep => false }.should_not raise_error lambda { @securable.rights :read, "The Dude", :applies_to_children => false, :one_level_deep => true }.should raise_error(ArgumentError) - lambda { @securable.rights :read, "The Dude", :applies_to_children => false, :one_level_deep => false }.should_not raise_error(ArgumentError) - lambda { @securable.rights :read, "The Dude", :one_level_deep => true }.should_not raise_error(ArgumentError) - lambda { @securable.rights :read, "The Dude", :one_level_deep => false }.should_not raise_error(ArgumentError) + lambda { @securable.rights :read, "The Dude", :applies_to_children => false, :one_level_deep => false }.should_not raise_error + lambda { @securable.rights :read, "The Dude", :one_level_deep => true }.should_not raise_error + lambda { @securable.rights :read, "The Dude", :one_level_deep => false }.should_not raise_error end it "should allow you to specify whether the permissions inherit with true/false" do - lambda { @securable.inherits true }.should_not raise_error(ArgumentError) - lambda { @securable.inherits false }.should_not raise_error(ArgumentError) + lambda { @securable.inherits true }.should_not raise_error + lambda { @securable.inherits false }.should_not raise_error lambda { @securable.inherits "monkey" }.should raise_error(ArgumentError) end end diff --git a/spec/unit/mixin/shell_out_spec.rb b/spec/unit/mixin/shell_out_spec.rb index c7ca56fe84..f325f687d9 100644 --- a/spec/unit/mixin/shell_out_spec.rb +++ b/spec/unit/mixin/shell_out_spec.rb @@ -32,7 +32,7 @@ describe Chef::Mixin::ShellOut do let(:output) { StringIO.new } let!(:capture_log_output) { Chef::Log.logger = Logger.new(output) } - let(:assume_deprecation_log_level) { Chef::Log.stub!(:level).and_return(:warn) } + let(:assume_deprecation_log_level) { Chef::Log.stub(:level).and_return(:warn) } context 'without options' do let(:command_args) { [ cmd ] } diff --git a/spec/unit/mixin/template_spec.rb b/spec/unit/mixin/template_spec.rb index ca2c3c7318..3aa0b9ba22 100644 --- a/spec/unit/mixin/template_spec.rb +++ b/spec/unit/mixin/template_spec.rb @@ -39,7 +39,7 @@ describe Chef::Mixin::Template, "render_template" do describe "when running on windows" do before do - Chef::Platform.stub!(:windows?).and_return(true) + Chef::Platform.stub(:windows?).and_return(true) end it "should render the templates with windows line endings" do @@ -54,7 +54,7 @@ describe Chef::Mixin::Template, "render_template" do describe "when running on unix" do before do - Chef::Platform.stub!(:windows?).and_return(false) + Chef::Platform.stub(:windows?).and_return(false) end it "should render the templates with unix line endings" do diff --git a/spec/unit/monologger_spec.rb b/spec/unit/monologger_spec.rb new file mode 100644 index 0000000000..3babc29218 --- /dev/null +++ b/spec/unit/monologger_spec.rb @@ -0,0 +1,45 @@ +# +# Copyright:: Copyright (c) 2014 Opscode, Inc. +# License:: Apache License, Version 2.0 +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +require 'chef/monologger' +require 'tempfile' +require 'spec_helper' + +describe MonoLogger do + it "should disable buffering when passed an IO stream" do + STDOUT.sync = false + MonoLogger.new(STDOUT) + STDOUT.sync.should == true + end + + describe "when given an object that responds to write and close e.g. IO" do + it "should use the object directly" do + stream = StringIO.new + MonoLogger.new(stream).fatal("Houston, we've had a problem.") + stream.string.should =~ /Houston, we've had a problem./ + end + end + + describe "when given an object that is stringable (to_str)" do + it "should open a File object with the given path" do + temp_file = Tempfile.new("rspec-monologger-log") + temp_file.close + MonoLogger.new(temp_file.path).fatal("Do, or do not. There is no try.") + File.read(temp_file.path).should =~ /Do, or do not. There is no try./ + end + end +end diff --git a/spec/unit/node/attribute_spec.rb b/spec/unit/node/attribute_spec.rb index 70905d334b..bab2e33aa9 100644 --- a/spec/unit/node/attribute_spec.rb +++ b/spec/unit/node/attribute_spec.rb @@ -437,7 +437,7 @@ describe Chef::Node::Attribute do it "should let you set an attribute value when another hash has an intermediate value" do @attributes.normal["the_ghost"] = { "exterminate" => "the future" } - lambda { @attributes.normal["the_ghost"]["exterminate"]["tomorrow"] = false }.should_not raise_error(NoMethodError) + lambda { @attributes.normal["the_ghost"]["eviscerate"]["tomorrow"] = false }.should_not raise_error end it "should set the attribute value" do @@ -488,6 +488,13 @@ describe Chef::Node::Attribute do end end + describe "dup" do + it "array can be duped even if some elements can't" do + @attributes.default[:foo] = %w[foo bar baz] + Array(1..3) + [nil, true, false, [ "el", 0, nil ] ] + @attributes.default[:foo].dup + end + end + describe "has_key?" do it "should return true if an attribute exists" do @attributes.has_key?("music").should == true @@ -597,7 +604,7 @@ describe Chef::Node::Attribute do end it "should not raise an exception if one of the hashes has a nil value on a deep lookup" do - lambda { @attributes.place.keys { |k| } }.should_not raise_error(NoMethodError) + lambda { @attributes.place.keys { |k| } }.should_not raise_error end end @@ -981,7 +988,7 @@ describe Chef::Node::Attribute do if RUBY_VERSION >= "1.8.7" it "should not raise a LocalJumpError if no block is given" do - lambda { @attributes.select }.should_not raise_error(LocalJumpError) + lambda { @attributes.select }.should_not raise_error end else it "should raise a LocalJumpError if no block is given" do diff --git a/spec/unit/node/immutable_collections_spec.rb b/spec/unit/node/immutable_collections_spec.rb index 0c2b878cd2..f30c1970f7 100644 --- a/spec/unit/node/immutable_collections_spec.rb +++ b/spec/unit/node/immutable_collections_spec.rb @@ -86,7 +86,7 @@ end describe Chef::Node::ImmutableArray do before do - @immutable_array = Chef::Node::ImmutableArray.new(%w[foo bar baz]) + @immutable_array = Chef::Node::ImmutableArray.new(%w[foo bar baz] + Array(1..3) + [nil, true, false, [ "el", 0, nil ] ]) end ## @@ -130,6 +130,10 @@ describe Chef::Node::ImmutableArray do end end + it "can be duped even if some elements can't" do + @immutable_array.dup + end + it "returns a mutable version of itself when duped" do mutable = @immutable_array.dup mutable[0] = :value diff --git a/spec/unit/node_spec.rb b/spec/unit/node_spec.rb index bb567dbdf7..f2a78f87cd 100644 --- a/spec/unit/node_spec.rb +++ b/spec/unit/node_spec.rb @@ -46,12 +46,12 @@ describe Chef::Node do before do response = OpenStruct.new(:code => '404') exception = Net::HTTPServerException.new("404 not found", response) - Chef::Node.stub!(:load).and_raise(exception) + Chef::Node.stub(:load).and_raise(exception) node.name("created-node") end it "creates a new node for find_or_create" do - Chef::Node.stub!(:new).and_return(node) + Chef::Node.stub(:new).and_return(node) node.should_receive(:create).and_return(node) node = Chef::Node.find_or_create("created-node") node.name.should == 'created-node' @@ -62,7 +62,7 @@ describe Chef::Node do describe "when the node exists on the server" do before do node.name('existing-node') - Chef::Node.stub!(:load).and_return(node) + Chef::Node.stub(:load).and_return(node) end it "loads the node via the REST API for find_or_create" do @@ -405,7 +405,7 @@ describe Chef::Node do it "saves non-runlist json attrs for later" do expansion = Chef::RunList::RunListExpansion.new('_default', []) - node.run_list.stub!(:expand).and_return(expansion) + node.run_list.stub(:expand).and_return(expansion) node.consume_external_attrs(@ohai_data, {"foo" => "bar"}) node.expand! node.normal_attrs.should == {"foo" => "bar", "tags" => []} @@ -423,7 +423,7 @@ describe Chef::Node do Chef::Environment.should_receive(:load).with("rspec_env").and_return(@environment) @expansion = Chef::RunList::RunListExpansion.new("rspec_env", []) node.chef_environment("rspec_env") - node.run_list.stub!(:expand).and_return(@expansion) + node.run_list.stub(:expand).and_return(@expansion) end it "sets the 'recipes' automatic attribute to the recipes in the expanded run_list" do @@ -461,6 +461,22 @@ describe Chef::Node do end end + describe "loaded_recipe" do + it "should not add a recipe that is already in the recipes list" do + node.automatic_attrs[:recipes] = [ "nginx::module" ] + node.loaded_recipe(:nginx, "module") + expect(node.automatic_attrs[:recipes].length).to eq(1) + end + + it "should add a recipe that is not already in the recipes list" do + node.automatic_attrs[:recipes] = [ "nginx::other_module" ] + node.loaded_recipe(:nginx, "module") + expect(node.automatic_attrs[:recipes].length).to eq(2) + expect(node.recipe?("nginx::module")).to be_true + expect(node.recipe?("nginx::other_module")).to be_true + end + end + describe "when querying for recipes in the run list" do context "when a recipe is in the top level run list" do before do @@ -524,7 +540,7 @@ describe Chef::Node do @environment = Chef::Environment.new @environment.default_attributes = {:default => "from env", :d_env => "env only" } @environment.override_attributes = {:override => "from env", :o_env => "env only"} - Chef::Environment.stub!(:load).and_return(@environment) + Chef::Environment.stub(:load).and_return(@environment) node.apply_expansion_attributes(@expansion) end @@ -748,16 +764,16 @@ describe Chef::Node do describe "api model" do before(:each) do - @rest = mock("Chef::REST") - Chef::REST.stub!(:new).and_return(@rest) - @query = mock("Chef::Search::Query") - Chef::Search::Query.stub!(:new).and_return(@query) + @rest = double("Chef::REST") + Chef::REST.stub(:new).and_return(@rest) + @query = double("Chef::Search::Query") + Chef::Search::Query.stub(:new).and_return(@query) end describe "list" do describe "inflated" do it "should return a hash of node names and objects" do - n1 = mock("Chef::Node", :name => "one") + n1 = double("Chef::Node", :name => "one") @query.should_receive(:search).with(:node).and_yield(n1) r = Chef::Node.list(true) r["one"].should == n1 @@ -802,7 +818,7 @@ describe Chef::Node do it "should create if it cannot update" do node.name("monkey") - exception = mock("404 error", :code => "404") + exception = double("404 error", :code => "404") @rest.should_receive(:put_rest).and_raise(Net::HTTPServerException.new("foo", exception)) @rest.should_receive(:post_rest).with("nodes", node) node.save diff --git a/spec/unit/platform_spec.rb b/spec/unit/platform_spec.rb index 3904435ea0..e0386a1a61 100644 --- a/spec/unit/platform_spec.rb +++ b/spec/unit/platform_spec.rb @@ -151,7 +151,7 @@ describe Chef::Platform do it "should prefer an explicit provider" do kitty = Chef::Resource::Cat.new("loulou") - kitty.stub!(:provider).and_return(Chef::Provider::File) + kitty.stub(:provider).and_return(Chef::Provider::File) node = Chef::Node.new node.name("Intel") node.automatic_attrs[:platform] = "mac_os_x" diff --git a/spec/unit/policy_builder/expand_node_object_spec.rb b/spec/unit/policy_builder/expand_node_object_spec.rb new file mode 100644 index 0000000000..5c6f39d28c --- /dev/null +++ b/spec/unit/policy_builder/expand_node_object_spec.rb @@ -0,0 +1,336 @@ +# +# Author:: Daniel DeLeo (<dan@getchef.com>) +# Copyright:: Copyright 2014 Chef Software, Inc. +# License:: Apache License, Version 2.0 +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +require 'spec_helper' +require 'chef/policy_builder' + +describe Chef::PolicyBuilder::ExpandNodeObject do + + let(:node_name) { "joe_node" } + let(:ohai_data) { {"platform" => "ubuntu", "platform_version" => "13.04", "fqdn" => "joenode.example.com"} } + let(:json_attribs) { {"run_list" => []} } + let(:override_runlist) { "recipe[foo::default]" } + let(:events) { Chef::EventDispatch::Dispatcher.new } + let(:policy_builder) { Chef::PolicyBuilder::ExpandNodeObject.new(node_name, ohai_data, json_attribs, override_runlist, events) } + + # All methods that Chef::Client calls on this class. + describe "Public API" do + it "implements a node method" do + expect(policy_builder).to respond_to(:node) + end + + it "implements a load_node method" do + expect(policy_builder).to respond_to(:load_node) + end + + it "implements a build_node method" do + expect(policy_builder).to respond_to(:build_node) + end + + it "implements a setup_run_context method that accepts a list of recipe files to run" do + expect(policy_builder).to respond_to(:setup_run_context) + expect(policy_builder.method(:setup_run_context).arity).to eq(-1) #optional argument + end + + it "implements a run_context method" do + expect(policy_builder).to respond_to(:run_context) + end + + it "implements an expand_run_list method" do + expect(policy_builder).to respond_to(:expand_run_list) + end + + it "implements a sync_cookbooks method" do + expect(policy_builder).to respond_to(:sync_cookbooks) + end + + it "implements a temporary_policy? method" do + expect(policy_builder).to respond_to(:temporary_policy?) + end + + describe "loading the node" do + + context "on chef-solo" do + + before do + Chef::Config[:solo] = true + end + + it "creates a new in-memory node object with the given name" do + policy_builder.load_node + policy_builder.node.name.should == node_name + end + + end + + context "on chef-client" do + + let(:node) { Chef::Node.new.tap { |n| n.name(node_name) } } + + it "loads or creates a node on the server" do + Chef::Node.should_receive(:find_or_create).with(node_name).and_return(node) + policy_builder.load_node + policy_builder.node.should == node + end + + end + end + + describe "building the node" do + + # XXX: Chef::Client just needs to be able to call this, it doesn't depend on the return value. + it "builds the node and returns the updated node object" do + pending + end + + end + + end + + # Implementation specific tests + + describe "when first created" do + + it "has a node_name" do + expect(policy_builder.node_name).to eq(node_name) + end + + it "has ohai data" do + expect(policy_builder.ohai_data).to eq(ohai_data) + end + + it "has a set of attributes from command line option" do + expect(policy_builder.json_attribs).to eq(json_attribs) + end + + it "has an override_runlist" do + expect(policy_builder.override_runlist).to eq(override_runlist) + end + + end + + context "once the node has been loaded" do + let(:node) do + node = Chef::Node.new + node.name(node_name) + node.run_list(["recipe[a::default]", "recipe[b::server]"]) + node + end + + before do + Chef::Node.should_receive(:find_or_create).with(node_name).and_return(node) + policy_builder.load_node + end + + it "expands the run_list" do + expect(policy_builder.expand_run_list).to be_a(Chef::RunList::RunListExpansion) + expect(policy_builder.run_list_expansion).to be_a(Chef::RunList::RunListExpansion) + expect(policy_builder.run_list_expansion.recipes).to eq(["a::default", "b::server"]) + end + + end + + describe "building the node" do + + let(:configured_environment) { nil } + let(:json_attribs) { nil } + + let(:override_runlist) { nil } + let(:primary_runlist) { ["recipe[primary::default]"] } + + let(:original_default_attrs) { {"default_key" => "default_value"} } + let(:original_override_attrs) { {"override_key" => "override_value"} } + + let(:node) do + node = Chef::Node.new + node.name(node_name) + node.default_attrs = original_default_attrs + node.override_attrs = original_override_attrs + node.run_list(primary_runlist) + node + end + + before do + Chef::Config[:environment] = configured_environment + Chef::Node.should_receive(:find_or_create).with(node_name).and_return(node) + policy_builder.load_node + policy_builder.build_node + end + + it "sanity checks test setup" do + expect(node.run_list).to eq(primary_runlist) + end + + it "clears existing default and override attributes from the node" do + expect(node["default_key"]).to be_nil + expect(node["override_key"]).to be_nil + end + + it "applies ohai data to the node" do + expect(node["fqdn"]).to eq(ohai_data["fqdn"]) + end + + it "reports that a temporary_policy is not being used" do + expect(policy_builder.temporary_policy?).to be_false + end + + describe "when the given run list is not in expanded form" do + + # NOTE: for chef-client, the behavior is always to expand the run list, + # but this operation is a no-op when none of the run list items are + # roles. Because of the amount of mocking required to make this work in + # tests, this test is isolated from the others. + + let(:primary_runlist) { ["role[some_role]"] } + let(:expansion) do + recipe_list = Chef::RunList::VersionedRecipeList.new + recipe_list.add_recipe("recipe[from_role::default", "1.0.2") + double("RunListExpansion", :recipes => recipe_list) + end + + let(:node) do + node = Chef::Node.new + node.name(node_name) + node.default_attrs = original_default_attrs + node.override_attrs = original_override_attrs + node.run_list(primary_runlist) + + node.should_receive(:expand!).with("server") do + node.run_list("recipe[from_role::default]") + expansion + end + + node + end + + it "expands run list items via the server API" do + expect(node.run_list).to eq(["recipe[from_role::default]"]) + end + + end + + context "when JSON attributes are given on the command line" do + + let(:json_attribs) { {"run_list" => ["recipe[json_attribs::default]"], "json_attribs_key" => "json_attribs_value" } } + + it "sets the run list according to the given JSON" do + expect(node.run_list).to eq(["recipe[json_attribs::default]"]) + end + + it "sets node attributes according to the given JSON" do + expect(node["json_attribs_key"]).to eq("json_attribs_value") + end + + end + + context "when an override_runlist is given" do + + let(:override_runlist) { "recipe[foo::default]" } + + it "sets the override run_list on the node" do + expect(node.run_list).to eq([override_runlist]) + expect(policy_builder.original_runlist).to eq(primary_runlist) + end + + it "reports that a temporary policy is being used" do + expect(policy_builder.temporary_policy?).to be_true + end + + end + + context "when no environment is specified" do + + it "does not set the environment" do + expect(node.chef_environment).to eq("_default") + end + + end + + context "when a custom environment is configured" do + + let(:configured_environment) { environment.name } + + let(:environment) do + environment = Chef::Environment.new.tap {|e| e.name("prod") } + Chef::Environment.should_receive(:load).with("prod").and_return(environment) + environment + end + + it "sets the environment as configured" do + expect(node.chef_environment).to eq(environment.name) + end + end + + end + + describe "configuring the run_context" do + let(:json_attribs) { nil } + let(:override_runlist) { nil } + + let(:node) do + node = Chef::Node.new + node.name(node_name) + node.run_list("recipe[first::default]", "recipe[second::default]") + node + end + + let(:chef_http) { double("Chef::REST") } + + let(:cookbook_resolve_url) { "environments/#{node.chef_environment}/cookbook_versions" } + let(:cookbook_resolve_post_data) { {:run_list=>["first::default", "second::default"]} } + + # cookbook_hash is just a hash, but since we're passing it between mock + # objects, we get a little better test strictness by using a double (which + # will have object equality rather than semantic equality #== semantics). + let(:cookbook_hash) { double("cookbook hash", :each => nil) } + + let(:cookbook_synchronizer) { double("CookbookSynchronizer") } + + before do + Chef::Node.should_receive(:find_or_create).with(node_name).and_return(node) + + policy_builder.stub(:api_service).and_return(chef_http) + + policy_builder.load_node + policy_builder.build_node + + run_list_expansion = policy_builder.run_list_expansion + + chef_http.should_receive(:post).with(cookbook_resolve_url, cookbook_resolve_post_data).and_return(cookbook_hash) + Chef::CookbookSynchronizer.should_receive(:new).with(cookbook_hash, events).and_return(cookbook_synchronizer) + cookbook_synchronizer.should_receive(:sync_cookbooks) + + Chef::RunContext.any_instance.should_receive(:load).with(run_list_expansion) + + policy_builder.setup_run_context + end + + it "configures FileVendor to fetch files remotely" do + manifest = double("cookbook manifest") + Chef::Cookbook::RemoteFileVendor.should_receive(:new).with(manifest, chef_http) + Chef::Cookbook::FileVendor.create_from_manifest(manifest) + end + + it "triggers cookbook compilation in the run_context" do + # Test condition already covered by `Chef::RunContext.any_instance.should_receive(:load).with(run_list_expansion)` + end + + end + +end + diff --git a/spec/unit/policy_builder/policyfile_spec.rb b/spec/unit/policy_builder/policyfile_spec.rb new file mode 100644 index 0000000000..f02c79ef12 --- /dev/null +++ b/spec/unit/policy_builder/policyfile_spec.rb @@ -0,0 +1,403 @@ +# +# Author:: Daniel DeLeo (<dan@getchef.com>) +# Copyright:: Copyright 2014 Chef Software, Inc. +# License:: Apache License, Version 2.0 +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +require 'spec_helper' +require 'chef/policy_builder' + +describe Chef::PolicyBuilder::Policyfile do + + let(:node_name) { "joe_node" } + let(:ohai_data) { {"platform" => "ubuntu", "platform_version" => "13.04", "fqdn" => "joenode.example.com"} } + let(:json_attribs) { {"custom_attr" => "custom_attr_value"} } + let(:override_runlist) { nil } + let(:events) { Chef::EventDispatch::Dispatcher.new } + let(:policy_builder) { Chef::PolicyBuilder::Policyfile.new(node_name, ohai_data, json_attribs, override_runlist, events) } + + # Convert a SHA1 (160 bit) hex string into an x.y.z version number where the + # maximum value is smaller than a postgres BIGINT (signed 64bit, so 63 usable + # bits). This requires enterprise Chef or open source server 11.1.0+ (currently not released) + # + # The SHA1 is devided as follows: + # * "major": first 14 chars (56 bits) + # * "minor": next 14 chars (56 bits) + # * "patch": last 12 chars (48 bits) + def id_to_dotted(sha1_id) + major = sha1_id[0...14] + minor = sha1_id[14...28] + patch = sha1_id[28..40] + decimal_integers =[major, minor, patch].map {|hex| hex.to_i(16) } + decimal_integers.join(".") + end + + + let(:example1_lock_data) do + # based on https://github.com/danielsdeleo/chef-workflow2-prototype/blob/master/skeletons/basic_policy/Policyfile.lock.json + { + "identifier" => "168d2102fb11c9617cd8a981166c8adc30a6e915", + "version" => "2.3.5", + # NOTE: for compatibility mode we include the dotted id in the policyfile to enhance discoverability. + "dotted_decimal_identifier" => id_to_dotted("168d2102fb11c9617cd8a981166c8adc30a6e915"), + "source" => { "path" => "./cookbooks/demo" }, + "scm_identifier"=> { + "vcs"=> "git", + "rev_id"=> "9d5b09026470c322c3cb5ca8a4157c4d2f16cef3", + "remote"=> nil + } + } + end + + let(:example2_lock_data) do + { + "identifier" => "feab40e1fca77c7360ccca1481bb8ba5f919ce3a", + "version" => "4.2.0", + # NOTE: for compatibility mode we include the dotted id in the policyfile to enhance discoverability. + "dotted_decimal_identifier" => id_to_dotted("feab40e1fca77c7360ccca1481bb8ba5f919ce3a"), + "source" => { "api" => "https://community.getchef.com/api/v1/cookbooks/example2" } + } + end + + let(:policyfile_default_attributes) { {"policyfile_default_attr" => "policyfile_default_value"} } + let(:policyfile_override_attributes) { {"policyfile_override_attr" => "policyfile_override_value"} } + + let(:policyfile_run_list) { ["recipe[example1::default]", "recipe[example2::server]"] } + + let(:parsed_policyfile_json) do + { + "run_list" => policyfile_run_list, + + "cookbook_locks" => { + "example1" => example1_lock_data, + "example2" => example2_lock_data + }, + + "default_attributes" => policyfile_default_attributes, + "override_attributes" => policyfile_override_attributes + } + end + + let(:err_namespace) { Chef::PolicyBuilder::Policyfile } + + it "configures a Chef HTTP API client" do + http = double("Chef::REST") + server_url = "https://api.opscode.com/organizations/example" + Chef::Config[:chef_server_url] = server_url + Chef::REST.should_receive(:new).with(server_url).and_return(http) + expect(policy_builder.http_api).to eq(http) + end + + describe "reporting unsupported features" do + + def initialize_pb + Chef::PolicyBuilder::Policyfile.new(node_name, ohai_data, json_attribs, override_runlist, events) + end + + it "always gives `false` for #temporary_policy?" do + expect(initialize_pb.temporary_policy?).to be_false + end + + context "chef-solo" do + before { Chef::Config[:solo] = true } + + it "errors on create" do + expect { initialize_pb }.to raise_error(err_namespace::UnsupportedFeature) + end + end + + context "when given an override run_list" do + let(:override_runlist) { "recipe[foo],recipe[bar]" } + + it "errors on create" do + expect { initialize_pb }.to raise_error(err_namespace::UnsupportedFeature) + end + end + + context "when json_attribs contains a run_list" do + let(:json_attribs) { {"run_list" => []} } + + it "errors on create" do + expect { initialize_pb }.to raise_error(err_namespace::UnsupportedFeature) + end + end + + context "when an environment is configured" do + before { Chef::Config[:environment] = "blurch" } + + it "errors when an environment is configured" do + expect { initialize_pb }.to raise_error(err_namespace::UnsupportedFeature) + end + end + + end + + describe "when using compatibility mode" do + + let(:http_api) { double("Chef::REST") } + + let(:configured_environment) { nil } + + let(:override_runlist) { nil } + let(:primary_runlist) { nil } + + let(:original_default_attrs) { {"default_key" => "default_value"} } + let(:original_override_attrs) { {"override_key" => "override_value"} } + + let(:node) do + node = Chef::Node.new + node.name(node_name) + node.default_attrs = original_default_attrs + node.override_attrs = original_override_attrs + node.run_list(primary_runlist) if primary_runlist + node + end + + before do + # TODO: agree on this name and logic. + Chef::Config[:deployment_group] = "example-policy-stage" + policy_builder.stub(:http_api).and_return(http_api) + end + + context "when the deployment group cannot be loaded" do + let(:error404) { Net::HTTPServerException.new("404 message", :body) } + + before do + Chef::Node.should_receive(:find_or_create).with(node_name).and_return(node) + http_api.should_receive(:get). + with("data/policyfiles/example-policy-stage"). + and_raise(error404) + end + + it "raises an error" do + expect { policy_builder.load_node }.to raise_error(err_namespace::ConfigurationError) + end + + it "sends error message to the event system" do + events.should_receive(:node_load_failed).with(node_name, an_instance_of(err_namespace::ConfigurationError), Chef::Config) + expect { policy_builder.load_node }.to raise_error(err_namespace::ConfigurationError) + end + + end + + describe "when the deployment_group is not configured" do + before do + Chef::Config[:deployment_group] = nil + Chef::Node.should_receive(:find_or_create).with(node_name).and_return(node) + end + + it "errors while loading the node" do + expect { policy_builder.load_node }.to raise_error(err_namespace::ConfigurationError) + end + + + it "passes error information to the event system" do + # TODO: also make sure something acceptable happens with the error formatters + err_class = err_namespace::ConfigurationError + events.should_receive(:node_load_failed).with(node_name, an_instance_of(err_class), Chef::Config) + expect { policy_builder.load_node }.to raise_error(err_class) + end + end + + context "and a deployment_group is configured" do + before do + http_api.should_receive(:get).with("data/policyfiles/example-policy-stage").and_return(parsed_policyfile_json) + end + + it "fetches the policy file from a data bag item" do + expect(policy_builder.policy).to eq(parsed_policyfile_json) + end + + it "extracts the run_list from the policyfile" do + expect(policy_builder.run_list).to eq(policyfile_run_list) + end + + it "extracts the cookbooks and versions for display from the policyfile" do + expected = [ + "example1::default@2.3.5 (168d210)", + "example2::server@4.2.0 (feab40e)" + ] + + expect(policy_builder.run_list_with_versions_for_display).to eq(expected) + end + + it "generates a RunListExpansion-alike object for feeding to the CookbookCompiler" do + expect(policy_builder.run_list_expansion_ish).to respond_to(:recipes) + expect(policy_builder.run_list_expansion_ish.recipes).to eq(["example1::default", "example2::server"]) + end + + it "implements #expand_run_list in a manner compatible with ExpandNodeObject" do + Chef::Node.should_receive(:find_or_create).with(node_name).and_return(node) + policy_builder.load_node + expect(policy_builder.expand_run_list).to respond_to(:recipes) + expect(policy_builder.expand_run_list.recipes).to eq(["example1::default", "example2::server"]) + expect(policy_builder.expand_run_list.roles).to eq([]) + end + + + describe "validating the Policyfile.lock" do + + it "errors if the policyfile json contains any non-recipe items" do + parsed_policyfile_json["run_list"] = ["role[foo]"] + expect { policy_builder.validate_policyfile }.to raise_error(err_namespace::PolicyfileError) + end + + it "errors if the policyfile json contains non-fully qualified recipe items" do + parsed_policyfile_json["run_list"] = ["recipe[foo]"] + expect { policy_builder.validate_policyfile }.to raise_error(err_namespace::PolicyfileError) + end + + it "errors if the policyfile doesn't have a run_list key" do + parsed_policyfile_json.delete("run_list") + expect { policy_builder.validate_policyfile }.to raise_error(err_namespace::PolicyfileError) + end + + it "error if the policyfile doesn't have a cookbook_locks key" do + parsed_policyfile_json.delete("cookbook_locks") + expect { policy_builder.validate_policyfile }.to raise_error(err_namespace::PolicyfileError) + end + + it "accepts a valid policyfile" do + policy_builder.validate_policyfile + end + + end + + describe "building the node object" do + + before do + Chef::Node.should_receive(:find_or_create).with(node_name).and_return(node) + + policy_builder.load_node + policy_builder.build_node + end + + it "resets default and override data" do + expect(node["default_key"]).to be_nil + expect(node["override_key"]).to be_nil + end + + it "applies ohai data" do + expect(ohai_data).to_not be_empty # ensure test is testing something + ohai_data.each do |key, value| + expect(node.automatic_attrs[key]).to eq(value) + end + end + + it "applies attributes from json file" do + expect(node["custom_attr"]).to eq("custom_attr_value") + end + + it "applies attributes from the policyfile" do + expect(node["policyfile_default_attr"]).to eq("policyfile_default_value") + expect(node["policyfile_override_attr"]).to eq("policyfile_override_value") + end + + it "sets the policyfile's run_list on the node object" do + expect(node.run_list).to eq(policyfile_run_list) + end + + it "creates node.automatic_attrs[:roles]" do + expect(node.automatic_attrs[:roles]).to eq([]) + end + + it "create node.automatic_attrs[:recipes]" do + expect(node.automatic_attrs[:recipes]).to eq(["example1::default", "example2::server"]) + end + + end + + + describe "fetching the desired cookbook set" do + + let(:example1_cookbook_object) { double("Chef::CookbookVersion for example1 cookbook") } + let(:example2_cookbook_object) { double("Chef::CookbookVersion for example2 cookbook") } + + let(:expected_cookbook_hash) do + { "example1" => example1_cookbook_object, "example2" => example2_cookbook_object } + end + + let(:example1_xyz_version) { example1_lock_data["dotted_decimal_identifier"] } + let(:example2_xyz_version) { example2_lock_data["dotted_decimal_identifier"] } + + let(:cookbook_synchronizer) { double("Chef::CookbookSynchronizer") } + + context "and a cookbook is missing" do + + let(:error404) { Net::HTTPServerException.new("404 message", :body) } + + before do + Chef::Node.should_receive(:find_or_create).with(node_name).and_return(node) + + # Remove references to example2 cookbook because we're iterating + # over a Hash data structure and on ruby 1.8.7 iteration order will + # not be stable. + parsed_policyfile_json["cookbook_locks"].delete("example2") + parsed_policyfile_json["run_list"].delete("recipe[example2::server]") + + policy_builder.load_node + policy_builder.build_node + + http_api.should_receive(:get).with("cookbooks/example1/#{example1_xyz_version}"). + and_raise(error404) + end + + it "raises an error indicating which cookbook is missing" do + expect { policy_builder.cookbooks_to_sync }.to raise_error(Chef::Exceptions::CookbookNotFound) + end + + end + + context "and the cookbooks can be fetched" do + before do + Chef::Node.should_receive(:find_or_create).with(node_name).and_return(node) + + policy_builder.load_node + policy_builder.build_node + + http_api.should_receive(:get).with("cookbooks/example1/#{example1_xyz_version}"). + and_return(example1_cookbook_object) + http_api.should_receive(:get).with("cookbooks/example2/#{example2_xyz_version}"). + and_return(example2_cookbook_object) + + Chef::CookbookSynchronizer.stub(:new). + with(expected_cookbook_hash, events). + and_return(cookbook_synchronizer) + end + + it "builds a Hash of the form 'cookbook_name' => Chef::CookbookVersion" do + expect(policy_builder.cookbooks_to_sync).to eq(expected_cookbook_hash) + end + + it "syncs the desired cookbooks via CookbookSynchronizer" do + cookbook_synchronizer.should_receive(:sync_cookbooks) + policy_builder.sync_cookbooks + end + + it "builds a run context" do + cookbook_synchronizer.should_receive(:sync_cookbooks) + Chef::RunContext.any_instance.should_receive(:load).with(policy_builder.run_list_expansion_ish) + run_context = policy_builder.setup_run_context + expect(run_context.node).to eq(node) + expect(run_context.cookbook_collection.keys).to match_array(["example1", "example2"]) + end + + end + end + end + + end + +end diff --git a/spec/unit/policy_builder_spec.rb b/spec/unit/policy_builder_spec.rb new file mode 100644 index 0000000000..506911452c --- /dev/null +++ b/spec/unit/policy_builder_spec.rb @@ -0,0 +1,26 @@ +# +# Author:: Daniel DeLeo (<dan@getchef.com>) +# Copyright:: Copyright 2014 Chef Software, Inc. +# License:: Apache License, Version 2.0 +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +require 'spec_helper' +require 'chef/policy_builder' + +describe Chef::PolicyBuilder do + + # TODO: test the strategy method + +end diff --git a/spec/unit/provider/breakpoint_spec.rb b/spec/unit/provider/breakpoint_spec.rb index 977624597a..05f3e8e0ed 100644 --- a/spec/unit/provider/breakpoint_spec.rb +++ b/spec/unit/provider/breakpoint_spec.rb @@ -25,8 +25,8 @@ describe Chef::Provider::Breakpoint do @node = Chef::Node.new @events = Chef::EventDispatch::Dispatcher.new @run_context = Chef::RunContext.new(@node, {}, @events) - @collection = mock("resource collection") - @run_context.stub!(:resource_collection).and_return(@collection) + @collection = double("resource collection") + @run_context.stub(:resource_collection).and_return(@collection) @provider = Chef::Provider::Breakpoint.new(@resource, @run_context) end @@ -35,18 +35,18 @@ describe Chef::Provider::Breakpoint do end it "gets the iterator from @collection and pauses it" do - Shell.stub!(:running?).and_return(true) - @iterator = mock("stepable_iterator") - @collection.stub!(:iterator).and_return(@iterator) + Shell.stub(:running?).and_return(true) + @iterator = double("stepable_iterator") + @collection.stub(:iterator).and_return(@iterator) @iterator.should_receive(:pause) @provider.action_break @resource.should be_updated end it "doesn't pause the iterator if chef-shell isn't running" do - Shell.stub!(:running?).and_return(false) - @iterator = mock("stepable_iterator") - @collection.stub!(:iterator).and_return(@iterator) + Shell.stub(:running?).and_return(false) + @iterator = double("stepable_iterator") + @collection.stub(:iterator).and_return(@iterator) @iterator.should_not_receive(:pause) @provider.action_break end diff --git a/spec/unit/provider/cookbook_file/content_spec.rb b/spec/unit/provider/cookbook_file/content_spec.rb index b771b76aae..ed8942aaf2 100644 --- a/spec/unit/provider/cookbook_file/content_spec.rb +++ b/spec/unit/provider/cookbook_file/content_spec.rb @@ -20,15 +20,15 @@ require 'spec_helper' describe Chef::Provider::CookbookFile::Content do - let(:new_resource) { mock('Chef::Resource::CookbookFile (new)', :cookbook_name => 'apache2', :cookbook => 'apache2') } + let(:new_resource) { double('Chef::Resource::CookbookFile (new)', :cookbook_name => 'apache2', :cookbook => 'apache2') } let(:content) do - @run_context = mock('Chef::RunContext') - @current_resource = mock('Chef::Resource::CookbookFile (current)') + @run_context = double('Chef::RunContext') + @current_resource = double('Chef::Resource::CookbookFile (current)') Chef::Provider::CookbookFile::Content.new(new_resource, @current_resource, @run_context) end it "prefers the explicit cookbook name on the resource to the implicit one" do - new_resource.stub!(:cookbook).and_return('nginx') + new_resource.stub(:cookbook).and_return('nginx') content.send(:resource_cookbook).should == 'nginx' end diff --git a/spec/unit/provider/cookbook_file_spec.rb b/spec/unit/provider/cookbook_file_spec.rb index 05509fbae4..131fca2ba6 100644 --- a/spec/unit/provider/cookbook_file_spec.rb +++ b/spec/unit/provider/cookbook_file_spec.rb @@ -49,7 +49,7 @@ describe Chef::Provider::CookbookFile do end let(:content) do - content = mock('Chef::Provider::CookbookFile::Content') + content = double('Chef::Provider::CookbookFile::Content') end it_behaves_like Chef::Provider::File diff --git a/spec/unit/provider/cron/unix_spec.rb b/spec/unit/provider/cron/unix_spec.rb index ffdfa198b6..60e09baceb 100644 --- a/spec/unit/provider/cron/unix_spec.rb +++ b/spec/unit/provider/cron/unix_spec.rb @@ -39,7 +39,7 @@ describe Chef::Provider::Cron::Unix do describe "read_crontab" do before :each do - @status = mock("Status", :exitstatus => 0) + @status = double("Status", :exitstatus => 0) @stdout = StringIO.new(<<-CRONTAB) 0 2 * * * /some/other/command @@ -48,7 +48,7 @@ describe Chef::Provider::Cron::Unix do # Another comment CRONTAB - @provider.stub!(:popen4).and_yield(1234, StringIO.new, @stdout, StringIO.new).and_return(@status) + @provider.stub(:popen4).and_yield(1234, StringIO.new, @stdout, StringIO.new).and_return(@status) end it "should call crontab -l with the user" do @@ -69,14 +69,14 @@ CRONTAB end it "should return nil if the user has no crontab" do - status = mock("Status", :exitstatus => 1) - @provider.stub!(:popen4).and_return(status) + status = double("Status", :exitstatus => 1) + @provider.stub(:popen4).and_return(status) @provider.send(:read_crontab).should == nil end it "should raise an exception if another error occurs" do - status = mock("Status", :exitstatus => 2) - @provider.stub!(:popen4).and_return(status) + status = double("Status", :exitstatus => 2) + @provider.stub(:popen4).and_return(status) lambda do @provider.send(:read_crontab) end.should raise_error(Chef::Exceptions::Cron, "Error determining state of #{@new_resource.name}, exit: 2") @@ -85,10 +85,10 @@ CRONTAB describe "write_crontab" do before :each do - @status = mock("Status", :exitstatus => 0) - @provider.stub!(:run_command_and_return_stdout_stderr).and_return(@status, String.new, String.new) - @tempfile = mock("foo", :path => "/tmp/foo", :close => true) - Tempfile.stub!(:new).and_return(@tempfile) + @status = double("Status", :exitstatus => 0) + @provider.stub(:run_command_and_return_stdout_stderr).and_return(@status, String.new, String.new) + @tempfile = double("foo", :path => "/tmp/foo", :close => true) + Tempfile.stub(:new).and_return(@tempfile) @tempfile.should_receive(:flush) @tempfile.should_receive(:chmod).with(420) @tempfile.should_receive(:close!) @@ -112,7 +112,7 @@ CRONTAB it "should raise an exception if the command returns non-zero" do @tempfile.should_receive(:<<).with("Foo") - @status.stub!(:exitstatus).and_return(1) + @status.stub(:exitstatus).and_return(1) lambda do @provider.send(:write_crontab, "Foo") end.should raise_error(Chef::Exceptions::Cron, /Error updating state of #{@new_resource.name}, exit: 1/) diff --git a/spec/unit/provider/cron_spec.rb b/spec/unit/provider/cron_spec.rb index 35656e0ad6..3a7a96c549 100644 --- a/spec/unit/provider/cron_spec.rb +++ b/spec/unit/provider/cron_spec.rb @@ -34,7 +34,7 @@ describe Chef::Provider::Cron do describe "when examining the current system state" do context "with no crontab for the user" do before :each do - @provider.stub!(:read_crontab).and_return(nil) + @provider.stub(:read_crontab).and_return(nil) end it "should set cron_empty" do @@ -51,7 +51,7 @@ describe Chef::Provider::Cron do context "with no matching entry in the user's crontab" do before :each do - @provider.stub!(:read_crontab).and_return(<<-CRONTAB) + @provider.stub(:read_crontab).and_return(<<-CRONTAB) 0 2 * * * /some/other/command # Chef Name: something else @@ -73,7 +73,7 @@ CRONTAB end it "should not fail if there's an existing cron with a numerical argument" do - @provider.stub!(:read_crontab).and_return(<<-CRONTAB) + @provider.stub(:read_crontab).and_return(<<-CRONTAB) # Chef Name: foo[bar] (baz) 21 */4 * * * some_prog 1234567 CRONTAB @@ -85,7 +85,7 @@ CRONTAB context "with a matching entry in the user's crontab" do before :each do - @provider.stub!(:read_crontab).and_return(<<-CRONTAB) + @provider.stub(:read_crontab).and_return(<<-CRONTAB) 0 2 * * * /some/other/command # Chef Name: cronhole some stuff @@ -114,7 +114,7 @@ CRONTAB end it "should pull env vars out" do - @provider.stub!(:read_crontab).and_return(<<-CRONTAB) + @provider.stub(:read_crontab).and_return(<<-CRONTAB) 0 2 * * * /some/other/command # Chef Name: cronhole some stuff @@ -142,7 +142,7 @@ CRONTAB end it "should parse and load generic and standard environment variables from cron entry" do - @provider.stub!(:read_crontab).and_return(<<-CRONTAB) + @provider.stub(:read_crontab).and_return(<<-CRONTAB) # Chef Name: cronhole some stuff MAILTO=warn@example.com TEST=lol @@ -156,7 +156,7 @@ CRONTAB end it "should not break with variabels that match the cron resource internals" do - @provider.stub!(:read_crontab).and_return(<<-CRONTAB) + @provider.stub(:read_crontab).and_return(<<-CRONTAB) # Chef Name: cronhole some stuff MINUTE=40 HOUR=midnight @@ -179,7 +179,7 @@ CRONTAB context "with a matching entry in the user's crontab using month names and weekday names (#CHEF-3178)" do before :each do - @provider.stub!(:read_crontab).and_return(<<-CRONTAB) + @provider.stub(:read_crontab).and_return(<<-CRONTAB) 0 2 * * * /some/other/command # Chef Name: cronhole some stuff @@ -215,7 +215,7 @@ CRONTAB context "with a matching entry without a crontab line" do it "should set cron_exists and leave current_resource values at defaults" do - @provider.stub!(:read_crontab).and_return(<<-CRONTAB) + @provider.stub(:read_crontab).and_return(<<-CRONTAB) 0 2 * * * /some/other/command # Chef Name: cronhole some stuff @@ -231,7 +231,7 @@ CRONTAB end it "should not pick up a commented out crontab line" do - @provider.stub!(:read_crontab).and_return(<<-CRONTAB) + @provider.stub(:read_crontab).and_return(<<-CRONTAB) 0 2 * * * /some/other/command # Chef Name: cronhole some stuff @@ -248,7 +248,7 @@ CRONTAB end it "should not pick up a later crontab entry" do - @provider.stub!(:read_crontab).and_return(<<-CRONTAB) + @provider.stub(:read_crontab).and_return(<<-CRONTAB) 0 2 * * * /some/other/command # Chef Name: cronhole some stuff @@ -304,8 +304,8 @@ CRONTAB describe "action_create" do before :each do - @provider.stub!(:write_crontab) - @provider.stub!(:read_crontab).and_return(nil) + @provider.stub(:write_crontab) + @provider.stub(:read_crontab).and_return(nil) end context "when there is no existing crontab" do @@ -354,7 +354,7 @@ TEST=LOL context "when there is a crontab with no matching section" do before :each do @provider.cron_exists = false - @provider.stub!(:read_crontab).and_return(<<-CRONTAB) + @provider.stub(:read_crontab).and_return(<<-CRONTAB) 0 2 * * * /some/other/command # Chef Name: something else @@ -416,8 +416,8 @@ TEST=LOL context "when there is a crontab with a matching but different section" do before :each do @provider.cron_exists = true - @provider.stub!(:cron_different?).and_return(true) - @provider.stub!(:read_crontab).and_return(<<-CRONTAB) + @provider.stub(:cron_different?).and_return(true) + @provider.stub(:read_crontab).and_return(<<-CRONTAB) 0 2 * * * /some/other/command # Chef Name: cronhole some stuff @@ -481,11 +481,11 @@ TEST=LOL context "when there is a crontab with a matching section with no crontab line in it" do before :each do @provider.cron_exists = true - @provider.stub!(:cron_different?).and_return(true) + @provider.stub(:cron_different?).and_return(true) end it "should add the crontab to the entry" do - @provider.stub!(:read_crontab).and_return(<<-CRONTAB) + @provider.stub(:read_crontab).and_return(<<-CRONTAB) 0 2 * * * /some/other/command # Chef Name: cronhole some stuff @@ -500,7 +500,7 @@ TEST=LOL end it "should not blat any following entries" do - @provider.stub!(:read_crontab).and_return(<<-CRONTAB) + @provider.stub(:read_crontab).and_return(<<-CRONTAB) 0 2 * * * /some/other/command # Chef Name: cronhole some stuff @@ -525,7 +525,7 @@ TEST=LOL end it "should handle env vars with no crontab" do - @provider.stub!(:read_crontab).and_return(<<-CRONTAB) + @provider.stub(:read_crontab).and_return(<<-CRONTAB) 0 2 * * * /some/other/command # Chef Name: cronhole some stuff @@ -565,8 +565,8 @@ HOME=/home/foo context "when there is a crontab with a matching and identical section" do before :each do @provider.cron_exists = true - @provider.stub!(:cron_different?).and_return(false) - @provider.stub!(:read_crontab).and_return(<<-CRONTAB) + @provider.stub(:cron_different?).and_return(false) + @provider.stub(:read_crontab).and_return(<<-CRONTAB) 0 2 * * * /some/other/command # Chef Name: cronhole some stuff @@ -596,8 +596,8 @@ CRONTAB describe "action_delete" do before :each do - @provider.stub!(:write_crontab) - @provider.stub!(:read_crontab).and_return(nil) + @provider.stub(:write_crontab) + @provider.stub(:read_crontab).and_return(nil) end context "when the user's crontab has no matching section" do @@ -620,7 +620,7 @@ CRONTAB context "when the user has a crontab with a matching section" do before :each do @provider.cron_exists = true - @provider.stub!(:read_crontab).and_return(<<-CRONTAB) + @provider.stub(:read_crontab).and_return(<<-CRONTAB) 0 2 * * * /some/other/command # Chef Name: cronhole some stuff @@ -645,7 +645,7 @@ CRONTAB end it "should remove any env vars with the entry" do - @provider.stub!(:read_crontab).and_return(<<-CRONTAB) + @provider.stub(:read_crontab).and_return(<<-CRONTAB) 0 2 * * * /some/other/command # Chef Name: cronhole some stuff @@ -685,7 +685,7 @@ FOO=test end it "should remove the section" do - @provider.stub!(:read_crontab).and_return(<<-CRONTAB) + @provider.stub(:read_crontab).and_return(<<-CRONTAB) 0 2 * * * /some/other/command # Chef Name: cronhole some stuff @@ -698,7 +698,7 @@ FOO=test end it "should not blat following sections" do - @provider.stub!(:read_crontab).and_return(<<-CRONTAB) + @provider.stub(:read_crontab).and_return(<<-CRONTAB) 0 2 * * * /some/other/command # Chef Name: cronhole some stuff @@ -721,7 +721,7 @@ FOO=test end it "should remove any envvars with the section" do - @provider.stub!(:read_crontab).and_return(<<-CRONTAB) + @provider.stub(:read_crontab).and_return(<<-CRONTAB) 0 2 * * * /some/other/command # Chef Name: cronhole some stuff @@ -748,7 +748,7 @@ MAILTO=foo@example.com describe "read_crontab" do before :each do - @status = mock("Status", :exitstatus => 0) + @status = double("Status", :exitstatus => 0) @stdout = StringIO.new(<<-CRONTAB) 0 2 * * * /some/other/command @@ -757,7 +757,7 @@ MAILTO=foo@example.com # Another comment CRONTAB - @provider.stub!(:popen4).and_yield(1234, StringIO.new, @stdout, StringIO.new).and_return(@status) + @provider.stub(:popen4).and_yield(1234, StringIO.new, @stdout, StringIO.new).and_return(@status) end it "should call crontab -l with the user" do @@ -778,14 +778,14 @@ MAILTO=foo@example.com end it "should return nil if the user has no crontab" do - status = mock("Status", :exitstatus => 1) - @provider.stub!(:popen4).and_return(status) + status = double("Status", :exitstatus => 1) + @provider.stub(:popen4).and_return(status) @provider.send(:read_crontab).should == nil end it "should raise an exception if another error occurs" do - status = mock("Status", :exitstatus => 2) - @provider.stub!(:popen4).and_return(status) + status = double("Status", :exitstatus => 2) + @provider.stub(:popen4).and_return(status) lambda do @provider.send(:read_crontab) end.should raise_error(Chef::Exceptions::Cron, "Error determining state of #{@new_resource.name}, exit: 2") @@ -794,9 +794,9 @@ MAILTO=foo@example.com describe "write_crontab" do before :each do - @status = mock("Status", :exitstatus => 0) + @status = double("Status", :exitstatus => 0) @stdin = StringIO.new - @provider.stub!(:popen4).and_yield(1234, @stdin, StringIO.new, StringIO.new).and_return(@status) + @provider.stub(:popen4).and_yield(1234, @stdin, StringIO.new, StringIO.new).and_return(@status) end it "should call crontab for the user" do @@ -810,7 +810,7 @@ MAILTO=foo@example.com end it "should raise an exception if the command returns non-zero" do - @status.stub!(:exitstatus).and_return(1) + @status.stub(:exitstatus).and_return(1) lambda do @provider.send(:write_crontab, "Foo") end.should raise_error(Chef::Exceptions::Cron, "Error updating state of #{@new_resource.name}, exit: 1") @@ -822,8 +822,8 @@ MAILTO=foo@example.com raise Errno::EPIPE, "Test" end end - @status.stub!(:exitstatus).and_return(1) - @provider.stub!(:popen4).and_yield(1234, WriteErrPipe.new, StringIO.new, StringIO.new).and_return(@status) + @status.stub(:exitstatus).and_return(1) + @provider.stub(:popen4).and_yield(1234, WriteErrPipe.new, StringIO.new, StringIO.new).and_return(@status) Chef::Log.should_receive(:debug).with("Broken pipe - Test") diff --git a/spec/unit/provider/deploy/revision_spec.rb b/spec/unit/provider/deploy/revision_spec.rb index 13eaee6867..8d4590378e 100644 --- a/spec/unit/provider/deploy/revision_spec.rb +++ b/spec/unit/provider/deploy/revision_spec.rb @@ -30,20 +30,19 @@ describe Chef::Provider::Deploy::Revision do @run_context = Chef::RunContext.new(@node, {}, @events) @provider = Chef::Provider::Deploy::Revision.new(@resource, @run_context) @provider.load_current_resource - @runner = mock("runnah") - Chef::Runner.stub!(:new).and_return(@runner) + @runner = double("runnah") + Chef::Runner.stub(:new).and_return(@runner) @expected_release_dir = "/my/deploy/dir/releases/8a3195bf3efa246f743c5dfa83683201880f935c" end after do # Make sure we don't keep any state in our tests - FileUtils.rspec_reset FileUtils.rm_rf @temp_dir if File.directory?( @temp_dir ) end it "uses the resolved revision from the SCM as the release slug" do - @provider.scm_provider.stub!(:revision_slug).and_return("uglySlugly") + @provider.scm_provider.stub(:revision_slug).and_return("uglySlugly") @provider.send(:release_slug).should == "uglySlugly" end @@ -52,10 +51,10 @@ describe Chef::Provider::Deploy::Revision do end it "stores the release dir in the file cache in the cleanup step" do - FileUtils.stub!(:mkdir_p) - FileUtils.stub!(:cp_r) + FileUtils.stub(:mkdir_p) + FileUtils.stub(:cp_r) @provider.cleanup! - @provider.stub!(:release_slug).and_return("73219b87e977d9c7ba1aa57e9ad1d88fa91a0ec2") + @provider.stub(:release_slug).and_return("73219b87e977d9c7ba1aa57e9ad1d88fa91a0ec2") @provider.load_current_resource @provider.cleanup! second_release = "/my/deploy/dir/releases/73219b87e977d9c7ba1aa57e9ad1d88fa91a0ec2" @@ -64,17 +63,17 @@ describe Chef::Provider::Deploy::Revision do end it "removes a release from the file cache when it's used again in another release and append it to the end" do - FileUtils.stub!(:mkdir_p) - FileUtils.stub!(:cp_r) + FileUtils.stub(:mkdir_p) + FileUtils.stub(:cp_r) @provider.cleanup! - @provider.stub!(:release_slug).and_return("73219b87e977d9c7ba1aa57e9ad1d88fa91a0ec2") + @provider.stub(:release_slug).and_return("73219b87e977d9c7ba1aa57e9ad1d88fa91a0ec2") @provider.load_current_resource @provider.cleanup! second_release = "/my/deploy/dir/releases/73219b87e977d9c7ba1aa57e9ad1d88fa91a0ec2" @provider.all_releases.should == [@expected_release_dir,second_release] @provider.cleanup! - @provider.stub!(:release_slug).and_return("8a3195bf3efa246f743c5dfa83683201880f935c") + @provider.stub(:release_slug).and_return("8a3195bf3efa246f743c5dfa83683201880f935c") @provider.load_current_resource @provider.cleanup! @provider.all_releases.should == [second_release, @expected_release_dir] @@ -89,7 +88,7 @@ describe Chef::Provider::Deploy::Revision do end @provider.all_releases.should == release_paths - FileUtils.stub!(:rm_rf) + FileUtils.stub(:rm_rf) @provider.cleanup! expected_release_paths = (%w{second third fourth fifth} << @resource.revision).map do |release_name| diff --git a/spec/unit/provider/deploy/timestamped_spec.rb b/spec/unit/provider/deploy/timestamped_spec.rb index a9cea1142e..1d42abfc05 100644 --- a/spec/unit/provider/deploy/timestamped_spec.rb +++ b/spec/unit/provider/deploy/timestamped_spec.rb @@ -22,15 +22,15 @@ describe Chef::Provider::Deploy::Timestamped do before do @release_time = Time.utc( 2004, 8, 15, 16, 23, 42) - Time.stub!(:now).and_return(@release_time) + Time.stub(:now).and_return(@release_time) @expected_release_dir = "/my/deploy/dir/releases/20040815162342" @resource = Chef::Resource::Deploy.new("/my/deploy/dir") @node = Chef::Node.new @events = Chef::EventDispatch::Dispatcher.new @run_context = Chef::RunContext.new(@node, {}, @events) @timestamped_deploy = Chef::Provider::Deploy::Timestamped.new(@resource, @run_context) - @runner = mock("runnah") - Chef::Runner.stub!(:new).and_return(@runner) + @runner = double("runnah") + Chef::Runner.stub(:new).and_return(@runner) end it "gives a timestamp for release_slug" do diff --git a/spec/unit/provider/deploy_spec.rb b/spec/unit/provider/deploy_spec.rb index d9b1619d72..e6e4566011 100644 --- a/spec/unit/provider/deploy_spec.rb +++ b/spec/unit/provider/deploy_spec.rb @@ -22,15 +22,15 @@ describe Chef::Provider::Deploy do before do @release_time = Time.utc( 2004, 8, 15, 16, 23, 42) - Time.stub!(:now).and_return(@release_time) + Time.stub(:now).and_return(@release_time) @expected_release_dir = "/my/deploy/dir/releases/20040815162342" @resource = Chef::Resource::Deploy.new("/my/deploy/dir") @node = Chef::Node.new @events = Chef::EventDispatch::Dispatcher.new @run_context = Chef::RunContext.new(@node, {}, @events) @provider = Chef::Provider::Deploy.new(@resource, @run_context) - @provider.stub!(:release_slug) - @provider.stub!(:release_path).and_return(@expected_release_dir) + @provider.stub(:release_slug) + @provider.stub(:release_path).and_return(@expected_release_dir) end it "loads scm resource" do @@ -61,7 +61,7 @@ describe Chef::Provider::Deploy do before do FileUtils.should_receive(:mkdir_p).with(@resource.deploy_to).ordered FileUtils.should_receive(:mkdir_p).with(@resource.shared_path).ordered - ::File.stub!(:directory?).and_return(false) + ::File.stub(:directory?).and_return(false) @provider.stub(:symlink) @provider.stub(:migrate) @provider.stub(:copy_cached_repo) @@ -77,7 +77,7 @@ describe Chef::Provider::Deploy do end it "does not create deploy_to dir if it exists" do - ::File.stub!(:directory?).and_return(true) + ::File.stub(:directory?).and_return(true) ::Dir.should_receive(:chdir).with(@expected_release_dir).exactly(4).times FileUtils.should_not_receive(:mkdir_p).with(@resource.deploy_to) FileUtils.should_not_receive(:mkdir_p).with(@resource.shared_path) @@ -122,22 +122,22 @@ describe Chef::Provider::Deploy do end it "should not deploy if there is already a deploy at release_path, and it is the current release" do - @provider.stub!(:all_releases).and_return([@expected_release_dir]) - @provider.stub!(:current_release?).with(@expected_release_dir).and_return(true) + @provider.stub(:all_releases).and_return([@expected_release_dir]) + @provider.stub(:current_release?).with(@expected_release_dir).and_return(true) @provider.should_not_receive(:deploy) @provider.run_action(:deploy) end it "should call action_rollback if there is already a deploy of this revision at release_path, and it is not the current release" do - @provider.stub!(:all_releases).and_return([@expected_release_dir, "102021"]) - @provider.stub!(:current_release?).with(@expected_release_dir).and_return(false) + @provider.stub(:all_releases).and_return([@expected_release_dir, "102021"]) + @provider.stub(:current_release?).with(@expected_release_dir).and_return(false) @provider.should_receive(:rollback_to).with(@expected_release_dir) @provider.should_receive(:current_release?) @provider.run_action(:deploy) end it "calls deploy when deploying a new release" do - @provider.stub!(:all_releases).and_return([]) + @provider.stub(:all_releases).and_return([]) @provider.should_receive(:deploy) @provider.run_action(:deploy) end @@ -149,22 +149,22 @@ describe Chef::Provider::Deploy do end it "Removes the old release before deploying when force deploying over it" do - @provider.stub!(:all_releases).and_return([@expected_release_dir]) + @provider.stub(:all_releases).and_return([@expected_release_dir]) FileUtils.should_receive(:rm_rf).with(@expected_release_dir) @provider.should_receive(:deploy) @provider.run_action(:force_deploy) end it "deploys as normal when force deploying and there's no prior release at the same path" do - @provider.stub!(:all_releases).and_return([]) + @provider.stub(:all_releases).and_return([]) @provider.should_receive(:deploy) @provider.run_action(:force_deploy) end it "dont care by default if error happens on deploy" do - @provider.stub!(:all_releases).and_return(['previous_release']) - @provider.stub!(:deploy).and_return{ raise "Unexpected error" } - @provider.stub!(:previous_release_path).and_return('previous_release') + @provider.stub(:all_releases).and_return(['previous_release']) + @provider.stub(:deploy).and_return{ raise "Unexpected error" } + @provider.stub(:previous_release_path).and_return('previous_release') @provider.should_not_receive(:rollback) lambda { @provider.run_action(:deploy) @@ -173,9 +173,9 @@ describe Chef::Provider::Deploy do it "rollbacks to previous release if error happens on deploy" do @resource.rollback_on_error true - @provider.stub!(:all_releases).and_return(['previous_release']) - @provider.stub!(:deploy).and_return{ raise "Unexpected error" } - @provider.stub!(:previous_release_path).and_return('previous_release') + @provider.stub(:all_releases).and_return(['previous_release']) + @provider.stub(:deploy).and_return{ raise "Unexpected error" } + @provider.stub(:previous_release_path).and_return('previous_release') @provider.should_receive(:rollback) lambda { @provider.run_action(:deploy) @@ -184,9 +184,9 @@ describe Chef::Provider::Deploy do describe "on systems without broken Dir.glob results" do it "sets the release path to the penultimate release when one is not specified, symlinks, and rm's the last release on rollback" do - @provider.stub!(:release_path).and_return("/my/deploy/dir/releases/3") + @provider.stub(:release_path).and_return("/my/deploy/dir/releases/3") all_releases = ["/my/deploy/dir/releases/1", "/my/deploy/dir/releases/2", "/my/deploy/dir/releases/3", "/my/deploy/dir/releases/4", "/my/deploy/dir/releases/5"] - Dir.stub!(:glob).with("/my/deploy/dir/releases/*").and_return(all_releases) + Dir.stub(:glob).with("/my/deploy/dir/releases/*").and_return(all_releases) @provider.should_receive(:symlink) FileUtils.should_receive(:rm_rf).with("/my/deploy/dir/releases/4") FileUtils.should_receive(:rm_rf).with("/my/deploy/dir/releases/5") @@ -195,10 +195,10 @@ describe Chef::Provider::Deploy do end it "sets the release path to the specified release, symlinks, and rm's any newer releases on rollback" do - @provider.unstub!(:release_path) + @provider.unstub(:release_path) all_releases = ["/my/deploy/dir/releases/20040815162342", "/my/deploy/dir/releases/20040700000000", "/my/deploy/dir/releases/20040600000000", "/my/deploy/dir/releases/20040500000000"].sort! - Dir.stub!(:glob).with("/my/deploy/dir/releases/*").and_return(all_releases) + Dir.stub(:glob).with("/my/deploy/dir/releases/*").and_return(all_releases) @provider.should_receive(:symlink) FileUtils.should_receive(:rm_rf).with("/my/deploy/dir/releases/20040815162342") @provider.run_action(:rollback) @@ -206,12 +206,12 @@ describe Chef::Provider::Deploy do end it "sets the release path to the penultimate release, symlinks, and rm's the last release on rollback" do - @provider.unstub!(:release_path) + @provider.unstub(:release_path) all_releases = [ "/my/deploy/dir/releases/20040815162342", "/my/deploy/dir/releases/20040700000000", "/my/deploy/dir/releases/20040600000000", "/my/deploy/dir/releases/20040500000000"] - Dir.stub!(:glob).with("/my/deploy/dir/releases/*").and_return(all_releases) + Dir.stub(:glob).with("/my/deploy/dir/releases/*").and_return(all_releases) @provider.should_receive(:symlink) FileUtils.should_receive(:rm_rf).with("/my/deploy/dir/releases/20040815162342") @provider.run_action(:rollback) @@ -221,9 +221,9 @@ describe Chef::Provider::Deploy do describe "if there are no releases to fallback to" do it "an exception is raised when there is only 1 release" do - #@provider.unstub!(:release_path) -- unstub the release path on top to feed our own release path + #@provider.unstub(:release_path) -- unstub the release path on top to feed our own release path all_releases = [ "/my/deploy/dir/releases/20040815162342"] - Dir.stub!(:glob).with("/my/deploy/dir/releases/*").and_return(all_releases) + Dir.stub(:glob).with("/my/deploy/dir/releases/*").and_return(all_releases) #@provider.should_receive(:symlink) #FileUtils.should_receive(:rm_rf).with("/my/deploy/dir/releases/20040815162342") #@provider.run_action(:rollback) @@ -235,7 +235,7 @@ describe Chef::Provider::Deploy do it "an exception is raised when there are no releases" do all_releases = [] - Dir.stub!(:glob).with("/my/deploy/dir/releases/*").and_return(all_releases) + Dir.stub(:glob).with("/my/deploy/dir/releases/*").and_return(all_releases) lambda { @provider.run_action(:rollback) }.should raise_exception(RuntimeError, "There is no release to rollback to!") @@ -245,12 +245,12 @@ describe Chef::Provider::Deploy do describe "CHEF-628: on systems with broken Dir.glob results" do it "sets the release path to the penultimate release, symlinks, and rm's the last release on rollback" do - @provider.unstub!(:release_path) + @provider.unstub(:release_path) all_releases = [ "/my/deploy/dir/releases/20040500000000", "/my/deploy/dir/releases/20040600000000", "/my/deploy/dir/releases/20040700000000", "/my/deploy/dir/releases/20040815162342" ] - Dir.stub!(:glob).with("/my/deploy/dir/releases/*").and_return(all_releases) + Dir.stub(:glob).with("/my/deploy/dir/releases/*").and_return(all_releases) @provider.should_receive(:symlink) FileUtils.should_receive(:rm_rf).with("/my/deploy/dir/releases/20040815162342") @provider.run_action(:rollback) @@ -260,13 +260,13 @@ describe Chef::Provider::Deploy do it "raises a runtime error when there's no release to rollback to" do all_releases = [] - Dir.stub!(:glob).with("/my/deploy/dir/releases/*").and_return(all_releases) + Dir.stub(:glob).with("/my/deploy/dir/releases/*").and_return(all_releases) lambda {@provider.run_action(:rollback)}.should raise_error(RuntimeError) end it "runs the new resource collection in the runner during a callback" do - @runner = mock("Runner") - Chef::Runner.stub!(:new).and_return(@runner) + @runner = double("Runner") + Chef::Runner.stub(:new).and_return(@runner) @runner.should_receive(:converge) callback_code = Proc.new { :noop } @provider.callback(:whatevs, callback_code) @@ -342,8 +342,8 @@ describe Chef::Provider::Deploy do end it "calls the internal callback :release_created when cleaning up the releases" do - FileUtils.stub!(:mkdir_p) - FileUtils.stub!(:cp_r) + FileUtils.stub(:mkdir_p) + FileUtils.stub(:cp_r) @provider.should_receive(:release_created) @provider.cleanup! end @@ -371,8 +371,8 @@ describe Chef::Provider::Deploy do FileUtils.should_receive(:ln_sf).with("/my/deploy/dir/shared/config/database.yml", @expected_release_dir + "/config/database.yml") @provider.should_receive(:enforce_ownership) - STDOUT.stub!(:tty?).and_return(true) - Chef::Log.stub!(:info?).and_return(true) + STDOUT.stub(:tty?).and_return(true) + Chef::Log.stub(:info?).and_return(true) @provider.should_receive(:run_command).with(:command => "migration_foo", :cwd => @expected_release_dir, :user => "deployNinja", :group => "deployNinjas", :log_level => :info, :live_stream => STDOUT, @@ -462,7 +462,7 @@ describe Chef::Provider::Deploy do "/my/deploy/dir/20040600000000", "/my/deploy/dir/20040500000000", "/my/deploy/dir/20040400000000", "/my/deploy/dir/20040300000000", "/my/deploy/dir/20040200000000", "/my/deploy/dir/20040100000000"].sort! - @provider.stub!(:all_releases).and_return(all_releases) + @provider.stub(:all_releases).and_return(all_releases) FileUtils.should_receive(:rm_rf).with("/my/deploy/dir/20040100000000") FileUtils.should_receive(:rm_rf).with("/my/deploy/dir/20040200000000") FileUtils.should_receive(:rm_rf).with("/my/deploy/dir/20040300000000") @@ -475,7 +475,7 @@ describe Chef::Provider::Deploy do "/my/deploy/dir/20040600000000", "/my/deploy/dir/20040500000000", "/my/deploy/dir/20040400000000", "/my/deploy/dir/20040300000000", "/my/deploy/dir/20040200000000", "/my/deploy/dir/20040100000000"].sort! - @provider.stub!(:all_releases).and_return(all_releases) + @provider.stub(:all_releases).and_return(all_releases) FileUtils.should_receive(:rm_rf).with("/my/deploy/dir/20040100000000") @provider.cleanup! end @@ -484,8 +484,8 @@ describe Chef::Provider::Deploy do all_releases = ["/my/deploy/dir/20040815162342", "/my/deploy/dir/20040700000000", "/my/deploy/dir/20040600000000", "/my/deploy/dir/20040500000000", "/my/deploy/dir/20040400000000", "/my/deploy/dir/20040300000000"].sort! - @provider.stub!(:all_releases).and_return(all_releases) - FileUtils.stub!(:rm_rf) + @provider.stub(:all_releases).and_return(all_releases) + FileUtils.stub(:rm_rf) @provider.should_receive(:release_deleted).with("/my/deploy/dir/20040300000000") @provider.cleanup! end @@ -502,9 +502,9 @@ describe Chef::Provider::Deploy do end it "shouldn't give a no method error on migrate if the environment is nil" do - @provider.stub!(:enforce_ownership) - @provider.stub!(:run_symlinks_before_migrate) - @provider.stub!(:run_command) + @provider.stub(:enforce_ownership) + @provider.stub(:run_symlinks_before_migrate) + @provider.stub(:run_command) @provider.migrate end @@ -543,7 +543,7 @@ describe Chef::Provider::Deploy do end it "defines run as a forwarder to execute, setting the user, group, cwd and environment to new_resource.user" do - mock_execution = mock("Resource::Execute") + mock_execution = double("Resource::Execute") @provider.should_receive(:execute).with("iGoToHell4this").and_return(mock_execution) @resource.user("notCoolMan") @resource.group("Ggroup") @@ -572,7 +572,7 @@ describe Chef::Provider::Deploy do end it "defines run as a forwarder to execute, setting cwd and environment but not override" do - mock_execution = mock("Resource::Execute") + mock_execution = double("Resource::Execute") @provider.should_receive(:execute).with("iGoToHell4this").and_return(mock_execution) @resource.user("notCoolMan") mock_execution.should_receive(:user).with("notCoolMan") @@ -583,8 +583,8 @@ describe Chef::Provider::Deploy do it "converts sudo and run to exec resources in hooks" do - runner = mock("tehRunner") - Chef::Runner.stub!(:new).and_return(runner) + runner = double("tehRunner") + Chef::Runner.stub(:new).and_return(runner) snitch = nil @resource.user("tehCat") @@ -607,7 +607,7 @@ describe Chef::Provider::Deploy do describe "installing gems from a gems.yml" do before do - ::File.stub!(:exist?).with("#{@expected_release_dir}/gems.yml").and_return(true) + ::File.stub(:exist?).with("#{@expected_release_dir}/gems.yml").and_return(true) @gem_list = [{:name=>"eventmachine", :version=>"0.12.9"}] end @@ -623,8 +623,8 @@ describe Chef::Provider::Deploy do end it "takes a list of gem providers converges them" do - IO.stub!(:read) - YAML.stub!(:load).and_return(@gem_list) + IO.stub(:read) + YAML.stub(:load).and_return(@gem_list) expected_gem_resources = @provider.send(:gem_packages).map { |r| [r.name, r.version] } gem_runner = @provider.send(:gem_resource_collection_runner) # no one has heard of defining == to be meaningful so I have use this monstrosity diff --git a/spec/unit/provider/directory_spec.rb b/spec/unit/provider/directory_spec.rb index 61946d2664..25ca9e0175 100644 --- a/spec/unit/provider/directory_spec.rb +++ b/spec/unit/provider/directory_spec.rb @@ -48,18 +48,18 @@ describe Chef::Provider::Directory do describe "scanning file security metadata on unix" do before do - Chef::Platform.stub!(:windows?).and_return(false) + Chef::Platform.stub(:windows?).and_return(false) end let(:mock_stat) do - cstats = mock("stats") - cstats.stub!(:uid).and_return(500) - cstats.stub!(:gid).and_return(500) - cstats.stub!(:mode).and_return(0755) + cstats = double("stats") + cstats.stub(:uid).and_return(500) + cstats.stub(:gid).and_return(500) + cstats.stub(:mode).and_return(0755) cstats end it "describes the access mode as a String of octal integers" do - File.stub!(:exists?).and_return(true) + File.stub(:exists?).and_return(true) File.should_receive(:stat).and_return(mock_stat) @directory.load_current_resource @directory.current_resource.mode.should == "0755" @@ -67,7 +67,7 @@ describe Chef::Provider::Directory do context "when user and group are specified with UID/GID" do it "describes the current owner and group as UID and GID" do - File.stub!(:exists?).and_return(true) + File.stub(:exists?).and_return(true) File.should_receive(:stat).and_return(mock_stat) @directory.load_current_resource @directory.current_resource.path.should eql(@new_resource.path) @@ -91,7 +91,7 @@ describe Chef::Provider::Directory do Dir.should_receive(:mkdir).with(@new_resource.path).once.and_return(true) @directory.should_receive(:do_acl_changes) - @directory.stub!(:do_selinux) + @directory.stub(:do_selinux) @directory.run_action(:create) @directory.new_resource.should be_updated end @@ -117,7 +117,7 @@ describe Chef::Provider::Directory do FileUtils.should_receive(:mkdir_p).with(@new_resource.path).and_return(true) @directory.should_receive(:do_acl_changes) - @directory.stub!(:do_selinux) + @directory.stub(:do_selinux) @directory.run_action(:create) @new_resource.should be_updated end @@ -152,14 +152,14 @@ describe Chef::Provider::Directory do end it "should raise an exception if it cannot delete the directory due to bad permissions" do - File.stub!(:exists?).and_return(true) - File.stub!(:writable?).and_return(false) + File.stub(:exists?).and_return(true) + File.stub(:writable?).and_return(false) lambda { @directory.run_action(:delete) }.should raise_error(RuntimeError) end it "should take no action when deleting a target directory that does not exist" do @new_resource.path "/an/invalid/path" - File.stub!(:exists?).and_return(false) + File.stub(:exists?).and_return(false) Dir.should_not_receive(:delete).with(@new_resource.path) @directory.run_action(:delete) @directory.new_resource.should_not be_updated @@ -168,7 +168,7 @@ describe Chef::Provider::Directory do it "should raise an exception when deleting a directory when target directory is a file" do stub_file_cstats @new_resource.path "/an/invalid/path" - File.stub!(:exists?).and_return(true) + File.stub(:exists?).and_return(true) File.should_receive(:directory?).and_return(false) Dir.should_not_receive(:delete).with(@new_resource.path) lambda { @directory.run_action(:delete) }.should raise_error(RuntimeError) @@ -176,13 +176,13 @@ describe Chef::Provider::Directory do end def stub_file_cstats - cstats = mock("stats") - cstats.stub!(:uid).and_return(500) - cstats.stub!(:gid).and_return(500) - cstats.stub!(:mode).and_return(0755) + cstats = double("stats") + cstats.stub(:uid).and_return(500) + cstats.stub(:gid).and_return(500) + cstats.stub(:mode).and_return(0755) # File.stat is called in: # - Chef::Provider::File.load_current_resource_attrs # - Chef::ScanAccessControl via Chef::Provider::File.setup_acl - File.stub!(:stat).and_return(cstats) + File.stub(:stat).and_return(cstats) end end diff --git a/spec/unit/provider/env_spec.rb b/spec/unit/provider/env_spec.rb index 673ba9798a..0bc5117e48 100644 --- a/spec/unit/provider/env_spec.rb +++ b/spec/unit/provider/env_spec.rb @@ -36,10 +36,10 @@ describe Chef::Provider::Env do describe "when loading the current status" do before do #@current_resource = @new_resource.clone - #Chef::Resource::Env.stub!(:new).and_return(@current_resource) + #Chef::Resource::Env.stub(:new).and_return(@current_resource) @provider.current_resource = @current_resource - @provider.stub!(:env_value).with("FOO").and_return("bar") - @provider.stub!(:env_key_exists).and_return(true) + @provider.stub(:env_value).with("FOO").and_return("bar") + @provider.stub(:env_key_exists).and_return(true) end it "should create a current resource with the same name as the new resource" do @@ -72,8 +72,8 @@ describe Chef::Provider::Env do describe "action_create" do before do @provider.key_exists = false - @provider.stub!(:create_env).and_return(true) - @provider.stub!(:modify_env).and_return(true) + @provider.stub(:create_env).and_return(true) + @provider.stub(:modify_env).and_return(true) end it "should call create_env if the key does not exist" do @@ -94,15 +94,15 @@ describe Chef::Provider::Env do it "should call modify_env if the key exists and values are not equal" do @provider.key_exists = true - @provider.stub!(:compare_value).and_return(true) + @provider.stub(:compare_value).and_return(true) @provider.should_receive(:modify_env).and_return(true) @provider.action_create end it "should set the new_resources updated flag when it updates an existing value" do @provider.key_exists = true - @provider.stub!(:compare_value).and_return(true) - @provider.stub!(:modify_env).and_return(true) + @provider.stub(:compare_value).and_return(true) + @provider.stub(:modify_env).and_return(true) @provider.action_create @new_resource.should be_updated end @@ -112,8 +112,8 @@ describe Chef::Provider::Env do before(:each) do @provider.current_resource = @current_resource @provider.key_exists = false - @provider.stub!(:delete_element).and_return(false) - @provider.stub!(:delete_env).and_return(true) + @provider.stub(:delete_element).and_return(false) + @provider.stub(:delete_env).and_return(true) end it "should not call delete_env if the key does not exist" do @@ -143,7 +143,7 @@ describe Chef::Provider::Env do before(:each) do @provider.current_resource = @current_resource @provider.key_exists = true - @provider.stub!(:modify_env).and_return(true) + @provider.stub(:modify_env).and_return(true) end it "should call modify_group if the key exists and values are not equal" do @@ -153,8 +153,8 @@ describe Chef::Provider::Env do end it "should set the new resources updated flag to true if modify_env is called" do - @provider.stub!(:compare_value).and_return(true) - @provider.stub!(:modify_env).and_return(true) + @provider.stub(:compare_value).and_return(true) + @provider.stub(:modify_env).and_return(true) @provider.action_modify @new_resource.should be_updated end @@ -183,12 +183,12 @@ describe Chef::Provider::Env do end it "should return true if the element is not found" do - @new_resource.stub!(:value).and_return("C:/baz/bin") + @new_resource.stub(:value).and_return("C:/baz/bin") @provider.delete_element.should eql(true) end it "should return false if the delim not defined" do - @new_resource.stub!(:delim).and_return(nil) + @new_resource.stub(:delim).and_return(nil) @provider.delete_element.should eql(false) end diff --git a/spec/unit/provider/erl_call_spec.rb b/spec/unit/provider/erl_call_spec.rb index fa85b6cda7..19e16f282f 100644 --- a/spec/unit/provider/erl_call_spec.rb +++ b/spec/unit/provider/erl_call_spec.rb @@ -31,7 +31,7 @@ describe Chef::Provider::ErlCall do @provider = Chef::Provider::ErlCall.new(@new_resource, @run_context) - @provider.stub!(:popen4).and_return(@status) + @provider.stub(:popen4).and_return(@status) @stdin = StringIO.new @stdout = StringIO.new('{ok, woohoo}') @stderr = StringIO.new diff --git a/spec/unit/provider/execute_spec.rb b/spec/unit/provider/execute_spec.rb index 0d108f521d..78216a89fa 100644 --- a/spec/unit/provider/execute_spec.rb +++ b/spec/unit/provider/execute_spec.rb @@ -33,12 +33,12 @@ describe Chef::Provider::Execute do @provider.current_resource = @current_resource Chef::Log.level = :info # FIXME: There should be a test for how STDOUT.tty? changes the live_stream option being passed - STDOUT.stub!(:tty?).and_return(true) + STDOUT.stub(:tty?).and_return(true) end it "should execute foo_resource" do - @provider.stub!(:load_current_resource) + @provider.stub(:load_current_resource) opts = {} opts[:timeout] = @new_resource.timeout opts[:returns] = @new_resource.returns @@ -53,7 +53,7 @@ describe Chef::Provider::Execute do end it "should do nothing if the sentinel file exists" do - @provider.stub!(:load_current_resource) + @provider.stub(:load_current_resource) File.should_receive(:exists?).with(@new_resource.creates).and_return(true) @provider.should_not_receive(:shell_out!) Chef::Log.should_not_receive(:warn) @@ -65,7 +65,7 @@ describe Chef::Provider::Execute do it "should respect cwd options for 'creates'" do @new_resource.cwd "/tmp" @new_resource.creates "foo_resource" - @provider.stub!(:load_current_resource) + @provider.stub(:load_current_resource) File.should_receive(:exists?).with(@new_resource.creates).and_return(false) File.should_receive(:exists?).with(File.join("/tmp", @new_resource.creates)).and_return(true) Chef::Log.should_not_receive(:warn) @@ -77,7 +77,7 @@ describe Chef::Provider::Execute do it "should warn if user specified relative path without cwd" do @new_resource.creates "foo_resource" - @provider.stub!(:load_current_resource) + @provider.stub(:load_current_resource) Chef::Log.should_receive(:warn).with(/relative path/) File.should_receive(:exists?).with(@new_resource.creates).and_return(true) @provider.should_not_receive(:shell_out!) diff --git a/spec/unit/provider/file/content_spec.rb b/spec/unit/provider/file/content_spec.rb index 9262a35245..34d98b6619 100644 --- a/spec/unit/provider/file/content_spec.rb +++ b/spec/unit/provider/file/content_spec.rb @@ -25,7 +25,7 @@ describe Chef::Provider::File::Content do # let(:current_resource) do - mock("Chef::Provider::File::Resource (current)") + double("Chef::Provider::File::Resource (current)") end let(:enclosing_directory) { @@ -36,11 +36,11 @@ describe Chef::Provider::File::Content do } let(:new_resource) do - mock("Chef::Provider::File::Resource (new)", :name => "seattle.txt", :path => resource_path) + double("Chef::Provider::File::Resource (new)", :name => "seattle.txt", :path => resource_path) end let(:run_context) do - mock("Chef::RunContext") + double("Chef::RunContext") end # @@ -53,7 +53,7 @@ describe Chef::Provider::File::Content do describe "when the resource has a content attribute set" do before do - new_resource.stub!(:content).and_return("Do do do do, do do do do, do do do do, do do do do") + new_resource.stub(:content).and_return("Do do do do, do do do do, do do do do, do do do do") end it "returns a tempfile" do @@ -81,7 +81,7 @@ describe Chef::Provider::File::Content do describe "when the resource does not have a content attribute set" do before do - new_resource.stub!(:content).and_return(nil) + new_resource.stub(:content).and_return(nil) end it "should return nil instead of a tempfile" do diff --git a/spec/unit/provider/file_spec.rb b/spec/unit/provider/file_spec.rb index 6c401e3030..059f1722fb 100644 --- a/spec/unit/provider/file_spec.rb +++ b/spec/unit/provider/file_spec.rb @@ -29,7 +29,7 @@ describe Chef::Provider::File do end let(:content) do - content = mock('Chef::Provider::File::Content') + content = double('Chef::Provider::File::Content') end let(:node) { double('Chef::Node') } diff --git a/spec/unit/provider/git_spec.rb b/spec/unit/provider/git_spec.rb index 4c54a17958..b18a2a8996 100644 --- a/spec/unit/provider/git_spec.rb +++ b/spec/unit/provider/git_spec.rb @@ -21,7 +21,7 @@ require 'spec_helper' describe Chef::Provider::Git do before(:each) do - STDOUT.stub!(:tty?).and_return(true) + STDOUT.stub(:tty?).and_return(true) Chef::Log.level = :info @current_resource = Chef::Resource::Git.new("web2.0 app") @@ -41,9 +41,9 @@ describe Chef::Provider::Git do context "determining the revision of the currently deployed checkout" do before do - @stdout = mock("standard out") - @stderr = mock("standard error") - @exitstatus = mock("exitstatus") + @stdout = double("standard out") + @stderr = double("standard error") + @exitstatus = double("exitstatus") end it "sets the current revision to nil if the deploy dir does not exist" do @@ -54,7 +54,7 @@ describe Chef::Provider::Git do it "determines the current revision when there is one" do ::File.should_receive(:exist?).with("/my/deploy/dir/.git").and_return(true) @stdout = "9b4d8dc38dd471246e7cfb1c3c1ad14b0f2bee13\n" - @provider.should_receive(:shell_out!).with('git rev-parse HEAD', {:cwd => '/my/deploy/dir', :returns => [0,128]}).and_return(mock("ShellOut result", :stdout => @stdout)) + @provider.should_receive(:shell_out!).with('git rev-parse HEAD', {:cwd => '/my/deploy/dir', :returns => [0,128]}).and_return(double("ShellOut result", :stdout => @stdout)) @provider.find_current_revision.should eql("9b4d8dc38dd471246e7cfb1c3c1ad14b0f2bee13") end @@ -62,13 +62,13 @@ describe Chef::Provider::Git do ::File.should_receive(:exist?).with("/my/deploy/dir/.git").and_return(true) @stderr = "fatal: Not a git repository (or any of the parent directories): .git" @stdout = "" - @provider.should_receive(:shell_out!).with('git rev-parse HEAD', :cwd => '/my/deploy/dir', :returns => [0,128]).and_return(mock("ShellOut result", :stdout => "", :stderr => @stderr)) + @provider.should_receive(:shell_out!).with('git rev-parse HEAD', :cwd => '/my/deploy/dir', :returns => [0,128]).and_return(double("ShellOut result", :stdout => "", :stderr => @stderr)) @provider.find_current_revision.should be_nil end end it "creates a current_resource with the currently deployed revision when a clone exists in the destination dir" do - @provider.stub!(:find_current_revision).and_return("681c9802d1c62a45b490786c18f0b8216b309440") + @provider.stub(:find_current_revision).and_return("681c9802d1c62a45b490786c18f0b8216b309440") @provider.load_current_resource @provider.current_resource.name.should eql(@resource.name) @provider.current_resource.revision.should eql("681c9802d1c62a45b490786c18f0b8216b309440") @@ -93,7 +93,7 @@ describe Chef::Provider::Git do @resource.revision "v1.0" @stdout = ("d03c22a5e41f5ae3193460cca044ed1435029f53\trefs/heads/0.8-alpha\n" + "503c22a5e41f5ae3193460cca044ed1435029f53\trefs/heads/v1.0\n") - @provider.should_receive(:shell_out!).with(@git_ls_remote + "v1.0*", {:log_tag=>"git[web2.0 app]"}).and_return(mock("ShellOut result", :stdout => @stdout)) + @provider.should_receive(:shell_out!).with(@git_ls_remote + "v1.0*", {:log_tag=>"git[web2.0 app]"}).and_return(double("ShellOut result", :stdout => @stdout)) @provider.target_revision.should eql("503c22a5e41f5ae3193460cca044ed1435029f53") end @@ -102,7 +102,7 @@ describe Chef::Provider::Git do @stdout = ("d03c22a5e41f5ae3193460cca044ed1435029f53\trefs/heads/0.8-alpha\n" + "503c22a5e41f5ae3193460cca044ed1435029f53\trefs/heads/v1.0\n" + "663c22a5e41f5ae3193460cca044ed1435029f53\trefs/heads/v1.0^{}\n") - @provider.should_receive(:shell_out!).with(@git_ls_remote + "v1.0*", {:log_tag=>"git[web2.0 app]"}).and_return(mock("ShellOut result", :stdout => @stdout)) + @provider.should_receive(:shell_out!).with(@git_ls_remote + "v1.0*", {:log_tag=>"git[web2.0 app]"}).and_return(double("ShellOut result", :stdout => @stdout)) @provider.target_revision.should eql("663c22a5e41f5ae3193460cca044ed1435029f53") end @@ -110,32 +110,32 @@ describe Chef::Provider::Git do @resource.revision "origin/" @provider.action = :checkout @provider.define_resource_requirements - ::File.stub!(:directory?).with("/my/deploy").and_return(true) + ::File.stub(:directory?).with("/my/deploy").and_return(true) lambda {@provider.process_resource_requirements}.should raise_error(Chef::Exceptions::InvalidRemoteGitReference) end it "raises an unresolvable git reference error if the revision can't be resolved to any revision and assertions are run" do @resource.revision "FAIL, that's the revision I want" @provider.action = :checkout - @provider.should_receive(:shell_out!).and_return(mock("ShellOut result", :stdout => "\n")) + @provider.should_receive(:shell_out!).and_return(double("ShellOut result", :stdout => "\n")) @provider.define_resource_requirements lambda { @provider.process_resource_requirements }.should raise_error(Chef::Exceptions::UnresolvableGitReference) end it "does not raise an error if the revision can't be resolved when assertions are not run" do @resource.revision "FAIL, that's the revision I want" - @provider.should_receive(:shell_out!).and_return(mock("ShellOut result", :stdout => "\n")) + @provider.should_receive(:shell_out!).and_return(double("ShellOut result", :stdout => "\n")) @provider.target_revision.should == nil end it "does not raise an error when the revision is valid and assertions are run." do @resource.revision "0.8-alpha" @stdout = "503c22a5e41f5ae3193460cca044ed1435029f53\trefs/heads/0.8-alpha\n" - @provider.should_receive(:shell_out!).with(@git_ls_remote + "0.8-alpha*", {:log_tag=>"git[web2.0 app]"}).and_return(mock("ShellOut result", :stdout => @stdout)) + @provider.should_receive(:shell_out!).with(@git_ls_remote + "0.8-alpha*", {:log_tag=>"git[web2.0 app]"}).and_return(double("ShellOut result", :stdout => @stdout)) @provider.action = :checkout - ::File.stub!(:directory?).with("/my/deploy").and_return(true) + ::File.stub(:directory?).with("/my/deploy").and_return(true) @provider.define_resource_requirements - lambda { @provider.process_resource_requirements }.should_not raise_error(RuntimeError) + lambda { @provider.process_resource_requirements }.should_not raise_error end it "gives the latest HEAD revision SHA if nothing is specified" do @@ -156,7 +156,7 @@ b7d19519a1c15f1c1a324e2683bd728b6198ce5a\trefs/tags/0.7.8^{} ebc1b392fe7e8f0fbabc305c299b4d365d2b4d9b\trefs/tags/chef-server-package SHAS @resource.revision '' - @provider.should_receive(:shell_out!).with(@git_ls_remote + "HEAD", {:log_tag=>"git[web2.0 app]"}).and_return(mock("ShellOut result", :stdout => @stdout)) + @provider.should_receive(:shell_out!).with(@git_ls_remote + "HEAD", {:log_tag=>"git[web2.0 app]"}).and_return(double("ShellOut result", :stdout => @stdout)) @provider.target_revision.should eql("28af684d8460ba4793eda3e7ac238c864a5d029a") end end @@ -179,7 +179,7 @@ SHAS before do @resource.user deploy_user @resource.ssh_wrapper wrapper - Etc.stub!(:getpwnam).and_return(double("Struct::Passwd", :name => @resource.user, :dir => "/home/deployNinja")) + Etc.stub(:getpwnam).and_return(double("Struct::Passwd", :name => @resource.user, :dir => "/home/deployNinja")) end context "without a timeout set" do it "clones a repo with default git options" do @@ -199,7 +199,7 @@ SHAS it "runs a clone command with escaped destination" do @resource.user "deployNinja" - Etc.stub!(:getpwnam).and_return(double("Struct::Passwd", :name => @resource.user, :dir => "/home/deployNinja")) + Etc.stub(:getpwnam).and_return(double("Struct::Passwd", :name => @resource.user, :dir => "/home/deployNinja")) @resource.destination "/Application Support/with/space" @resource.ssh_wrapper "do_it_this_way.sh" expected_cmd = "git clone \"git://github.com/opscode/chef.git\" \"/Application Support/with/space\"" @@ -255,7 +255,7 @@ SHAS it "runs a sync command with the user and group specified in the resource" do @resource.user("whois") - Etc.stub!(:getpwnam).and_return(double("Struct::Passwd", :name => @resource.user, :dir => "/home/whois")) + Etc.stub(:getpwnam).and_return(double("Struct::Passwd", :name => @resource.user, :dir => "/home/whois")) @resource.group("thisis") @provider.should_receive(:setup_remote_tracking_branches).with(@resource.remote, @resource.repository) expected_cmd = "git fetch origin && git fetch origin --tags && git reset --hard d35af14d41ae22b19da05d7d03a0bafc321b244c" @@ -302,7 +302,7 @@ SHAS it "runs the config with the user and group specified in the resource" do @resource.user("whois") @resource.group("thisis") - Etc.stub!(:getpwnam).and_return(double("Struct::Passwd", :name => @resource.user, :dir => "/home/whois")) + Etc.stub(:getpwnam).and_return(double("Struct::Passwd", :name => @resource.user, :dir => "/home/whois")) command_response = double('shell_out') command_response.stub(:exitstatus) { 1 } expected_command = "git config --get remote.#{@resource.remote}.url" @@ -391,17 +391,17 @@ SHAS end it "raises an error if the git clone command would fail because the enclosing directory doesn't exist" do - @provider.stub!(:shell_out!) + @provider.stub(:shell_out!) lambda {@provider.run_action(:sync)}.should raise_error(Chef::Exceptions::MissingParentDirectory) end it "does a checkout by cloning the repo and then enabling submodules" do # will be invoked in load_current_resource - ::File.stub!(:exist?).with("/my/deploy/dir/.git").and_return(false) + ::File.stub(:exist?).with("/my/deploy/dir/.git").and_return(false) - ::File.stub!(:exist?).with("/my/deploy/dir").and_return(true) - ::File.stub!(:directory?).with("/my/deploy").and_return(true) - ::Dir.stub!(:entries).with("/my/deploy/dir").and_return(['.','..']) + ::File.stub(:exist?).with("/my/deploy/dir").and_return(true) + ::File.stub(:directory?).with("/my/deploy").and_return(true) + ::Dir.stub(:entries).with("/my/deploy/dir").and_return(['.','..']) @provider.should_receive(:clone) @provider.should_receive(:checkout) @provider.should_receive(:enable_submodules) @@ -413,11 +413,11 @@ SHAS it "does not call checkout if enable_checkout is false" do # will be invoked in load_current_resource - ::File.stub!(:exist?).with("/my/deploy/dir/.git").and_return(false) + ::File.stub(:exist?).with("/my/deploy/dir/.git").and_return(false) - ::File.stub!(:exist?).with("/my/deploy/dir").and_return(true) - ::File.stub!(:directory?).with("/my/deploy").and_return(true) - ::Dir.stub!(:entries).with("/my/deploy/dir").and_return(['.','..']) + ::File.stub(:exist?).with("/my/deploy/dir").and_return(true) + ::File.stub(:directory?).with("/my/deploy").and_return(true) + ::Dir.stub(:entries).with("/my/deploy/dir").and_return(['.','..']) @resource.enable_checkout false @provider.should_receive(:clone) @@ -429,10 +429,10 @@ SHAS # REGRESSION TEST: on some OSes, the entries from an empty directory will be listed as # ['..', '.'] but this shouldn't change the behavior it "does a checkout by cloning the repo and then enabling submodules when the directory entries are listed as %w{.. .}" do - ::File.stub!(:exist?).with("/my/deploy/dir/.git").and_return(false) - ::File.stub!(:exist?).with("/my/deploy/dir").and_return(false) - ::File.stub!(:directory?).with("/my/deploy").and_return(true) - ::Dir.stub!(:entries).with("/my/deploy/dir").and_return(['..','.']) + ::File.stub(:exist?).with("/my/deploy/dir/.git").and_return(false) + ::File.stub(:exist?).with("/my/deploy/dir").and_return(false) + ::File.stub(:directory?).with("/my/deploy").and_return(true) + ::Dir.stub(:entries).with("/my/deploy/dir").and_return(['..','.']) @provider.should_receive(:clone) @provider.should_receive(:checkout) @provider.should_receive(:enable_submodules) @@ -443,11 +443,11 @@ SHAS it "should not checkout if the destination exists or is a non empty directory" do # will be invoked in load_current_resource - ::File.stub!(:exist?).with("/my/deploy/dir/.git").and_return(false) + ::File.stub(:exist?).with("/my/deploy/dir/.git").and_return(false) - ::File.stub!(:exist?).with("/my/deploy/dir").and_return(true) - ::File.stub!(:directory?).with("/my/deploy").and_return(true) - ::Dir.stub!(:entries).with("/my/deploy/dir").and_return(['.','..','foo','bar']) + ::File.stub(:exist?).with("/my/deploy/dir").and_return(true) + ::File.stub(:directory?).with("/my/deploy").and_return(true) + ::Dir.stub(:entries).with("/my/deploy/dir").and_return(['.','..','foo','bar']) @provider.should_not_receive(:clone) @provider.should_not_receive(:checkout) @provider.should_not_receive(:enable_submodules) @@ -458,7 +458,7 @@ SHAS it "syncs the code by updating the source when the repo has already been checked out" do ::File.should_receive(:exist?).with("/my/deploy/dir/.git").and_return(true) - ::File.stub!(:directory?).with("/my/deploy").and_return(true) + ::File.stub(:directory?).with("/my/deploy").and_return(true) @provider.should_receive(:find_current_revision).exactly(2).and_return('d35af14d41ae22b19da05d7d03a0bafc321b244c') @provider.should_not_receive(:fetch_updates) @provider.should_receive(:add_remotes) @@ -468,10 +468,10 @@ SHAS it "marks the resource as updated when the repo is updated and gets a new version" do ::File.should_receive(:exist?).with("/my/deploy/dir/.git").and_return(true) - ::File.stub!(:directory?).with("/my/deploy").and_return(true) + ::File.stub(:directory?).with("/my/deploy").and_return(true) # invoked twice - first time from load_current_resource @provider.should_receive(:find_current_revision).exactly(2).and_return('d35af14d41ae22b19da05d7d03a0bafc321b244c') - @provider.stub!(:target_revision).and_return('28af684d8460ba4793eda3e7ac238c864a5d029a') + @provider.stub(:target_revision).and_return('28af684d8460ba4793eda3e7ac238c864a5d029a') @provider.should_receive(:fetch_updates) @provider.should_receive(:enable_submodules) @provider.should_receive(:add_remotes) @@ -481,9 +481,9 @@ SHAS it "does not fetch any updates if the remote revision matches the current revision" do ::File.should_receive(:exist?).with("/my/deploy/dir/.git").and_return(true) - ::File.stub!(:directory?).with("/my/deploy").and_return(true) - @provider.stub!(:find_current_revision).and_return('d35af14d41ae22b19da05d7d03a0bafc321b244c') - @provider.stub!(:target_revision).and_return('d35af14d41ae22b19da05d7d03a0bafc321b244c') + ::File.stub(:directory?).with("/my/deploy").and_return(true) + @provider.stub(:find_current_revision).and_return('d35af14d41ae22b19da05d7d03a0bafc321b244c') + @provider.stub(:target_revision).and_return('d35af14d41ae22b19da05d7d03a0bafc321b244c') @provider.should_not_receive(:fetch_updates) @provider.should_receive(:add_remotes) @provider.run_action(:sync) @@ -491,7 +491,7 @@ SHAS end it "clones the repo instead of fetching it if the deploy directory doesn't exist" do - ::File.stub!(:directory?).with("/my/deploy").and_return(true) + ::File.stub(:directory?).with("/my/deploy").and_return(true) ::File.should_receive(:exist?).with("/my/deploy/dir/.git").exactly(2).and_return(false) @provider.should_receive(:action_checkout) @provider.should_not_receive(:shell_out!) @@ -501,9 +501,9 @@ SHAS it "clones the repo instead of fetching updates if the deploy directory is empty" do ::File.should_receive(:exist?).with("/my/deploy/dir/.git").exactly(2).and_return(false) - ::File.stub!(:directory?).with("/my/deploy").and_return(true) - ::File.stub!(:directory?).with("/my/deploy/dir").and_return(true) - @provider.stub!(:sync_command).and_return("huzzah!") + ::File.stub(:directory?).with("/my/deploy").and_return(true) + ::File.stub(:directory?).with("/my/deploy/dir").and_return(true) + @provider.stub(:sync_command).and_return("huzzah!") @provider.should_receive(:action_checkout) @provider.should_not_receive(:shell_out!).with("huzzah!", :cwd => "/my/deploy/dir") @provider.run_action(:sync) diff --git a/spec/unit/provider/group/dscl_spec.rb b/spec/unit/provider/group/dscl_spec.rb index 360a799b5f..5a02ee8dfb 100644 --- a/spec/unit/provider/group/dscl_spec.rb +++ b/spec/unit/provider/group/dscl_spec.rb @@ -27,12 +27,12 @@ describe Chef::Provider::Group::Dscl do @current_resource = Chef::Resource::Group.new("aj") @provider = Chef::Provider::Group::Dscl.new(@new_resource, @run_context) @provider.current_resource = @current_resource - @status = mock("Process::Status", :exitstatus => 0) + @status = double("Process::Status", :exitstatus => 0) @pid = 2342 @stdin = StringIO.new @stdout = StringIO.new("\n") @stderr = StringIO.new("") - @provider.stub!(:popen4).and_yield(@pid,@stdin,@stdout,@stderr).and_return(@status) + @provider.stub(:popen4).and_yield(@pid,@stdin,@stdout,@stderr).and_return(@status) end it "should run popen4 with the supplied array of arguments appended to the dscl command" do @@ -50,7 +50,7 @@ describe Chef::Provider::Group::Dscl do before do @node = Chef::Node.new @provider = Chef::Provider::Group::Dscl.new(@node, @new_resource) - @provider.stub!(:dscl).and_return(["cmd", @status, "stdout", "stderr"]) + @provider.stub(:dscl).and_return(["cmd", @status, "stdout", "stderr"]) end it "should run dscl with the supplied cmd /Path args" do @@ -60,8 +60,8 @@ describe Chef::Provider::Group::Dscl do describe "with the dscl command returning a non zero exit status for a delete" do before do - @status = mock("Process::Status", :exitstatus => 1) - @provider.stub!(:dscl).and_return(["cmd", @status, "stdout", "stderr"]) + @status = double("Process::Status", :exitstatus => 1) + @provider.stub(:dscl).and_return(["cmd", @status, "stdout", "stderr"]) end it "should return an empty string of standard output for a delete" do @@ -77,7 +77,7 @@ describe Chef::Provider::Group::Dscl do describe "with the dscl command returning no such key" do before do - @provider.stub!(:dscl).and_return(["cmd", @status, "No such key: ", "stderr"]) + @provider.stub(:dscl).and_return(["cmd", @status, "No such key: ", "stderr"]) end it "should raise an exception" do @@ -98,7 +98,7 @@ describe Chef::Provider::Group::Dscl do before do @node = Chef::Node.new @provider = Chef::Provider::Group::Dscl.new(@node, @new_resource) - @provider.stub!(:safe_dscl).and_return("\naj 200\njt 201\n") + @provider.stub(:safe_dscl).and_return("\naj 200\njt 201\n") end it "should run safe_dscl with list /Groups gid" do @@ -120,7 +120,7 @@ describe Chef::Provider::Group::Dscl do before do @node = Chef::Node.new @provider = Chef::Provider::Group::Dscl.new(@node, @new_resource) - @provider.stub!(:safe_dscl).and_return("\naj 500\n") + @provider.stub(:safe_dscl).and_return("\naj 500\n") end it "should run safe_dscl with list /Groups gid" do @@ -144,7 +144,7 @@ describe Chef::Provider::Group::Dscl do describe "set_gid" do describe "with the new resource and a gid number which is already in use" do before do - @provider.stub!(:gid_used?).and_return(true) + @provider.stub(:gid_used?).and_return(true) end it "should raise an exception if the new resources gid is already in use" do @@ -162,7 +162,7 @@ describe Chef::Provider::Group::Dscl do describe "with blank gid number for the new resources" do before do @new_resource.instance_variable_set(:@gid, nil) - @new_resource.stub!(:safe_dscl) + @new_resource.stub(:safe_dscl) end it "should run get_free_gid and return a valid, unused gid number" do @@ -185,9 +185,9 @@ describe Chef::Provider::Group::Dscl do describe "with existing members in the current resource and append set to false in the new resource" do before do - @new_resource.stub!(:members).and_return([]) - @new_resource.stub!(:append).and_return(false) - @current_resource.stub!(:members).and_return(["all", "your", "base"]) + @new_resource.stub(:members).and_return([]) + @new_resource.stub(:append).and_return(false) + @current_resource.stub(:members).and_return(["all", "your", "base"]) end it "should log an appropriate message" do @@ -236,6 +236,7 @@ describe Chef::Provider::Group::Dscl do describe "when loading the current system state" do before (:each) do + @provider.action = :create @provider.load_current_resource @provider.define_resource_requirements end @@ -246,8 +247,8 @@ describe Chef::Provider::Group::Dscl do end it "doesn't raise an error if /usr/bin/dscl exists" do - File.stub!(:exists?).and_return(true) - lambda { @provider.process_resource_requirements }.should_not raise_error(Chef::Exceptions::Group) + File.stub(:exists?).and_return(true) + lambda { @provider.process_resource_requirements }.should_not raise_error end end diff --git a/spec/unit/provider/group/gpasswd_spec.rb b/spec/unit/provider/group/gpasswd_spec.rb index f765667300..5bd7fdc569 100644 --- a/spec/unit/provider/group/gpasswd_spec.rb +++ b/spec/unit/provider/group/gpasswd_spec.rb @@ -27,11 +27,12 @@ describe Chef::Provider::Group::Gpasswd, "modify_group_members" do @new_resource.members %w{lobster rage fist} @new_resource.append false @provider = Chef::Provider::Group::Gpasswd.new(@new_resource, @run_context) - #@provider.stub!(:run_command).and_return(true) + #@provider.stub(:run_command).and_return(true) end describe "when determining the current group state" do before (:each) do + @provider.action = :create @provider.load_current_resource @provider.define_resource_requirements end @@ -40,14 +41,14 @@ describe Chef::Provider::Group::Gpasswd, "modify_group_members" do # for Chef::Provider::Group - no need to repeat it here. We'll # include only what's specific to this provider. it "should raise an error if the required binary /usr/bin/gpasswd doesn't exist" do - File.stub!(:exists?).and_return(true) + File.stub(:exists?).and_return(true) File.should_receive(:exists?).with("/usr/bin/gpasswd").and_return(false) lambda { @provider.process_resource_requirements }.should raise_error(Chef::Exceptions::Group) end it "shouldn't raise an error if the required binaries exist" do - File.stub!(:exists?).and_return(true) - lambda { @provider.process_resource_requirements }.should_not raise_error(Chef::Exceptions::Group) + File.stub(:exists?).and_return(true) + lambda { @provider.process_resource_requirements }.should_not raise_error end end @@ -85,7 +86,7 @@ describe Chef::Provider::Group::Gpasswd, "modify_group_members" do describe "when the resource specifies group members" do it "should log an appropriate debug message" do Chef::Log.should_receive(:debug).with("group[wheel] setting group members to: lobster, rage, fist") - @provider.stub!(:shell_out!) + @provider.stub(:shell_out!) @provider.modify_group_members end diff --git a/spec/unit/provider/group/groupadd_spec.rb b/spec/unit/provider/group/groupadd_spec.rb index 91073727c8..793615d04c 100644 --- a/spec/unit/provider/group/groupadd_spec.rb +++ b/spec/unit/provider/group/groupadd_spec.rb @@ -48,7 +48,7 @@ describe Chef::Provider::Group::Groupadd, "set_options" do @provider.set_options end it "should set the option for #{attribute} if the new resources #{attribute} is not null" do - @new_resource.stub!(attribute).and_return("wowaweea") + @new_resource.stub(attribute).and_return("wowaweea") @provider.set_options.should eql(" #{option} '#{@new_resource.send(attribute)}' #{@new_resource.group_name}") end end @@ -56,7 +56,7 @@ describe Chef::Provider::Group::Groupadd, "set_options" do it "should combine all the possible options" do match_string = "" field_list.sort{ |a,b| a[0] <=> b[0] }.each do |attribute, option| - @new_resource.stub!(attribute).and_return("hola") + @new_resource.stub(attribute).and_return("hola") match_string << " #{option} 'hola'" end match_string << " aj" @@ -93,10 +93,10 @@ describe Chef::Provider::Group::Groupadd, "create_group" do @node = Chef::Node.new @new_resource = Chef::Resource::Group.new("aj") @provider = Chef::Provider::Group::Groupadd.new(@node, @new_resource) - @provider.stub!(:run_command).and_return(true) - @provider.stub!(:set_options).and_return(" monkey") - @provider.stub!(:groupadd_options).and_return("") - @provider.stub!(:modify_group_members).and_return(true) + @provider.stub(:run_command).and_return(true) + @provider.stub(:set_options).and_return(" monkey") + @provider.stub(:groupadd_options).and_return("") + @provider.stub(:modify_group_members).and_return(true) end it "should run groupadd with the return of set_options" do @@ -117,14 +117,14 @@ describe Chef::Provider::Group::Groupadd do @run_context = Chef::RunContext.new(@node, {}, @events) @new_resource = Chef::Resource::Group.new("aj") @provider = Chef::Provider::Group::Groupadd.new(@new_resource, @run_context) - @provider.stub!(:run_command).and_return(true) - @provider.stub!(:set_options).and_return(" monkey") + @provider.stub(:run_command).and_return(true) + @provider.stub(:set_options).and_return(" monkey") end describe "manage group" do it "should run groupmod with the return of set_options" do - @provider.stub!(:modify_group_members).and_return(true) + @provider.stub(:modify_group_members).and_return(true) @provider.should_receive(:run_command).with({ :command => "groupmod monkey" }).and_return(true) @provider.manage_group end @@ -151,7 +151,7 @@ describe Chef::Provider::Group::Groupadd do describe "load_current_resource" do before do - File.stub!(:exists?).and_return(false) + File.stub(:exists?).and_return(false) @provider.define_resource_requirements end it "should raise an error if the required binary /usr/sbin/groupadd doesn't exist" do diff --git a/spec/unit/provider/group/groupmod_spec.rb b/spec/unit/provider/group/groupmod_spec.rb index bfacfa5c26..001f9c66e8 100644 --- a/spec/unit/provider/group/groupmod_spec.rb +++ b/spec/unit/provider/group/groupmod_spec.rb @@ -43,8 +43,8 @@ describe Chef::Provider::Group::Groupmod do end it "shouldn't raise an error if the required binaries exist" do - File.stub!(:exists?).and_return(true) - lambda { @provider.load_current_resource }.should_not raise_error(Chef::Exceptions::Group) + File.stub(:exists?).and_return(true) + lambda { @provider.load_current_resource }.should_not raise_error end end @@ -89,7 +89,7 @@ describe Chef::Provider::Group::Groupmod do end it "updates group membership correctly" do - Chef::Log.stub!(:debug) + Chef::Log.stub(:debug) @provider.should_receive(:shell_out!).with("group mod -n wheel_bak wheel") @provider.should_receive(:shell_out!).with("user mod -G wheel lobster") @provider.should_receive(:shell_out!).with("group add -g '123' -o wheel") diff --git a/spec/unit/provider/group/pw_spec.rb b/spec/unit/provider/group/pw_spec.rb index a545f8ee70..af64a21fde 100644 --- a/spec/unit/provider/group/pw_spec.rb +++ b/spec/unit/provider/group/pw_spec.rb @@ -77,8 +77,8 @@ describe Chef::Provider::Group::Pw do describe "with an empty members array in both the new and current resource" do before do - @new_resource.stub!(:members).and_return([]) - @current_resource.stub!(:members).and_return([]) + @new_resource.stub(:members).and_return([]) + @current_resource.stub(:members).and_return([]) end it "should set no options" do @@ -88,8 +88,8 @@ describe Chef::Provider::Group::Pw do describe "with an empty members array in the new resource and existing members in the current resource" do before do - @new_resource.stub!(:members).and_return([]) - @current_resource.stub!(:members).and_return(["all", "your", "base"]) + @new_resource.stub(:members).and_return([]) + @current_resource.stub(:members).and_return(["all", "your", "base"]) end it "should log an appropriate message" do @@ -104,8 +104,8 @@ describe Chef::Provider::Group::Pw do describe "with supplied members array in the new resource and an empty members array in the current resource" do before do - @new_resource.stub!(:members).and_return(["all", "your", "base"]) - @current_resource.stub!(:members).and_return([]) + @new_resource.stub(:members).and_return(["all", "your", "base"]) + @current_resource.stub(:members).and_return([]) end it "should log an appropriate debug message" do @@ -121,6 +121,7 @@ describe Chef::Provider::Group::Pw do describe"load_current_resource" do before (:each) do + @provider.action = :create @provider.load_current_resource @provider.define_resource_requirements end @@ -130,8 +131,8 @@ describe Chef::Provider::Group::Pw do end it "shouldn't raise an error if /usr/sbin/pw exists" do - File.stub!(:exists?).and_return(true) - lambda { @provider.process_resource_requirements }.should_not raise_error(Chef::Exceptions::Group) + File.stub(:exists?).and_return(true) + lambda { @provider.process_resource_requirements }.should_not raise_error end end end diff --git a/spec/unit/provider/group/usermod_spec.rb b/spec/unit/provider/group/usermod_spec.rb index 1687cc0b65..c0178e5e57 100644 --- a/spec/unit/provider/group/usermod_spec.rb +++ b/spec/unit/provider/group/usermod_spec.rb @@ -27,15 +27,15 @@ describe Chef::Provider::Group::Usermod do @new_resource.members [ "all", "your", "base" ] @new_resource.excluded_members [ ] @provider = Chef::Provider::Group::Usermod.new(@new_resource, @run_context) - @provider.stub!(:run_command) + @provider.stub(:run_command) end describe "modify_group_members" do describe "with an empty members array" do before do - @new_resource.stub!(:append).and_return(true) - @new_resource.stub!(:members).and_return([]) + @new_resource.stub(:append).and_return(true) + @new_resource.stub(:members).and_return([]) end it "should log an appropriate message" do @@ -55,8 +55,8 @@ describe Chef::Provider::Group::Usermod do } before do - @new_resource.stub!(:members).and_return(["all", "your", "base"]) - File.stub!(:exists?).and_return(true) + @new_resource.stub(:members).and_return(["all", "your", "base"]) + File.stub(:exists?).and_return(true) end it "should raise an error when setting the entire group directly" do @@ -72,8 +72,8 @@ describe Chef::Provider::Group::Usermod do @provider.load_current_resource @provider.instance_variable_set("@group_exists", true) @provider.action = :modify - @new_resource.stub!(:append).and_return(true) - @new_resource.stub!(:excluded_members).and_return(["someone"]) + @new_resource.stub(:append).and_return(true) + @new_resource.stub(:excluded_members).and_return(["someone"]) lambda { @provider.run_action(@provider.process_resource_requirements) }.should raise_error(Chef::Exceptions::Group, "excluded_members is not supported by #{@provider.to_s}") end @@ -83,7 +83,7 @@ describe Chef::Provider::Group::Usermod do current_resource.members([ ]) @provider.current_resource = current_resource @node.automatic_attrs[:platform] = platform - @new_resource.stub!(:append).and_return(true) + @new_resource.stub(:append).and_return(true) @provider.should_receive(:shell_out!).with("usermod #{flags} wheel all") @provider.should_receive(:shell_out!).with("usermod #{flags} wheel your") @provider.should_receive(:shell_out!).with("usermod #{flags} wheel base") @@ -95,19 +95,20 @@ describe Chef::Provider::Group::Usermod do describe "when loading the current resource" do before(:each) do - File.stub!(:exists?).and_return(false) + File.stub(:exists?).and_return(false) + @provider.action = :create @provider.define_resource_requirements end it "should raise an error if the required binary /usr/sbin/usermod doesn't exist" do - File.stub!(:exists?).and_return(true) + File.stub(:exists?).and_return(true) File.should_receive(:exists?).with("/usr/sbin/usermod").and_return(false) lambda { @provider.process_resource_requirements }.should raise_error(Chef::Exceptions::Group) end it "shouldn't raise an error if the required binaries exist" do - File.stub!(:exists?).and_return(true) - lambda { @provider.process_resource_requirements }.should_not raise_error(Chef::Exceptions::Group) + File.stub(:exists?).and_return(true) + lambda { @provider.process_resource_requirements }.should_not raise_error end end end diff --git a/spec/unit/provider/group/windows_spec.rb b/spec/unit/provider/group/windows_spec.rb index 14a4f4bb40..6888c750f5 100644 --- a/spec/unit/provider/group/windows_spec.rb +++ b/spec/unit/provider/group/windows_spec.rb @@ -33,8 +33,8 @@ describe Chef::Provider::Group::Windows do @events = Chef::EventDispatch::Dispatcher.new @run_context = Chef::RunContext.new(@node, {}, @events) @new_resource = Chef::Resource::Group.new("staff") - @net_group = mock("Chef::Util::Windows::NetGroup") - Chef::Util::Windows::NetGroup.stub!(:new).and_return(@net_group) + @net_group = double("Chef::Util::Windows::NetGroup") + Chef::Util::Windows::NetGroup.stub(:new).and_return(@net_group) @provider = Chef::Provider::Group::Windows.new(@new_resource, @run_context) end @@ -52,20 +52,21 @@ describe Chef::Provider::Group::Windows do @current_resource = Chef::Resource::Group.new("staff") @current_resource.members [ "all", "your", "base" ] - Chef::Util::Windows::NetGroup.stub!(:new).and_return(@net_group) - @net_group.stub!(:local_add_members) - @net_group.stub!(:local_set_members) + Chef::Util::Windows::NetGroup.stub(:new).and_return(@net_group) + @net_group.stub(:local_add_members) + @net_group.stub(:local_set_members) + @provider.stub(:local_group_name_to_sid) @provider.current_resource = @current_resource end it "should call @net_group.local_set_members" do - @new_resource.stub!(:append).and_return(false) + @new_resource.stub(:append).and_return(false) @net_group.should_receive(:local_set_members).with(@new_resource.members) @provider.manage_group end it "should call @net_group.local_add_members" do - @new_resource.stub!(:append).and_return(true) + @new_resource.stub(:append).and_return(true) @net_group.should_receive(:local_add_members).with(@new_resource.members) @provider.manage_group end @@ -74,8 +75,8 @@ describe Chef::Provider::Group::Windows do describe "remove_group" do before do - Chef::Util::Windows::NetGroup.stub!(:new).and_return(@net_group) - @provider.stub!(:run_command).and_return(true) + Chef::Util::Windows::NetGroup.stub(:new).and_return(@net_group) + @provider.stub(:run_command).and_return(true) end it "should call @net_group.local_delete" do diff --git a/spec/unit/provider/group_spec.rb b/spec/unit/provider/group_spec.rb index a076593511..b138f6b210 100644 --- a/spec/unit/provider/group_spec.rb +++ b/spec/unit/provider/group_spec.rb @@ -36,12 +36,12 @@ describe Chef::Provider::User do @provider.current_resource = @current_resource - @pw_group = mock("Struct::Group", + @pw_group = double("Struct::Group", :name => "wheel", :gid => 20, :mem => [ "root", "aj" ] ) - Etc.stub!(:getgrnam).with('wheel').and_return(@pw_group) + Etc.stub(:getgrnam).with('wheel').and_return(@pw_group) end it "assumes the group exists by default" do @@ -74,7 +74,7 @@ describe Chef::Provider::User do end it "should flip the value of exists if it cannot be found in /etc/group" do - Etc.stub!(:getgrnam).and_raise(ArgumentError) + Etc.stub(:getgrnam).and_raise(ArgumentError) @provider.load_current_resource @provider.group_exists.should be_false end @@ -87,7 +87,7 @@ describe Chef::Provider::User do describe "when determining if the system is already in the target state" do [ :gid, :members ].each do |attribute| it "should return true if #{attribute} doesn't match" do - @current_resource.stub!(attribute).and_return("looooooooooooooooooool") + @current_resource.stub(attribute).and_return("looooooooooooooooooool") @provider.compare_group.should be_true end end @@ -96,28 +96,33 @@ describe Chef::Provider::User do @provider.compare_group.should be_false end + it "should coerce an integer to a string for comparison" do + @current_resource.stub!(:gid).and_return("500") + @provider.compare_group.should be_false + end + it "should return false if append is true and the group member(s) already exists" do @current_resource.members << "extra_user" - @new_resource.stub!(:append).and_return(true) + @new_resource.stub(:append).and_return(true) @provider.compare_group.should be_false end it "should return true if append is true and the group member(s) do not already exist" do @new_resource.members << "extra_user" - @new_resource.stub!(:append).and_return(true) + @new_resource.stub(:append).and_return(true) @provider.compare_group.should be_true end it "should return false if append is true and excluded_members include a non existing member" do @new_resource.excluded_members << "extra_user" - @new_resource.stub!(:append).and_return(true) + @new_resource.stub(:append).and_return(true) @provider.compare_group.should be_false end it "should return true if the append is true and excluded_members include an existing user" do @new_resource.members.each {|m| @new_resource.excluded_members << m } @new_resource.members.clear - @new_resource.stub!(:append).and_return(true) + @new_resource.stub(:append).and_return(true) @provider.compare_group.should be_true end @@ -132,32 +137,32 @@ describe Chef::Provider::User do it "should set the new_resources updated flag when it creates the group" do @provider.group_exists = false - @provider.stub!(:create_group) + @provider.stub(:create_group) @provider.run_action(:create) @provider.new_resource.should be_updated end it "should check to see if the group has mismatched attributes if the group exists" do @provider.group_exists = true - @provider.stub!(:compare_group).and_return(false) - @provider.stub!(:change_desc).and_return([ ]) + @provider.stub(:compare_group).and_return(false) + @provider.stub(:change_desc).and_return([ ]) @provider.run_action(:create) @provider.new_resource.should_not be_updated end it "should call manage_group if the group exists and has mismatched attributes" do @provider.group_exists = true - @provider.stub!(:compare_group).and_return(true) - @provider.stub!(:change_desc).and_return([ ]) + @provider.stub(:compare_group).and_return(true) + @provider.stub(:change_desc).and_return([ ]) @provider.should_receive(:manage_group).and_return(true) @provider.run_action(:create) end it "should set the new_resources updated flag when it creates the group if we call manage_group" do @provider.group_exists = true - @provider.stub!(:compare_group).and_return(true) - @provider.stub!(:change_desc).and_return(["Some changes are going to be done."]) - @provider.stub!(:manage_group).and_return(true) + @provider.stub(:compare_group).and_return(true) + @provider.stub(:change_desc).and_return(["Some changes are going to be done."]) + @provider.stub(:manage_group).and_return(true) @provider.run_action(:create) @new_resource.should be_updated end @@ -183,20 +188,20 @@ describe Chef::Provider::User do describe "when updating a group" do before(:each) do @provider.group_exists = true - @provider.stub!(:manage_group).and_return(true) + @provider.stub(:manage_group).and_return(true) end it "should run manage_group if the group exists and has mismatched attributes" do @provider.should_receive(:compare_group).and_return(true) - @provider.stub!(:change_desc).and_return(["Some changes are going to be done."]) + @provider.stub(:change_desc).and_return(["Some changes are going to be done."]) @provider.should_receive(:manage_group).and_return(true) @provider.run_action(:manage) end it "should set the new resources updated flag to true if manage_group is called" do - @provider.stub!(:compare_group).and_return(true) - @provider.stub!(:change_desc).and_return(["Some changes are going to be done."]) - @provider.stub!(:manage_group).and_return(true) + @provider.stub(:compare_group).and_return(true) + @provider.stub(:change_desc).and_return(["Some changes are going to be done."]) + @provider.stub(:manage_group).and_return(true) @provider.run_action(:manage) @new_resource.should be_updated end @@ -209,7 +214,7 @@ describe Chef::Provider::User do it "should not run manage_group if the group exists but has no differing attributes" do @provider.should_receive(:compare_group).and_return(false) - @provider.stub!(:change_desc).and_return(["Some changes are going to be done."]) + @provider.stub(:change_desc).and_return(["Some changes are going to be done."]) @provider.should_not_receive(:manage_group) @provider.run_action(:manage) end @@ -218,27 +223,27 @@ describe Chef::Provider::User do describe "when modifying the group" do before(:each) do @provider.group_exists = true - @provider.stub!(:manage_group).and_return(true) + @provider.stub(:manage_group).and_return(true) end it "should run manage_group if the group exists and has mismatched attributes" do @provider.should_receive(:compare_group).and_return(true) - @provider.stub!(:change_desc).and_return(["Some changes are going to be done."]) + @provider.stub(:change_desc).and_return(["Some changes are going to be done."]) @provider.should_receive(:manage_group).and_return(true) @provider.run_action(:modify) end it "should set the new resources updated flag to true if manage_group is called" do - @provider.stub!(:compare_group).and_return(true) - @provider.stub!(:change_desc).and_return(["Some changes are going to be done."]) - @provider.stub!(:manage_group).and_return(true) + @provider.stub(:compare_group).and_return(true) + @provider.stub(:change_desc).and_return(["Some changes are going to be done."]) + @provider.stub(:manage_group).and_return(true) @provider.run_action(:modify) @new_resource.should be_updated end it "should not run manage_group if the group exists but has no differing attributes" do @provider.should_receive(:compare_group).and_return(false) - @provider.stub!(:change_desc).and_return(["Some changes are going to be done."]) + @provider.stub(:change_desc).and_return(["Some changes are going to be done."]) @provider.should_not_receive(:manage_group) @provider.run_action(:modify) end @@ -253,20 +258,20 @@ describe Chef::Provider::User do it "should report which group members are missing if members are missing and appending to the group" do @new_resource.members << "user1" @new_resource.members << "user2" - @new_resource.stub!(:append).and_return true + @new_resource.stub(:append).and_return true @provider.compare_group.should be_true @provider.change_desc.should == [ "add missing member(s): user1, user2" ] end it "should report that the group members will be overwritten if not appending" do @new_resource.members << "user1" - @new_resource.stub!(:append).and_return false + @new_resource.stub(:append).and_return false @provider.compare_group.should be_true @provider.change_desc.should == [ "replace group members with new list of members" ] end it "should report the gid will be changed when it does not match" do - @current_resource.stub!(:gid).and_return("BADF00D") + @current_resource.stub(:gid).and_return("BADF00D") @provider.compare_group.should be_true @provider.change_desc.should == [ "change gid #{@current_resource.gid} to #{@new_resource.gid}" ] diff --git a/spec/unit/provider/http_request_spec.rb b/spec/unit/provider/http_request_spec.rb index e8ce5f9ae3..605287fcc3 100644 --- a/spec/unit/provider/http_request_spec.rb +++ b/spec/unit/provider/http_request_spec.rb @@ -44,8 +44,8 @@ describe Chef::Provider::HttpRequest do before(:each) do # run_action(x) forces load_current_resource to run; # that would overwrite our supplied mock Chef::Rest # object - @provider.stub!(:load_current_resource).and_return(true) - @http = mock("Chef::REST") + @provider.stub(:load_current_resource).and_return(true) + @http = double("Chef::REST") @provider.http = @http end @@ -73,7 +73,7 @@ describe Chef::Provider::HttpRequest do end it "should inflate a message block at runtime" do - @new_resource.stub!(:message).and_return(lambda { "return" }) + @new_resource.stub(:message).and_return(lambda { "return" }) @http.should_receive(:put).with("http://www.opscode.com/", "return", {}) @provider.run_action(:put) @new_resource.should be_updated @@ -103,6 +103,8 @@ describe Chef::Provider::HttpRequest do end end + # CHEF-4762: we expect a nil return value for a "200 Success" response + # and false for a "304 Not Modified" response describe "action_head" do before do @provider.http = @http @@ -110,17 +112,37 @@ describe Chef::Provider::HttpRequest do it "should inflate a message block at runtime" do @new_resource.message { "return" } - @http.should_receive(:head).with("http://www.opscode.com/?message=return", {}).and_return("") + @http.should_receive(:head).with("http://www.opscode.com/?message=return", {}).and_return(nil) @provider.run_action(:head) @new_resource.should be_updated end it "should run a HEAD request" do + @http.should_receive(:head).with("http://www.opscode.com/?message=is cool", {}).and_return(nil) + @provider.run_action(:head) + @new_resource.should be_updated + end + + it "should update a HEAD request with empty string response body (CHEF-4762)" do @http.should_receive(:head).with("http://www.opscode.com/?message=is cool", {}).and_return("") @provider.run_action(:head) @new_resource.should be_updated end + it "should update a HEAD request with nil response body (CHEF-4762)" do + @http.should_receive(:head).with("http://www.opscode.com/?message=is cool", {}).and_return(nil) + @provider.run_action(:head) + @new_resource.should be_updated + end + + it "should not update a HEAD request if a not modified response (CHEF-4762)" do + if_modified_since = File.mtime(__FILE__).httpdate + @new_resource.headers "If-Modified-Since" => if_modified_since + @http.should_receive(:head).with("http://www.opscode.com/?message=is cool", {"If-Modified-Since" => if_modified_since}).and_return(false) + @provider.run_action(:head) + @new_resource.should_not be_updated + end + it "should run a HEAD request with If-Modified-Since header" do @new_resource.headers "If-Modified-Since" => File.mtime(__FILE__).httpdate @http.should_receive(:head).with("http://www.opscode.com/?message=is cool", @new_resource.headers) diff --git a/spec/unit/provider/ifconfig/aix_spec.rb b/spec/unit/provider/ifconfig/aix_spec.rb index 39e9919740..24f5fb18f3 100644 --- a/spec/unit/provider/ifconfig/aix_spec.rb +++ b/spec/unit/provider/ifconfig/aix_spec.rb @@ -67,7 +67,7 @@ IFCONFIG it "should add an interface if it does not exist" do @new_resource.device "en10" - @provider.stub!(:load_current_resource) do + @provider.stub(:load_current_resource) do @provider.instance_variable_set("@status", double("Status", :exitstatus => 0)) @provider.instance_variable_set("@current_resource", Chef::Resource::Ifconfig.new("10.0.0.1", @run_context)) end @@ -81,7 +81,7 @@ IFCONFIG it "should raise exception if metric attribute is set" do @new_resource.device "en0" @new_resource.metric "1" - @provider.stub!(:load_current_resource) do + @provider.stub(:load_current_resource) do @provider.instance_variable_set("@status", double("Status", :exitstatus => 0)) @provider.instance_variable_set("@current_resource", Chef::Resource::Ifconfig.new("10.0.0.1", @run_context)) end @@ -93,7 +93,7 @@ IFCONFIG describe "#action_enable" do it "should enable an interface if it does not exist" do @new_resource.device "en10" - @provider.stub!(:load_current_resource) do + @provider.stub(:load_current_resource) do @provider.instance_variable_set("@status", double("Status", :exitstatus => 0)) @provider.instance_variable_set("@current_resource", Chef::Resource::Ifconfig.new("10.0.0.1", @run_context)) end @@ -109,7 +109,7 @@ IFCONFIG it "should not disable an interface if it does not exist" do @new_resource.device "en10" - @provider.stub!(:load_current_resource) do + @provider.stub(:load_current_resource) do @provider.instance_variable_set("@status", double("Status", :exitstatus => 0)) @provider.instance_variable_set("@current_resource", Chef::Resource::Ifconfig.new("10.0.0.1", @run_context)) end @@ -123,7 +123,7 @@ IFCONFIG context "interface exists" do before do @new_resource.device "en10" - @provider.stub!(:load_current_resource) do + @provider.stub(:load_current_resource) do @provider.instance_variable_set("@status", double("Status", :exitstatus => 0)) current_resource = Chef::Resource::Ifconfig.new("10.0.0.1", @run_context) current_resource.device @new_resource.device @@ -146,7 +146,7 @@ IFCONFIG it "should not delete an interface if it does not exist" do @new_resource.device "en10" - @provider.stub!(:load_current_resource) do + @provider.stub(:load_current_resource) do @provider.instance_variable_set("@status", double("Status", :exitstatus => 0)) @provider.instance_variable_set("@current_resource", Chef::Resource::Ifconfig.new("10.0.0.1", @run_context)) end @@ -160,7 +160,7 @@ IFCONFIG context "interface exists" do before do @new_resource.device "en10" - @provider.stub!(:load_current_resource) do + @provider.stub(:load_current_resource) do @provider.instance_variable_set("@status", double("Status", :exitstatus => 0)) current_resource = Chef::Resource::Ifconfig.new("10.0.0.1", @run_context) current_resource.device @new_resource.device diff --git a/spec/unit/provider/ifconfig/debian_spec.rb b/spec/unit/provider/ifconfig/debian_spec.rb index 617e840e1f..c6a37fdd5b 100644 --- a/spec/unit/provider/ifconfig/debian_spec.rb +++ b/spec/unit/provider/ifconfig/debian_spec.rb @@ -20,70 +20,309 @@ require 'spec_helper' require 'chef/exceptions' describe Chef::Provider::Ifconfig::Debian do - before do - @node = Chef::Node.new - @cookbook_collection = Chef::CookbookCollection.new([]) - @events = Chef::EventDispatch::Dispatcher.new - @run_context = Chef::RunContext.new(@node, @cookbook_collection, @events) - #This new_resource can be called anything --> it is not the same as in ifconfig.rb - @new_resource = Chef::Resource::Ifconfig.new("10.0.0.1", @run_context) - @new_resource.mask "255.255.254.0" - @new_resource.metric "1" - @new_resource.mtu "1500" - @new_resource.device "eth0" - @provider = Chef::Provider::Ifconfig::Debian.new(@new_resource, @run_context) - @current_resource = Chef::Resource::Ifconfig.new("10.0.0.1", @run_context) - - status = mock("Status", :exitstatus => 0) - @provider.instance_variable_set("@status", status) - @provider.current_resource = @current_resource - @provider.stub!(:load_current_resource) - @provider.stub!(:run_command) - - @config_filename_ifaces = "/etc/network/interfaces" - @config_filename_ifcfg = "/etc/network/interfaces.d/ifcfg-#{@new_resource.device}" + + let(:run_context) do + node = Chef::Node.new + cookbook_collection = Chef::CookbookCollection.new([]) + events = Chef::EventDispatch::Dispatcher.new + Chef::RunContext.new(node, cookbook_collection, events) + end + + let(:new_resource) do + new_resource = Chef::Resource::Ifconfig.new("10.0.0.1", run_context) + new_resource.mask "255.255.254.0" + new_resource.metric "1" + new_resource.mtu "1500" + new_resource.device "eth0" + new_resource end - describe "generate_config for action_add" do - before do - @config_file_ifaces = StringIO.new - @config_file_ifcfg = StringIO.new - FileUtils.should_receive(:cp) - File.should_receive(:new).with(@config_filename_ifaces).and_return(StringIO.new) - File.should_receive(:open).with(@config_filename_ifaces, "w").and_yield(@config_file_ifaces) - File.should_receive(:new).with(@config_filename_ifcfg, "w").and_return(@config_file_ifcfg) - File.should_receive(:exist?).with(@config_filename_ifaces).and_return(true) - end - - it "should create network-scripts directory" do - File.should_receive(:directory?).with(File.dirname(@config_filename_ifcfg)).and_return(false) - Dir.should_receive(:mkdir).with(File.dirname(@config_filename_ifcfg)) - @provider.run_action(:add) - end - - it "should write configure network-scripts directory" do - File.should_receive(:directory?).with(File.dirname(@config_filename_ifcfg)).and_return(true) - @provider.run_action(:add) - @config_file_ifaces.string.should match(/^\s*source\s+\/etc\/network\/interfaces[.]d\/[*]\s*$/) - end - - it "should write a network-script" do - File.should_receive(:directory?).with(File.dirname(@config_filename_ifcfg)).and_return(true) - @provider.run_action(:add) - @config_file_ifcfg.string.should match(/^iface eth0 inet static\s*$/) - @config_file_ifcfg.string.should match(/^\s+address 10\.0\.0\.1\s*$/) - @config_file_ifcfg.string.should match(/^\s+netmask 255\.255\.254\.0\s*$/) - end + let(:current_resource) { Chef::Resource::Ifconfig.new("10.0.0.1", run_context) } + + let(:provider) do + status = double("Status", :exitstatus => 0) + provider = Chef::Provider::Ifconfig::Debian.new(new_resource, run_context) + provider.instance_variable_set("@status", status) + provider.current_resource = current_resource + allow(provider).to receive(:load_current_resource) + allow(provider).to receive(:run_command) + provider + end + + let(:config_filename_ifaces) { "/etc/network/interfaces" } + + let(:config_filename_ifcfg) { "/etc/network/interfaces.d/ifcfg-#{new_resource.device}" } + + describe "generate_config" do + + context "when writing a file" do + let(:config_file_ifcfg) { StringIO.new } + + let(:tempfile) { Tempfile.new("rspec-chef-ifconfig-debian") } + + let(:tempdir_path) { Dir.mktmpdir("rspec-chef-ifconfig-debian-dir") } + + let(:config_filename_ifcfg) { "#{tempdir_path}/ifcfg-#{new_resource.device}" } + + before do + stub_const("Chef::Provider::Ifconfig::Debian::INTERFACES_FILE", tempfile.path) + stub_const("Chef::Provider::Ifconfig::Debian::INTERFACES_DOT_D_DIR", tempdir_path) + expect(File).to receive(:new).with(config_filename_ifcfg, "w").and_return(config_file_ifcfg) + end + + it "should write a network-script" do + provider.run_action(:add) + expect(config_file_ifcfg.string).to match(/^iface eth0 inet static\s*$/) + expect(config_file_ifcfg.string).to match(/^\s+address 10\.0\.0\.1\s*$/) + expect(config_file_ifcfg.string).to match(/^\s+netmask 255\.255\.254\.0\s*$/) + end + + context "when the interface_dot_d directory does not exist" do + before do + FileUtils.rmdir tempdir_path + expect(File.exists?(tempdir_path)).to be_false + end + + it "should create the /etc/network/interfaces.d directory" do + provider.run_action(:add) + expect(File.exists?(tempdir_path)).to be_true + expect(File.directory?(tempdir_path)).to be_true + end + + it "should mark the resource as updated" do + provider.run_action(:add) + expect(new_resource.updated_by_last_action?).to be_true + end + end + + context "when the interface_dot_d directory exists" do + before do + expect(File.exists?(tempdir_path)).to be_true + end + + it "should still mark the resource as updated (we still write a file to it)" do + provider.run_action(:add) + expect(new_resource.updated_by_last_action?).to be_true + end + end + end + + context "when the file is up-to-date" do + let(:tempfile) { Tempfile.new("rspec-chef-ifconfig-debian") } + + let(:tempdir_path) { Dir.mktmpdir("rspec-chef-ifconfig-debian-dir") } + + let(:config_filename_ifcfg) { "#{tempdir_path}/ifcfg-#{new_resource.device}" } + + before do + stub_const("Chef::Provider::Ifconfig::Debian::INTERFACES_FILE", tempfile.path) + stub_const("Chef::Provider::Ifconfig::Debian::INTERFACES_DOT_D_DIR", tempdir_path) + config_file_ifcfg = StringIO.new(<<-EOF +iface eth0 inet static + address 10.0.0.1 + netmask 255.255.254.0 +EOF + ) + expect(File).to receive(:new).with(config_filename_ifcfg, "w").and_return(config_file_ifcfg) + expect(File.exists?(tempdir_path)).to be_true # since the file exists, the enclosing dir must also exist + end + + context "when the /etc/network/interfaces file has the source line" do + let(:expected_string) do + <<-EOF +a line +source #{tempdir_path}/* +another line +EOF + end + + before do + tempfile.write(expected_string) + tempfile.close + end + + it "should preserve all the contents" do + provider.run_action(:add) + expect(IO.read(tempfile.path)).to eq(expected_string) + end + + it "should not mark the resource as updated" do + provider.run_action(:add) + pending "superclass ifconfig provider is not idempotent" + expect(new_resource.updated_by_last_action?).to be_false + end + end + + context "when the /etc/network/interfaces file does not have the source line" do + let(:expected_string) do + <<-EOF +a line +another line +source #{tempdir_path}/* +EOF + end + + before do + tempfile.write("a line\nanother line\n") + tempfile.close + end + + it "should preserve the original contents and add the source line" do + provider.run_action(:add) + expect(IO.read(tempfile.path)).to eq(expected_string) + end + + it "should mark the resource as updated" do + provider.run_action(:add) + expect(new_resource.updated_by_last_action?).to be_true + end + end + end + + describe "when running under why run" do + + before do + Chef::Config[:why_run] = true + end + + after do + Chef::Config[:why_run] = false + end + + context "when writing a file" do + let(:config_file_ifcfg) { StringIO.new } + + let(:tempfile) { Tempfile.new("rspec-chef-ifconfig-debian") } + + let(:tempdir_path) { Dir.mktmpdir("rspec-chef-ifconfig-debian-dir") } + + let(:config_filename_ifcfg) { "#{tempdir_path}/ifcfg-#{new_resource.device}" } + + before do + stub_const("Chef::Provider::Ifconfig::Debian::INTERFACES_FILE", tempfile.path) + stub_const("Chef::Provider::Ifconfig::Debian::INTERFACES_DOT_D_DIR", tempdir_path) + expect(File).not_to receive(:new).with(config_filename_ifcfg, "w") + end + + it "should write a network-script" do + provider.run_action(:add) + expect(config_file_ifcfg.string).not_to match(/^iface eth0 inet static\s*$/) + expect(config_file_ifcfg.string).not_to match(/^\s+address 10\.0\.0\.1\s*$/) + expect(config_file_ifcfg.string).not_to match(/^\s+netmask 255\.255\.254\.0\s*$/) + end + + context "when the interface_dot_d directory does not exist" do + before do + FileUtils.rmdir tempdir_path + expect(File.exists?(tempdir_path)).to be_false + end + + it "should not create the /etc/network/interfaces.d directory" do + provider.run_action(:add) + expect(File.exists?(tempdir_path)).not_to be_true + end + + it "should mark the resource as updated" do + provider.run_action(:add) + expect(new_resource.updated_by_last_action?).to be_true + end + end + + context "when the interface_dot_d directory exists" do + before do + expect(File.exists?(tempdir_path)).to be_true + end + + it "should still mark the resource as updated (we still write a file to it)" do + provider.run_action(:add) + expect(new_resource.updated_by_last_action?).to be_true + end + end + end + + context "when the file is up-to-date" do + let(:tempfile) { Tempfile.new("rspec-chef-ifconfig-debian") } + + let(:tempdir_path) { Dir.mktmpdir("rspec-chef-ifconfig-debian-dir") } + + let(:config_filename_ifcfg) { "#{tempdir_path}/ifcfg-#{new_resource.device}" } + + before do + stub_const("Chef::Provider::Ifconfig::Debian::INTERFACES_FILE", tempfile.path) + stub_const("Chef::Provider::Ifconfig::Debian::INTERFACES_DOT_D_DIR", tempdir_path) + config_file_ifcfg = StringIO.new(<<-EOF +iface eth0 inet static + address 10.0.0.1 + netmask 255.255.254.0 + EOF + ) + expect(File).not_to receive(:new).with(config_filename_ifcfg, "w") + expect(File.exists?(tempdir_path)).to be_true # since the file exists, the enclosing dir must also exist + end + + context "when the /etc/network/interfaces file has the source line" do + let(:expected_string) do + <<-EOF +a line +source #{tempdir_path}/* +another line + EOF + end + + before do + tempfile.write(expected_string) + tempfile.close + end + + it "should preserve all the contents" do + provider.run_action(:add) + expect(IO.read(tempfile.path)).to eq(expected_string) + end + + it "should not mark the resource as updated" do + provider.run_action(:add) + pending "superclass ifconfig provider is not idempotent" + expect(new_resource.updated_by_last_action?).to be_false + end + end + + context "when the /etc/network/interfaces file does not have the source line" do + let(:expected_string) do + <<-EOF +a line +another line +source #{tempdir_path}/* + EOF + end + + before do + tempfile.write("a line\nanother line\n") + tempfile.close + end + + it "should preserve the original contents and not add the source line" do + provider.run_action(:add) + expect(IO.read(tempfile.path)).to eq("a line\nanother line\n") + end + + it "should mark the resource as updated" do + provider.run_action(:add) + expect(new_resource.updated_by_last_action?).to be_true + end + end + end + end end describe "delete_config for action_delete" do it "should delete network-script if it exists" do - @current_resource.device @new_resource.device - File.should_receive(:exist?).with(@config_filename_ifcfg).and_return(true) - FileUtils.should_receive(:rm_f).with(@config_filename_ifcfg, :verbose => false) + current_resource.device new_resource.device + expect(File).to receive(:exist?).with(config_filename_ifcfg).and_return(true) + expect(FileUtils).to receive(:rm_f).with(config_filename_ifcfg, :verbose => false) - @provider.run_action(:delete) + provider.run_action(:delete) end end + end diff --git a/spec/unit/provider/ifconfig/redhat_spec.rb b/spec/unit/provider/ifconfig/redhat_spec.rb index b6f83ffea9..f4b98dfc32 100644 --- a/spec/unit/provider/ifconfig/redhat_spec.rb +++ b/spec/unit/provider/ifconfig/redhat_spec.rb @@ -34,7 +34,7 @@ describe Chef::Provider::Ifconfig::Redhat do @provider = Chef::Provider::Ifconfig::Redhat.new(@new_resource, @run_context) @current_resource = Chef::Resource::Ifconfig.new("10.0.0.1", @run_context) - status = mock("Status", :exitstatus => 0) + status = double("Status", :exitstatus => 0) @provider.instance_variable_set("@status", status) @provider.current_resource = @current_resource end @@ -42,8 +42,8 @@ describe Chef::Provider::Ifconfig::Redhat do describe "generate_config for action_add" do it "should write network-script for centos" do - @provider.stub!(:load_current_resource) - @provider.stub!(:run_command) + @provider.stub(:load_current_resource) + @provider.stub(:run_command) config_filename = "/etc/sysconfig/network-scripts/ifcfg-#{@new_resource.device}" config_file = StringIO.new File.should_receive(:new).with(config_filename, "w").and_return(config_file) @@ -59,8 +59,8 @@ describe Chef::Provider::Ifconfig::Redhat do it "should delete network-script if it exists for centos" do @current_resource.device @new_resource.device - @provider.stub!(:load_current_resource) - @provider.stub!(:run_command) + @provider.stub(:load_current_resource) + @provider.stub(:run_command) config_filename = "/etc/sysconfig/network-scripts/ifcfg-#{@new_resource.device}" File.should_receive(:exist?).with(config_filename).and_return(true) FileUtils.should_receive(:rm_f).with(config_filename, :verbose => false) diff --git a/spec/unit/provider/ifconfig_spec.rb b/spec/unit/provider/ifconfig_spec.rb index f4fdc23353..fb8d0956d7 100644 --- a/spec/unit/provider/ifconfig_spec.rb +++ b/spec/unit/provider/ifconfig_spec.rb @@ -35,14 +35,14 @@ describe Chef::Provider::Ifconfig do @provider = Chef::Provider::Ifconfig.new(@new_resource, @run_context) @current_resource = Chef::Resource::Ifconfig.new("10.0.0.1", @run_context) - status = mock("Status", :exitstatus => 0) + status = double("Status", :exitstatus => 0) @provider.instance_variable_set("@status", status) @provider.current_resource = @current_resource end describe Chef::Provider::Ifconfig, "load_current_resource" do before do - status = mock("Status", :exitstatus => 1) + status = double("Status", :exitstatus => 1) @provider.should_receive(:popen4).and_return status @provider.load_current_resource end @@ -57,8 +57,8 @@ describe Chef::Provider::Ifconfig do describe Chef::Provider::Ifconfig, "action_add" do it "should add an interface if it does not exist" do - #@provider.stub!(:run_command).and_return(true) - @provider.stub!(:load_current_resource) + #@provider.stub(:run_command).and_return(true) + @provider.stub(:load_current_resource) @current_resource.inet_addr nil command = "ifconfig eth0 10.0.0.1 netmask 255.255.254.0 metric 1 mtu 1500" @provider.should_receive(:run_command).with(:command => command) @@ -69,7 +69,7 @@ describe Chef::Provider::Ifconfig do end it "should not add an interface if it already exists" do - @provider.stub!(:load_current_resource) + @provider.stub(:load_current_resource) @provider.should_not_receive(:run_command) @current_resource.inet_addr "10.0.0.1" @provider.should_not_receive(:generate_config) @@ -86,7 +86,7 @@ describe Chef::Provider::Ifconfig do describe Chef::Provider::Ifconfig, "action_enable" do it "should enable interface if does not exist" do - @provider.stub!(:load_current_resource) + @provider.stub(:load_current_resource) @current_resource.inet_addr nil command = "ifconfig eth0 10.0.0.1 netmask 255.255.254.0 metric 1 mtu 1500" @provider.should_receive(:run_command).with(:command => command) @@ -97,7 +97,7 @@ describe Chef::Provider::Ifconfig do end it "should not enable interface if it already exists" do - @provider.stub!(:load_current_resource) + @provider.stub(:load_current_resource) @provider.should_not_receive(:run_command) @current_resource.inet_addr "10.0.0.1" @provider.should_not_receive(:generate_config) @@ -110,7 +110,7 @@ describe Chef::Provider::Ifconfig do describe Chef::Provider::Ifconfig, "action_delete" do it "should delete interface if it exists" do - @provider.stub!(:load_current_resource) + @provider.stub(:load_current_resource) @current_resource.device "eth0" command = "ifconfig #{@new_resource.device} down" @provider.should_receive(:run_command).with(:command => command) @@ -121,7 +121,7 @@ describe Chef::Provider::Ifconfig do end it "should not delete interface if it does not exist" do - @provider.stub!(:load_current_resource) + @provider.stub(:load_current_resource) @provider.should_not_receive(:run_command) @provider.should_not_receive(:delete_config) @@ -133,7 +133,7 @@ describe Chef::Provider::Ifconfig do describe Chef::Provider::Ifconfig, "action_disable" do it "should disable interface if it exists" do - @provider.stub!(:load_current_resource) + @provider.stub(:load_current_resource) @current_resource.device "eth0" command = "ifconfig #{@new_resource.device} down" @provider.should_receive(:run_command).with(:command => command) @@ -144,7 +144,7 @@ describe Chef::Provider::Ifconfig do end it "should not delete interface if it does not exist" do - @provider.stub!(:load_current_resource) + @provider.stub(:load_current_resource) @provider.should_not_receive(:run_command) @provider.should_not_receive(:delete_config) @@ -156,7 +156,7 @@ describe Chef::Provider::Ifconfig do describe Chef::Provider::Ifconfig, "action_delete" do it "should delete interface of it exists" do - @provider.stub!(:load_current_resource) + @provider.stub(:load_current_resource) @current_resource.device "eth0" command = "ifconfig #{@new_resource.device} down" @provider.should_receive(:run_command).with(:command => command) @@ -168,7 +168,7 @@ describe Chef::Provider::Ifconfig do it "should not delete interface if it does not exist" do # This is so that our fake values do not get overwritten - @provider.stub!(:load_current_resource) + @provider.stub(:load_current_resource) # This is so that nothing actually runs @provider.should_not_receive(:run_command) @provider.should_not_receive(:delete_config) diff --git a/spec/unit/provider/link_spec.rb b/spec/unit/provider/link_spec.rb index bd3204510b..6052f5dd3b 100644 --- a/spec/unit/provider/link_spec.rb +++ b/spec/unit/provider/link_spec.rb @@ -44,13 +44,13 @@ describe Chef::Resource::Link, :not_supported_on_win2k3 do describe "when the target is a symlink" do before(:each) do - lstat = mock("stats", :ino => 5) - lstat.stub!(:uid).and_return(501) - lstat.stub!(:gid).and_return(501) - lstat.stub!(:mode).and_return(0777) - File.stub!(:lstat).with("#{CHEF_SPEC_DATA}/fofile-link").and_return(lstat) - provider.file_class.stub!(:symlink?).with("#{CHEF_SPEC_DATA}/fofile-link").and_return(true) - provider.file_class.stub!(:readlink).with("#{CHEF_SPEC_DATA}/fofile-link").and_return("#{CHEF_SPEC_DATA}/fofile") + lstat = double("stats", :ino => 5) + lstat.stub(:uid).and_return(501) + lstat.stub(:gid).and_return(501) + lstat.stub(:mode).and_return(0777) + File.stub(:lstat).with("#{CHEF_SPEC_DATA}/fofile-link").and_return(lstat) + provider.file_class.stub(:symlink?).with("#{CHEF_SPEC_DATA}/fofile-link").and_return(true) + provider.file_class.stub(:readlink).with("#{CHEF_SPEC_DATA}/fofile-link").and_return("#{CHEF_SPEC_DATA}/fofile") end describe "to a file that exists" do @@ -95,9 +95,9 @@ describe Chef::Resource::Link, :not_supported_on_win2k3 do describe "to a file that doesn't exist" do before do - File.stub!(:exist?).with("#{CHEF_SPEC_DATA}/fofile-link").and_return(false) - provider.file_class.stub!(:symlink?).with("#{CHEF_SPEC_DATA}/fofile-link").and_return(true) - provider.file_class.stub!(:readlink).with("#{CHEF_SPEC_DATA}/fofile-link").and_return("#{CHEF_SPEC_DATA}/fofile") + File.stub(:exist?).with("#{CHEF_SPEC_DATA}/fofile-link").and_return(false) + provider.file_class.stub(:symlink?).with("#{CHEF_SPEC_DATA}/fofile-link").and_return(true) + provider.file_class.stub(:readlink).with("#{CHEF_SPEC_DATA}/fofile-link").and_return("#{CHEF_SPEC_DATA}/fofile") new_resource.owner "501" # only loaded in current_resource if present in new new_resource.group "501" provider.load_current_resource @@ -123,8 +123,8 @@ describe Chef::Resource::Link, :not_supported_on_win2k3 do describe "when the target doesn't exist" do before do - File.stub!(:exists?).with("#{CHEF_SPEC_DATA}/fofile-link").and_return(false) - provider.file_class.stub!(:symlink?).with("#{CHEF_SPEC_DATA}/fofile-link").and_return(false) + File.stub(:exists?).with("#{CHEF_SPEC_DATA}/fofile-link").and_return(false) + provider.file_class.stub(:symlink?).with("#{CHEF_SPEC_DATA}/fofile-link").and_return(false) provider.load_current_resource end @@ -144,19 +144,19 @@ describe Chef::Resource::Link, :not_supported_on_win2k3 do describe "when the target is a regular old file" do before do - stat = mock("stats", :ino => 5) - stat.stub!(:uid).and_return(501) - stat.stub!(:gid).and_return(501) - stat.stub!(:mode).and_return(0755) - provider.file_class.stub!(:stat).with("#{CHEF_SPEC_DATA}/fofile-link").and_return(stat) - - File.stub!(:exists?).with("#{CHEF_SPEC_DATA}/fofile-link").and_return(true) - provider.file_class.stub!(:symlink?).with("#{CHEF_SPEC_DATA}/fofile-link").and_return(false) + stat = double("stats", :ino => 5) + stat.stub(:uid).and_return(501) + stat.stub(:gid).and_return(501) + stat.stub(:mode).and_return(0755) + provider.file_class.stub(:stat).with("#{CHEF_SPEC_DATA}/fofile-link").and_return(stat) + + File.stub(:exists?).with("#{CHEF_SPEC_DATA}/fofile-link").and_return(true) + provider.file_class.stub(:symlink?).with("#{CHEF_SPEC_DATA}/fofile-link").and_return(false) end describe "and the source does not exist" do before do - File.stub!(:exists?).with("#{CHEF_SPEC_DATA}/fofile").and_return(false) + File.stub(:exists?).with("#{CHEF_SPEC_DATA}/fofile").and_return(false) provider.load_current_resource end @@ -176,14 +176,14 @@ describe Chef::Resource::Link, :not_supported_on_win2k3 do describe "and the source exists" do before do - stat = mock("stats", :ino => 6) - stat.stub!(:uid).and_return(502) - stat.stub!(:gid).and_return(502) - stat.stub!(:mode).and_return(0644) + stat = double("stats", :ino => 6) + stat.stub(:uid).and_return(502) + stat.stub(:gid).and_return(502) + stat.stub(:mode).and_return(0644) - provider.file_class.stub!(:stat).with("#{CHEF_SPEC_DATA}/fofile").and_return(stat) + provider.file_class.stub(:stat).with("#{CHEF_SPEC_DATA}/fofile").and_return(stat) - File.stub!(:exists?).with("#{CHEF_SPEC_DATA}/fofile").and_return(true) + File.stub(:exists?).with("#{CHEF_SPEC_DATA}/fofile").and_return(true) provider.load_current_resource end @@ -203,14 +203,14 @@ describe Chef::Resource::Link, :not_supported_on_win2k3 do describe "and is hardlinked to the source" do before do - stat = mock("stats", :ino => 5) - stat.stub!(:uid).and_return(502) - stat.stub!(:gid).and_return(502) - stat.stub!(:mode).and_return(0644) + stat = double("stats", :ino => 5) + stat.stub(:uid).and_return(502) + stat.stub(:gid).and_return(502) + stat.stub(:mode).and_return(0644) - provider.file_class.stub!(:stat).with("#{CHEF_SPEC_DATA}/fofile").and_return(stat) + provider.file_class.stub(:stat).with("#{CHEF_SPEC_DATA}/fofile").and_return(stat) - File.stub!(:exists?).with("#{CHEF_SPEC_DATA}/fofile").and_return(true) + File.stub(:exists?).with("#{CHEF_SPEC_DATA}/fofile").and_return(true) provider.load_current_resource end diff --git a/spec/unit/provider/mdadm_spec.rb b/spec/unit/provider/mdadm_spec.rb index 25991e4732..6595728741 100644 --- a/spec/unit/provider/mdadm_spec.rb +++ b/spec/unit/provider/mdadm_spec.rb @@ -32,20 +32,20 @@ describe Chef::Provider::Mdadm do describe "when determining the current metadevice status" do it "should set the current resources mount point to the new resources mount point" do - @provider.stub!(:shell_out!).and_return(OpenStruct.new(:status => 0)) + @provider.stub(:shell_out!).and_return(OpenStruct.new(:status => 0)) @provider.load_current_resource @provider.current_resource.name.should == '/dev/md1' @provider.current_resource.raid_device.should == '/dev/md1' end it "determines that the metadevice exists when mdadm exit code is zero" do - @provider.stub!(:shell_out!).with("mdadm --detail --test /dev/md1", :returns => [0,4]).and_return(OpenStruct.new(:status => 0)) + @provider.stub(:shell_out!).with("mdadm --detail --test /dev/md1", :returns => [0,4]).and_return(OpenStruct.new(:status => 0)) @provider.load_current_resource @provider.current_resource.exists.should be_true end it "determines that the metadevice does not exist when mdadm exit code is 4" do - @provider.stub!(:shell_out!).with("mdadm --detail --test /dev/md1", :returns => [0,4]).and_return(OpenStruct.new(:status => 4)) + @provider.stub(:shell_out!).with("mdadm --detail --test /dev/md1", :returns => [0,4]).and_return(OpenStruct.new(:status => 4)) @provider.load_current_resource @provider.current_resource.exists.should be_false end @@ -55,7 +55,7 @@ describe Chef::Provider::Mdadm do before(:each) do @current_resource = Chef::Resource::Mdadm.new('/dev/md1') @new_resource.level 5 - @provider.stub!(:load_current_resource).and_return(true) + @provider.stub(:load_current_resource).and_return(true) @provider.current_resource = @current_resource end diff --git a/spec/unit/provider/mount/aix_spec.rb b/spec/unit/provider/mount/aix_spec.rb index 89de47038a..dcd9170e1f 100644 --- a/spec/unit/provider/mount/aix_spec.rb +++ b/spec/unit/provider/mount/aix_spec.rb @@ -60,8 +60,8 @@ ENABLED @provider = Chef::Provider::Mount::Aix.new(@new_resource, @run_context) - ::File.stub!(:exists?).with("/dev/sdz1").and_return true - ::File.stub!(:exists?).with("/tmp/foo").and_return true + ::File.stub(:exists?).with("/dev/sdz1").and_return true + ::File.stub(:exists?).with("/tmp/foo").and_return true end def stub_mounted(provider, mounted_output) @@ -179,7 +179,7 @@ ENABLED @new_resource.options("nodev,rw") stub_mounted_enabled(@provider, @mounted_output, "") filesystems = StringIO.new - ::File.stub!(:open).with("/etc/filesystems", "a").and_yield(filesystems) + ::File.stub(:open).with("/etc/filesystems", "a").and_yield(filesystems) @provider.run_action(:enable) @@ -200,7 +200,7 @@ ENABLED it "should disable mount if it is mounted and enabled" do stub_mounted_enabled(@provider, @mounted_output, @enabled_output) - ::File.stub!(:open).with("/etc/filesystems", "r").and_return(<<-ETCFILESYSTEMS) + ::File.stub(:open).with("/etc/filesystems", "r").and_return(<<-ETCFILESYSTEMS) /tmp/foo: dev = /dev/sdz1 vfs = jfs2 @@ -219,7 +219,7 @@ ENABLED ETCFILESYSTEMS filesystems = StringIO.new - ::File.stub!(:open).with("/etc/filesystems", "w").and_yield(filesystems) + ::File.stub(:open).with("/etc/filesystems", "w").and_yield(filesystems) @provider.run_action(:disable) diff --git a/spec/unit/provider/mount/mount_spec.rb b/spec/unit/provider/mount/mount_spec.rb index cf0e8791de..99e78590f1 100644 --- a/spec/unit/provider/mount/mount_spec.rb +++ b/spec/unit/provider/mount/mount_spec.rb @@ -34,16 +34,16 @@ describe Chef::Provider::Mount::Mount do @provider = Chef::Provider::Mount::Mount.new(@new_resource, @run_context) - ::File.stub!(:exists?).with("/dev/sdz1").and_return true - ::File.stub!(:exists?).with("/tmp/foo").and_return true - ::File.stub!(:realpath).with("/dev/sdz1").and_return "/dev/sdz1" - ::File.stub!(:realpath).with("/tmp/foo").and_return "/tmp/foo" + ::File.stub(:exists?).with("/dev/sdz1").and_return true + ::File.stub(:exists?).with("/tmp/foo").and_return true + ::File.stub(:realpath).with("/dev/sdz1").and_return "/dev/sdz1" + ::File.stub(:realpath).with("/tmp/foo").and_return "/tmp/foo" end describe "when discovering the current fs state" do before do - @provider.stub!(:shell_out!).and_return(OpenStruct.new(:stdout => '')) - ::File.stub!(:foreach).with("/etc/fstab") + @provider.stub(:shell_out!).and_return(OpenStruct.new(:stdout => '')) + ::File.stub(:foreach).with("/etc/fstab") end it "should create a current resource with the same mount point and device" do @@ -56,7 +56,7 @@ describe Chef::Provider::Mount::Mount do it "should accecpt device_type :uuid" do @new_resource.device_type :uuid @new_resource.device "d21afe51-a0fe-4dc6-9152-ac733763ae0a" - @stdout_findfs = mock("STDOUT", :first => "/dev/sdz1") + @stdout_findfs = double("STDOUT", :first => "/dev/sdz1") @provider.should_receive(:popen4).with("/sbin/findfs UUID=d21afe51-a0fe-4dc6-9152-ac733763ae0a").and_yield(@pid,@stdin,@stdout_findfs,@stderr).and_return(@status) @provider.load_current_resource() @provider.mountable? @@ -72,7 +72,7 @@ describe Chef::Provider::Mount::Mount do it "should ignore trailing slash and set mounted to true for network mount (#{type})" do @new_resource.device fs_spec - @provider.stub!(:shell_out!).and_return(OpenStruct.new(:stdout => "#{fs_spec}/ on /tmp/foo type #{type} (rw)\n")) + @provider.stub(:shell_out!).and_return(OpenStruct.new(:stdout => "#{fs_spec}/ on /tmp/foo type #{type} (rw)\n")) @provider.load_current_resource @provider.current_resource.mounted.should be_true end @@ -80,12 +80,12 @@ describe Chef::Provider::Mount::Mount do end it "should raise an error if the mount device does not exist" do - ::File.stub!(:exists?).with("/dev/sdz1").and_return false + ::File.stub(:exists?).with("/dev/sdz1").and_return false lambda { @provider.load_current_resource();@provider.mountable? }.should raise_error(Chef::Exceptions::Mount) end it "should not call mountable? with load_current_resource - CHEF-1565" do - ::File.stub!(:exists?).with("/dev/sdz1").and_return false + ::File.stub(:exists?).with("/dev/sdz1").and_return false @provider.should_receive(:mounted?).and_return(true) @provider.should_receive(:enabled?).and_return(true) @provider.should_not_receive(:mountable?) @@ -95,15 +95,15 @@ describe Chef::Provider::Mount::Mount do it "should raise an error if the mount device (uuid) does not exist" do @new_resource.device_type :uuid @new_resource.device "d21afe51-a0fe-4dc6-9152-ac733763ae0a" - status_findfs = mock("Status", :exitstatus => 1) - stdout_findfs = mock("STDOUT", :first => nil) + status_findfs = double("Status", :exitstatus => 1) + stdout_findfs = double("STDOUT", :first => nil) @provider.should_receive(:popen4).with("/sbin/findfs UUID=d21afe51-a0fe-4dc6-9152-ac733763ae0a").and_yield(@pid,@stdin,stdout_findfs,@stderr).and_return(status_findfs) ::File.should_receive(:exists?).with("").and_return(false) lambda { @provider.load_current_resource();@provider.mountable? }.should raise_error(Chef::Exceptions::Mount) end it "should raise an error if the mount point does not exist" do - ::File.stub!(:exists?).with("/tmp/foo").and_return false + ::File.stub(:exists?).with("/tmp/foo").and_return false lambda { @provider.load_current_resource();@provider.mountable? }.should raise_error(Chef::Exceptions::Mount) end @@ -125,7 +125,7 @@ describe Chef::Provider::Mount::Mount do end it "should set mounted true if the mount point is found in the mounts list" do - @provider.stub!(:shell_out!).and_return(OpenStruct.new(:stdout => '/dev/sdz1 on /tmp/foo')) + @provider.stub(:shell_out!).and_return(OpenStruct.new(:stdout => '/dev/sdz1 on /tmp/foo')) @provider.load_current_resource() @provider.current_resource.mounted.should be_true end @@ -133,10 +133,10 @@ describe Chef::Provider::Mount::Mount do it "should set mounted true if the symlink target of the device is found in the mounts list" do target = "/dev/mapper/target" - ::File.stub!(:symlink?).with("#{@new_resource.device}").and_return(true) - ::File.stub!(:readlink).with("#{@new_resource.device}").and_return(target) + ::File.stub(:symlink?).with("#{@new_resource.device}").and_return(true) + ::File.stub(:readlink).with("#{@new_resource.device}").and_return(target) - @provider.stub!(:shell_out!).and_return(OpenStruct.new(:stdout => "/dev/mapper/target on /tmp/foo type ext3 (rw)\n")) + @provider.stub(:shell_out!).and_return(OpenStruct.new(:stdout => "/dev/mapper/target on /tmp/foo type ext3 (rw)\n")) @provider.load_current_resource() @provider.current_resource.mounted.should be_true end @@ -145,7 +145,7 @@ describe Chef::Provider::Mount::Mount do mount = "/dev/sdy1 on #{@new_resource.mount_point} type ext3 (rw)\n" mount << "#{@new_resource.device} on #{@new_resource.mount_point} type ext3 (rw)\n" - @provider.stub!(:shell_out!).and_return(OpenStruct.new(:stdout => mount)) + @provider.stub(:shell_out!).and_return(OpenStruct.new(:stdout => mount)) @provider.load_current_resource() @provider.current_resource.mounted.should be_true end @@ -154,13 +154,13 @@ describe Chef::Provider::Mount::Mount do mount = "#{@new_resource.device} on #{@new_resource.mount_point} type ext3 (rw)\n" mount << "/dev/sdy1 on #{@new_resource.mount_point} type ext3 (rw)\n" - @provider.stub!(:shell_out!).and_return(OpenStruct.new(:stdout => mount)) + @provider.stub(:shell_out!).and_return(OpenStruct.new(:stdout => mount)) @provider.load_current_resource() @provider.current_resource.mounted.should be_false end it "mounted should be false if the mount point is not found in the mounts list" do - @provider.stub!(:shell_out!).and_return(OpenStruct.new(:stdout => "/dev/sdy1 on /tmp/foo type ext3 (rw)\n")) + @provider.stub(:shell_out!).and_return(OpenStruct.new(:stdout => "/dev/sdy1 on /tmp/foo type ext3 (rw)\n")) @provider.load_current_resource() @provider.current_resource.mounted.should be_false end @@ -169,7 +169,7 @@ describe Chef::Provider::Mount::Mount do fstab1 = "/dev/sdy1 /tmp/foo ext3 defaults 1 2\n" fstab2 = "#{@new_resource.device} #{@new_resource.mount_point} ext3 defaults 1 2\n" - ::File.stub!(:foreach).with("/etc/fstab").and_yield(fstab1).and_yield(fstab2) + ::File.stub(:foreach).with("/etc/fstab").and_yield(fstab1).and_yield(fstab2) @provider.load_current_resource @provider.current_resource.enabled.should be_true @@ -179,7 +179,7 @@ describe Chef::Provider::Mount::Mount do fstab1 = "#{@new_resource.device} #{@new_resource.mount_point} ext3 defaults 1 2\n" fstab2 = "/dev/sdy1 /tmp/foo/bar ext3 defaults 1 2\n" - ::File.stub!(:foreach).with("/etc/fstab").and_yield(fstab1).and_yield(fstab2) + ::File.stub(:foreach).with("/etc/fstab").and_yield(fstab1).and_yield(fstab2) @provider.load_current_resource @provider.current_resource.enabled.should be_true @@ -188,12 +188,12 @@ describe Chef::Provider::Mount::Mount do it "should set enabled to true if the symlink target is in fstab" do target = "/dev/mapper/target" - ::File.stub!(:symlink?).with("#{@new_resource.device}").and_return(true) - ::File.stub!(:readlink).with("#{@new_resource.device}").and_return(target) + ::File.stub(:symlink?).with("#{@new_resource.device}").and_return(true) + ::File.stub(:readlink).with("#{@new_resource.device}").and_return(target) fstab = "/dev/sdz1 /tmp/foo ext3 defaults 1 2\n" - ::File.stub!(:foreach).with("/etc/fstab").and_yield fstab + ::File.stub(:foreach).with("/etc/fstab").and_yield fstab @provider.load_current_resource @provider.current_resource.enabled.should be_true @@ -201,7 +201,7 @@ describe Chef::Provider::Mount::Mount do it "should set enabled to false if the mount point is not in fstab" do fstab = "/dev/sdy1 #{@new_resource.mount_point} ext3 defaults 1 2\n" - ::File.stub!(:foreach).with("/etc/fstab").and_yield fstab + ::File.stub(:foreach).with("/etc/fstab").and_yield fstab @provider.load_current_resource @provider.current_resource.enabled.should be_false @@ -209,7 +209,7 @@ describe Chef::Provider::Mount::Mount do it "should ignore commented lines in fstab " do fstab = "\# #{@new_resource.device} #{@new_resource.mount_point} ext3 defaults 1 2\n" - ::File.stub!(:foreach).with("/etc/fstab").and_yield fstab + ::File.stub(:foreach).with("/etc/fstab").and_yield fstab @provider.load_current_resource @provider.current_resource.enabled.should be_false @@ -218,7 +218,7 @@ describe Chef::Provider::Mount::Mount do it "should set enabled to false if the mount point is not last in fstab" do line_1 = "#{@new_resource.device} #{@new_resource.mount_point} ext3 defaults 1 2\n" line_2 = "/dev/sdy1 #{@new_resource.mount_point} ext3 defaults 1 2\n" - ::File.stub!(:foreach).with("/etc/fstab").and_yield(line_1).and_yield(line_2) + ::File.stub(:foreach).with("/etc/fstab").and_yield(line_1).and_yield(line_2) @provider.load_current_resource @provider.current_resource.enabled.should be_false @@ -228,11 +228,11 @@ describe Chef::Provider::Mount::Mount do target = "/dev/mapper/target" options = "rw,noexec,noauto" - ::File.stub!(:symlink?).with(@new_resource.device).and_return(true) - ::File.stub!(:readlink).with(@new_resource.device).and_return(target) + ::File.stub(:symlink?).with(@new_resource.device).and_return(true) + ::File.stub(:readlink).with(@new_resource.device).and_return(target) fstab = "#{@new_resource.device} #{@new_resource.mount_point} #{@new_resource.fstype} #{options} 1 2\n" - ::File.stub!(:foreach).with("/etc/fstab").and_yield fstab + ::File.stub(:foreach).with("/etc/fstab").and_yield fstab @provider.load_current_resource @provider.current_resource.options.should eq(options.split(',')) end @@ -241,11 +241,11 @@ describe Chef::Provider::Mount::Mount do target = "/dev/mapper/target" options = "rw,noexec,noauto" - ::File.stub!(:symlink?).with(@new_resource.device).and_return(true) - ::File.stub!(:readlink).with(@new_resource.device).and_return(target) + ::File.stub(:symlink?).with(@new_resource.device).and_return(true) + ::File.stub(:readlink).with(@new_resource.device).and_return(target) fstab = "#{target} #{@new_resource.mount_point} #{@new_resource.fstype} #{options} 1 2\n" - ::File.stub!(:foreach).with("/etc/fstab").and_yield fstab + ::File.stub(:foreach).with("/etc/fstab").and_yield fstab @provider.load_current_resource @provider.current_resource.options.should eq(options.split(',')) end @@ -263,7 +263,6 @@ describe Chef::Provider::Mount::Mount do describe "mount_fs" do it "should mount the filesystem if it is not mounted" do - @provider.rspec_reset @provider.should_receive(:shell_out!).with("mount -t ext3 -o defaults /dev/sdz1 /tmp/foo") @provider.mount_fs() end @@ -278,16 +277,16 @@ describe Chef::Provider::Mount::Mount do it "should mount the filesystem specified by uuid" do @new_resource.device "d21afe51-a0fe-4dc6-9152-ac733763ae0a" @new_resource.device_type :uuid - @stdout_findfs = mock("STDOUT", :first => "/dev/sdz1") - @provider.stub!(:popen4).with("/sbin/findfs UUID=d21afe51-a0fe-4dc6-9152-ac733763ae0a").and_yield(@pid,@stdin,@stdout_findfs,@stderr).and_return(@status) - @stdout_mock = mock('stdout mock') - @stdout_mock.stub!(:each).and_yield("#{@new_resource.device} on #{@new_resource.mount_point}") + @stdout_findfs = double("STDOUT", :first => "/dev/sdz1") + @provider.stub(:popen4).with("/sbin/findfs UUID=d21afe51-a0fe-4dc6-9152-ac733763ae0a").and_yield(@pid,@stdin,@stdout_findfs,@stderr).and_return(@status) + @stdout_mock = double('stdout mock') + @stdout_mock.stub(:each).and_yield("#{@new_resource.device} on #{@new_resource.mount_point}") @provider.should_receive(:shell_out!).with("mount -t #{@new_resource.fstype} -o defaults -U #{@new_resource.device} #{@new_resource.mount_point}").and_return(@stdout_mock) @provider.mount_fs() end it "should not mount the filesystem if it is mounted" do - @current_resource.stub!(:mounted).and_return(true) + @current_resource.stub(:mounted).and_return(true) @provider.should_not_receive(:shell_out!) @provider.mount_fs() end @@ -339,7 +338,7 @@ describe Chef::Provider::Mount::Mount do @current_resource.enabled(false) @fstab = StringIO.new - ::File.stub!(:open).with("/etc/fstab", "a").and_yield(@fstab) + ::File.stub(:open).with("/etc/fstab", "a").and_yield(@fstab) @provider.enable_fs @fstab.string.should match(%r{^/dev/sdz1\s+/tmp/foo\s+ext3\s+defaults\s+0\s+2\s*$}) end @@ -378,9 +377,9 @@ describe Chef::Provider::Mount::Mount do this_mount = "/dev/sdz1 /tmp/foo ext3 defaults 1 2\n" @fstab_read = [this_mount, other_mount] - ::File.stub!(:readlines).with("/etc/fstab").and_return(@fstab_read) + ::File.stub(:readlines).with("/etc/fstab").and_return(@fstab_read) @fstab_write = StringIO.new - ::File.stub!(:open).with("/etc/fstab", "w").and_yield(@fstab_write) + ::File.stub(:open).with("/etc/fstab", "w").and_yield(@fstab_write) @provider.disable_fs @fstab_write.string.should match(Regexp.escape(other_mount)) @@ -395,8 +394,8 @@ describe Chef::Provider::Mount::Mount do %q{#/dev/sdz1 /tmp/foo ext3 defaults 1 2}] fstab_write = StringIO.new - ::File.stub!(:readlines).with("/etc/fstab").and_return(fstab_read) - ::File.stub!(:open).with("/etc/fstab", "w").and_yield(fstab_write) + ::File.stub(:readlines).with("/etc/fstab").and_return(fstab_read) + ::File.stub(:open).with("/etc/fstab", "w").and_yield(fstab_write) @provider.disable_fs fstab_write.string.should match(%r{^/dev/sdy1 /tmp/foo ext3 defaults 1 2$}) @@ -405,23 +404,23 @@ describe Chef::Provider::Mount::Mount do end it "should disable only the last entry if enabled is true" do - @current_resource.stub!(:enabled).and_return(true) + @current_resource.stub(:enabled).and_return(true) fstab_read = ["/dev/sdz1 /tmp/foo ext3 defaults 1 2\n", "/dev/sdy1 /tmp/foo ext3 defaults 1 2\n", "/dev/sdz1 /tmp/foo ext3 defaults 1 2\n"] fstab_write = StringIO.new - ::File.stub!(:readlines).with("/etc/fstab").and_return(fstab_read) - ::File.stub!(:open).with("/etc/fstab", "w").and_yield(fstab_write) + ::File.stub(:readlines).with("/etc/fstab").and_return(fstab_read) + ::File.stub(:open).with("/etc/fstab", "w").and_yield(fstab_write) @provider.disable_fs fstab_write.string.should == "/dev/sdz1 /tmp/foo ext3 defaults 1 2\n/dev/sdy1 /tmp/foo ext3 defaults 1 2\n" end it "should not disable if enabled is false" do - @current_resource.stub!(:enabled).and_return(false) + @current_resource.stub(:enabled).and_return(false) - ::File.stub!(:readlines).with("/etc/fstab").and_return([]) + ::File.stub(:readlines).with("/etc/fstab").and_return([]) ::File.should_not_receive(:open).and_yield(@fstab) @provider.disable_fs diff --git a/spec/unit/provider/mount/windows_spec.rb b/spec/unit/provider/mount/windows_spec.rb index 4c9916ae87..80e7f1e695 100644 --- a/spec/unit/provider/mount/windows_spec.rb +++ b/spec/unit/provider/mount/windows_spec.rb @@ -40,12 +40,12 @@ describe Chef::Provider::Mount::Windows do @new_resource = Chef::Resource::Mount.new("X:") @new_resource.device GUID @current_resource = Chef::Resource::Mount.new("X:") - Chef::Resource::Mount.stub!(:new).and_return(@current_resource) + Chef::Resource::Mount.stub(:new).and_return(@current_resource) - @net_use = mock("Chef::Util::Windows::NetUse") - Chef::Util::Windows::NetUse.stub!(:new).and_return(@net_use) - @vol = mock("Chef::Util::Windows::Volume") - Chef::Util::Windows::Volume.stub!(:new).and_return(@vol) + @net_use = double("Chef::Util::Windows::NetUse") + Chef::Util::Windows::NetUse.stub(:new).and_return(@net_use) + @vol = double("Chef::Util::Windows::Volume") + Chef::Util::Windows::Volume.stub(:new).and_return(@vol) @provider = Chef::Provider::Mount::Windows.new(@new_resource, @run_context) @provider.current_resource = @current_resource @@ -53,13 +53,13 @@ describe Chef::Provider::Mount::Windows do describe "when loading the current resource" do it "should set mounted true if the mount point is found" do - @vol.stub!(:device).and_return(@new_resource.device) + @vol.stub(:device).and_return(@new_resource.device) @current_resource.should_receive(:mounted).with(true) @provider.load_current_resource end it "should set mounted false if the mount point is not found" do - @vol.stub!(:device).and_raise(ArgumentError) + @vol.stub(:device).and_raise(ArgumentError) @current_resource.should_receive(:mounted).with(false) @provider.load_current_resource end @@ -67,8 +67,8 @@ describe Chef::Provider::Mount::Windows do describe "with a local device" do before do @new_resource.device GUID - @vol.stub!(:device).and_return(@new_resource.device) - @net_use.stub!(:device).and_raise(ArgumentError) + @vol.stub(:device).and_return(@new_resource.device) + @net_use.stub(:device).and_raise(ArgumentError) end it "should determine the device is a volume GUID" do @@ -80,8 +80,8 @@ describe Chef::Provider::Mount::Windows do describe "with a remote device" do before do @new_resource.device REMOTE - @net_use.stub!(:device).and_return(@new_resource.device) - @vol.stub!(:device).and_raise(ArgumentError) + @net_use.stub(:device).and_return(@new_resource.device) + @vol.stub(:device).and_raise(ArgumentError) end it "should determine the device is remote" do @@ -93,8 +93,8 @@ describe Chef::Provider::Mount::Windows do describe "when mounting a file system" do before do @new_resource.device GUID - @vol.stub!(:add) - @vol.stub!(:device).and_raise(ArgumentError) + @vol.stub(:add) + @vol.stub(:device).and_raise(ArgumentError) @provider.load_current_resource end @@ -108,7 +108,7 @@ describe Chef::Provider::Mount::Windows do it "should not mount the filesystem if it is mounted" do @vol.should_not_receive(:add) - @current_resource.stub!(:mounted).and_return(true) + @current_resource.stub(:mounted).and_return(true) @provider.mount_fs end end @@ -116,19 +116,19 @@ describe Chef::Provider::Mount::Windows do describe "when unmounting a file system" do before do @new_resource.device GUID - @vol.stub!(:delete) - @vol.stub!(:device).and_raise(ArgumentError) + @vol.stub(:delete) + @vol.stub(:device).and_raise(ArgumentError) @provider.load_current_resource end it "should umount the filesystem if it is mounted" do - @current_resource.stub!(:mounted).and_return(true) + @current_resource.stub(:mounted).and_return(true) @vol.should_receive(:delete) @provider.umount_fs end it "should not umount the filesystem if it is not mounted" do - @current_resource.stub!(:mounted).and_return(false) + @current_resource.stub(:mounted).and_return(false) @vol.should_not_receive(:delete) @provider.umount_fs end diff --git a/spec/unit/provider/mount_spec.rb b/spec/unit/provider/mount_spec.rb index a44f9705ee..d9bfeb3e0f 100644 --- a/spec/unit/provider/mount_spec.rb +++ b/spec/unit/provider/mount_spec.rb @@ -43,14 +43,14 @@ describe Chef::Provider::Mount do describe "when the target state is a mounted filesystem" do it "should mount the filesystem if it isn't mounted" do - @current_resource.stub!(:mounted).and_return(false) + @current_resource.stub(:mounted).and_return(false) @provider.should_receive(:mount_fs).with.and_return(true) @provider.run_action(:mount) @new_resource.should be_updated_by_last_action end it "should not mount the filesystem if it is mounted" do - @current_resource.stub!(:mounted).and_return(true) + @current_resource.stub(:mounted).and_return(true) @provider.should_not_receive(:mount_fs) @provider.run_action(:mount) @new_resource.should_not be_updated_by_last_action @@ -60,14 +60,14 @@ describe Chef::Provider::Mount do describe "when the target state is an unmounted filesystem" do it "should umount the filesystem if it is mounted" do - @current_resource.stub!(:mounted).and_return(true) + @current_resource.stub(:mounted).and_return(true) @provider.should_receive(:umount_fs).with.and_return(true) @provider.run_action(:umount) @new_resource.should be_updated_by_last_action end it "should not umount the filesystem if it is not mounted" do - @current_resource.stub!(:mounted).and_return(false) + @current_resource.stub(:mounted).and_return(false) @provider.should_not_receive(:umount_fs) @provider.run_action(:umount) @new_resource.should_not be_updated_by_last_action @@ -80,14 +80,14 @@ describe Chef::Provider::Mount do end it "should remount the filesystem if it is mounted" do - @current_resource.stub!(:mounted).and_return(true) + @current_resource.stub(:mounted).and_return(true) @provider.should_receive(:remount_fs).and_return(true) @provider.run_action(:remount) @new_resource.should be_updated_by_last_action end it "should not remount the filesystem if it is not mounted" do - @current_resource.stub!(:mounted).and_return(false) + @current_resource.stub(:mounted).and_return(false) @provider.should_not_receive(:remount_fs) @provider.run_action(:remount) @new_resource.should_not be_updated_by_last_action @@ -107,7 +107,7 @@ describe Chef::Provider::Mount do end describe "when enabling the filesystem to be mounted" do it "should enable the mount if it isn't enable" do - @current_resource.stub!(:enabled).and_return(false) + @current_resource.stub(:enabled).and_return(false) @provider.should_not_receive(:mount_options_unchanged?) @provider.should_receive(:enable_fs).and_return(true) @provider.run_action(:enable) @@ -115,7 +115,7 @@ describe Chef::Provider::Mount do end it "should enable the mount if it is enabled and mount options have changed" do - @current_resource.stub!(:enabled).and_return(true) + @current_resource.stub(:enabled).and_return(true) @provider.should_receive(:mount_options_unchanged?).and_return(false) @provider.should_receive(:enable_fs).and_return(true) @provider.run_action(:enable) @@ -123,9 +123,9 @@ describe Chef::Provider::Mount do end it "should not enable the mount if it is enabled and mount options have not changed" do - @current_resource.stub!(:enabled).and_return(true) + @current_resource.stub(:enabled).and_return(true) @provider.should_receive(:mount_options_unchanged?).and_return(true) - @provider.should_not_receive(:enable_fs).and_return(true) + @provider.should_not_receive(:enable_fs) @provider.run_action(:enable) @new_resource.should_not be_updated_by_last_action end @@ -133,14 +133,14 @@ describe Chef::Provider::Mount do describe "when the target state is to disable the mount" do it "should disable the mount if it is enabled" do - @current_resource.stub!(:enabled).and_return(true) + @current_resource.stub(:enabled).and_return(true) @provider.should_receive(:disable_fs).with.and_return(true) @provider.run_action(:disable) @new_resource.should be_updated_by_last_action end it "should not disable the mount if it isn't enabled" do - @current_resource.stub!(:enabled).and_return(false) + @current_resource.stub(:enabled).and_return(false) @provider.should_not_receive(:disable_fs) @provider.run_action(:disable) @new_resource.should_not be_updated_by_last_action diff --git a/spec/unit/provider/ohai_spec.rb b/spec/unit/provider/ohai_spec.rb index 8402c92e97..2085f44309 100644 --- a/spec/unit/provider/ohai_spec.rb +++ b/spec/unit/provider/ohai_spec.rb @@ -42,16 +42,15 @@ describe Chef::Provider::Ohai do } } mock_ohai.stub!(:all_plugins).and_return(true) - mock_ohai.stub!(:require_plugin).and_return(true) mock_ohai.stub!(:data).and_return(mock_ohai[:data], mock_ohai[:data2]) - Ohai::System.stub!(:new).and_return(mock_ohai) - Chef::Platform.stub!(:find_platform_and_version).and_return({ "platform" => @platform, + Ohai::System.stub(:new).and_return(mock_ohai) + Chef::Platform.stub(:find_platform_and_version).and_return({ "platform" => @platform, "platform_version" => @platform_version}) # Fake node with a dummy save @node = Chef::Node.new @node.name(@fqdn) - @node.stub!(:save).and_return(@node) + @node.stub(:save).and_return(@node) @events = Chef::EventDispatch::Dispatcher.new @run_context = Chef::RunContext.new(@node, {}, @events) @new_resource = Chef::Resource::Ohai.new("ohai_reload") diff --git a/spec/unit/provider/package/aix_spec.rb b/spec/unit/provider/package/aix_spec.rb index 6e936156a0..35f85b628f 100644 --- a/spec/unit/provider/package/aix_spec.rb +++ b/spec/unit/provider/package/aix_spec.rb @@ -28,7 +28,7 @@ describe Chef::Provider::Package::Aix do @new_resource.source("/tmp/samba.base") @provider = Chef::Provider::Package::Aix.new(@new_resource, @run_context) - ::File.stub!(:exists?).and_return(true) + ::File.stub(:exists?).and_return(true) end describe "assessing the current package status" do @@ -36,24 +36,24 @@ describe Chef::Provider::Package::Aix do @bffinfo ="/usr/lib/objrepos:samba.base:3.3.12.0::COMMITTED:I:Samba for AIX: /etc/objrepos:samba.base:3.3.12.0::COMMITTED:I:Samba for AIX:" - @status = mock("Status", :exitstatus => 0) + @status = double("Status", :exitstatus => 0) end it "should create a current resource with the name of new_resource" do - @provider.stub!(:popen4).and_return(@status) + @provider.stub(:popen4).and_return(@status) @provider.load_current_resource @provider.current_resource.name.should == "samba.base" end it "should set the current resource bff package name to the new resource bff package name" do - @provider.stub!(:popen4).and_return(@status) + @provider.stub(:popen4).and_return(@status) @provider.load_current_resource @provider.current_resource.package_name.should == "samba.base" end it "should raise an exception if a source is supplied but not found" do - @provider.stub!(:popen4).and_return(@status) - ::File.stub!(:exists?).and_return(false) + @provider.stub(:popen4).and_return(@status) + ::File.stub(:exists?).and_return(false) @provider.define_resource_requirements @provider.load_current_resource lambda { @provider.process_resource_requirements }.should raise_error(Chef::Exceptions::Package) @@ -83,13 +83,13 @@ describe Chef::Provider::Package::Aix do it "should raise an exception if the source is not set but we are installing" do @new_resource = Chef::Resource::Package.new("samba.base") @provider = Chef::Provider::Package::Aix.new(@new_resource, @run_context) - @provider.stub!(:popen4).and_return(@status) + @provider.stub(:popen4).and_return(@status) lambda { @provider.run_action(:install) }.should raise_error(Chef::Exceptions::Package) end it "should raise an exception if installp/lslpp fails to run" do - @status = mock("Status", :exitstatus => -1) - @provider.stub!(:popen4).and_return(@status) + @status = double("Status", :exitstatus => -1) + @provider.stub(:popen4).and_return(@status) lambda { @provider.load_current_resource }.should raise_error(Chef::Exceptions::Package) end @@ -110,14 +110,14 @@ describe Chef::Provider::Package::Aix do end it "should lookup the candidate_version if the variable is not already set" do - @status = mock("Status", :exitstatus => 0) + @status = double("Status", :exitstatus => 0) @provider.should_receive(:popen4).and_return(@status) @provider.candidate_version end it "should throw and exception if the exitstatus is not 0" do - @status = mock("Status", :exitstatus => 1) - @provider.stub!(:popen4).and_return(@status) + @status = double("Status", :exitstatus => 1) + @provider.stub(:popen4).and_return(@status) lambda { @provider.candidate_version }.should raise_error(Chef::Exceptions::Package) end @@ -142,7 +142,7 @@ describe Chef::Provider::Package::Aix do end it "should run installp with -eLogfile option." do - @new_resource.stub!(:options).and_return("-e/tmp/installp.log") + @new_resource.stub(:options).and_return("-e/tmp/installp.log") @provider.should_receive(:run_command_with_systems_locale).with({ :command => "installp -aYF -e/tmp/installp.log -d /tmp/samba.base samba.base" }) @@ -159,7 +159,7 @@ describe Chef::Provider::Package::Aix do end it "should run installp -u -e/tmp/installp.log with options -e/tmp/installp.log" do - @new_resource.stub!(:options).and_return("-e/tmp/installp.log") + @new_resource.stub(:options).and_return("-e/tmp/installp.log") @provider.should_receive(:run_command_with_systems_locale).with({ :command => "installp -u -e/tmp/installp.log samba.base" }) diff --git a/spec/unit/provider/package/apt_spec.rb b/spec/unit/provider/package/apt_spec.rb index 32b55163b4..b8e23d8756 100644 --- a/spec/unit/provider/package/apt_spec.rb +++ b/spec/unit/provider/package/apt_spec.rb @@ -26,7 +26,7 @@ describe Chef::Provider::Package::Apt do @run_context = Chef::RunContext.new(@node, {}, @events) @new_resource = Chef::Resource::Package.new("irssi", @run_context) - @status = mock("Status", :exitstatus => 0) + @status = double("Status", :exitstatus => 0) @provider = Chef::Provider::Package::Apt.new(@new_resource, @run_context) @stdin = StringIO.new @stdout =<<-PKG_STATUS @@ -83,7 +83,7 @@ libmysqlclient15-dev: Candidate: (none) Version table: VPKG_STDOUT - virtual_package = mock(:stdout => virtual_package_out,:exitstatus => 0) + virtual_package = double(:stdout => virtual_package_out,:exitstatus => 0) @provider.should_receive(:shell_out!).with("apt-cache policy libmysqlclient15-dev").and_return(virtual_package) showpkg_out =<<-SHOWPKG_STDOUT Package: libmysqlclient15-dev @@ -103,7 +103,7 @@ libmysqlclient-dev 5.1.41-3ubuntu12.7 libmysqlclient-dev 5.1.41-3ubuntu12.10 libmysqlclient-dev 5.1.41-3ubuntu12 SHOWPKG_STDOUT - showpkg = mock(:stdout => showpkg_out,:exitstatus => 0) + showpkg = double(:stdout => showpkg_out,:exitstatus => 0) @provider.should_receive(:shell_out!).with("apt-cache showpkg libmysqlclient15-dev").and_return(showpkg) real_package_out=<<-RPKG_STDOUT libmysqlclient-dev: @@ -118,7 +118,7 @@ libmysqlclient-dev: 5.1.41-3ubuntu12 0 500 http://us.archive.ubuntu.com/ubuntu/ lucid/main Packages RPKG_STDOUT - real_package = mock(:stdout => real_package_out,:exitstatus => 0) + real_package = double(:stdout => real_package_out,:exitstatus => 0) @provider.should_receive(:shell_out!).with("apt-cache policy libmysqlclient-dev").and_return(real_package) @provider.load_current_resource end @@ -131,7 +131,7 @@ mp3-decoder: Candidate: (none) Version table: VPKG_STDOUT - virtual_package = mock(:stdout => virtual_package_out,:exitstatus => 0) + virtual_package = double(:stdout => virtual_package_out,:exitstatus => 0) @provider.should_receive(:shell_out!).with("apt-cache policy mp3-decoder").and_return(virtual_package) showpkg_out=<<-SHOWPKG_STDOUT Package: mp3-decoder @@ -154,7 +154,7 @@ opencubicplayer 1:0.1.17-2 mpg321 0.2.10.6 mpg123 1.12.1-0ubuntu1 SHOWPKG_STDOUT - showpkg = mock(:stdout => showpkg_out,:exitstatus => 0) + showpkg = double(:stdout => showpkg_out,:exitstatus => 0) @provider.should_receive(:shell_out!).with("apt-cache showpkg mp3-decoder").and_return(showpkg) lambda { @provider.load_current_resource }.should raise_error(Chef::Exceptions::Package) end @@ -163,8 +163,8 @@ SHOWPKG_STDOUT @new_resource = Chef::Resource::AptPackage.new("irssi", @run_context) @provider = Chef::Provider::Package::Apt.new(@new_resource, @run_context) - @new_resource.stub!(:default_release).and_return("lenny-backports") - @new_resource.stub!(:provider).and_return("Chef::Provider::Package::Apt") + @new_resource.stub(:default_release).and_return("lenny-backports") + @new_resource.stub(:provider).and_return("Chef::Provider::Package::Apt") @provider.should_receive(:shell_out!).with("apt-cache -o APT::Default-Release=lenny-backports policy irssi").and_return(@shell_out) @provider.load_current_resource end @@ -256,7 +256,7 @@ SHOWPKG_STDOUT describe "when preseeding a package" do before(:each) do - @provider.stub!(:get_preseed_file).and_return("/tmp/irssi-0.8.12-7.seed") + @provider.stub(:get_preseed_file).and_return("/tmp/irssi-0.8.12-7.seed") end it "should get the full path to the preseed response file" do @@ -282,7 +282,7 @@ SHOWPKG_STDOUT @provider.stub(:check_package_state) @current_resource.version "0.8.11" @new_resource.response_file "/tmp/file" - @provider.stub!(:get_preseed_file).and_return(false) + @provider.stub(:get_preseed_file).and_return(false) @provider.should_not_receive(:shell_out!) @provider.run_action(:reconfig) end diff --git a/spec/unit/provider/package/dpkg_spec.rb b/spec/unit/provider/package/dpkg_spec.rb index 30021e31f3..6ba7695a1e 100644 --- a/spec/unit/provider/package/dpkg_spec.rb +++ b/spec/unit/provider/package/dpkg_spec.rb @@ -30,12 +30,12 @@ describe Chef::Provider::Package::Dpkg do @stdin = StringIO.new @stdout = StringIO.new - @status = mock("Status", :exitstatus => 0) + @status = double("Status", :exitstatus => 0) @stderr = StringIO.new - @pid = mock("PID") - @provider.stub!(:popen4).and_return(@status) + @pid = double("PID") + @provider.stub(:popen4).and_return(@status) - ::File.stub!(:exists?).and_return(true) + ::File.stub(:exists?).and_return(true) end describe "when loading the current resource state" do @@ -48,14 +48,14 @@ describe Chef::Provider::Package::Dpkg do it "should raise an exception if a source is supplied but not found" do @provider.load_current_resource @provider.define_resource_requirements - ::File.stub!(:exists?).and_return(false) + ::File.stub(:exists?).and_return(false) lambda { @provider.run_action(:install) }.should raise_error(Chef::Exceptions::Package) end describe 'gets the source package version from dpkg-deb' do def check_version(version) @stdout = StringIO.new("wget\t#{version}") - @provider.stub!(:popen4).with("dpkg-deb -W #{@new_resource.source}").and_yield(@pid, @stdin, @stdout, @stderr).and_return(@status) + @provider.stub(:popen4).with("dpkg-deb -W #{@new_resource.source}").and_yield(@pid, @stdin, @stdout, @stderr).and_return(@status) @provider.load_current_resource @provider.current_resource.package_name.should == "wget" @new_resource.version.should == version @@ -76,7 +76,7 @@ describe Chef::Provider::Package::Dpkg do it "gets the source package name from dpkg-deb correctly when the package name has `-', `+' or `.' characters" do @stdout = StringIO.new("f.o.o-pkg++2\t1.11.4-1ubuntu1") - @provider.stub!(:popen4).and_yield(@pid, @stdin, @stdout, @stderr).and_return(@status) + @provider.stub(:popen4).and_yield(@pid, @stdin, @stdout, @stderr).and_return(@status) @provider.load_current_resource @provider.current_resource.package_name.should == "f.o.o-pkg++2" end @@ -103,15 +103,15 @@ Config-Version: 1.11.4-1ubuntu1 Depends: libc6 (>= 2.8~20080505), libssl0.9.8 (>= 0.9.8f-5) Conflicts: wget-ssl DPKG_S - @provider.stub!(:popen4).with("dpkg -s wget").and_yield(@pid, @stdin, @stdout, @stderr).and_return(@status) + @provider.stub(:popen4).with("dpkg -s wget").and_yield(@pid, @stdin, @stdout, @stderr).and_return(@status) @provider.load_current_resource @provider.current_resource.version.should == "1.11.4-1ubuntu1" end it "should raise an exception if dpkg fails to run" do - @status = mock("Status", :exitstatus => -1) - @provider.stub!(:popen4).and_return(@status) + @status = double("Status", :exitstatus => -1) + @provider.stub(:popen4).and_return(@status) lambda { @provider.load_current_resource }.should raise_error(Chef::Exceptions::Package) end end @@ -158,7 +158,7 @@ DPKG_S "DEBIAN_FRONTEND" => "noninteractive" } }) - @new_resource.stub!(:options).and_return("--force-yes") + @new_resource.stub(:options).and_return("--force-yes") @provider.install_package("wget", "1.11.4-1ubuntu1") end @@ -186,7 +186,7 @@ DPKG_S "DEBIAN_FRONTEND" => "noninteractive" } }) - @new_resource.stub!(:options).and_return("--force-yes") + @new_resource.stub(:options).and_return("--force-yes") @provider.remove_package("wget", "1.11.4-1ubuntu1") end @@ -208,7 +208,7 @@ DPKG_S "DEBIAN_FRONTEND" => "noninteractive" } }) - @new_resource.stub!(:options).and_return("--force-yes") + @new_resource.stub(:options).and_return("--force-yes") @provider.purge_package("wget", "1.11.4-1ubuntu1") end diff --git a/spec/unit/provider/package/easy_install_spec.rb b/spec/unit/provider/package/easy_install_spec.rb index 02f8399af8..87cbabcc19 100644 --- a/spec/unit/provider/package/easy_install_spec.rb +++ b/spec/unit/provider/package/easy_install_spec.rb @@ -30,14 +30,14 @@ describe Chef::Provider::Package::EasyInstall do @current_resource.version('1.8d') @provider = Chef::Provider::Package::EasyInstall.new(@new_resource, @run_context) - Chef::Resource::Package.stub!(:new).and_return(@current_resource) + Chef::Resource::Package.stub(:new).and_return(@current_resource) @stdin = StringIO.new @stdout = StringIO.new - @status = mock("Status", :exitstatus => 0) + @status = double("Status", :exitstatus => 0) @stderr = StringIO.new @pid = 2342 - @provider.stub!(:popen4).and_return(@status) + @provider.stub(:popen4).and_return(@status) end describe "easy_install_binary_path" do @@ -47,7 +47,7 @@ describe Chef::Provider::Package::EasyInstall do end it "should set the current resources package name to the new resources package name" do - $stdout.stub!(:write) + $stdout.stub(:write) @current_resource.should_receive(:package_name).with(@new_resource.package_name) @provider.load_current_resource end @@ -75,7 +75,7 @@ describe Chef::Provider::Package::EasyInstall do @provider.should_receive(:run_command).with({ :command => "easy_install --always-unzip \"boto==1.8d\"" }) - @new_resource.stub!(:options).and_return("--always-unzip") + @new_resource.stub(:options).and_return("--always-unzip") @provider.install_package("boto", "1.8d") end @@ -97,7 +97,7 @@ describe Chef::Provider::Package::EasyInstall do @provider.should_receive(:run_command).with({ :command => "easy_install -x -m boto" }) - @new_resource.stub!(:options).and_return("-x") + @new_resource.stub(:options).and_return("-x") @provider.remove_package("boto", "1.8d") end diff --git a/spec/unit/provider/package/freebsd_spec.rb b/spec/unit/provider/package/freebsd_spec.rb index 2901b84f49..962f9c23d1 100644 --- a/spec/unit/provider/package/freebsd_spec.rb +++ b/spec/unit/provider/package/freebsd_spec.rb @@ -30,12 +30,12 @@ describe Chef::Provider::Package::Freebsd, "load_current_resource" do @provider = Chef::Provider::Package::Freebsd.new(@new_resource, @run_context) @provider.current_resource = @current_resource - ::File.stub!(:exist?).with('/usr/ports/Makefile').and_return(false) + ::File.stub(:exist?).with('/usr/ports/Makefile').and_return(false) end describe "when determining the current package state" do before do - @provider.stub!(:ports_candidate_version).and_return("4.3.6") + @provider.stub(:ports_candidate_version).and_return("4.3.6") end it "should create a current resource with the name of the new_resource" do @@ -68,25 +68,25 @@ describe Chef::Provider::Package::Freebsd, "load_current_resource" do #@provider = Chef::Provider::Package::Freebsd.new(@node, @new_resource) - #@status = mock("Status", :exitstatus => 0) - #@stdin = mock("STDIN", :null_object => true) - #@stdout = mock("STDOUT", :null_object => true) - #@stderr = mock("STDERR", :null_object => true) - #@pid = mock("PID", :null_object => true) + #@status = double("Status", :exitstatus => 0) + #@stdin = double("STDIN", :null_object => true) + #@stdout = double("STDOUT", :null_object => true) + #@stderr = double("STDERR", :null_object => true) + #@pid = double("PID", :null_object => true) end it "should return the version number when it is installed" do pkg_info = OpenStruct.new(:stdout => "zsh-4.3.6_7") @provider.should_receive(:shell_out!).with('pkg_info -E "zsh*"', :env => nil, :returns => [0,1]).and_return(pkg_info) #@provider.should_receive(:popen4).with('pkg_info -E "zsh*"').and_yield(@pid, @stdin, ["zsh-4.3.6_7"], @stderr).and_return(@status) - @provider.stub!(:package_name).and_return("zsh") + @provider.stub(:package_name).and_return("zsh") @provider.current_installed_version.should == "4.3.6_7" end it "does not set the current version number when the package is not installed" do pkg_info = OpenStruct.new(:stdout => "") @provider.should_receive(:shell_out!).with('pkg_info -E "zsh*"', :env => nil, :returns => [0,1]).and_return(pkg_info) - @provider.stub!(:package_name).and_return("zsh") + @provider.stub(:package_name).and_return("zsh") @provider.current_installed_version.should be_nil end @@ -94,21 +94,21 @@ describe Chef::Provider::Package::Freebsd, "load_current_resource" do whereis = OpenStruct.new(:stdout => "zsh: /usr/ports/shells/zsh") @provider.should_receive(:shell_out!).with("whereis -s zsh", :env => nil).and_return(whereis) #@provider.should_receive(:popen4).with("whereis -s zsh").and_yield(@pid, @stdin, ["zsh: /usr/ports/shells/zsh"], @stderr).and_return(@status) - @provider.stub!(:port_name).and_return("zsh") + @provider.stub(:port_name).and_return("zsh") @provider.port_path.should == "/usr/ports/shells/zsh" end # Not happy with the form of these tests as they are far too closely tied to the implementation and so very fragile. it "should return the ports candidate version when given a valid port path" do - @provider.stub!(:port_path).and_return("/usr/ports/shells/zsh") + @provider.stub(:port_path).and_return("/usr/ports/shells/zsh") make_v = OpenStruct.new(:stdout => "4.3.6\n") @provider.should_receive(:shell_out!).with("make -V PORTVERSION", {:cwd=>"/usr/ports/shells/zsh", :returns=>[0, 1], :env=>nil}).and_return(make_v) @provider.ports_candidate_version.should == "4.3.6" end it "should figure out the package name when we have ports" do - ::File.stub!(:exist?).with('/usr/ports/Makefile').and_return(true) - @provider.stub!(:port_path).and_return("/usr/ports/shells/zsh") + ::File.stub(:exist?).with('/usr/ports/Makefile').and_return(true) + @provider.stub(:port_path).and_return("/usr/ports/shells/zsh") make_v = OpenStruct.new(:stdout => "zsh-4.3.6_7\n") @provider.should_receive(:shell_out!).with("make -V PKGNAME", {:cwd=>"/usr/ports/shells/zsh", :env=>nil, :returns=>[0, 1]}).and_return(make_v) #@provider.should_receive(:ports_makefile_variable_value).with("PKGNAME").and_return("zsh-4.3.6_7") @@ -121,9 +121,9 @@ describe Chef::Provider::Package::Freebsd, "load_current_resource" do @cmd_result = OpenStruct.new(:status => true) @provider.current_resource = @current_resource - @provider.stub!(:package_name).and_return("zsh") - @provider.stub!(:latest_link_name).and_return("zsh") - @provider.stub!(:port_path).and_return("/usr/ports/shells/zsh") + @provider.stub(:package_name).and_return("zsh") + @provider.stub(:latest_link_name).and_return("zsh") + @provider.stub(:port_path).and_return("/usr/ports/shells/zsh") end it "should run pkg_add -r with the package name" do @@ -132,7 +132,7 @@ describe Chef::Provider::Package::Freebsd, "load_current_resource" do end it "should run make install when installing from ports" do - @new_resource.stub!(:source).and_return("ports") + @new_resource.stub(:source).and_return("ports") @provider.should_not_receive(:shell_out!).with("make -DBATCH -f /usr/ports/shells/zsh/Makefile install", :timeout => 1200, :env=>nil) @provider.should_receive(:shell_out!).with("make -DBATCH install", :timeout => 1200, :env=>nil, :cwd => @provider.port_path).and_return(@cmd_result) @provider.install_package("zsh", "4.3.6_7") @@ -161,7 +161,7 @@ describe Chef::Provider::Package::Freebsd, "load_current_resource" do end it "should use the package_name as a relative path from /usr/ports when it contains / but doesn't start with it" do - # @new_resource = mock( "Chef::Resource::Package", + # @new_resource = double( "Chef::Resource::Package", # :package_name => "www/wordpress", # :cookbook_name => "xenoparadox") new_resource = Chef::Resource::Package.new("www/wordpress") @@ -177,9 +177,9 @@ describe Chef::Provider::Package::Freebsd, "load_current_resource" do @current_resource = Chef::Resource::Package.new("ruby-iconv") @provider = Chef::Provider::Package::Freebsd.new(@new_resource, @run_context) @provider.current_resource = @current_resource - @provider.stub!(:port_path).and_return("/usr/ports/converters/ruby-iconv") - @provider.stub!(:package_name).and_return("ruby18-iconv") - @provider.stub!(:latest_link_name).and_return("ruby18-iconv") + @provider.stub(:port_path).and_return("/usr/ports/converters/ruby-iconv") + @provider.stub(:package_name).and_return("ruby18-iconv") + @provider.stub(:latest_link_name).and_return("ruby18-iconv") @install_result = OpenStruct.new(:status => true) end @@ -190,7 +190,7 @@ describe Chef::Provider::Package::Freebsd, "load_current_resource" do end it "should run make install when installing from ports" do - @new_resource.stub!(:source).and_return("ports") + @new_resource.stub(:source).and_return("ports") @provider.should_receive(:shell_out!).with("make -DBATCH install", :timeout => 1200, :env=>nil, :cwd => @provider.port_path).and_return(@install_result) @provider.install_package("ruby-iconv", "1.0") end @@ -202,7 +202,7 @@ describe Chef::Provider::Package::Freebsd, "load_current_resource" do @new_resource.version "4.3.6_7" @current_resource.version "4.3.6_7" @provider.current_resource = @current_resource - @provider.stub!(:package_name).and_return("zsh") + @provider.stub(:package_name).and_return("zsh") end it "should run pkg_delete with the package name and version" do @@ -227,14 +227,14 @@ describe Chef::Provider::Package::Freebsd, "load_current_resource" do it "should return the port path for a valid port name" do whereis = OpenStruct.new(:stdout => "bonnie++: /usr/ports/benchmarks/bonnie++") @provider.should_receive(:shell_out!).with("whereis -s bonnie++", :env => nil).and_return(whereis) - @provider.stub!(:port_name).and_return("bonnie++") + @provider.stub(:port_name).and_return("bonnie++") @provider.port_path.should == "/usr/ports/benchmarks/bonnie++" end it "should return the version number when it is installed" do pkg_info = OpenStruct.new(:stdout => "bonnie++-1.96") @provider.should_receive(:shell_out!).with('pkg_info -E "bonnie++*"', :env => nil, :returns => [0,1]).and_return(pkg_info) - @provider.stub!(:package_name).and_return("bonnie++") + @provider.stub(:package_name).and_return("bonnie++") @provider.current_installed_version.should == "1.96" end end @@ -262,8 +262,8 @@ describe Chef::Provider::Package::Freebsd, "load_current_resource" do @current_resource = Chef::Resource::Package.new("perl5.8") @provider = Chef::Provider::Package::Freebsd.new(@new_resource, @run_context) @provider.current_resource = @current_resource - @provider.stub!(:package_name).and_return("perl") - @provider.stub!(:latest_link_name).and_return("perl") + @provider.stub(:package_name).and_return("perl") + @provider.stub(:latest_link_name).and_return("perl") cmd = OpenStruct.new(:status => true) @provider.should_receive(:shell_out!).with("pkg_add -r perl", :env => nil).and_return(cmd) @@ -276,8 +276,8 @@ describe Chef::Provider::Package::Freebsd, "load_current_resource" do @current_resource = Chef::Resource::Package.new("mysql50-server") @provider = Chef::Provider::Package::Freebsd.new(@new_resource, @run_context) @provider.current_resource = @current_resource - @provider.stub!(:package_name).and_return("mysql-server") - @provider.stub!(:latest_link_name).and_return("mysql50-server") + @provider.stub(:package_name).and_return("mysql-server") + @provider.stub(:latest_link_name).and_return("mysql50-server") cmd = OpenStruct.new(:status => true) @provider.should_receive(:shell_out!).with("pkg_add -r mysql50-server", :env=>nil).and_return(cmd) diff --git a/spec/unit/provider/package/ips_spec.rb b/spec/unit/provider/package/ips_spec.rb index 95839dbe89..53f8169623 100644 --- a/spec/unit/provider/package/ips_spec.rb +++ b/spec/unit/provider/package/ips_spec.rb @@ -28,7 +28,7 @@ describe Chef::Provider::Package::Ips do @run_context = Chef::RunContext.new(@node, {}, @events) @new_resource = Chef::Resource::Package.new("crypto/gnupg", @run_context) @current_resource = Chef::Resource::Package.new("crypto/gnupg", @run_context) - Chef::Resource::Package.stub!(:new).and_return(@current_resource) + Chef::Resource::Package.stub(:new).and_return(@current_resource) @provider = Chef::Provider::Package::Ips.new(@new_resource, @run_context) @stdin = StringIO.new @@ -117,7 +117,7 @@ INSTALLED @provider.should_receive(:run_command_with_systems_locale).with({ :command => "pkg --no-refresh install -q crypto/gnupg@2.0.17" }) - @new_resource.stub!(:options).and_return("--no-refresh") + @new_resource.stub(:options).and_return("--no-refresh") @provider.install_package("crypto/gnupg", "2.0.17") end @@ -168,7 +168,7 @@ PKG_STATUS context "when accept_license is true" do before do - @new_resource.stub!(:accept_license).and_return(true) + @new_resource.stub(:accept_license).and_return(true) end it "should run pkg install with the --accept flag" do @@ -202,7 +202,7 @@ PKG_STATUS @provider.should_receive(:run_command_with_systems_locale).with({ :command => "pkg --no-refresh uninstall -q crypto/gnupg@2.0.17" }) - @new_resource.stub!(:options).and_return("--no-refresh") + @new_resource.stub(:options).and_return("--no-refresh") @provider.remove_package("crypto/gnupg", "2.0.17") end end diff --git a/spec/unit/provider/package/macports_spec.rb b/spec/unit/provider/package/macports_spec.rb index 2f0db3f7a8..9ebf23860d 100644 --- a/spec/unit/provider/package/macports_spec.rb +++ b/spec/unit/provider/package/macports_spec.rb @@ -27,9 +27,9 @@ describe Chef::Provider::Package::Macports do @current_resource = Chef::Resource::Package.new("zsh") @provider = Chef::Provider::Package::Macports.new(@new_resource, @run_context) - Chef::Resource::Package.stub!(:new).and_return(@current_resource) + Chef::Resource::Package.stub(:new).and_return(@current_resource) - @status = mock("Status", :exitstatus => 0) + @status = double("Status", :exitstatus => 0) @stdin = StringIO.new @stdout = StringIO.new @stderr = StringIO.new @@ -121,7 +121,7 @@ EOF it "should add options to the port command when specified" do @current_resource.should_receive(:version).and_return("4.1.6") @provider.current_resource = @current_resource - @new_resource.stub!(:options).and_return("-f") + @new_resource.stub(:options).and_return("-f") @provider.should_receive(:run_command_with_systems_locale).with(:command => "port -f install zsh @4.2.7") @provider.install_package("zsh", "4.2.7") @@ -140,7 +140,7 @@ EOF end it "should add options to the port command when specified" do - @new_resource.stub!(:options).and_return("-f") + @new_resource.stub(:options).and_return("-f") @provider.should_receive(:run_command_with_systems_locale).with(:command => "port -f uninstall zsh @4.2.7") @provider.purge_package("zsh", "4.2.7") end @@ -158,7 +158,7 @@ EOF end it "should add options to the port command when specified" do - @new_resource.stub!(:options).and_return("-f") + @new_resource.stub(:options).and_return("-f") @provider.should_receive(:run_command_with_systems_locale).with(:command => "port -f deactivate zsh @4.2.7") @provider.remove_package("zsh", "4.2.7") end @@ -191,7 +191,7 @@ EOF end it "should add options to the port command when specified" do - @new_resource.stub!(:options).and_return("-f") + @new_resource.stub(:options).and_return("-f") @current_resource.should_receive(:version).at_least(:once).and_return("4.1.6") @provider.current_resource = @current_resource diff --git a/spec/unit/provider/package/pacman_spec.rb b/spec/unit/provider/package/pacman_spec.rb index 7e4abcb6d5..528f7097e8 100644 --- a/spec/unit/provider/package/pacman_spec.rb +++ b/spec/unit/provider/package/pacman_spec.rb @@ -26,10 +26,10 @@ describe Chef::Provider::Package::Pacman do @new_resource = Chef::Resource::Package.new("nano") @current_resource = Chef::Resource::Package.new("nano") - @status = mock("Status", :exitstatus => 0) + @status = double("Status", :exitstatus => 0) @provider = Chef::Provider::Package::Pacman.new(@new_resource, @run_context) - Chef::Resource::Package.stub!(:new).and_return(@current_resource) - @provider.stub!(:popen4).and_return(@status) + Chef::Resource::Package.stub(:new).and_return(@current_resource) + @provider.stub(:popen4).and_return(@status) @stdin = StringIO.new @stdout = StringIO.new(<<-ERR) error: package "nano" not found @@ -55,13 +55,13 @@ ERR end it "should read stdout on pacman" do - @provider.stub!(:popen4).and_yield(@pid, @stdin, @stdout, @stderr).and_return(@status) + @provider.stub(:popen4).and_yield(@pid, @stdin, @stdout, @stderr).and_return(@status) @stdout.should_receive(:each).and_return(true) @provider.load_current_resource end it "should set the installed version to nil on the current resource if pacman installed version not exists" do - @provider.stub!(:popen4).and_yield(@pid, @stdin, @stdout, @stderr).and_return(@status) + @provider.stub(:popen4).and_yield(@pid, @stdin, @stdout, @stderr).and_return(@status) @current_resource.should_receive(:version).with(nil).and_return(true) @provider.load_current_resource end @@ -88,17 +88,17 @@ Install Reason : Explicitly installed Install Script : Yes Description : Pico editor clone with enhancements PACMAN - @provider.stub!(:popen4).and_yield(@pid, @stdin, @stdout, @stderr).and_return(@status) + @provider.stub(:popen4).and_yield(@pid, @stdin, @stdout, @stderr).and_return(@status) @provider.load_current_resource @current_resource.version.should == "2.2.2-1" end it "should set the candidate version if pacman has one" do - @stdout.stub!(:each).and_yield("core/nano 2.2.3-1 (base)"). + @stdout.stub(:each).and_yield("core/nano 2.2.3-1 (base)"). and_yield(" Pico editor clone with enhancements"). and_yield("community/nanoblogger 3.4.1-1"). and_yield(" NanoBlogger is a small weblog engine written in Bash for the command line") - @provider.stub!(:popen4).and_yield(@pid, @stdin, @stdout, @stderr).and_return(@status) + @provider.stub(:popen4).and_yield(@pid, @stdin, @stdout, @stderr).and_return(@status) @provider.load_current_resource @provider.candidate_version.should eql("2.2.3-1") end @@ -122,11 +122,11 @@ Include = /etc/pacman.d/mirrorlist Include = /etc/pacman.d/mirrorlist PACMAN_CONF - ::File.stub!(:exists?).with("/etc/pacman.conf").and_return(true) - ::File.stub!(:read).with("/etc/pacman.conf").and_return(@pacman_conf) - @stdout.stub!(:each).and_yield("customrepo/nano 1.2.3-4"). + ::File.stub(:exists?).with("/etc/pacman.conf").and_return(true) + ::File.stub(:read).with("/etc/pacman.conf").and_return(@pacman_conf) + @stdout.stub(:each).and_yield("customrepo/nano 1.2.3-4"). and_yield(" My custom package") - @provider.stub!(:popen4).and_yield(@pid, @stdin, @stdout, @stderr).and_return(@status) + @provider.stub(:popen4).and_yield(@pid, @stdin, @stdout, @stderr).and_return(@status) @provider.load_current_resource @provider.candidate_version.should eql("1.2.3-4") @@ -139,12 +139,12 @@ PACMAN_CONF it "should not raise an exception if pacman succeeds" do @status.should_receive(:exitstatus).and_return(0) - lambda { @provider.load_current_resource }.should_not raise_error(Chef::Exceptions::Package) + lambda { @provider.load_current_resource }.should_not raise_error end it "should raise an exception if pacman does not return a candidate version" do - @stdout.stub!(:each).and_yield("") - @provider.stub!(:popen4).and_yield(@pid, @stdin, @stdout, @stderr).and_return(@status) + @stdout.stub(:each).and_yield("") + @provider.stub(:popen4).and_yield(@pid, @stdin, @stdout, @stderr).and_return(@status) lambda { @provider.candidate_version }.should raise_error(Chef::Exceptions::Package) end @@ -165,7 +165,7 @@ PACMAN_CONF @provider.should_receive(:run_command_with_systems_locale).with({ :command => "pacman --sync --noconfirm --noprogressbar --debug nano" }) - @new_resource.stub!(:options).and_return("--debug") + @new_resource.stub(:options).and_return("--debug") @provider.install_package("nano", "1.0") end @@ -190,7 +190,7 @@ PACMAN_CONF @provider.should_receive(:run_command_with_systems_locale).with({ :command => "pacman --remove --noconfirm --noprogressbar --debug nano" }) - @new_resource.stub!(:options).and_return("--debug") + @new_resource.stub(:options).and_return("--debug") @provider.remove_package("nano", "1.0") end diff --git a/spec/unit/provider/package/portage_spec.rb b/spec/unit/provider/package/portage_spec.rb index f44731b73a..6f22952da2 100644 --- a/spec/unit/provider/package/portage_spec.rb +++ b/spec/unit/provider/package/portage_spec.rb @@ -27,70 +27,70 @@ describe Chef::Provider::Package::Portage, "load_current_resource" do @current_resource = Chef::Resource::Package.new("dev-util/git") @provider = Chef::Provider::Package::Portage.new(@new_resource, @run_context) - Chef::Resource::Package.stub!(:new).and_return(@current_resource) + Chef::Resource::Package.stub(:new).and_return(@current_resource) end describe "when determining the current state of the package" do it "should create a current resource with the name of new_resource" do - ::Dir.stub!(:[]).with("/var/db/pkg/dev-util/git-*").and_return(["/var/db/pkg/dev-util/git-1.0.0"]) + ::Dir.stub(:[]).with("/var/db/pkg/dev-util/git-*").and_return(["/var/db/pkg/dev-util/git-1.0.0"]) Chef::Resource::Package.should_receive(:new).and_return(@current_resource) @provider.load_current_resource end it "should set the current resource package name to the new resource package name" do - ::Dir.stub!(:[]).with("/var/db/pkg/dev-util/git-*").and_return(["/var/db/pkg/dev-util/git-1.0.0"]) + ::Dir.stub(:[]).with("/var/db/pkg/dev-util/git-*").and_return(["/var/db/pkg/dev-util/git-1.0.0"]) @current_resource.should_receive(:package_name).with(@new_resource.package_name) @provider.load_current_resource end it "should return a current resource with the correct version if the package is found" do - ::Dir.stub!(:[]).with("/var/db/pkg/dev-util/git-*").and_return(["/var/db/pkg/dev-util/git-foobar-0.9", "/var/db/pkg/dev-util/git-1.0.0"]) + ::Dir.stub(:[]).with("/var/db/pkg/dev-util/git-*").and_return(["/var/db/pkg/dev-util/git-foobar-0.9", "/var/db/pkg/dev-util/git-1.0.0"]) @provider.load_current_resource @provider.current_resource.version.should == "1.0.0" end it "should return a current resource with the correct version if the package is found with revision" do - ::Dir.stub!(:[]).with("/var/db/pkg/dev-util/git-*").and_return(["/var/db/pkg/dev-util/git-1.0.0-r1"]) + ::Dir.stub(:[]).with("/var/db/pkg/dev-util/git-*").and_return(["/var/db/pkg/dev-util/git-1.0.0-r1"]) @provider.load_current_resource @provider.current_resource.version.should == "1.0.0-r1" end it "should return a current resource with a nil version if the package is not found" do - ::Dir.stub!(:[]).with("/var/db/pkg/dev-util/git-*").and_return(["/var/db/pkg/dev-util/notgit-1.0.0"]) + ::Dir.stub(:[]).with("/var/db/pkg/dev-util/git-*").and_return(["/var/db/pkg/dev-util/notgit-1.0.0"]) @provider.load_current_resource @provider.current_resource.version.should be_nil end it "should return a package name match from /var/db/pkg/* if a category isn't specified and a match is found" do - ::Dir.stub!(:[]).with("/var/db/pkg/*/git-*").and_return(["/var/db/pkg/dev-util/git-foobar-0.9", "/var/db/pkg/dev-util/git-1.0.0"]) + ::Dir.stub(:[]).with("/var/db/pkg/*/git-*").and_return(["/var/db/pkg/dev-util/git-foobar-0.9", "/var/db/pkg/dev-util/git-1.0.0"]) @provider = Chef::Provider::Package::Portage.new(@new_resource_without_category, @run_context) @provider.load_current_resource @provider.current_resource.version.should == "1.0.0" end it "should return a current resource with a nil version if a category isn't specified and a name match from /var/db/pkg/* is not found" do - ::Dir.stub!(:[]).with("/var/db/pkg/*/git-*").and_return(["/var/db/pkg/dev-util/notgit-1.0.0"]) + ::Dir.stub(:[]).with("/var/db/pkg/*/git-*").and_return(["/var/db/pkg/dev-util/notgit-1.0.0"]) @provider = Chef::Provider::Package::Portage.new(@new_resource_without_category, @run_context) @provider.load_current_resource @provider.current_resource.version.should be_nil end it "should throw an exception if a category isn't specified and multiple packages are found" do - ::Dir.stub!(:[]).with("/var/db/pkg/*/git-*").and_return(["/var/db/pkg/dev-util/git-1.0.0", "/var/db/pkg/funny-words/git-1.0.0"]) + ::Dir.stub(:[]).with("/var/db/pkg/*/git-*").and_return(["/var/db/pkg/dev-util/git-1.0.0", "/var/db/pkg/funny-words/git-1.0.0"]) @provider = Chef::Provider::Package::Portage.new(@new_resource_without_category, @run_context) lambda { @provider.load_current_resource }.should raise_error(Chef::Exceptions::Package) end it "should return a current resource with a nil version if a category is specified and multiple packages are found" do - ::Dir.stub!(:[]).with("/var/db/pkg/dev-util/git-*").and_return(["/var/db/pkg/dev-util/git-1.0.0", "/var/db/pkg/funny-words/git-1.0.0"]) + ::Dir.stub(:[]).with("/var/db/pkg/dev-util/git-*").and_return(["/var/db/pkg/dev-util/git-1.0.0", "/var/db/pkg/funny-words/git-1.0.0"]) @provider = Chef::Provider::Package::Portage.new(@new_resource, @run_context) @provider.load_current_resource @provider.current_resource.version.should be_nil end it "should return a current resource with a nil version if a category is not specified and multiple packages from the same category are found" do - ::Dir.stub!(:[]).with("/var/db/pkg/*/git-*").and_return(["/var/db/pkg/dev-util/git-1.0.0", "/var/db/pkg/dev-util/git-1.0.1"]) + ::Dir.stub(:[]).with("/var/db/pkg/*/git-*").and_return(["/var/db/pkg/dev-util/git-1.0.0", "/var/db/pkg/dev-util/git-1.0.1"]) @provider = Chef::Provider::Package::Portage.new(@new_resource_without_category, @run_context) @provider.load_current_resource @provider.current_resource.version.should be_nil @@ -107,8 +107,8 @@ describe Chef::Provider::Package::Portage, "load_current_resource" do end it "should throw an exception if the exitstatus is not 0" do - @status = mock("Status", :exitstatus => 1) - @provider.stub!(:popen4).and_return(@status) + @status = double("Status", :exitstatus => 1) + @provider.stub(:popen4).and_return(@status) lambda { @provider.candidate_version }.should raise_error(Chef::Exceptions::Package) end @@ -143,7 +143,7 @@ Searching... License: GPL-2 EOF - @status = mock("Status", :exitstatus => 0) + @status = double("Status", :exitstatus => 0) @provider.should_receive(:popen4).and_yield(nil, nil, StringIO.new(output), nil).and_return(@status) @provider.candidate_version.should == "1.6.0.6" end @@ -179,7 +179,7 @@ Searching... License: GPL-2 EOF - @status = mock("Status", :exitstatus => 0) + @status = double("Status", :exitstatus => 0) @provider = Chef::Provider::Package::Portage.new(@new_resource_without_category, @run_context) @provider.should_receive(:popen4).and_yield(nil, nil, StringIO.new(output), nil).and_return(@status) @provider.candidate_version.should == "1.6.0.6" @@ -224,7 +224,7 @@ Searching... License: GPL-2 EOF - @status = mock("Status", :exitstatus => 0) + @status = double("Status", :exitstatus => 0) @provider = Chef::Provider::Package::Portage.new(@new_resource_without_category, @run_context) @provider.should_receive(:popen4).and_yield(nil, nil, StringIO.new(output), nil).and_return(@status) lambda { @provider.candidate_version }.should raise_error(Chef::Exceptions::Package) @@ -269,7 +269,7 @@ Searching... License: GPL-2 EOF - @status = mock("Status", :exitstatus => 0) + @status = double("Status", :exitstatus => 0) @provider = Chef::Provider::Package::Portage.new(@new_resource, @run_context) @provider.should_receive(:popen4).and_yield(nil, nil, StringIO.new(output), nil).and_return(@status) @provider.candidate_version.should == "1.6.0.6" @@ -295,7 +295,7 @@ EOF @provider.should_receive(:run_command_with_systems_locale).with({ :command => "emerge -g --color n --nospinner --quiet --oneshot =dev-util/git-1.0.0" }) - @new_resource.stub!(:options).and_return("--oneshot") + @new_resource.stub(:options).and_return("--oneshot") @provider.install_package("dev-util/git", "1.0.0") end diff --git a/spec/unit/provider/package/rpm_spec.rb b/spec/unit/provider/package/rpm_spec.rb index 86327be42b..7126b06d66 100644 --- a/spec/unit/provider/package/rpm_spec.rb +++ b/spec/unit/provider/package/rpm_spec.rb @@ -29,26 +29,26 @@ describe Chef::Provider::Package::Rpm do @provider = Chef::Provider::Package::Rpm.new(@new_resource, @run_context) - @status = mock("Status", :exitstatus => 0) - ::File.stub!(:exists?).and_return(true) + @status = double("Status", :exitstatus => 0) + ::File.stub(:exists?).and_return(true) end describe "when determining the current state of the package" do it "should create a current resource with the name of new_resource" do - @provider.stub!(:popen4).and_return(@status) + @provider.stub(:popen4).and_return(@status) @provider.load_current_resource @provider.current_resource.name.should == "emacs" end it "should set the current reource package name to the new resource package name" do - @provider.stub!(:popen4).and_return(@status) + @provider.stub(:popen4).and_return(@status) @provider.load_current_resource @provider.current_resource.package_name.should == 'emacs' end it "should raise an exception if a source is supplied but not found" do - ::File.stub!(:exists?).and_return(false) + ::File.stub(:exists?).and_return(false) lambda { @provider.run_action(:any) }.should raise_error(Chef::Exceptions::Package) end @@ -76,8 +76,8 @@ describe Chef::Provider::Package::Rpm do end it "should raise an exception if rpm fails to run" do - status = mock("Status", :exitstatus => -1) - @provider.stub!(:popen4).and_return(status) + status = double("Status", :exitstatus => -1) + @provider.stub(:popen4).and_return(status) lambda { @provider.run_action(:any) }.should raise_error(Chef::Exceptions::Package) end end diff --git a/spec/unit/provider/package/rubygems_spec.rb b/spec/unit/provider/package/rubygems_spec.rb index 7d0567314a..d3cb9cf7fa 100644 --- a/spec/unit/provider/package/rubygems_spec.rb +++ b/spec/unit/provider/package/rubygems_spec.rb @@ -89,7 +89,7 @@ describe Chef::Provider::Package::Rubygems::CurrentGemEnvironment do it "finds a matching gem candidate version" do dep = Gem::Dependency.new('rspec', '>= 0') dep_installer = Gem::DependencyInstaller.new - @gem_env.stub!(:dependency_installer).and_return(dep_installer) + @gem_env.stub(:dependency_installer).and_return(dep_installer) latest = [[gemspec("rspec", Gem::Version.new("1.3.0")), "http://rubygems.org/"]] dep_installer.should_receive(:find_gems_with_sources).with(dep).and_return(latest) @gem_env.candidate_version_from_remote(Gem::Dependency.new('rspec', '>= 0')).should == Gem::Version.new('1.3.0') @@ -98,9 +98,9 @@ describe Chef::Provider::Package::Rubygems::CurrentGemEnvironment do it "finds a matching gem candidate version on rubygems 2.0.0+" do dep = Gem::Dependency.new('rspec', '>= 0') dep_installer = Gem::DependencyInstaller.new - @gem_env.stub!(:dependency_installer).and_return(dep_installer) - best_gem = mock("best gem match", :spec => gemspec("rspec", Gem::Version.new("1.3.0")), :source => "https://rubygems.org") - available_set = mock("Gem::AvailableSet test double") + @gem_env.stub(:dependency_installer).and_return(dep_installer) + best_gem = double("best gem match", :spec => gemspec("rspec", Gem::Version.new("1.3.0")), :source => "https://rubygems.org") + available_set = double("Gem::AvailableSet test double") available_set.should_receive(:pick_best!) available_set.should_receive(:set).and_return([best_gem]) dep_installer.should_receive(:find_gems_with_sources).with(dep).and_return(available_set) @@ -121,7 +121,7 @@ describe Chef::Provider::Package::Rubygems::CurrentGemEnvironment do Gem.const_set(:Format, Object.new) @remove_gem_format = true end - Gem::Package.stub!(:respond_to?).with(:open).and_return(false) + Gem::Package.stub(:respond_to?).with(:open).and_return(false) end after do @@ -131,7 +131,7 @@ describe Chef::Provider::Package::Rubygems::CurrentGemEnvironment do end it "finds a matching gem candidate version on rubygems 2.0+ with some rubygems 1.8 code loaded" do - package = mock("Gem::Package", :spec => "a gemspec from package") + package = double("Gem::Package", :spec => "a gemspec from package") Gem::Package.should_receive(:new).with("/path/to/package.gem").and_return(package) @gem_env.spec_from_file("/path/to/package.gem").should == "a gemspec from package" end @@ -142,7 +142,7 @@ describe Chef::Provider::Package::Rubygems::CurrentGemEnvironment do dep = Gem::Dependency.new('rspec', '>= 0') latest = [] dep_installer = Gem::DependencyInstaller.new - @gem_env.stub!(:dependency_installer).and_return(dep_installer) + @gem_env.stub(:dependency_installer).and_return(dep_installer) dep_installer.should_receive(:find_gems_with_sources).with(dep).and_return(latest) @gem_env.candidate_version_from_remote(Gem::Dependency.new('rspec', '>= 0')).should be_nil end @@ -159,7 +159,7 @@ describe Chef::Provider::Package::Rubygems::CurrentGemEnvironment do @gem_env.should_receive(:with_gem_sources).with('http://gems.example.com').and_yield dep_installer = Gem::DependencyInstaller.new - @gem_env.stub!(:dependency_installer).and_return(dep_installer) + @gem_env.stub(:dependency_installer).and_return(dep_installer) dep_installer.should_receive(:find_gems_with_sources).with(dep).and_return(latest) @gem_env.candidate_version_from_remote(Gem::Dependency.new('rspec', '>=0'), 'http://gems.example.com').should == Gem::Version.new('1.3.0') end @@ -180,14 +180,14 @@ describe Chef::Provider::Package::Rubygems::CurrentGemEnvironment do end it "uninstalls all versions of a gem" do - uninstaller = mock('gem uninstaller') + uninstaller = double('gem uninstaller') uninstaller.should_receive(:uninstall) @gem_env.should_receive(:uninstaller).with('rspec', :all => true).and_return(uninstaller) @gem_env.uninstall('rspec') end it "uninstalls a specific version of a gem" do - uninstaller = mock('gem uninstaller') + uninstaller = double('gem uninstaller') uninstaller.should_receive(:uninstall) @gem_env.should_receive(:uninstaller).with('rspec', :version => '1.2.3').and_return(uninstaller) @gem_env.uninstall('rspec', '1.2.3') @@ -230,7 +230,7 @@ describe Chef::Provider::Package::Rubygems::AlternateGemEnvironment do end it "builds the gems source index from the gem paths" do - @gem_env.stub!(:gem_paths).and_return(['/path/to/gems', '/another/path/to/gems']) + @gem_env.stub(:gem_paths).and_return(['/path/to/gems', '/another/path/to/gems']) if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.8.0') @gem_env.gem_specification Gem::Specification.dirs.should == [ '/path/to/gems/specifications', '/another/path/to/gems/specifications' ] @@ -244,17 +244,17 @@ describe Chef::Provider::Package::Rubygems::AlternateGemEnvironment do gems = [gemspec('rspec', Gem::Version.new('1.2.9')), gemspec('rspec', Gem::Version.new('1.3.0'))] rspec_dep = Gem::Dependency.new('rspec', nil) if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.8.0') - @gem_env.stub!(:gem_specification).and_return(Gem::Specification) + @gem_env.stub(:gem_specification).and_return(Gem::Specification) @gem_env.gem_specification.should_receive(:find_all_by_name).with(rspec_dep.name, rspec_dep.requirement).and_return(gems) else - @gem_env.stub!(:gem_source_index).and_return(Gem.source_index) + @gem_env.stub(:gem_source_index).and_return(Gem.source_index) @gem_env.gem_source_index.should_receive(:search).with(rspec_dep).and_return(gems) end @gem_env.installed_versions(Gem::Dependency.new('rspec', nil)).should == gems end it "determines the installed versions of gems from the source index (part2: the unmockening)" do - $stdout.stub!(:write) + $stdout.stub(:write) path_to_gem = if windows? `where gem`.split[1] else @@ -295,7 +295,7 @@ RubyGems Environment: - http://rubygems.org/ - http://gems.github.com/ JRUBY_GEM_ENV - @gem_env.should_receive(:shell_out!).with('/usr/weird/bin/gem env').and_return(mock('jruby_gem_env', :stdout => gem_env_out)) + @gem_env.should_receive(:shell_out!).with('/usr/weird/bin/gem env').and_return(double('jruby_gem_env', :stdout => gem_env_out)) expected = ['ruby', Gem::Platform.new('universal-java-1.6')] @gem_env.gem_platforms.should == expected # it should also cache the result @@ -337,7 +337,7 @@ RubyGems Environment: - http://rubygems.org/ - http://gems.github.com/ RBX_GEM_ENV - @gem_env.should_receive(:shell_out!).with('/usr/weird/bin/gem env').and_return(mock('rbx_gem_env', :stdout => gem_env_out)) + @gem_env.should_receive(:shell_out!).with('/usr/weird/bin/gem env').and_return(double('rbx_gem_env', :stdout => gem_env_out)) @gem_env.gem_platforms.should == Gem.platforms Chef::Provider::Package::Rubygems::AlternateGemEnvironment.platform_cache['/usr/weird/bin/gem'].should == Gem.platforms end @@ -367,7 +367,7 @@ describe Chef::Provider::Package::Rubygems do @run_context = Chef::RunContext.new(@node, {}, @events) # We choose detect omnibus via RbConfig::CONFIG['bindir'] in Chef::Provider::Package::Rubygems.new - RbConfig::CONFIG.stub!(:[]).with('bindir').and_return("/usr/bin/ruby") + RbConfig::CONFIG.stub(:[]).with('bindir').and_return("/usr/bin/ruby") @provider = Chef::Provider::Package::Rubygems.new(@new_resource, @run_context) end @@ -388,11 +388,11 @@ describe Chef::Provider::Package::Rubygems do it "searches for a gem binary when running on Omnibus on Unix" do platform_mock :unix do - RbConfig::CONFIG.stub!(:[]).with('bindir').and_return("/opt/chef/embedded/bin") - ENV.stub!(:[]).with('PATH').and_return("/usr/bin:/usr/sbin:/opt/chef/embedded/bin") - File.stub!(:exists?).with('/usr/bin/gem').and_return(false) - File.stub!(:exists?).with('/usr/sbin/gem').and_return(true) - File.stub!(:exists?).with('/opt/chef/embedded/bin/gem').and_return(true) # should not get here + RbConfig::CONFIG.stub(:[]).with('bindir').and_return("/opt/chef/embedded/bin") + ENV.stub(:[]).with('PATH').and_return("/usr/bin:/usr/sbin:/opt/chef/embedded/bin") + File.stub(:exists?).with('/usr/bin/gem').and_return(false) + File.stub(:exists?).with('/usr/sbin/gem').and_return(true) + File.stub(:exists?).with('/opt/chef/embedded/bin/gem').and_return(true) # should not get here provider = Chef::Provider::Package::Rubygems.new(@new_resource, @run_context) provider.gem_env.gem_binary_location.should == '/usr/sbin/gem' end @@ -400,13 +400,13 @@ describe Chef::Provider::Package::Rubygems do it "searches for a gem binary when running on Omnibus on Windows" do platform_mock :windows do - RbConfig::CONFIG.stub!(:[]).with('bindir').and_return("d:/opscode/chef/embedded/bin") - ENV.stub!(:[]).with('PATH').and_return('C:\windows\system32;C:\windows;C:\Ruby186\bin;d:\opscode\chef\embedded\bin') - File.stub!(:exists?).with('C:\\windows\\system32\\gem').and_return(false) - File.stub!(:exists?).with('C:\\windows\\gem').and_return(false) - File.stub!(:exists?).with('C:\\Ruby186\\bin\\gem').and_return(true) - File.stub!(:exists?).with('d:\\opscode\\chef\\bin\\gem').and_return(false) # should not get here - File.stub!(:exists?).with('d:\\opscode\\chef\\embedded\\bin\\gem').and_return(false) # should not get here + RbConfig::CONFIG.stub(:[]).with('bindir').and_return("d:/opscode/chef/embedded/bin") + ENV.stub(:[]).with('PATH').and_return('C:\windows\system32;C:\windows;C:\Ruby186\bin;d:\opscode\chef\embedded\bin') + File.stub(:exists?).with('C:\\windows\\system32\\gem').and_return(false) + File.stub(:exists?).with('C:\\windows\\gem').and_return(false) + File.stub(:exists?).with('C:\\Ruby186\\bin\\gem').and_return(true) + File.stub(:exists?).with('d:\\opscode\\chef\\bin\\gem').and_return(false) # should not get here + File.stub(:exists?).with('d:\\opscode\\chef\\embedded\\bin\\gem').and_return(false) # should not get here provider = Chef::Provider::Package::Rubygems.new(@new_resource, @run_context) provider.gem_env.gem_binary_location.should == 'C:\Ruby186\bin\gem' end @@ -475,7 +475,7 @@ describe Chef::Provider::Package::Rubygems do @current_resource = Chef::Resource::GemPackage.new('rspec-core') @provider.current_resource = @current_resource @gem_dep = Gem::Dependency.new('rspec-core', @spec_version) - @provider.stub!(:load_current_resource) + @provider.stub(:load_current_resource) end describe "in the current gem environment" do @@ -508,7 +508,7 @@ describe Chef::Provider::Package::Rubygems do # this catches 'gem_package "foo"' when "./foo" is a file in the cwd, and instead of installing './foo' it fetches the remote gem it "installs the gem via the gems api, when the package has no file separator characters in it, but a matching file exists in cwd" do - ::File.stub!(:exists?).and_return(true) + ::File.stub(:exists?).and_return(true) @new_resource.package_name('rspec-core') @provider.gem_env.should_receive(:install).with(@gem_dep, :sources => nil) @provider.action_install.should be_true diff --git a/spec/unit/provider/package/smartos_spec.rb b/spec/unit/provider/package/smartos_spec.rb index e5092f69d9..1c690acbf5 100644 --- a/spec/unit/provider/package/smartos_spec.rb +++ b/spec/unit/provider/package/smartos_spec.rb @@ -29,9 +29,9 @@ describe Chef::Provider::Package::SmartOS, "load_current_resource" do @current_resource = Chef::Resource::Package.new("varnish") - @status = mock("Status", :exitstatus => 0) + @status = double("Status", :exitstatus => 0) @provider = Chef::Provider::Package::SmartOS.new(@new_resource, @run_context) - Chef::Resource::Package.stub!(:new).and_return(@current_resource) + Chef::Resource::Package.stub(:new).and_return(@current_resource) @stdin = StringIO.new @stdout = "varnish-2.1.5nb2\n" @stderr = StringIO.new @@ -77,11 +77,11 @@ describe Chef::Provider::Package::SmartOS, "load_current_resource" do end it "should lookup the candidate_version if the variable is not already set" do - search = mock() + search = double() search.should_receive(:each_line). and_yield("something-varnish-1.1.1 something varnish like\n"). and_yield("varnish-2.3.4 actual varnish\n") - @shell_out = mock('shell_out!', :stdout => search) + @shell_out = double('shell_out!', :stdout => search) @provider.should_receive(:shell_out!).with('/opt/local/bin/pkgin se varnish', :env => nil, :returns => [0,1]).and_return(@shell_out) @provider.candidate_version.should == "2.3.4" end diff --git a/spec/unit/provider/package/solaris_spec.rb b/spec/unit/provider/package/solaris_spec.rb index dd7cea2aaa..086e327cce 100644 --- a/spec/unit/provider/package/solaris_spec.rb +++ b/spec/unit/provider/package/solaris_spec.rb @@ -27,7 +27,7 @@ describe Chef::Provider::Package::Solaris do @new_resource.source("/tmp/bash.pkg") @provider = Chef::Provider::Package::Solaris.new(@new_resource, @run_context) - ::File.stub!(:exists?).and_return(true) + ::File.stub(:exists?).and_return(true) end describe "assessing the current package status" do @@ -46,24 +46,24 @@ INSTDATE: Nov 04 2009 01:02 HOTLINE: Please contact your local service provider PKGINFO - @status = mock("Status", :exitstatus => 0) + @status = double("Status", :exitstatus => 0) end it "should create a current resource with the name of new_resource" do - @provider.stub!(:popen4).and_return(@status) + @provider.stub(:popen4).and_return(@status) @provider.load_current_resource @provider.current_resource.name.should == "SUNWbash" end it "should set the current reource package name to the new resource package name" do - @provider.stub!(:popen4).and_return(@status) + @provider.stub(:popen4).and_return(@status) @provider.load_current_resource @provider.current_resource.package_name.should == "SUNWbash" end it "should raise an exception if a source is supplied but not found" do - @provider.stub!(:popen4).and_return(@status) - ::File.stub!(:exists?).and_return(false) + @provider.stub(:popen4).and_return(@status) + ::File.stub(:exists?).and_return(false) @provider.define_resource_requirements @provider.load_current_resource lambda { @provider.process_resource_requirements }.should raise_error(Chef::Exceptions::Package) @@ -93,13 +93,13 @@ PKGINFO it "should raise an exception if the source is not set but we are installing" do @new_resource = Chef::Resource::Package.new("SUNWbash") @provider = Chef::Provider::Package::Solaris.new(@new_resource, @run_context) - @provider.stub!(:popen4).and_return(@status) + @provider.stub(:popen4).and_return(@status) lambda { @provider.run_action(:install) }.should raise_error(Chef::Exceptions::Package) end it "should raise an exception if pkginfo fails to run" do - @status = mock("Status", :exitstatus => -1) - @provider.stub!(:popen4).and_return(@status) + @status = double("Status", :exitstatus => -1) + @provider.stub(:popen4).and_return(@status) lambda { @provider.load_current_resource }.should raise_error(Chef::Exceptions::Package) end @@ -120,15 +120,15 @@ PKGINFO end it "should lookup the candidate_version if the variable is not already set" do - @status = mock("Status", :exitstatus => 0) - @provider.stub!(:popen4).and_return(@status) + @status = double("Status", :exitstatus => 0) + @provider.stub(:popen4).and_return(@status) @provider.should_receive(:popen4) @provider.candidate_version end it "should throw and exception if the exitstatus is not 0" do - @status = mock("Status", :exitstatus => 1) - @provider.stub!(:popen4).and_return(@status) + @status = double("Status", :exitstatus => 1) + @provider.stub(:popen4).and_return(@status) lambda { @provider.candidate_version }.should raise_error(Chef::Exceptions::Package) end @@ -153,7 +153,7 @@ PKGINFO end it "should run pkgadd -n -a /tmp/myadmin -d with the package options -a /tmp/myadmin" do - @new_resource.stub!(:options).and_return("-a /tmp/myadmin") + @new_resource.stub(:options).and_return("-a /tmp/myadmin") @provider.should_receive(:run_command_with_systems_locale).with({ :command => "pkgadd -n -a /tmp/myadmin -d /tmp/bash.pkg all" }) @@ -170,7 +170,7 @@ PKGINFO end it "should run pkgrm -n -a /tmp/myadmin with options -a /tmp/myadmin" do - @new_resource.stub!(:options).and_return("-a /tmp/myadmin") + @new_resource.stub(:options).and_return("-a /tmp/myadmin") @provider.should_receive(:run_command_with_systems_locale).with({ :command => "pkgrm -n -a /tmp/myadmin SUNWbash" }) diff --git a/spec/unit/provider/package/yum_spec.rb b/spec/unit/provider/package/yum_spec.rb index d2674f523d..adbcd86722 100644 --- a/spec/unit/provider/package/yum_spec.rb +++ b/spec/unit/provider/package/yum_spec.rb @@ -24,8 +24,8 @@ describe Chef::Provider::Package::Yum do @events = Chef::EventDispatch::Dispatcher.new @run_context = Chef::RunContext.new(@node, {}, @events) @new_resource = Chef::Resource::Package.new('cups') - @status = mock("Status", :exitstatus => 0) - @yum_cache = mock( + @status = double("Status", :exitstatus => 0) + @yum_cache = double( 'Chef::Provider::Yum::YumCache', :reload_installed => true, :reset => true, @@ -37,9 +37,9 @@ describe Chef::Provider::Package::Yum do :package_repository => "base", :disable_extra_repo_control => true ) - Chef::Provider::Package::Yum::YumCache.stub!(:instance).and_return(@yum_cache) + Chef::Provider::Package::Yum::YumCache.stub(:instance).and_return(@yum_cache) @provider = Chef::Provider::Package::Yum.new(@new_resource, @run_context) - @pid = mock("PID") + @pid = double("PID") end describe "when loading the current system state" do @@ -54,7 +54,7 @@ describe Chef::Provider::Package::Yum do end it "should set the installed version to nil on the current resource if no installed package" do - @yum_cache.stub!(:installed_version).and_return(nil) + @yum_cache.stub(:installed_version).and_return(nil) @provider.load_current_resource @provider.current_resource.version.should be_nil end @@ -76,14 +76,14 @@ describe Chef::Provider::Package::Yum do describe "when arch in package_name" do it "should set the arch if no existing package_name is found and new_package_name+new_arch is available" do @new_resource = Chef::Resource::YumPackage.new('testing.noarch') - @yum_cache = mock( + @yum_cache = double( 'Chef::Provider::Yum::YumCache' ) - @yum_cache.stub!(:installed_version) do |package_name, arch| + @yum_cache.stub(:installed_version) do |package_name, arch| # nothing installed for package_name/new_package_name nil end - @yum_cache.stub!(:candidate_version) do |package_name, arch| + @yum_cache.stub(:candidate_version) do |package_name, arch| if package_name == "testing.noarch" || package_name == "testing.more.noarch" nil # candidate for new_package_name @@ -91,9 +91,9 @@ describe Chef::Provider::Package::Yum do "1.1" end end - @yum_cache.stub!(:package_available?).and_return(true) - @yum_cache.stub!(:disable_extra_repo_control).and_return(true) - Chef::Provider::Package::Yum::YumCache.stub!(:instance).and_return(@yum_cache) + @yum_cache.stub(:package_available?).and_return(true) + @yum_cache.stub(:disable_extra_repo_control).and_return(true) + Chef::Provider::Package::Yum::YumCache.stub(:instance).and_return(@yum_cache) @provider = Chef::Provider::Package::Yum.new(@new_resource, @run_context) @provider.load_current_resource @provider.new_resource.package_name.should == "testing" @@ -110,10 +110,10 @@ describe Chef::Provider::Package::Yum do it "should not set the arch when an existing package_name is found" do @new_resource = Chef::Resource::YumPackage.new('testing.beta3') - @yum_cache = mock( + @yum_cache = double( 'Chef::Provider::Yum::YumCache' ) - @yum_cache.stub!(:installed_version) do |package_name, arch| + @yum_cache.stub(:installed_version) do |package_name, arch| # installed for package_name if package_name == "testing.beta3" || package_name == "testing.beta3.more" "1.1" @@ -121,13 +121,13 @@ describe Chef::Provider::Package::Yum do nil end end - @yum_cache.stub!(:candidate_version) do |package_name, arch| + @yum_cache.stub(:candidate_version) do |package_name, arch| # no candidate for package_name/new_package_name nil end - @yum_cache.stub!(:package_available?).and_return(true) - @yum_cache.stub!(:disable_extra_repo_control).and_return(true) - Chef::Provider::Package::Yum::YumCache.stub!(:instance).and_return(@yum_cache) + @yum_cache.stub(:package_available?).and_return(true) + @yum_cache.stub(:disable_extra_repo_control).and_return(true) + Chef::Provider::Package::Yum::YumCache.stub(:instance).and_return(@yum_cache) @provider = Chef::Provider::Package::Yum.new(@new_resource, @run_context) # annoying side effect of the fun stub'ing above @provider.load_current_resource @@ -145,20 +145,20 @@ describe Chef::Provider::Package::Yum do it "should not set the arch when no existing package_name or new_package_name+new_arch is found" do @new_resource = Chef::Resource::YumPackage.new('testing.beta3') - @yum_cache = mock( + @yum_cache = double( 'Chef::Provider::Yum::YumCache' ) - @yum_cache.stub!(:installed_version) do |package_name, arch| + @yum_cache.stub(:installed_version) do |package_name, arch| # nothing installed for package_name/new_package_name nil end - @yum_cache.stub!(:candidate_version) do |package_name, arch| + @yum_cache.stub(:candidate_version) do |package_name, arch| # no candidate for package_name/new_package_name nil end - @yum_cache.stub!(:package_available?).and_return(true) - @yum_cache.stub!(:disable_extra_repo_control).and_return(true) - Chef::Provider::Package::Yum::YumCache.stub!(:instance).and_return(@yum_cache) + @yum_cache.stub(:package_available?).and_return(true) + @yum_cache.stub(:disable_extra_repo_control).and_return(true) + Chef::Provider::Package::Yum::YumCache.stub(:instance).and_return(@yum_cache) @provider = Chef::Provider::Package::Yum.new(@new_resource, @run_context) @provider.load_current_resource @provider.new_resource.package_name.should == "testing.beta3" @@ -176,14 +176,14 @@ describe Chef::Provider::Package::Yum do it "should ensure it doesn't clobber an existing arch if passed" do @new_resource = Chef::Resource::YumPackage.new('testing.i386') @new_resource.arch("x86_64") - @yum_cache = mock( + @yum_cache = double( 'Chef::Provider::Yum::YumCache' ) - @yum_cache.stub!(:installed_version) do |package_name, arch| + @yum_cache.stub(:installed_version) do |package_name, arch| # nothing installed for package_name/new_package_name nil end - @yum_cache.stub!(:candidate_version) do |package_name, arch| + @yum_cache.stub(:candidate_version) do |package_name, arch| if package_name == "testing.noarch" nil # candidate for new_package_name @@ -191,9 +191,9 @@ describe Chef::Provider::Package::Yum do "1.1" end end.and_return("something") - @yum_cache.stub!(:package_available?).and_return(true) - @yum_cache.stub!(:disable_extra_repo_control).and_return(true) - Chef::Provider::Package::Yum::YumCache.stub!(:instance).and_return(@yum_cache) + @yum_cache.stub(:package_available?).and_return(true) + @yum_cache.stub(:disable_extra_repo_control).and_return(true) + Chef::Provider::Package::Yum::YumCache.stub(:instance).and_return(@yum_cache) @provider = Chef::Provider::Package::Yum.new(@new_resource, @run_context) @provider.load_current_resource @provider.new_resource.package_name.should == "testing.i386" @@ -202,37 +202,37 @@ describe Chef::Provider::Package::Yum do end it "should flush the cache if :before is true" do - @new_resource.stub!(:flush_cache).and_return({:after => false, :before => true}) + @new_resource.stub(:flush_cache).and_return({:after => false, :before => true}) @yum_cache.should_receive(:reload).once @provider.load_current_resource end it "should flush the cache if :before is false" do - @new_resource.stub!(:flush_cache).and_return({:after => false, :before => false}) + @new_resource.stub(:flush_cache).and_return({:after => false, :before => false}) @yum_cache.should_not_receive(:reload) @provider.load_current_resource end it "should detect --enablerepo or --disablerepo when passed among options, collect them preserving order and notify the yum cache" do - @new_resource.stub!(:options).and_return("--stuff --enablerepo=foo --otherthings --disablerepo=a,b,c --enablerepo=bar") + @new_resource.stub(:options).and_return("--stuff --enablerepo=foo --otherthings --disablerepo=a,b,c --enablerepo=bar") @yum_cache.should_receive(:enable_extra_repo_control).with("--enablerepo=foo --disablerepo=a,b,c --enablerepo=bar") @provider.load_current_resource end it "should let the yum cache know extra repos are disabled if --enablerepo or --disablerepo aren't among options" do - @new_resource.stub!(:options).and_return("--stuff --otherthings") + @new_resource.stub(:options).and_return("--stuff --otherthings") @yum_cache.should_receive(:disable_extra_repo_control) @provider.load_current_resource end it "should let the yum cache know extra repos are disabled if options aren't set" do - @new_resource.stub!(:options).and_return(nil) + @new_resource.stub(:options).and_return(nil) @yum_cache.should_receive(:disable_extra_repo_control) @provider.load_current_resource end it "should search provides if package name can't be found then set package_name to match" do - @yum_cache = mock( + @yum_cache = double( 'Chef::Provider::Yum::YumCache', :reload_installed => true, :reset => true, @@ -242,7 +242,7 @@ describe Chef::Provider::Package::Yum do :version_available? => true, :disable_extra_repo_control => true ) - Chef::Provider::Package::Yum::YumCache.stub!(:instance).and_return(@yum_cache) + Chef::Provider::Package::Yum::YumCache.stub(:instance).and_return(@yum_cache) pkg = Chef::Provider::Package::Yum::RPMPackage.new("test-package", "1.2.4-11.18.el5", "x86_64", []) @yum_cache.should_receive(:packages_from_require).and_return([pkg]) @provider = Chef::Provider::Package::Yum.new(@new_resource, @run_context) @@ -251,7 +251,7 @@ describe Chef::Provider::Package::Yum do end it "should search provides if package name can't be found, warn about multiple matches, but use the first one" do - @yum_cache = mock( + @yum_cache = double( 'Chef::Provider::Yum::YumCache', :reload_installed => true, :reset => true, @@ -261,7 +261,7 @@ describe Chef::Provider::Package::Yum do :version_available? => true, :disable_extra_repo_control => true ) - Chef::Provider::Package::Yum::YumCache.stub!(:instance).and_return(@yum_cache) + Chef::Provider::Package::Yum::YumCache.stub(:instance).and_return(@yum_cache) pkg_x = Chef::Provider::Package::Yum::RPMPackage.new("test-package-x", "1.2.4-11.18.el5", "x86_64", []) pkg_y = Chef::Provider::Package::Yum::RPMPackage.new("test-package-y", "1.2.6-11.3.el5", "i386", []) @yum_cache.should_receive(:packages_from_require).and_return([pkg_x, pkg_y]) @@ -272,7 +272,7 @@ describe Chef::Provider::Package::Yum do end it "should search provides if no package is available - if no match in installed provides then load the complete set" do - @yum_cache = mock( + @yum_cache = double( 'Chef::Provider::Yum::YumCache', :reload_installed => true, :reset => true, @@ -282,7 +282,7 @@ describe Chef::Provider::Package::Yum do :version_available? => true, :disable_extra_repo_control => true ) - Chef::Provider::Package::Yum::YumCache.stub!(:instance).and_return(@yum_cache) + Chef::Provider::Package::Yum::YumCache.stub(:instance).and_return(@yum_cache) @yum_cache.should_receive(:packages_from_require).twice.and_return([]) @yum_cache.should_receive(:reload_provides) @provider = Chef::Provider::Package::Yum.new(@new_resource, @run_context) @@ -290,7 +290,7 @@ describe Chef::Provider::Package::Yum do end it "should search provides if no package is available and not load the complete set if action is :remove or :purge" do - @yum_cache = mock( + @yum_cache = double( 'Chef::Provider::Yum::YumCache', :reload_installed => true, :reset => true, @@ -300,7 +300,7 @@ describe Chef::Provider::Package::Yum do :version_available? => true, :disable_extra_repo_control => true ) - Chef::Provider::Package::Yum::YumCache.stub!(:instance).and_return(@yum_cache) + Chef::Provider::Package::Yum::YumCache.stub(:instance).and_return(@yum_cache) @provider = Chef::Provider::Package::Yum.new(@new_resource, @run_context) @yum_cache.should_receive(:packages_from_require).once.and_return([]) @yum_cache.should_not_receive(:reload_provides) @@ -313,7 +313,7 @@ describe Chef::Provider::Package::Yum do end it "should search provides if no package is available - if no match in provides leave the name intact" do - @yum_cache = mock( + @yum_cache = double( 'Chef::Provider::Yum::YumCache', :reload_provides => true, :reload_installed => true, @@ -324,7 +324,7 @@ describe Chef::Provider::Package::Yum do :version_available? => true, :disable_extra_repo_control => true ) - Chef::Provider::Package::Yum::YumCache.stub!(:instance).and_return(@yum_cache) + Chef::Provider::Package::Yum::YumCache.stub(:instance).and_return(@yum_cache) @yum_cache.should_receive(:packages_from_require).twice.and_return([]) @provider = Chef::Provider::Package::Yum.new(@new_resource, @run_context) @provider.load_current_resource @@ -335,7 +335,7 @@ describe Chef::Provider::Package::Yum do describe "when installing a package" do it "should run yum install with the package name and version" do @provider.load_current_resource - Chef::Provider::Package::Yum::RPMUtils.stub!(:rpmvercmp).and_return(-1) + Chef::Provider::Package::Yum::RPMUtils.stub(:rpmvercmp).and_return(-1) @provider.should_receive(:yum_command).with( "yum -d0 -e0 -y install emacs-1.0" ) @@ -343,7 +343,7 @@ describe Chef::Provider::Package::Yum do end it "should run yum localinstall if given a path to an rpm" do - @new_resource.stub!(:source).and_return("/tmp/emacs-21.4-20.el5.i386.rpm") + @new_resource.stub(:source).and_return("/tmp/emacs-21.4-20.el5.i386.rpm") @provider.should_receive(:yum_command).with( "yum -d0 -e0 -y localinstall /tmp/emacs-21.4-20.el5.i386.rpm" ) @@ -352,7 +352,7 @@ describe Chef::Provider::Package::Yum do it "should run yum localinstall if given a path to an rpm as the package" do @new_resource = Chef::Resource::Package.new("/tmp/emacs-21.4-20.el5.i386.rpm") - ::File.stub!(:exists?).and_return(true) + ::File.stub(:exists?).and_return(true) @provider = Chef::Provider::Package::Yum.new(@new_resource, @run_context) @new_resource.source.should == "/tmp/emacs-21.4-20.el5.i386.rpm" @provider.should_receive(:yum_command).with( @@ -363,8 +363,8 @@ describe Chef::Provider::Package::Yum do it "should run yum install with the package name, version and arch" do @provider.load_current_resource - @new_resource.stub!(:arch).and_return("i386") - Chef::Provider::Package::Yum::RPMUtils.stub!(:rpmvercmp).and_return(-1) + @new_resource.stub(:arch).and_return("i386") + Chef::Provider::Package::Yum::RPMUtils.stub(:rpmvercmp).and_return(-1) @provider.should_receive(:yum_command).with( "yum -d0 -e0 -y install emacs-21.4-20.el5.i386" ) @@ -374,8 +374,8 @@ describe Chef::Provider::Package::Yum do it "installs the package with the options given in the resource" do @provider.load_current_resource @provider.candidate_version = '11' - @new_resource.stub!(:options).and_return("--disablerepo epmd") - Chef::Provider::Package::Yum::RPMUtils.stub!(:rpmvercmp).and_return(-1) + @new_resource.stub(:options).and_return("--disablerepo epmd") + Chef::Provider::Package::Yum::RPMUtils.stub(:rpmvercmp).and_return(-1) @provider.should_receive(:yum_command).with( "yum -d0 -e0 -y --disablerepo epmd install cups-11" ) @@ -383,7 +383,7 @@ describe Chef::Provider::Package::Yum do end it "should raise an exception if the package is not available" do - @yum_cache = mock( + @yum_cache = double( 'Chef::Provider::Yum::YumCache', :reload_from_cache => true, :reset => true, @@ -393,14 +393,14 @@ describe Chef::Provider::Package::Yum do :version_available? => nil, :disable_extra_repo_control => true ) - Chef::Provider::Package::Yum::YumCache.stub!(:instance).and_return(@yum_cache) + Chef::Provider::Package::Yum::YumCache.stub(:instance).and_return(@yum_cache) @provider = Chef::Provider::Package::Yum.new(@new_resource, @run_context) lambda { @provider.install_package("lolcats", "0.99") }.should raise_error(Chef::Exceptions::Package, %r{Version .* not found}) end it "should raise an exception if candidate version is older than the installed version and allow_downgrade is false" do - @new_resource.stub!(:allow_downgrade).and_return(false) - @yum_cache = mock( + @new_resource.stub(:allow_downgrade).and_return(false) + @yum_cache = double( 'Chef::Provider::Yum::YumCache', :reload_installed => true, :reset => true, @@ -411,14 +411,14 @@ describe Chef::Provider::Package::Yum do :allow_multi_install => [ "kernel" ], :disable_extra_repo_control => true ) - Chef::Provider::Package::Yum::YumCache.stub!(:instance).and_return(@yum_cache) + Chef::Provider::Package::Yum::YumCache.stub(:instance).and_return(@yum_cache) @provider = Chef::Provider::Package::Yum.new(@new_resource, @run_context) @provider.load_current_resource lambda { @provider.install_package("cups", "1.2.4-11.15.el5") }.should raise_error(Chef::Exceptions::Package, %r{is newer than candidate package}) end it "should not raise an exception if candidate version is older than the installed version and the package is list in yum's installonlypkg option" do - @yum_cache = mock( + @yum_cache = double( 'Chef::Provider::Yum::YumCache', :reload_installed => true, :reset => true, @@ -430,7 +430,7 @@ describe Chef::Provider::Package::Yum do :package_repository => "base", :disable_extra_repo_control => true ) - Chef::Provider::Package::Yum::YumCache.stub!(:instance).and_return(@yum_cache) + Chef::Provider::Package::Yum::YumCache.stub(:instance).and_return(@yum_cache) @provider = Chef::Provider::Package::Yum.new(@new_resource, @run_context) @provider.load_current_resource @provider.should_receive(:yum_command).with( @@ -440,8 +440,8 @@ describe Chef::Provider::Package::Yum do end it "should run yum downgrade if candidate version is older than the installed version and allow_downgrade is true" do - @new_resource.stub!(:allow_downgrade).and_return(true) - @yum_cache = mock( + @new_resource.stub(:allow_downgrade).and_return(true) + @yum_cache = double( 'Chef::Provider::Yum::YumCache', :reload_installed => true, :reset => true, @@ -453,7 +453,7 @@ describe Chef::Provider::Package::Yum do :package_repository => "base", :disable_extra_repo_control => true ) - Chef::Provider::Package::Yum::YumCache.stub!(:instance).and_return(@yum_cache) + Chef::Provider::Package::Yum::YumCache.stub(:instance).and_return(@yum_cache) @provider = Chef::Provider::Package::Yum.new(@new_resource, @run_context) @provider.load_current_resource @provider.should_receive(:yum_command).with( @@ -463,9 +463,9 @@ describe Chef::Provider::Package::Yum do end it "should run yum install then flush the cache if :after is true" do - @new_resource.stub!(:flush_cache).and_return({:after => true, :before => false}) + @new_resource.stub(:flush_cache).and_return({:after => true, :before => false}) @provider.load_current_resource - Chef::Provider::Package::Yum::RPMUtils.stub!(:rpmvercmp).and_return(-1) + Chef::Provider::Package::Yum::RPMUtils.stub(:rpmvercmp).and_return(-1) @provider.should_receive(:yum_command).with( "yum -d0 -e0 -y install emacs-1.0" ) @@ -474,9 +474,9 @@ describe Chef::Provider::Package::Yum do end it "should run yum install then not flush the cache if :after is false" do - @new_resource.stub!(:flush_cache).and_return({:after => false, :before => false}) + @new_resource.stub(:flush_cache).and_return({:after => false, :before => false}) @provider.load_current_resource - Chef::Provider::Package::Yum::RPMUtils.stub!(:rpmvercmp).and_return(-1) + Chef::Provider::Package::Yum::RPMUtils.stub(:rpmvercmp).and_return(-1) @provider.should_receive(:yum_command).with( "yum -d0 -e0 -y install emacs-1.0" ) @@ -489,7 +489,7 @@ describe Chef::Provider::Package::Yum do it "should run yum install if the package is installed and a version is given" do @provider.load_current_resource @provider.candidate_version = '11' - Chef::Provider::Package::Yum::RPMUtils.stub!(:rpmvercmp).and_return(-1) + Chef::Provider::Package::Yum::RPMUtils.stub(:rpmvercmp).and_return(-1) @provider.should_receive(:yum_command).with( "yum -d0 -e0 -y install cups-11" ) @@ -500,7 +500,7 @@ describe Chef::Provider::Package::Yum do @provider.load_current_resource @current_resource = Chef::Resource::Package.new('cups') @provider.candidate_version = '11' - Chef::Provider::Package::Yum::RPMUtils.stub!(:rpmvercmp).and_return(-1) + Chef::Provider::Package::Yum::RPMUtils.stub(:rpmvercmp).and_return(-1) @provider.should_receive(:yum_command).with( "yum -d0 -e0 -y install cups-11" ) @@ -508,7 +508,7 @@ describe Chef::Provider::Package::Yum do end it "should raise an exception if candidate version is older than the installed version" do - @yum_cache = mock( + @yum_cache = double( 'Chef::Provider::Yum::YumCache', :reload_installed => true, :reset => true, @@ -519,7 +519,7 @@ describe Chef::Provider::Package::Yum do :allow_multi_install => [ "kernel" ], :disable_extra_repo_control => true ) - Chef::Provider::Package::Yum::YumCache.stub!(:instance).and_return(@yum_cache) + Chef::Provider::Package::Yum::YumCache.stub(:instance).and_return(@yum_cache) @provider = Chef::Provider::Package::Yum.new(@new_resource, @run_context) @provider.load_current_resource lambda { @provider.upgrade_package("cups", "1.2.4-11.15.el5") }.should raise_error(Chef::Exceptions::Package, %r{is newer than candidate package}) @@ -527,7 +527,7 @@ describe Chef::Provider::Package::Yum do # Test our little workaround, some crossover into Chef::Provider::Package territory it "should call action_upgrade in the parent if the current resource version is nil" do - @yum_cache.stub!(:installed_version).and_return(nil) + @yum_cache.stub(:installed_version).and_return(nil) @provider.load_current_resource @current_resource = Chef::Resource::Package.new('cups') @provider.candidate_version = '11' @@ -558,7 +558,7 @@ describe Chef::Provider::Package::Yum do end it "should not call action_upgrade in the parent if the candidate is older" do - @yum_cache.stub!(:installed_version).and_return("12") + @yum_cache.stub(:installed_version).and_return("12") @provider.load_current_resource @current_resource = Chef::Resource::Package.new('cups') @provider.candidate_version = '11' @@ -576,7 +576,7 @@ describe Chef::Provider::Package::Yum do end it "should run yum remove with the package name and arch" do - @new_resource.stub!(:arch).and_return("x86_64") + @new_resource.stub(:arch).and_return("x86_64") @provider.should_receive(:yum_command).with( "yum -d0 -e0 -y remove emacs-1.0.x86_64" ) @@ -595,8 +595,8 @@ describe Chef::Provider::Package::Yum do describe "when running yum" do it "should run yum once if it exits with a return code of 0" do - @status = mock("Status", :exitstatus => 0) - @provider.stub!(:output_of_command).and_return([@status, "", ""]) + @status = double("Status", :exitstatus => 0) + @provider.stub(:output_of_command).and_return([@status, "", ""]) @provider.should_receive(:output_of_command).once.with( "yum -d0 -e0 -y install emacs-1.0", {:timeout => Chef::Config[:yum_timeout]} @@ -605,8 +605,8 @@ describe Chef::Provider::Package::Yum do end it "should run yum once if it exits with a return code > 0 and no scriptlet failures" do - @status = mock("Status", :exitstatus => 2) - @provider.stub!(:output_of_command).and_return([@status, "failure failure", "problem problem"]) + @status = double("Status", :exitstatus => 2) + @provider.stub(:output_of_command).and_return([@status, "failure failure", "problem problem"]) @provider.should_receive(:output_of_command).once.with( "yum -d0 -e0 -y install emacs-1.0", {:timeout => Chef::Config[:yum_timeout]} @@ -615,8 +615,8 @@ describe Chef::Provider::Package::Yum do end it "should run yum once if it exits with a return code of 1 and %pre scriptlet failures" do - @status = mock("Status", :exitstatus => 1) - @provider.stub!(:output_of_command).and_return([@status, "error: %pre(demo-1-1.el5.centos.x86_64) scriptlet failed, exit status 2", ""]) + @status = double("Status", :exitstatus => 1) + @provider.stub(:output_of_command).and_return([@status, "error: %pre(demo-1-1.el5.centos.x86_64) scriptlet failed, exit status 2", ""]) @provider.should_receive(:output_of_command).once.with( "yum -d0 -e0 -y install emacs-1.0", {:timeout => Chef::Config[:yum_timeout]} @@ -626,8 +626,8 @@ describe Chef::Provider::Package::Yum do end it "should run yum twice if it exits with a return code of 1 and %post scriptlet failures" do - @status = mock("Status", :exitstatus => 1) - @provider.stub!(:output_of_command).and_return([@status, "error: %post(demo-1-1.el5.centos.x86_64) scriptlet failed, exit status 2", ""]) + @status = double("Status", :exitstatus => 1) + @provider.stub(:output_of_command).and_return([@status, "error: %post(demo-1-1.el5.centos.x86_64) scriptlet failed, exit status 2", ""]) @provider.should_receive(:output_of_command).twice.with( "yum -d0 -e0 -y install emacs-1.0", {:timeout => Chef::Config[:yum_timeout]} @@ -1543,8 +1543,8 @@ describe Chef::Provider::Package::Yum::YumCache do end before(:each) do - @stdin = mock("STDIN", :nil_object => true) - @stdout = mock("STDOUT", :nil_object => true) + @stdin = double("STDIN", :nil_object => true) + @stdout = double("STDOUT", :nil_object => true) @stdout_good = <<EOF [option installonlypkgs] kernel kernel-bigmem kernel-enterprise @@ -1586,13 +1586,13 @@ yum-dump Config Error: File contains no section headers. file: file://///etc/yum.repos.d/CentOS-Base.repo, line: 12 'qeqwewe\n' EOF - @status = mock("Status", :exitstatus => 0, :stdin => @stdin, :stdout => @stdout_good, :stderr => @stderr) + @status = double("Status", :exitstatus => 0, :stdin => @stdin, :stdout => @stdout_good, :stderr => @stderr) # new singleton each time Chef::Provider::Package::Yum::YumCache.reset_instance @yc = Chef::Provider::Package::Yum::YumCache.instance # load valid data - @yc.stub!(:shell_out!).and_return(@status) + @yc.stub(:shell_out!).and_return(@status) end describe "initialize" do @@ -1642,29 +1642,29 @@ EOF end it "should warn about invalid data with too many separators" do - @status = mock("Status", :exitstatus => 0, :stdin => @stdin, :stdout => @stdout_bad_separators, :stderr => @stderr) - @yc.stub!(:shell_out!).and_return(@status) + @status = double("Status", :exitstatus => 0, :stdin => @stdin, :stdout => @stdout_bad_separators, :stderr => @stderr) + @yc.stub(:shell_out!).and_return(@status) Chef::Log.should_receive(:warn).exactly(3).times.with(%r{Problem parsing}) @yc.refresh end it "should warn about invalid data with an incorrect type" do - @status = mock("Status", :exitstatus => 0, :stdin => @stdin, :stdout => @stdout_bad_type, :stderr => @stderr) - @yc.stub!(:shell_out!).and_return(@status) + @status = double("Status", :exitstatus => 0, :stdin => @stdin, :stdout => @stdout_bad_type, :stderr => @stderr) + @yc.stub(:shell_out!).and_return(@status) Chef::Log.should_receive(:warn).exactly(2).times.with(%r{Problem parsing}) @yc.refresh end it "should warn about no output from yum-dump.py" do - @status = mock("Status", :exitstatus => 0, :stdin => @stdin, :stdout => @stdout_no_output, :stderr => @stderr) - @yc.stub!(:shell_out!).and_return(@status) + @status = double("Status", :exitstatus => 0, :stdin => @stdin, :stdout => @stdout_no_output, :stderr => @stderr) + @yc.stub(:shell_out!).and_return(@status) Chef::Log.should_receive(:warn).exactly(1).times.with(%r{no output from yum-dump.py}) @yc.refresh end it "should raise exception yum-dump.py exits with a non zero status" do - @status = mock("Status", :exitstatus => 1, :stdin => @stdin, :stdout => @stdout_no_output, :stderr => @stderr) - @yc.stub!(:shell_out!).and_return(@status) + @status = double("Status", :exitstatus => 1, :stdin => @stdin, :stdout => @stdout_no_output, :stderr => @stderr) + @yc.stub(:shell_out!).and_return(@status) lambda { @yc.refresh}.should raise_error(Chef::Exceptions::Package, %r{CentOS-Base.repo, line: 12}) end @@ -1690,8 +1690,8 @@ EOF describe "installed_version" do it "should take one or two arguments" do - lambda { @yc.installed_version("zip") }.should_not raise_error(ArgumentError) - lambda { @yc.installed_version("zip", "i386") }.should_not raise_error(ArgumentError) + lambda { @yc.installed_version("zip") }.should_not raise_error + lambda { @yc.installed_version("zip", "i386") }.should_not raise_error lambda { @yc.installed_version("zip", "i386", "extra") }.should raise_error(ArgumentError) end @@ -1714,8 +1714,8 @@ EOF describe "available_version" do it "should take one or two arguments" do - lambda { @yc.available_version("zisofs-tools") }.should_not raise_error(ArgumentError) - lambda { @yc.available_version("zisofs-tools", "i386") }.should_not raise_error(ArgumentError) + lambda { @yc.available_version("zisofs-tools") }.should_not raise_error + lambda { @yc.available_version("zisofs-tools", "i386") }.should_not raise_error lambda { @yc.available_version("zisofs-tools", "i386", "extra") }.should raise_error(ArgumentError) end @@ -1739,8 +1739,8 @@ EOF describe "version_available?" do it "should take two or three arguments" do lambda { @yc.version_available?("zisofs-tools") }.should raise_error(ArgumentError) - lambda { @yc.version_available?("zisofs-tools", "1.0.6-3.2.2") }.should_not raise_error(ArgumentError) - lambda { @yc.version_available?("zisofs-tools", "1.0.6-3.2.2", "x86_64") }.should_not raise_error(ArgumentError) + lambda { @yc.version_available?("zisofs-tools", "1.0.6-3.2.2") }.should_not raise_error + lambda { @yc.version_available?("zisofs-tools", "1.0.6-3.2.2", "x86_64") }.should_not raise_error end it "should return true if our package-version-arch is available" do @@ -1768,8 +1768,8 @@ EOF describe "package_repository" do it "should take two or three arguments" do lambda { @yc.package_repository("zisofs-tools") }.should raise_error(ArgumentError) - lambda { @yc.package_repository("zisofs-tools", "1.0.6-3.2.2") }.should_not raise_error(ArgumentError) - lambda { @yc.package_repository("zisofs-tools", "1.0.6-3.2.2", "x86_64") }.should_not raise_error(ArgumentError) + lambda { @yc.package_repository("zisofs-tools", "1.0.6-3.2.2") }.should_not raise_error + lambda { @yc.package_repository("zisofs-tools", "1.0.6-3.2.2", "x86_64") }.should_not raise_error end it "should return repoid for package-version-arch" do diff --git a/spec/unit/provider/package/zypper_spec.rb b/spec/unit/provider/package/zypper_spec.rb index cf0193993d..c437631309 100644 --- a/spec/unit/provider/package/zypper_spec.rb +++ b/spec/unit/provider/package/zypper_spec.rb @@ -27,15 +27,15 @@ describe Chef::Provider::Package::Zypper do @current_resource = Chef::Resource::Package.new("cups") - @status = mock("Status", :exitstatus => 0) + @status = double("Status", :exitstatus => 0) @provider = Chef::Provider::Package::Zypper.new(@new_resource, @run_context) - Chef::Resource::Package.stub!(:new).and_return(@current_resource) - @provider.stub!(:popen4).and_return(@status) + Chef::Resource::Package.stub(:new).and_return(@current_resource) + @provider.stub(:popen4).and_return(@status) @stderr = StringIO.new @stdout = StringIO.new - @pid = mock("PID") - @provider.stub!(:`).and_return("2.0") + @pid = double("PID") + @provider.stub(:`).and_return("2.0") end describe "when loading the current package state" do @@ -55,14 +55,14 @@ describe Chef::Provider::Package::Zypper do end it "should set the installed version to nil on the current resource if zypper info installed version is (none)" do - @provider.stub!(:popen4).and_yield(@pid, @stdin, @stdout, @stderr).and_return(@status) + @provider.stub(:popen4).and_yield(@pid, @stdin, @stdout, @stderr).and_return(@status) @current_resource.should_receive(:version).with(nil).and_return(true) @provider.load_current_resource end it "should set the installed version if zypper info has one" do @stdout = StringIO.new("Version: 1.0\nInstalled: Yes\n") - @provider.stub!(:popen4).and_yield(@pid, @stdin, @stdout, @stderr).and_return(@status) + @provider.stub(:popen4).and_yield(@pid, @stdin, @stdout, @stderr).and_return(@status) @current_resource.should_receive(:version).with("1.0").and_return(true) @provider.load_current_resource end @@ -70,7 +70,7 @@ describe Chef::Provider::Package::Zypper do it "should set the candidate version if zypper info has one" do @stdout = StringIO.new("Version: 1.0\nInstalled: No\nStatus: out-of-date (version 0.9 installed)") - @provider.stub!(:popen4).and_yield(@pid, @stdin, @stdout, @stderr).and_return(@status) + @provider.stub(:popen4).and_yield(@pid, @stdin, @stdout, @stderr).and_return(@status) @provider.load_current_resource @provider.candidate_version.should eql("1.0") end @@ -82,7 +82,7 @@ describe Chef::Provider::Package::Zypper do it "should not raise an exception if zypper info succeeds" do @status.should_receive(:exitstatus).and_return(0) - lambda { @provider.load_current_resource }.should_not raise_error(Chef::Exceptions::Package) + lambda { @provider.load_current_resource }.should_not raise_error end it "should return the current resouce" do @@ -191,7 +191,7 @@ describe Chef::Provider::Package::Zypper do describe "on an older zypper" do before(:each) do - @provider.stub!(:`).and_return("0.11.6") + @provider.stub(:`).and_return("0.11.6") end describe "install_package" do diff --git a/spec/unit/provider/package_spec.rb b/spec/unit/provider/package_spec.rb index f80eed17bd..33b4f8186a 100644 --- a/spec/unit/provider/package_spec.rb +++ b/spec/unit/provider/package_spec.rb @@ -34,7 +34,7 @@ describe Chef::Provider::Package do describe "when installing a package" do before(:each) do @provider.current_resource = @current_resource - @provider.stub!(:install_package).and_return(true) + @provider.stub(:install_package).and_return(true) end it "should raise a Chef::Exceptions::Package if no version is specified, and no candidate is available" do @@ -81,7 +81,7 @@ describe Chef::Provider::Package do it "should install the package at the version specified if a different version is installed" do @new_resource.version("1.0") - @current_resource.stub!(:version).and_return("0.99") + @current_resource.stub(:version).and_return("0.99") @provider.should_receive(:install_package).with( @new_resource.name, @new_resource.version @@ -107,7 +107,7 @@ describe Chef::Provider::Package do it "should call the candidate_version accessor only once if the package is already installed and no version is specified" do @current_resource.version("1.0") - @provider.stub!(:candidate_version).and_return("1.0") + @provider.stub(:candidate_version).and_return("1.0") @provider.run_action(:install) end @@ -126,7 +126,7 @@ describe Chef::Provider::Package do describe "when upgrading the package" do before(:each) do - @provider.stub!(:upgrade_package).and_return(true) + @provider.stub(:upgrade_package).and_return(true) end it "should upgrade the package if the current version is not the candidate version" do @@ -151,14 +151,14 @@ describe Chef::Provider::Package do end it "should print the word 'uninstalled' if there was no original version" do - @current_resource.stub!(:version).and_return(nil) + @current_resource.stub(:version).and_return(nil) Chef::Log.should_receive(:info).with("package[emacs] upgraded from uninstalled to 1.0") @provider.run_action(:upgrade) @new_resource.should be_updated_by_last_action end it "should raise a Chef::Exceptions::Package if current version and candidate are nil" do - @current_resource.stub!(:version).and_return(nil) + @current_resource.stub(:version).and_return(nil) @provider.candidate_version = nil lambda { @provider.run_action(:upgrade) }.should raise_error(Chef::Exceptions::Package) end @@ -174,7 +174,7 @@ describe Chef::Provider::Package do describe "When removing the package" do before(:each) do - @provider.stub!(:remove_package).and_return(true) + @provider.stub(:remove_package).and_return(true) @current_resource.version '1.4.2' end @@ -204,7 +204,7 @@ describe Chef::Provider::Package do it "should not remove the package if it is not installed" do @provider.should_not_receive(:remove_package) - @current_resource.stub!(:version).and_return(nil) + @current_resource.stub(:version).and_return(nil) @provider.run_action(:remove) @new_resource.should_not be_updated_by_last_action end @@ -218,7 +218,7 @@ describe Chef::Provider::Package do describe "When purging the package" do before(:each) do - @provider.stub!(:purge_package).and_return(true) + @provider.stub(:purge_package).and_return(true) @current_resource.version '1.4.2' end @@ -264,15 +264,15 @@ describe Chef::Provider::Package do describe "when reconfiguring the package" do before(:each) do - @provider.stub!(:reconfig_package).and_return(true) + @provider.stub(:reconfig_package).and_return(true) end it "should info log, reconfigure the package and update the resource" do - @current_resource.stub!(:version).and_return('1.0') - @new_resource.stub!(:response_file).and_return(true) + @current_resource.stub(:version).and_return('1.0') + @new_resource.stub(:response_file).and_return(true) @provider.should_receive(:get_preseed_file).and_return('/var/cache/preseed-test') - @provider.stub!(:preseed_package).and_return(true) - @provider.stub!(:reconfig_package).and_return(true) + @provider.stub(:preseed_package).and_return(true) + @provider.stub(:reconfig_package).and_return(true) Chef::Log.should_receive(:info).with("package[emacs] reconfigured") @provider.should_receive(:reconfig_package) @provider.run_action(:reconfig) @@ -281,7 +281,7 @@ describe Chef::Provider::Package do end it "should debug log and not reconfigure the package if the package is not installed" do - @current_resource.stub!(:version).and_return(nil) + @current_resource.stub(:version).and_return(nil) Chef::Log.should_receive(:debug).with("package[emacs] is NOT installed - nothing to do") @provider.should_not_receive(:reconfig_package) @provider.run_action(:reconfig) @@ -289,8 +289,8 @@ describe Chef::Provider::Package do end it "should debug log and not reconfigure the package if no response_file is given" do - @current_resource.stub!(:version).and_return('1.0') - @new_resource.stub!(:response_file).and_return(nil) + @current_resource.stub(:version).and_return('1.0') + @new_resource.stub(:response_file).and_return(nil) Chef::Log.should_receive(:debug).with("package[emacs] no response_file provided - nothing to do") @provider.should_not_receive(:reconfig_package) @provider.run_action(:reconfig) @@ -298,10 +298,10 @@ describe Chef::Provider::Package do end it "should debug log and not reconfigure the package if the response_file has not changed" do - @current_resource.stub!(:version).and_return('1.0') - @new_resource.stub!(:response_file).and_return(true) + @current_resource.stub(:version).and_return('1.0') + @new_resource.stub(:response_file).and_return(true) @provider.should_receive(:get_preseed_file).and_return(false) - @provider.stub!(:preseed_package).and_return(false) + @provider.stub(:preseed_package).and_return(false) Chef::Log.should_receive(:debug).with("package[emacs] preseeding has not changed - nothing to do") @provider.should_not_receive(:reconfig_package) @provider.run_action(:reconfig) @@ -362,7 +362,7 @@ describe Chef::Provider::Package do end it "sets the preseed resource's runcontext to its own run context" do - Chef::FileCache.stub!(:create_cache_path).and_return("/tmp/preseed/java") + Chef::FileCache.stub(:create_cache_path).and_return("/tmp/preseed/java") @provider.preseed_resource('java', '6').run_context.should_not be_nil @provider.preseed_resource('java', '6').run_context.should equal(@provider.run_context) end diff --git a/spec/unit/provider/registry_key_spec.rb b/spec/unit/provider/registry_key_spec.rb index 2f6f8179e6..f88d4c0a87 100644 --- a/spec/unit/provider/registry_key_spec.rb +++ b/spec/unit/provider/registry_key_spec.rb @@ -38,9 +38,9 @@ describe Chef::Provider::RegistryKey do @provider = Chef::Provider::RegistryKey.new(@new_resource, @run_context) - @provider.stub!(:running_on_windows!).and_return(true) + @provider.stub(:running_on_windows!).and_return(true) @double_registry = double(Chef::Win32::Registry) - @provider.stub!(:registry).and_return(@double_registry) + @provider.stub(:registry).and_return(@double_registry) end describe "when first created" do diff --git a/spec/unit/provider/remote_file/content_spec.rb b/spec/unit/provider/remote_file/content_spec.rb index 36ecfe1c8d..0f311dc0ec 100644 --- a/spec/unit/provider/remote_file/content_spec.rb +++ b/spec/unit/provider/remote_file/content_spec.rb @@ -36,7 +36,7 @@ describe Chef::Provider::RemoteFile::Content do r end - let(:run_context) { mock("Chef::RunContext") } + let(:run_context) { double("Chef::RunContext") } # # subject @@ -47,8 +47,8 @@ describe Chef::Provider::RemoteFile::Content do describe "when the checksum of the current_resource matches the checksum set on the resource" do before do - new_resource.stub!(:checksum).and_return("0fd012fdc96e96f8f7cf2046522a54aed0ce470224513e45da6bc1a17a4924aa") - current_resource.stub!(:checksum).and_return("0fd012fdc96e96f8f7cf2046522a54aed0ce470224513e45da6bc1a17a4924aa") + new_resource.stub(:checksum).and_return("0fd012fdc96e96f8f7cf2046522a54aed0ce470224513e45da6bc1a17a4924aa") + current_resource.stub(:checksum).and_return("0fd012fdc96e96f8f7cf2046522a54aed0ce470224513e45da6bc1a17a4924aa") end it "should return nil for the tempfile" do @@ -62,8 +62,8 @@ describe Chef::Provider::RemoteFile::Content do describe "when the checksum of the current_resource is a partial match for the checksum set on the resource" do before do - new_resource.stub!(:checksum).and_return("0fd012fd") - current_resource.stub!(:checksum).and_return("0fd012fdc96e96f8f7cf2046522a54aed0ce470224513e45da6bc1a17a4924aa") + new_resource.stub(:checksum).and_return("0fd012fd") + current_resource.stub(:checksum).and_return("0fd012fdc96e96f8f7cf2046522a54aed0ce470224513e45da6bc1a17a4924aa") end it "should return nil for the tempfile" do @@ -78,13 +78,13 @@ describe Chef::Provider::RemoteFile::Content do shared_examples_for "the resource needs fetching" do before do # FIXME: test one or the other nil, test both not nil and not equal, abuse the regexp a little - @uri = mock("URI") + @uri = double("URI") URI.should_receive(:parse).with(new_resource.source[0]).and_return(@uri) end describe "when the fetcher returns nil for the tempfile" do before do - http_fetcher = mock("Chef::Provider::RemoteFile::HTTP", :fetch => nil) + http_fetcher = double("Chef::Provider::RemoteFile::HTTP", :fetch => nil) Chef::Provider::RemoteFile::Fetcher.should_receive(:for_resource).with(@uri, new_resource, current_resource).and_return(http_fetcher) end @@ -96,8 +96,8 @@ describe Chef::Provider::RemoteFile::Content do describe "when the fetcher returns a valid tempfile" do let(:mtime) { Time.now } - let(:tempfile) { mock("Tempfile") } - let(:http_fetcher) { mock("Chef::Provider::RemoteFile::HTTP", :fetch => tempfile) } + let(:tempfile) { double("Tempfile") } + let(:http_fetcher) { double("Chef::Provider::RemoteFile::HTTP", :fetch => tempfile) } before do Chef::Provider::RemoteFile::Fetcher.should_receive(:for_resource).with(@uri, new_resource, current_resource).and_return(http_fetcher) @@ -119,24 +119,24 @@ describe Chef::Provider::RemoteFile::Content do describe "when the current_resource checksum is nil" do before do - new_resource.stub!(:checksum).and_return("fd012fd") - current_resource.stub!(:checksum).and_return(nil) + new_resource.stub(:checksum).and_return("fd012fd") + current_resource.stub(:checksum).and_return(nil) end it_behaves_like "the resource needs fetching" end describe "when the new_resource checksum is nil" do before do - new_resource.stub!(:checksum).and_return(nil) - current_resource.stub!(:checksum).and_return("0fd012fdc96e96f8f7cf2046522a54aed0ce470224513e45da6bc1a17a4924aa") + new_resource.stub(:checksum).and_return(nil) + current_resource.stub(:checksum).and_return("0fd012fdc96e96f8f7cf2046522a54aed0ce470224513e45da6bc1a17a4924aa") end it_behaves_like "the resource needs fetching" end describe "when the checksums are a partial match, but not to the leading portion" do before do - new_resource.stub!(:checksum).and_return("fd012fd") - current_resource.stub!(:checksum).and_return("0fd012fdc96e96f8f7cf2046522a54aed0ce470224513e45da6bc1a17a4924aa") + new_resource.stub(:checksum).and_return("fd012fd") + current_resource.stub(:checksum).and_return("0fd012fdc96e96f8f7cf2046522a54aed0ce470224513e45da6bc1a17a4924aa") end it_behaves_like "the resource needs fetching" end @@ -144,11 +144,11 @@ describe Chef::Provider::RemoteFile::Content do describe "when the fetcher throws an exception" do before do - new_resource.stub!(:checksum).and_return(nil) - current_resource.stub!(:checksum).and_return(nil) - @uri = mock("URI") + new_resource.stub(:checksum).and_return(nil) + current_resource.stub(:checksum).and_return(nil) + @uri = double("URI") URI.should_receive(:parse).with(new_resource.source[0]).and_return(@uri) - http_fetcher = mock("Chef::Provider::RemoteFile::HTTP") + http_fetcher = double("Chef::Provider::RemoteFile::HTTP") http_fetcher.should_receive(:fetch).and_raise(Errno::ECONNREFUSED) Chef::Provider::RemoteFile::Fetcher.should_receive(:for_resource).with(@uri, new_resource, current_resource).and_return(http_fetcher) end @@ -162,22 +162,22 @@ describe Chef::Provider::RemoteFile::Content do let(:source) { [ "http://opscode.com/seattle.txt", "http://opscode.com/nyc.txt" ] } before do - new_resource.stub!(:checksum).and_return(nil) - current_resource.stub!(:checksum).and_return(nil) - @uri0 = mock("URI0") - @uri1 = mock("URI1") + new_resource.stub(:checksum).and_return(nil) + current_resource.stub(:checksum).and_return(nil) + @uri0 = double("URI0") + @uri1 = double("URI1") URI.should_receive(:parse).with(new_resource.source[0]).and_return(@uri0) URI.should_receive(:parse).with(new_resource.source[1]).and_return(@uri1) - @http_fetcher_throws_exception = mock("Chef::Provider::RemoteFile::HTTP") + @http_fetcher_throws_exception = double("Chef::Provider::RemoteFile::HTTP") @http_fetcher_throws_exception.should_receive(:fetch).at_least(:once).and_raise(Errno::ECONNREFUSED) Chef::Provider::RemoteFile::Fetcher.should_receive(:for_resource).with(@uri0, new_resource, current_resource).and_return(@http_fetcher_throws_exception) end describe "when the second url succeeds" do before do - @tempfile = mock("Tempfile") + @tempfile = double("Tempfile") mtime = Time.now - http_fetcher_works = mock("Chef::Provider::RemoteFile::HTTP", :fetch => @tempfile) + http_fetcher_works = double("Chef::Provider::RemoteFile::HTTP", :fetch => @tempfile) Chef::Provider::RemoteFile::Fetcher.should_receive(:for_resource).with(@uri1, new_resource, current_resource).and_return(http_fetcher_works) end @@ -205,14 +205,14 @@ describe Chef::Provider::RemoteFile::Content do describe "when there is an array of sources and the first succeeds" do let(:source) { [ "http://opscode.com/seattle.txt", "http://opscode.com/nyc.txt" ] } before do - new_resource.stub!(:checksum).and_return(nil) - current_resource.stub!(:checksum).and_return(nil) - @uri0 = mock("URI0") + new_resource.stub(:checksum).and_return(nil) + current_resource.stub(:checksum).and_return(nil) + @uri0 = double("URI0") URI.should_receive(:parse).with(new_resource.source[0]).and_return(@uri0) URI.should_not_receive(:parse).with(new_resource.source[1]) - @tempfile = mock("Tempfile") + @tempfile = double("Tempfile") mtime = Time.now - http_fetcher_works = mock("Chef::Provider::RemoteFile::HTTP", :fetch => @tempfile) + http_fetcher_works = double("Chef::Provider::RemoteFile::HTTP", :fetch => @tempfile) Chef::Provider::RemoteFile::Fetcher.should_receive(:for_resource).with(@uri0, new_resource, current_resource).and_return(http_fetcher_works) end diff --git a/spec/unit/provider/remote_file/fetcher_spec.rb b/spec/unit/provider/remote_file/fetcher_spec.rb index 68802fb83c..b5594b50e6 100644 --- a/spec/unit/provider/remote_file/fetcher_spec.rb +++ b/spec/unit/provider/remote_file/fetcher_spec.rb @@ -20,12 +20,12 @@ require 'spec_helper' describe Chef::Provider::RemoteFile::Fetcher do - let(:current_resource) { mock("current resource") } - let(:new_resource) { mock("new resource") } - let(:fetcher_instance) { mock("fetcher") } + let(:current_resource) { double("current resource") } + let(:new_resource) { double("new resource") } + let(:fetcher_instance) { double("fetcher") } describe "when passed an http url" do - let(:uri) { mock("uri", :scheme => "http" ) } + let(:uri) { double("uri", :scheme => "http" ) } before do Chef::Provider::RemoteFile::HTTP.should_receive(:new).and_return(fetcher_instance) end @@ -35,7 +35,7 @@ describe Chef::Provider::RemoteFile::Fetcher do end describe "when passed an https url" do - let(:uri) { mock("uri", :scheme => "https" ) } + let(:uri) { double("uri", :scheme => "https" ) } before do Chef::Provider::RemoteFile::HTTP.should_receive(:new).and_return(fetcher_instance) end @@ -45,7 +45,7 @@ describe Chef::Provider::RemoteFile::Fetcher do end describe "when passed an ftp url" do - let(:uri) { mock("uri", :scheme => "ftp" ) } + let(:uri) { double("uri", :scheme => "ftp" ) } before do Chef::Provider::RemoteFile::FTP.should_receive(:new).and_return(fetcher_instance) end @@ -55,7 +55,7 @@ describe Chef::Provider::RemoteFile::Fetcher do end describe "when passed a file url" do - let(:uri) { mock("uri", :scheme => "file" ) } + let(:uri) { double("uri", :scheme => "file" ) } before do Chef::Provider::RemoteFile::LocalFile.should_receive(:new).and_return(fetcher_instance) end @@ -65,7 +65,7 @@ describe Chef::Provider::RemoteFile::Fetcher do end describe "when passed a url we do not recognize" do - let(:uri) { mock("uri", :scheme => "xyzzy" ) } + let(:uri) { double("uri", :scheme => "xyzzy" ) } it "throws an ArgumentError exception" do lambda { described_class.for_resource(uri, new_resource, current_resource) }.should raise_error(ArgumentError) end diff --git a/spec/unit/provider/remote_file/ftp_spec.rb b/spec/unit/provider/remote_file/ftp_spec.rb index 8dd1ef248e..b393912ef9 100644 --- a/spec/unit/provider/remote_file/ftp_spec.rb +++ b/spec/unit/provider/remote_file/ftp_spec.rb @@ -38,14 +38,14 @@ describe Chef::Provider::RemoteFile::FTP do end let(:ftp) do - ftp = mock(Net::FTP, { }) - ftp.stub!(:connect) - ftp.stub!(:login) - ftp.stub!(:voidcmd) - ftp.stub!(:mtime).and_return(Time.now) - ftp.stub!(:getbinaryfile) - ftp.stub!(:close) - ftp.stub!(:passive=) + ftp = double(Net::FTP, { }) + ftp.stub(:connect) + ftp.stub(:login) + ftp.stub(:voidcmd) + ftp.stub(:mtime).and_return(Time.now) + ftp.stub(:getbinaryfile) + ftp.stub(:close) + ftp.stub(:passive=) ftp end @@ -60,8 +60,8 @@ describe Chef::Provider::RemoteFile::FTP do let(:uri) { URI.parse("ftp://opscode.com/seattle.txt") } before(:each) do - Net::FTP.stub!(:new).with().and_return(ftp) - Tempfile.stub!(:new).and_return(tempfile) + Net::FTP.stub(:new).with().and_return(ftp) + Tempfile.stub(:new).and_return(tempfile) end describe "when first created" do diff --git a/spec/unit/provider/remote_file/http_spec.rb b/spec/unit/provider/remote_file/http_spec.rb index e763a60e6f..951d9f0a05 100644 --- a/spec/unit/provider/remote_file/http_spec.rb +++ b/spec/unit/provider/remote_file/http_spec.rb @@ -159,14 +159,14 @@ describe Chef::Provider::RemoteFile::HTTP do let(:tempfile_path) { "/tmp/chef-mock-tempfile-abc123" } - let(:tempfile) { mock(Tempfile, :path => tempfile_path, :close => nil) } + let(:tempfile) { double(Tempfile, :path => tempfile_path, :close => nil) } let(:last_response) { {} } let(:rest) do - rest = mock(Chef::HTTP::Simple) - rest.stub!(:streaming_request).and_return(tempfile) - rest.stub!(:last_response).and_return(last_response) + rest = double(Chef::HTTP::Simple) + rest.stub(:streaming_request).and_return(tempfile) + rest.stub(:last_response).and_return(last_response) rest end diff --git a/spec/unit/provider/remote_file/local_file_spec.rb b/spec/unit/provider/remote_file/local_file_spec.rb index 00634f50eb..0020a03210 100644 --- a/spec/unit/provider/remote_file/local_file_spec.rb +++ b/spec/unit/provider/remote_file/local_file_spec.rb @@ -40,8 +40,8 @@ describe Chef::Provider::RemoteFile::LocalFile do describe "when fetching the object" do - let(:tempfile) { mock("Tempfile", :path => "/tmp/foo/bar/nyan.png", :close => nil) } - let(:chef_tempfile) { mock("Chef::FileContentManagement::Tempfile", :tempfile => tempfile) } + let(:tempfile) { double("Tempfile", :path => "/tmp/foo/bar/nyan.png", :close => nil) } + let(:chef_tempfile) { double("Chef::FileContentManagement::Tempfile", :tempfile => tempfile) } before do current_resource.source("file:///nyan_cat.png") diff --git a/spec/unit/provider/remote_file_spec.rb b/spec/unit/provider/remote_file_spec.rb index 4562083e7e..3fa3866743 100644 --- a/spec/unit/provider/remote_file_spec.rb +++ b/spec/unit/provider/remote_file_spec.rb @@ -32,7 +32,7 @@ describe Chef::Provider::RemoteFile do end let(:content) do - content = mock('Chef::Provider::File::Content::RemoteFile') + content = double('Chef::Provider::File::Content::RemoteFile') end let(:node) { double('Chef::Node') } diff --git a/spec/unit/provider/route_spec.rb b/spec/unit/provider/route_spec.rb index 863f12641c..2a6d48c79e 100644 --- a/spec/unit/provider/route_spec.rb +++ b/spec/unit/provider/route_spec.rb @@ -55,13 +55,13 @@ describe Chef::Provider::Route do routing_table = "Iface Destination Gateway Flags RefCnt Use Metric Mask MTU Window IRTT\n" + "eth0 0064A8C0 0984A8C0 0003 0 0 0 00FFFFFF 0 0 0\n" route_file = StringIO.new(routing_table) - File.stub!(:open).with("/proc/net/route", "r").and_return(route_file) + File.stub(:open).with("/proc/net/route", "r").and_return(route_file) end it "should set is_running to false when a route is not detected" do resource = Chef::Resource::Route.new('10.10.10.0/24') - resource.stub!(:gateway).and_return("10.0.0.1") - resource.stub!(:device).and_return("eth0") + resource.stub(:gateway).and_return("10.0.0.1") + resource.stub(:device).and_return("eth0") provider = Chef::Provider::Route.new(resource, @run_context) provider.load_current_resource @@ -70,8 +70,8 @@ describe Chef::Provider::Route do it "should detect existing routes and set is_running attribute correctly" do resource = Chef::Resource::Route.new('192.168.100.0/24') - resource.stub!(:gateway).and_return("192.168.132.9") - resource.stub!(:device).and_return("eth0") + resource.stub(:gateway).and_return("192.168.132.9") + resource.stub(:device).and_return("eth0") provider = Chef::Provider::Route.new(resource, @run_context) provider.load_current_resource @@ -80,8 +80,8 @@ describe Chef::Provider::Route do it "should use gateway value when matching routes" do resource = Chef::Resource::Route.new('192.168.100.0/24') - resource.stub!(:gateway).and_return("10.10.10.10") - resource.stub!(:device).and_return("eth0") + resource.stub(:gateway).and_return("10.10.10.10") + resource.stub(:device).and_return("eth0") provider = Chef::Provider::Route.new(resource, @run_context) provider.load_current_resource @@ -92,8 +92,8 @@ describe Chef::Provider::Route do describe Chef::Provider::Route, "action_add" do it "should add the route if it does not exist" do - @provider.stub!(:run_command).and_return(true) - @current_resource.stub!(:gateway).and_return(nil) + @provider.stub(:run_command).and_return(true) + @current_resource.stub(:gateway).and_return(nil) @provider.should_receive(:generate_command).once.with(:add) @provider.should_receive(:generate_config) @provider.run_action(:add) @@ -101,8 +101,8 @@ describe Chef::Provider::Route do end it "should not add the route if it exists" do - @provider.stub!(:run_command).and_return(true) - @provider.stub!(:is_running).and_return(true) + @provider.stub(:run_command).and_return(true) + @provider.stub(:is_running).and_return(true) @provider.should_not_receive(:generate_command).with(:add) @provider.should_receive(:generate_config) @provider.run_action(:add) @@ -116,7 +116,7 @@ describe Chef::Provider::Route do File.should_receive(:new).and_return(route_file) @resource_add = Chef::Resource::Route.new('192.168.1.0/24 via 192.168.0.1') @run_context.resource_collection << @resource_add - @provider.stub!(:run_command).and_return(true) + @provider.stub(:run_command).and_return(true) @resource_add.action(:add) @provider.run_action(:add) @@ -127,16 +127,16 @@ describe Chef::Provider::Route do describe Chef::Provider::Route, "action_delete" do it "should delete the route if it exists" do - @provider.stub!(:run_command).and_return(true) + @provider.stub(:run_command).and_return(true) @provider.should_receive(:generate_command).once.with(:delete) - @provider.stub!(:is_running).and_return(true) + @provider.stub(:is_running).and_return(true) @provider.run_action(:delete) @new_resource.should be_updated end it "should not delete the route if it does not exist" do - @current_resource.stub!(:gateway).and_return(nil) - @provider.stub!(:run_command).and_return(true) + @current_resource.stub(:gateway).and_return(nil) + @provider.stub(:run_command).and_return(true) @provider.should_not_receive(:generate_command).with(:add) @provider.run_action(:delete) @new_resource.should_not be_updated @@ -145,12 +145,12 @@ describe Chef::Provider::Route do describe Chef::Provider::Route, "generate_command for action_add" do it "should include a netmask when a one is specified" do - @new_resource.stub!(:netmask).and_return('255.255.0.0') + @new_resource.stub(:netmask).and_return('255.255.0.0') @provider.generate_command(:add).should match(/\/\d{1,2}\s/) end it "should not include a netmask when a one is specified" do - @new_resource.stub!(:netmask).and_return(nil) + @new_resource.stub(:netmask).and_return(nil) @provider.generate_command(:add).should_not match(/\/\d{1,2}\s/) end @@ -159,19 +159,19 @@ describe Chef::Provider::Route do end it "should not include ' via $gateway ' when a gateway is not specified" do - @new_resource.stub!(:gateway).and_return(nil) + @new_resource.stub(:gateway).and_return(nil) @provider.generate_command(:add).should_not match(/\svia\s#{Regexp.escape(@new_resource.gateway.to_s)}\s/) end end describe Chef::Provider::Route, "generate_command for action_delete" do it "should include a netmask when a one is specified" do - @new_resource.stub!(:netmask).and_return('255.255.0.0') + @new_resource.stub(:netmask).and_return('255.255.0.0') @provider.generate_command(:delete).should match(/\/\d{1,2}\s/) end it "should not include a netmask when a one is specified" do - @new_resource.stub!(:netmask).and_return(nil) + @new_resource.stub(:netmask).and_return(nil) @provider.generate_command(:delete).should_not match(/\/\d{1,2}\s/) end @@ -180,14 +180,14 @@ describe Chef::Provider::Route do end it "should not include ' via $gateway ' when a gateway is not specified" do - @new_resource.stub!(:gateway).and_return(nil) + @new_resource.stub(:gateway).and_return(nil) @provider.generate_command(:delete).should_not match(/\svia\s#{Regexp.escape(@new_resource.gateway.to_s)}\s/) end end describe Chef::Provider::Route, "config_file_contents for action_add" do it "should include a netmask when a one is specified" do - @new_resource.stub!(:netmask).and_return('255.255.0.0') + @new_resource.stub(:netmask).and_return('255.255.0.0') @provider.config_file_contents(:add, { :target => @new_resource.target, :netmask => @new_resource.netmask}).should match(/\/\d{1,2}.*\n$/) end diff --git a/spec/unit/provider/script_spec.rb b/spec/unit/provider/script_spec.rb index 5111a94578..d072eddd04 100644 --- a/spec/unit/provider/script_spec.rb +++ b/spec/unit/provider/script_spec.rb @@ -30,9 +30,9 @@ describe Chef::Provider::Script, "action_run" do @provider = Chef::Provider::Script.new(@new_resource, @run_context) @script_file = StringIO.new - @script_file.stub!(:path).and_return('/tmp/the_script_file') + @script_file.stub(:path).and_return('/tmp/the_script_file') - @provider.stub!(:shell_out!).and_return(true) + @provider.stub(:shell_out!).and_return(true) end it "creates a temporary file to store the script" do @@ -48,15 +48,15 @@ describe Chef::Provider::Script, "action_run" do it "sets the owner and group for the script file" do @new_resource.user 'toor' @new_resource.group 'wheel' - @provider.stub!(:script_file).and_return(@script_file) + @provider.stub(:script_file).and_return(@script_file) FileUtils.should_receive(:chown).with('toor', 'wheel', "/tmp/the_script_file") @provider.set_owner_and_group end context "with the script file set to the correct owner and group" do before do - @provider.stub!(:set_owner_and_group) - @provider.stub!(:script_file).and_return(@script_file) + @provider.stub(:set_owner_and_group) + @provider.stub(:script_file).and_return(@script_file) end describe "when writing the script to the file" do it "should put the contents of the script in the temp file" do diff --git a/spec/unit/provider/service/arch_service_spec.rb b/spec/unit/provider/service/arch_service_spec.rb index 0865fdae86..b267915e44 100644 --- a/spec/unit/provider/service/arch_service_spec.rb +++ b/spec/unit/provider/service/arch_service_spec.rb @@ -39,8 +39,8 @@ describe Chef::Provider::Service::Arch, "load_current_resource" do @provider = Chef::Provider::Service::Arch.new(@new_resource, @run_context) - ::File.stub!(:exists?).with("/etc/rc.conf").and_return(true) - ::File.stub!(:read).with("/etc/rc.conf").and_return("DAEMONS=(network apache sshd)") + ::File.stub(:exists?).with("/etc/rc.conf").and_return(true) + ::File.stub(:read).with("/etc/rc.conf").and_return("DAEMONS=(network apache sshd)") end describe "when first created" do @@ -63,19 +63,19 @@ describe Chef::Provider::Service::Arch, "load_current_resource" do end it "should set running to true if the status command returns 0" do - @provider.stub!(:shell_out).with("/etc/rc.d/chef status").and_return(OpenStruct.new(:exitstatus => 0)) + @provider.stub(:shell_out).with("/etc/rc.d/chef status").and_return(OpenStruct.new(:exitstatus => 0)) @provider.load_current_resource @provider.current_resource.running.should be_true end it "should set running to false if the status command returns anything except 0" do - @provider.stub!(:shell_out).with("/etc/rc.d/chef status").and_return(OpenStruct.new(:exitstatus => 1)) + @provider.stub(:shell_out).with("/etc/rc.d/chef status").and_return(OpenStruct.new(:exitstatus => 1)) @provider.load_current_resource @provider.current_resource.running.should be_false end it "should set running to false if the status command raises" do - @provider.stub!(:shell_out).with("/etc/rc.d/chef status").and_raise(Mixlib::ShellOut::ShellCommandFailed) + @provider.stub(:shell_out).with("/etc/rc.d/chef status").and_raise(Mixlib::ShellOut::ShellCommandFailed) @provider.load_current_resource @provider.current_resource.running.should be_false end @@ -111,12 +111,12 @@ describe Chef::Provider::Service::Arch, "load_current_resource" do it "should fail if file /etc/rc.conf does not exist" do - ::File.stub!(:exists?).with("/etc/rc.conf").and_return(false) + ::File.stub(:exists?).with("/etc/rc.conf").and_return(false) lambda { @provider.load_current_resource }.should raise_error(Chef::Exceptions::Service) end it "should fail if file /etc/rc.conf does not contain DAEMONS array" do - ::File.stub!(:read).with("/etc/rc.conf").and_return("") + ::File.stub(:read).with("/etc/rc.conf").and_return("") lambda { @provider.load_current_resource }.should raise_error(Chef::Exceptions::Service) end @@ -127,8 +127,8 @@ aj 7842 5057 0 21:26 pts/2 00:00:06 vi init.rb aj 7903 5016 0 21:26 pts/5 00:00:00 /bin/bash aj 8119 6041 0 21:34 pts/3 00:00:03 vi init_service_spec.rb DEFAULT_PS - @status = mock("Status", :exitstatus => 0, :stdout => @stdout) - @provider.stub!(:shell_out!).and_return(@status) + @status = double("Status", :exitstatus => 0, :stdout => @stdout) + @provider.stub(:shell_out!).and_return(@status) @node.automatic_attrs[:command] = {:ps => "ps -ef"} end @@ -138,19 +138,19 @@ DEFAULT_PS aj 7842 5057 0 21:26 pts/2 00:00:06 chef aj 7842 5057 0 21:26 pts/2 00:00:06 poos RUNNING_PS - @status.stub!(:stdout).and_return(@stdout) + @status.stub(:stdout).and_return(@stdout) @provider.load_current_resource @provider.current_resource.running.should be_true end it "determines the service is not running when it does not appear in ps" do - @provider.stub!(:shell_out!).and_return(@status) + @provider.stub(:shell_out!).and_return(@status) @provider.load_current_resource @provider.current_resource.running.should be_false end it "should raise an exception if ps fails" do - @provider.stub!(:shell_out!).and_raise(Mixlib::ShellOut::ShellCommandFailed) + @provider.stub(:shell_out!).and_raise(Mixlib::ShellOut::ShellCommandFailed) @provider.load_current_resource @provider.action = :start @provider.define_resource_requirements @@ -159,7 +159,7 @@ RUNNING_PS end it "should return existing entries in DAEMONS array" do - ::File.stub!(:read).with("/etc/rc.conf").and_return("DAEMONS=(network !apache ssh)") + ::File.stub(:read).with("/etc/rc.conf").and_return("DAEMONS=(network !apache ssh)") @provider.daemons.should == ['network', '!apache', 'ssh'] end @@ -171,20 +171,20 @@ RUNNING_PS describe Chef::Provider::Service::Arch, "enable_service" do # before(:each) do - # @new_resource = mock("Chef::Resource::Service", + # @new_resource = double("Chef::Resource::Service", # :null_object => true, # :name => "chef", # :service_name => "chef", # :running => false # ) - # @new_resource.stub!(:start_command).and_return(false) + # @new_resource.stub(:start_command).and_return(false) # # @provider = Chef::Provider::Service::Arch.new(@node, @new_resource) - # Chef::Resource::Service.stub!(:new).and_return(@current_resource) + # Chef::Resource::Service.stub(:new).and_return(@current_resource) # end it "should add chef to DAEMONS array" do - ::File.stub!(:read).with("/etc/rc.conf").and_return("DAEMONS=(network)") + ::File.stub(:read).with("/etc/rc.conf").and_return("DAEMONS=(network)") @provider.should_receive(:update_daemons).with(['network', 'chef']) @provider.enable_service() end @@ -192,20 +192,20 @@ RUNNING_PS describe Chef::Provider::Service::Arch, "disable_service" do # before(:each) do - # @new_resource = mock("Chef::Resource::Service", + # @new_resource = double("Chef::Resource::Service", # :null_object => true, # :name => "chef", # :service_name => "chef", # :running => false # ) - # @new_resource.stub!(:start_command).and_return(false) + # @new_resource.stub(:start_command).and_return(false) # # @provider = Chef::Provider::Service::Arch.new(@node, @new_resource) - # Chef::Resource::Service.stub!(:new).and_return(@current_resource) + # Chef::Resource::Service.stub(:new).and_return(@current_resource) # end it "should remove chef from DAEMONS array" do - ::File.stub!(:read).with("/etc/rc.conf").and_return("DAEMONS=(network chef)") + ::File.stub(:read).with("/etc/rc.conf").and_return("DAEMONS=(network chef)") @provider.should_receive(:update_daemons).with(['network', '!chef']) @provider.disable_service() end @@ -214,20 +214,20 @@ RUNNING_PS describe Chef::Provider::Service::Arch, "start_service" do # before(:each) do - # @new_resource = mock("Chef::Resource::Service", + # @new_resource = double("Chef::Resource::Service", # :null_object => true, # :name => "chef", # :service_name => "chef", # :running => false # ) - # @new_resource.stub!(:start_command).and_return(false) + # @new_resource.stub(:start_command).and_return(false) # # @provider = Chef::Provider::Service::Arch.new(@node, @new_resource) - # Chef::Resource::Service.stub!(:new).and_return(@current_resource) + # Chef::Resource::Service.stub(:new).and_return(@current_resource) # end it "should call the start command if one is specified" do - @new_resource.stub!(:start_command).and_return("/etc/rc.d/chef startyousillysally") + @new_resource.stub(:start_command).and_return("/etc/rc.d/chef startyousillysally") @provider.should_receive(:shell_out!).with("/etc/rc.d/chef startyousillysally") @provider.start_service() end @@ -240,20 +240,20 @@ RUNNING_PS describe Chef::Provider::Service::Arch, "stop_service" do # before(:each) do - # @new_resource = mock("Chef::Resource::Service", + # @new_resource = double("Chef::Resource::Service", # :null_object => true, # :name => "chef", # :service_name => "chef", # :running => false # ) - # @new_resource.stub!(:stop_command).and_return(false) + # @new_resource.stub(:stop_command).and_return(false) # # @provider = Chef::Provider::Service::Arch.new(@node, @new_resource) - # Chef::Resource::Service.stub!(:new).and_return(@current_resource) + # Chef::Resource::Service.stub(:new).and_return(@current_resource) # end it "should call the stop command if one is specified" do - @new_resource.stub!(:stop_command).and_return("/etc/rc.d/chef itoldyoutostop") + @new_resource.stub(:stop_command).and_return("/etc/rc.d/chef itoldyoutostop") @provider.should_receive(:shell_out!).with("/etc/rc.d/chef itoldyoutostop") @provider.stop_service() end @@ -266,27 +266,27 @@ RUNNING_PS describe Chef::Provider::Service::Arch, "restart_service" do # before(:each) do - # @new_resource = mock("Chef::Resource::Service", + # @new_resource = double("Chef::Resource::Service", # :null_object => true, # :name => "chef", # :service_name => "chef", # :running => false # ) - # @new_resource.stub!(:restart_command).and_return(false) - # @new_resource.stub!(:supports).and_return({:restart => false}) + # @new_resource.stub(:restart_command).and_return(false) + # @new_resource.stub(:supports).and_return({:restart => false}) # # @provider = Chef::Provider::Service::Arch.new(@node, @new_resource) - # Chef::Resource::Service.stub!(:new).and_return(@current_resource) + # Chef::Resource::Service.stub(:new).and_return(@current_resource) # end it "should call 'restart' on the service_name if the resource supports it" do - @new_resource.stub!(:supports).and_return({:restart => true}) + @new_resource.stub(:supports).and_return({:restart => true}) @provider.should_receive(:shell_out!).with("/etc/rc.d/#{@new_resource.service_name} restart") @provider.restart_service() end it "should call the restart_command if one has been specified" do - @new_resource.stub!(:restart_command).and_return("/etc/rc.d/chef restartinafire") + @new_resource.stub(:restart_command).and_return("/etc/rc.d/chef restartinafire") @provider.should_receive(:shell_out!).with("/etc/rc.d/#{@new_resource.service_name} restartinafire") @provider.restart_service() end @@ -301,27 +301,27 @@ RUNNING_PS describe Chef::Provider::Service::Arch, "reload_service" do # before(:each) do - # @new_resource = mock("Chef::Resource::Service", + # @new_resource = double("Chef::Resource::Service", # :null_object => true, # :name => "chef", # :service_name => "chef", # :running => false # ) - # @new_resource.stub!(:reload_command).and_return(false) - # @new_resource.stub!(:supports).and_return({:reload => false}) + # @new_resource.stub(:reload_command).and_return(false) + # @new_resource.stub(:supports).and_return({:reload => false}) # # @provider = Chef::Provider::Service::Arch.new(@node, @new_resource) - # Chef::Resource::Service.stub!(:new).and_return(@current_resource) + # Chef::Resource::Service.stub(:new).and_return(@current_resource) # end it "should call 'reload' on the service if it supports it" do - @new_resource.stub!(:supports).and_return({:reload => true}) + @new_resource.stub(:supports).and_return({:reload => true}) @provider.should_receive(:shell_out!).with("/etc/rc.d/#{@new_resource.service_name} reload") @provider.reload_service() end it "should should run the user specified reload command if one is specified and the service doesn't support reload" do - @new_resource.stub!(:reload_command).and_return("/etc/rc.d/chef lollerpants") + @new_resource.stub(:reload_command).and_return("/etc/rc.d/chef lollerpants") @provider.should_receive(:shell_out!).with("/etc/rc.d/#{@new_resource.service_name} lollerpants") @provider.reload_service() end diff --git a/spec/unit/provider/service/debian_service_spec.rb b/spec/unit/provider/service/debian_service_spec.rb index 7d05b403de..567eb6744a 100644 --- a/spec/unit/provider/service/debian_service_spec.rb +++ b/spec/unit/provider/service/debian_service_spec.rb @@ -46,7 +46,7 @@ describe Chef::Provider::Service::Debian do context "when update-rc.d shows init linked to rc*.d/" do before do - @provider.stub!(:assert_update_rcd_available) + @provider.stub(:assert_update_rcd_available) result = <<-UPDATE_RC_D_SUCCESS Removing any system startup links for /etc/init.d/chef ... @@ -61,9 +61,9 @@ describe Chef::Provider::Service::Debian do @stdout = StringIO.new(result) @stderr = StringIO.new - @status = mock("Status", :exitstatus => 0, :stdout => @stdout) - @provider.stub!(:shell_out!).and_return(@status) - @provider.stub!(:popen4).and_yield(@pid, @stdin, @stdout, @stderr).and_return(@status) + @status = double("Status", :exitstatus => 0, :stdout => @stdout) + @provider.stub(:shell_out!).and_return(@status) + @provider.stub(:popen4).and_yield(@pid, @stdin, @stdout, @stderr).and_return(@status) end it "says the service is enabled" do @@ -71,7 +71,7 @@ describe Chef::Provider::Service::Debian do end it "stores the 'enabled' state" do - Chef::Resource::Service.stub!(:new).and_return(@current_resource) + Chef::Resource::Service.stub(:new).and_return(@current_resource) @provider.load_current_resource.should equal(@current_resource) @current_resource.enabled.should be_true end @@ -79,14 +79,14 @@ describe Chef::Provider::Service::Debian do context "when update-rc.d shows init isn't linked to rc*.d/" do before do - @provider.stub!(:assert_update_rcd_available) - @status = mock("Status", :exitstatus => 0) + @provider.stub(:assert_update_rcd_available) + @status = double("Status", :exitstatus => 0) @stdout = StringIO.new( " Removing any system startup links for /etc/init.d/chef ...") @stderr = StringIO.new - @status = mock("Status", :exitstatus => 0, :stdout => @stdout) - @provider.stub!(:shell_out!).and_return(@status) - @provider.stub!(:popen4).and_yield(@pid, @stdin, @stdout, @stderr).and_return(@status) + @status = double("Status", :exitstatus => 0, :stdout => @stdout) + @provider.stub(:shell_out!).and_return(@status) + @provider.stub(:popen4).and_yield(@pid, @stdin, @stdout, @stderr).and_return(@status) end it "says the service is disabled" do @@ -94,7 +94,7 @@ describe Chef::Provider::Service::Debian do end it "stores the 'disabled' state" do - Chef::Resource::Service.stub!(:new).and_return(@current_resource) + Chef::Resource::Service.stub(:new).and_return(@current_resource) @provider.load_current_resource.should equal(@current_resource) @current_resource.enabled.should be_false end @@ -102,8 +102,8 @@ describe Chef::Provider::Service::Debian do context "when update-rc.d fails" do before do - @status = mock("Status", :exitstatus => -1) - @provider.stub!(:popen4).and_return(@status) + @status = double("Status", :exitstatus => -1) + @provider.stub(:popen4).and_return(@status) end it "raises an error" do @@ -196,13 +196,13 @@ insserv: dryrun, not creating .depend.boot, .depend.start, and .depend.stop context "on #{model}" do context "when update-rc.d shows init linked to rc*.d/" do before do - @provider.stub!(:assert_update_rcd_available) + @provider.stub(:assert_update_rcd_available) @stdout = StringIO.new(expected_results["linked"]["stdout"]) @stderr = StringIO.new(expected_results["linked"]["stderr"]) - @status = mock("Status", :exitstatus => 0, :stdout => @stdout) - @provider.stub!(:shell_out!).and_return(@status) - @provider.stub!(:popen4).and_yield(@pid, @stdin, @stdout, @stderr).and_return(@status) + @status = double("Status", :exitstatus => 0, :stdout => @stdout) + @provider.stub(:shell_out!).and_return(@status) + @provider.stub(:popen4).and_yield(@pid, @stdin, @stdout, @stderr).and_return(@status) end it "says the service is enabled" do @@ -210,7 +210,7 @@ insserv: dryrun, not creating .depend.boot, .depend.start, and .depend.stop end it "stores the 'enabled' state" do - Chef::Resource::Service.stub!(:new).and_return(@current_resource) + Chef::Resource::Service.stub(:new).and_return(@current_resource) @provider.load_current_resource.should equal(@current_resource) @current_resource.enabled.should be_true end @@ -223,12 +223,12 @@ insserv: dryrun, not creating .depend.boot, .depend.start, and .depend.stop context "when update-rc.d shows init isn't linked to rc*.d/" do before do - @provider.stub!(:assert_update_rcd_available) + @provider.stub(:assert_update_rcd_available) @stdout = StringIO.new(expected_results["not linked"]["stdout"]) @stderr = StringIO.new(expected_results["not linked"]["stderr"]) - @status = mock("Status", :exitstatus => 0, :stdout => @stdout) - @provider.stub!(:shell_out!).and_return(@status) - @provider.stub!(:popen4).and_yield(@pid, @stdin, @stdout, @stderr).and_return(@status) + @status = double("Status", :exitstatus => 0, :stdout => @stdout) + @provider.stub(:shell_out!).and_return(@status) + @provider.stub(:popen4).and_yield(@pid, @stdin, @stdout, @stderr).and_return(@status) end it "says the service is disabled" do @@ -236,7 +236,7 @@ insserv: dryrun, not creating .depend.boot, .depend.start, and .depend.stop end it "stores the 'disabled' state" do - Chef::Resource::Service.stub!(:new).and_return(@current_resource) + Chef::Resource::Service.stub(:new).and_return(@current_resource) @provider.load_current_resource.should equal(@current_resource) @current_resource.enabled.should be_false end diff --git a/spec/unit/provider/service/freebsd_service_spec.rb b/spec/unit/provider/service/freebsd_service_spec.rb index 7861764309..820dfb8dc7 100644 --- a/spec/unit/provider/service/freebsd_service_spec.rb +++ b/spec/unit/provider/service/freebsd_service_spec.rb @@ -34,7 +34,7 @@ describe Chef::Provider::Service::Freebsd do @provider = Chef::Provider::Service::Freebsd.new(@new_resource,@run_context) @provider.action = :start @init_command = "/usr/local/etc/rc.d/apache22" - Chef::Resource::Service.stub!(:new).and_return(@current_resource) + Chef::Resource::Service.stub(:new).and_return(@current_resource) end describe "load_current_resource" do @@ -44,21 +44,21 @@ describe Chef::Provider::Service::Freebsd do 539 ?? Is 0:00.14 /usr/sbin/sshd 545 ?? Ss 0:17.53 sendmail: accepting connections (sendmail) PS_SAMPLE - @status = mock(:stdout => @stdout, :exitstatus => 0) - @provider.stub!(:shell_out!).with(@node[:command][:ps]).and_return(@status) + @status = double(:stdout => @stdout, :exitstatus => 0) + @provider.stub(:shell_out!).with(@node[:command][:ps]).and_return(@status) - ::File.stub!(:exists?).and_return(false) - ::File.stub!(:exists?).with("/usr/local/etc/rc.d/#{@new_resource.service_name}").and_return(true) - @lines = mock("lines") - @lines.stub!(:each).and_yield("sshd_enable=\"YES\""). + ::File.stub(:exists?).and_return(false) + ::File.stub(:exists?).with("/usr/local/etc/rc.d/#{@new_resource.service_name}").and_return(true) + @lines = double("lines") + @lines.stub(:each).and_yield("sshd_enable=\"YES\""). and_yield("#{@new_resource.name}_enable=\"YES\"") - ::File.stub!(:open).and_return(@lines) + ::File.stub(:open).and_return(@lines) @rc_with_name = StringIO.new(<<-RC_SAMPLE) name="apache22" rcvar=`set_rcvar` RC_SAMPLE - ::File.stub!(:open).with("/usr/local/etc/rc.d/#{@new_resource.service_name}").and_return(@rc_with_name) + ::File.stub(:open).with("/usr/local/etc/rc.d/#{@new_resource.service_name}").and_return(@rc_with_name) @provider.stub(:service_enable_variable_name).and_return nil end @@ -75,7 +75,7 @@ RC_SAMPLE it "should not raise an exception if the rcscript have a name variable" do @provider.load_current_resource - lambda { @provider.service_enable_variable_name }.should_not raise_error(Chef::Exceptions::Service) + lambda { @provider.service_enable_variable_name }.should_not raise_error end describe "when the service supports status" do @@ -129,14 +129,14 @@ RC_SAMPLE describe "when executing assertions" do it "should verify that /etc/rc.conf exists" do ::File.should_receive(:exists?).with("/etc/rc.conf") - @provider.stub!(:service_enable_variable_name).and_return("#{@current_resource.service_name}_enable") + @provider.stub(:service_enable_variable_name).and_return("#{@current_resource.service_name}_enable") @provider.load_current_resource end context "and the init script is not found" do [ "start", "reload", "restart", "enable" ].each do |action| it "should raise an exception when the action is #{action}" do - ::File.stub!(:exists?).and_return(false) + ::File.stub(:exists?).and_return(false) @provider.load_current_resource @provider.define_resource_requirements @provider.instance_variable_get("@rcd_script_found").should be_false @@ -160,7 +160,7 @@ RC_SAMPLE end it "update state when current resource enabled state could be determined" do - ::File.stub!(:exist?).with("/usr/local/etc/rc.d/#{@new_resource.service_name}").and_return(true) + ::File.stub(:exist?).with("/usr/local/etc/rc.d/#{@new_resource.service_name}").and_return(true) ::File.should_receive(:exists?).with("/etc/rc.conf").and_return true @provider.load_current_resource @provider.instance_variable_get("@enabled_state_found").should be_false @@ -189,26 +189,26 @@ RC_SAMPLE end it "should read stdout of the ps command" do - @provider.stub!(:shell_out!).and_return(@status) + @provider.stub(:shell_out!).and_return(@status) @stdout.should_receive(:each_line).and_return(true) @provider.load_current_resource end it "should set running to true if the regex matches the output" do - @stdout.stub!(:each_line).and_yield("555 ?? Ss 0:05.16 /usr/sbin/cron -s"). + @stdout.stub(:each_line).and_yield("555 ?? Ss 0:05.16 /usr/sbin/cron -s"). and_yield(" 9881 ?? Ss 0:06.67 /usr/local/sbin/httpd -DNOHTTPACCEPT") @provider.load_current_resource @current_resource.running.should be_true end it "should set running to false if the regex doesn't match" do - @provider.stub!(:shell_out!).and_return(@status) + @provider.stub(:shell_out!).and_return(@status) @provider.load_current_resource @current_resource.running.should be_false end it "should raise an exception if ps fails" do - @provider.stub!(:shell_out!).and_raise(Mixlib::ShellOut::ShellCommandFailed) + @provider.stub(:shell_out!).and_raise(Mixlib::ShellOut::ShellCommandFailed) @provider.load_current_resource @provider.define_resource_requirements lambda { @provider.process_resource_requirements }.should raise_error(Chef::Exceptions::Service) @@ -270,7 +270,7 @@ RC_SAMPLE @rc_without_name = StringIO.new(<<-RC_SAMPLE) rcvar=`set_rcvar` RC_SAMPLE - ::File.stub!(:open).with("/usr/local/etc/rc.d/#{@current_resource.service_name}").and_return(@rc_with_noname) + ::File.stub(:open).with("/usr/local/etc/rc.d/#{@current_resource.service_name}").and_return(@rc_with_noname) @provider.current_resource = @current_resource end @@ -282,19 +282,19 @@ RC_SAMPLE # #{@current_resource.service_name}_enable="YES" # (default: "") RCVAR_SAMPLE - @status = mock(:stdout => @rcvar_stdout, :exitstatus => 0) - @provider.stub!(:shell_out!).with("/usr/local/etc/rc.d/#{@current_resource.service_name} rcvar").and_return(@status) + @status = double(:stdout => @rcvar_stdout, :exitstatus => 0) + @provider.stub(:shell_out!).with("/usr/local/etc/rc.d/#{@current_resource.service_name} rcvar").and_return(@status) end it "should get the service name from rcvar if the rcscript does not have a name variable" do @provider.load_current_resource - @provider.unstub!(:service_enable_variable_name) + @provider.unstub(:service_enable_variable_name) @provider.service_enable_variable_name.should == "#{@current_resource.service_name}_enable" end it "should not raise an exception if the rcscript does not have a name variable" do @provider.load_current_resource - lambda { @provider.service_enable_variable_name }.should_not raise_error(Chef::Exceptions::Service) + lambda { @provider.service_enable_variable_name }.should_not raise_error end end @@ -304,8 +304,8 @@ RCVAR_SAMPLE # service_with_noname # RCVAR_SAMPLE - @status = mock(:stdout => @rcvar_stdout, :exitstatus => 0) - @provider.stub!(:shell_out!).with("/usr/local/etc/rc.d/#{@current_resource.service_name} rcvar").and_return(@status) + @status = double(:stdout => @rcvar_stdout, :exitstatus => 0) + @provider.stub(:shell_out!).with("/usr/local/etc/rc.d/#{@current_resource.service_name} rcvar").and_return(@status) end [ "start", "reload", "restart", "enable" ].each do |action| @@ -319,11 +319,11 @@ RCVAR_SAMPLE [ "stop", "disable" ].each do |action| it "should not raise an error when the action is #{action}" do - ::File.stub!(:exist?).with("/usr/local/etc/rc.d/#{@new_resource.service_name}").and_return(true) + ::File.stub(:exist?).with("/usr/local/etc/rc.d/#{@new_resource.service_name}").and_return(true) @provider.action = action @provider.load_current_resource @provider.define_resource_requirements - lambda { @provider.process_resource_requirements }.should_not raise_error(Chef::Exceptions::Service) + lambda { @provider.process_resource_requirements }.should_not raise_error end end end @@ -333,25 +333,25 @@ RCVAR_SAMPLE describe Chef::Provider::Service::Freebsd, "enable_service" do before do @provider.current_resource = @current_resource - @provider.stub!(:service_enable_variable_name).and_return("#{@current_resource.service_name}_enable") + @provider.stub(:service_enable_variable_name).and_return("#{@current_resource.service_name}_enable") end it "should enable the service if it is not enabled" do - @current_resource.stub!(:enabled).and_return(false) + @current_resource.stub(:enabled).and_return(false) @provider.should_receive(:read_rc_conf).and_return([ "foo", "#{@current_resource.service_name}_enable=\"NO\"", "bar" ]) @provider.should_receive(:write_rc_conf).with(["foo", "bar", "#{@current_resource.service_name}_enable=\"YES\""]) @provider.enable_service() end it "should enable the service if it is not enabled and not already specified in the rc.conf file" do - @current_resource.stub!(:enabled).and_return(false) + @current_resource.stub(:enabled).and_return(false) @provider.should_receive(:read_rc_conf).and_return([ "foo", "bar" ]) @provider.should_receive(:write_rc_conf).with(["foo", "bar", "#{@current_resource.service_name}_enable=\"YES\""]) @provider.enable_service() end it "should not enable the service if it is already enabled" do - @current_resource.stub!(:enabled).and_return(true) + @current_resource.stub(:enabled).and_return(true) @provider.should_not_receive(:write_rc_conf) @provider.enable_service end @@ -360,18 +360,18 @@ RCVAR_SAMPLE describe Chef::Provider::Service::Freebsd, "disable_service" do before do @provider.current_resource = @current_resource - @provider.stub!(:service_enable_variable_name).and_return("#{@current_resource.service_name}_enable") + @provider.stub(:service_enable_variable_name).and_return("#{@current_resource.service_name}_enable") end it "should should disable the service if it is not disabled" do - @current_resource.stub!(:enabled).and_return(true) + @current_resource.stub(:enabled).and_return(true) @provider.should_receive(:read_rc_conf).and_return([ "foo", "#{@current_resource.service_name}_enable=\"YES\"", "bar" ]) @provider.should_receive(:write_rc_conf).with(["foo", "bar", "#{@current_resource.service_name}_enable=\"NO\""]) @provider.disable_service() end it "should not disable the service if it is already disabled" do - @current_resource.stub!(:enabled).and_return(false) + @current_resource.stub(:enabled).and_return(false) @provider.should_not_receive(:write_rc_conf) @provider.disable_service() end diff --git a/spec/unit/provider/service/gentoo_service_spec.rb b/spec/unit/provider/service/gentoo_service_spec.rb index b658cab4d8..95dc04108d 100644 --- a/spec/unit/provider/service/gentoo_service_spec.rb +++ b/spec/unit/provider/service/gentoo_service_spec.rb @@ -29,13 +29,13 @@ describe Chef::Provider::Service::Gentoo do @current_resource = Chef::Resource::Service.new("chef") @provider = Chef::Provider::Service::Gentoo.new(@new_resource, @run_context) - Chef::Resource::Service.stub!(:new).and_return(@current_resource) - @status = mock("Status", :exitstatus => 0, :stdout => @stdout) - @provider.stub!(:shell_out).and_return(@status) - File.stub!(:exists?).with("/etc/init.d/chef").and_return(true) - File.stub!(:exists?).with("/sbin/rc-update").and_return(true) - File.stub!(:exists?).with("/etc/runlevels/default/chef").and_return(false) - File.stub!(:readable?).with("/etc/runlevels/default/chef").and_return(false) + Chef::Resource::Service.stub(:new).and_return(@current_resource) + @status = double("Status", :exitstatus => 0, :stdout => @stdout) + @provider.stub(:shell_out).and_return(@status) + File.stub(:exists?).with("/etc/init.d/chef").and_return(true) + File.stub(:exists?).with("/sbin/rc-update").and_return(true) + File.stub(:exists?).with("/etc/runlevels/default/chef").and_return(false) + File.stub(:readable?).with("/etc/runlevels/default/chef").and_return(false) end # new test: found_enabled state # @@ -52,7 +52,7 @@ describe Chef::Provider::Service::Gentoo do end it "should track when service file is found in /etc/runlevels/**/" do - Dir.stub!(:glob).with("/etc/runlevels/**/chef").and_return(["/etc/runlevels/default/chef"]) + Dir.stub(:glob).with("/etc/runlevels/**/chef").and_return(["/etc/runlevels/default/chef"]) @provider.load_current_resource @provider.instance_variable_get("@found_script").should be_true end @@ -60,13 +60,13 @@ describe Chef::Provider::Service::Gentoo do describe "when detecting the service enable state" do describe "and the glob returns a default service script file" do before do - Dir.stub!(:glob).with("/etc/runlevels/**/chef").and_return(["/etc/runlevels/default/chef"]) + Dir.stub(:glob).with("/etc/runlevels/**/chef").and_return(["/etc/runlevels/default/chef"]) end describe "and the file exists and is readable" do before do - File.stub!(:exists?).with("/etc/runlevels/default/chef").and_return(true) - File.stub!(:readable?).with("/etc/runlevels/default/chef").and_return(true) + File.stub(:exists?).with("/etc/runlevels/default/chef").and_return(true) + File.stub(:readable?).with("/etc/runlevels/default/chef").and_return(true) end it "should set enabled to true" do @provider.load_current_resource @@ -76,8 +76,8 @@ describe Chef::Provider::Service::Gentoo do describe "and the file exists but is not readable" do before do - File.stub!(:exists?).with("/etc/runlevels/default/chef").and_return(true) - File.stub!(:readable?).with("/etc/runlevels/default/chef").and_return(false) + File.stub(:exists?).with("/etc/runlevels/default/chef").and_return(true) + File.stub(:readable?).with("/etc/runlevels/default/chef").and_return(false) end it "should set enabled to false" do @@ -88,8 +88,8 @@ describe Chef::Provider::Service::Gentoo do describe "and the file does not exist" do before do - File.stub!(:exists?).with("/etc/runlevels/default/chef").and_return(false) - File.stub!(:readable?).with("/etc/runlevels/default/chef").and_return("foobarbaz") + File.stub(:exists?).with("/etc/runlevels/default/chef").and_return(false) + File.stub(:readable?).with("/etc/runlevels/default/chef").and_return("foobarbaz") end it "should set enabled to false" do @@ -124,7 +124,7 @@ describe Chef::Provider::Service::Gentoo do end describe "action_methods" do - before(:each) { @provider.stub!(:load_current_resource).and_return(@current_resource) } + before(:each) { @provider.stub(:load_current_resource).and_return(@current_resource) } describe Chef::Provider::Service::Gentoo, "enable_service" do it "should call rc-update add *service* default" do diff --git a/spec/unit/provider/service/init_service_spec.rb b/spec/unit/provider/service/init_service_spec.rb index c7d47e6281..ad887c84a5 100644 --- a/spec/unit/provider/service/init_service_spec.rb +++ b/spec/unit/provider/service/init_service_spec.rb @@ -30,15 +30,15 @@ describe Chef::Provider::Service::Init, "load_current_resource" do @current_resource = Chef::Resource::Service.new("chef") @provider = Chef::Provider::Service::Init.new(@new_resource, @run_context) - Chef::Resource::Service.stub!(:new).and_return(@current_resource) + Chef::Resource::Service.stub(:new).and_return(@current_resource) @stdout = StringIO.new(<<-PS) aj 7842 5057 0 21:26 pts/2 00:00:06 vi init.rb aj 7903 5016 0 21:26 pts/5 00:00:00 /bin/bash aj 8119 6041 0 21:34 pts/3 00:00:03 vi init_service_spec.rb PS - @status = mock("Status", :exitstatus => 0, :stdout => @stdout) - @provider.stub!(:shell_out!).and_return(@status) + @status = double("Status", :exitstatus => 0, :stdout => @stdout) + @provider.stub(:shell_out!).and_return(@status) end it "should create a current resource with the name of the new resource" do @@ -62,20 +62,20 @@ PS end it "should set running to true if the status command returns 0" do - @provider.stub!(:shell_out).with("/etc/init.d/#{@current_resource.service_name} status").and_return(@status) + @provider.stub(:shell_out).with("/etc/init.d/#{@current_resource.service_name} status").and_return(@status) @provider.load_current_resource @current_resource.running.should be_true end it "should set running to false if the status command returns anything except 0" do - @status.stub!(:exitstatus).and_return(1) - @provider.stub!(:shell_out).with("/etc/init.d/#{@current_resource.service_name} status").and_return(@status) + @status.stub(:exitstatus).and_return(1) + @provider.stub(:shell_out).with("/etc/init.d/#{@current_resource.service_name} status").and_return(@status) @provider.load_current_resource @current_resource.running.should be_false end it "should set running to false if the status command raises" do - @provider.stub!(:shell_out).and_raise(Mixlib::ShellOut::ShellCommandFailed) + @provider.stub(:shell_out).and_raise(Mixlib::ShellOut::ShellCommandFailed) @provider.load_current_resource @current_resource.running.should be_false end @@ -83,7 +83,7 @@ PS describe "when a status command has been specified" do before do - @new_resource.stub!(:status_command).and_return("/etc/init.d/chefhasmonkeypants status") + @new_resource.stub(:status_command).and_return("/etc/init.d/chefhasmonkeypants status") end it "should run the services status command if one has been specified" do @@ -95,7 +95,7 @@ PS describe "when an init command has been specified" do before do - @new_resource.stub!(:init_command).and_return("/opt/chef-server/service/erchef") + @new_resource.stub(:init_command).and_return("/opt/chef-server/service/erchef") @provider = Chef::Provider::Service::Init.new(@new_resource, @run_context) end @@ -138,19 +138,19 @@ PS aj 7842 5057 0 21:26 pts/2 00:00:06 chef aj 7842 5057 0 21:26 pts/2 00:00:06 poos RUNNING_PS - @status.stub!(:stdout).and_return(@stdout) + @status.stub(:stdout).and_return(@stdout) @provider.load_current_resource @current_resource.running.should be_true end it "should set running to false if the regex doesn't match" do - @provider.stub!(:shell_out!).and_return(@status) + @provider.stub(:shell_out!).and_return(@status) @provider.load_current_resource @current_resource.running.should be_false end it "should raise an exception if ps fails" do - @provider.stub!(:shell_out!).and_raise(Mixlib::ShellOut::ShellCommandFailed) + @provider.stub(:shell_out!).and_raise(Mixlib::ShellOut::ShellCommandFailed) @provider.load_current_resource @provider.action = :start @provider.define_resource_requirements @@ -229,7 +229,7 @@ RUNNING_PS end it "should still pass all why run assertions" do - lambda { @provider.run_action(:start) }.should_not raise_error(Chef::Exceptions::Service) + lambda { @provider.run_action(:start) }.should_not raise_error end end end diff --git a/spec/unit/provider/service/insserv_service_spec.rb b/spec/unit/provider/service/insserv_service_spec.rb index 8b5f09e78c..04e63458a0 100644 --- a/spec/unit/provider/service/insserv_service_spec.rb +++ b/spec/unit/provider/service/insserv_service_spec.rb @@ -29,14 +29,14 @@ describe Chef::Provider::Service::Insserv do @current_resource = Chef::Resource::Service.new("initgrediant") @provider = Chef::Provider::Service::Insserv.new(@new_resource, @run_context) - @status = mock("Process::Status mock", :exitstatus => 0, :stdout => "") - @provider.stub!(:shell_out!).and_return(@status) + @status = double("Process::Status mock", :exitstatus => 0, :stdout => "") + @provider.stub(:shell_out!).and_return(@status) end describe "load_current_resource" do describe "when startup links exist" do before do - Dir.stub!(:glob).with("/etc/rc**/S*initgrediant").and_return(["/etc/rc5.d/S18initgrediant", "/etc/rc2.d/S18initgrediant", "/etc/rc4.d/S18initgrediant", "/etc/rc3.d/S18initgrediant"]) + Dir.stub(:glob).with("/etc/rc**/S*initgrediant").and_return(["/etc/rc5.d/S18initgrediant", "/etc/rc2.d/S18initgrediant", "/etc/rc4.d/S18initgrediant", "/etc/rc3.d/S18initgrediant"]) end it "sets the current enabled status to true" do @@ -47,7 +47,7 @@ describe Chef::Provider::Service::Insserv do describe "when startup links do not exist" do before do - Dir.stub!(:glob).with("/etc/rc**/S*initgrediant").and_return([]) + Dir.stub(:glob).with("/etc/rc**/S*initgrediant").and_return([]) end it "sets the current enabled status to false" do diff --git a/spec/unit/provider/service/invokercd_service_spec.rb b/spec/unit/provider/service/invokercd_service_spec.rb index ca20657405..b638b08b72 100644 --- a/spec/unit/provider/service/invokercd_service_spec.rb +++ b/spec/unit/provider/service/invokercd_service_spec.rb @@ -30,15 +30,15 @@ describe Chef::Provider::Service::Invokercd, "load_current_resource" do @current_resource = Chef::Resource::Service.new("chef") @provider = Chef::Provider::Service::Invokercd.new(@new_resource, @run_context) - Chef::Resource::Service.stub!(:new).and_return(@current_resource) + Chef::Resource::Service.stub(:new).and_return(@current_resource) @stdout = StringIO.new(<<-PS) aj 7842 5057 0 21:26 pts/2 00:00:06 vi init.rb aj 7903 5016 0 21:26 pts/5 00:00:00 /bin/bash aj 8119 6041 0 21:34 pts/3 00:00:03 vi init_service_spec.rb PS - @status = mock("Status", :exitstatus => 0, :stdout => @stdout) - @provider.stub!(:shell_out!).and_return(@status) + @status = double("Status", :exitstatus => 0, :stdout => @stdout) + @provider.stub(:shell_out!).and_return(@status) end it "should create a current resource with the name of the new resource" do @@ -62,20 +62,20 @@ PS end it "should set running to true if the status command returns 0" do - @provider.stub!(:shell_out).with("/usr/sbin/invoke-rc.d #{@current_resource.service_name} status").and_return(@status) + @provider.stub(:shell_out).with("/usr/sbin/invoke-rc.d #{@current_resource.service_name} status").and_return(@status) @provider.load_current_resource @current_resource.running.should be_true end it "should set running to false if the status command returns anything except 0" do - @status.stub!(:exitstatus).and_return(1) - @provider.stub!(:shell_out).with("/usr/sbin/invoke-rc.d #{@current_resource.service_name} status").and_return(@status) + @status.stub(:exitstatus).and_return(1) + @provider.stub(:shell_out).with("/usr/sbin/invoke-rc.d #{@current_resource.service_name} status").and_return(@status) @provider.load_current_resource @current_resource.running.should be_false end it "should set running to false if the status command raises" do - @provider.stub!(:shell_out).with("/usr/sbin/invoke-rc.d #{@current_resource.service_name} status").and_raise(Mixlib::ShellOut::ShellCommandFailed) + @provider.stub(:shell_out).with("/usr/sbin/invoke-rc.d #{@current_resource.service_name} status").and_raise(Mixlib::ShellOut::ShellCommandFailed) @provider.load_current_resource @current_resource.running.should be_false end @@ -83,7 +83,7 @@ PS describe "when a status command has been specified" do before do - @new_resource.stub!(:status_command).and_return("/usr/sbin/invoke-rc.d chefhasmonkeypants status") + @new_resource.stub(:status_command).and_return("/usr/sbin/invoke-rc.d chefhasmonkeypants status") end it "should run the services status command if one has been specified" do @@ -113,7 +113,7 @@ PS describe "when we have a 'ps' attribute" do it "should shell_out! the node's ps command" do - @status = mock("Status", :exitstatus => 0, :stdout => @stdout) + @status = double("Status", :exitstatus => 0, :stdout => @stdout) @provider.should_receive(:shell_out!).with(@node[:command][:ps]).and_return(@status) @provider.load_current_resource end @@ -123,21 +123,21 @@ PS aj 7842 5057 0 21:26 pts/2 00:00:06 chef aj 7842 5057 0 21:26 pts/2 00:00:06 poos RUNNING_PS - @status = mock("Status", :exitstatus => 0, :stdout => @stdout) + @status = double("Status", :exitstatus => 0, :stdout => @stdout) @provider.should_receive(:shell_out!).and_return(@status) @provider.load_current_resource @current_resource.running.should be_true end it "should set running to false if the regex doesn't match" do - @status = mock("Status", :exitstatus => 0, :stdout => @stdout) + @status = double("Status", :exitstatus => 0, :stdout => @stdout) @provider.should_receive(:shell_out!).and_return(@status) @provider.load_current_resource @current_resource.running.should be_false end it "should raise an exception if ps fails" do - @provider.stub!(:shell_out!).and_raise(Mixlib::ShellOut::ShellCommandFailed) + @provider.stub(:shell_out!).and_raise(Mixlib::ShellOut::ShellCommandFailed) @provider.action = :start @provider.load_current_resource @provider.define_resource_requirements diff --git a/spec/unit/provider/service/macosx_spec.rb b/spec/unit/provider/service/macosx_spec.rb index 61bd5583e1..5d224dbd15 100644 --- a/spec/unit/provider/service/macosx_spec.rb +++ b/spec/unit/provider/service/macosx_spec.rb @@ -46,16 +46,34 @@ describe Chef::Provider::Service::Macosx do let(:events) {Chef::EventDispatch::Dispatcher.new} let(:run_context) { Chef::RunContext.new(node, {}, events) } let(:provider) { described_class.new(new_resource, run_context) } - let(:stdout) { StringIO.new } + let(:launchctl_stdout) { StringIO.new } + let(:plutil_stdout) { String.new <<-XML } +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> +<plist version="1.0"> +<dict> + <key>Label</key> + <string>io.redis.redis-server</string> +</dict> +</plist> +XML ["redis-server", "io.redis.redis-server"].each do |service_name| before do - Dir.stub!(:glob).and_return(["/Users/igor/Library/LaunchAgents/io.redis.redis-server.plist"], []) - provider.stub!(:shell_out!). + Dir.stub(:glob).and_return(["/Users/igor/Library/LaunchAgents/io.redis.redis-server.plist"], []) + provider.stub(:shell_out!). with("launchctl list", {:group => 1001, :user => 101}). - and_return(mock("ouput", :stdout => stdout)) - - File.stub!(:stat).and_return(mock("stat", :gid => 1001, :uid => 101)) + and_return(mock("Status", :stdout => launchctl_stdout)) + provider.stub(:shell_out). + with(/launchctl list /, + {:group => nil, :user => nil}). + and_return(mock("Status", + :stdout => launchctl_stdout, :exitstatus => 0)) + provider.stub(:shell_out!). + with(/plutil -convert xml1 -o/). + and_return(mock("Status", :stdout => plutil_stdout)) + + File.stub(:stat).and_return(double("stat", :gid => 1001, :uid => 101)) end context "#{service_name}" do @@ -64,7 +82,7 @@ describe Chef::Provider::Service::Macosx do describe "#load_current_resource" do context "when launchctl returns pid in service list" do - let(:stdout) { StringIO.new <<-SVC_LIST } + let(:launchctl_stdout) { StringIO.new <<-SVC_LIST } 12761 - 0x100114220.old.machinit.thing 7777 - io.redis.redis-server - - com.lol.stopped-thing @@ -84,21 +102,21 @@ describe Chef::Provider::Service::Macosx do end describe "running unsupported actions" do + let(:launchctl_stdout) { StringIO.new <<-SVC_LIST } +12761 - 0x100114220.old.machinit.thing +7777 - io.redis.redis-server +- - com.lol.stopped-thing +SVC_LIST + before do - Dir.stub!(:glob).and_return(["/Users/igor/Library/LaunchAgents/io.redis.redis-server.plist"], []) - end - it "should throw an exception when enable action is attempted" do - lambda {provider.run_action(:enable)}.should raise_error(Chef::Exceptions::UnsupportedAction) + Dir.stub(:glob).and_return(["/Users/igor/Library/LaunchAgents/io.redis.redis-server.plist"], []) end it "should throw an exception when reload action is attempted" do lambda {provider.run_action(:reload)}.should raise_error(Chef::Exceptions::UnsupportedAction) end - it "should throw an exception when disable action is attempted" do - lambda {provider.run_action(:disable)}.should raise_error(Chef::Exceptions::UnsupportedAction) - end end context "when launchctl returns empty service pid" do - let(:stdout) { StringIO.new <<-SVC_LIST } + let(:launchctl_stdout) { StringIO.new <<-SVC_LIST } 12761 - 0x100114220.old.machinit.thing - - io.redis.redis-server - - com.lol.stopped-thing @@ -118,7 +136,7 @@ describe Chef::Provider::Service::Macosx do end context "when launchctl doesn't return service entry at all" do - let(:stdout) { StringIO.new <<-SVC_LIST } + let(:launchctl_stdout) { StringIO.new <<-SVC_LIST } 12761 - 0x100114220.old.machinit.thing - - com.lol.stopped-thing SVC_LIST @@ -130,7 +148,7 @@ describe Chef::Provider::Service::Macosx do context "and plist for service is not available" do before do - Dir.stub!(:glob).and_return([]) + Dir.stub(:glob).and_return([]) provider.load_current_resource end @@ -141,7 +159,7 @@ describe Chef::Provider::Service::Macosx do context "and plist for service is available" do before do - Dir.stub!(:glob).and_return(["/Users/igor/Library/LaunchAgents/io.redis.redis-server.plist"], []) + Dir.stub(:glob).and_return(["/Users/igor/Library/LaunchAgents/io.redis.redis-server.plist"], []) provider.load_current_resource end @@ -152,7 +170,7 @@ describe Chef::Provider::Service::Macosx do describe "and several plists match service name" do it "throws exception" do - Dir.stub!(:glob).and_return(["/Users/igor/Library/LaunchAgents/io.redis.redis-server.plist", + Dir.stub(:glob).and_return(["/Users/igor/Library/LaunchAgents/io.redis.redis-server.plist", "/Users/wtf/something.plist"]) provider.load_current_resource provider.define_resource_requirements @@ -163,20 +181,20 @@ describe Chef::Provider::Service::Macosx do end describe "#start_service" do before do - Chef::Resource::Service.stub!(:new).and_return(current_resource) + Chef::Resource::Service.stub(:new).and_return(current_resource) provider.load_current_resource - current_resource.stub!(:running).and_return(false) + current_resource.stub(:running).and_return(false) end it "calls the start command if one is specified and service is not running" do - new_resource.stub!(:start_command).and_return("cowsay dirty") + new_resource.stub(:start_command).and_return("cowsay dirty") provider.should_receive(:shell_out!).with("cowsay dirty") provider.start_service end it "shows warning message if service is already running" do - current_resource.stub!(:running).and_return(true) + current_resource.stub(:running).and_return(true) Chef::Log.should_receive(:debug).with("service[#{service_name}] already running, not starting") provider.start_service @@ -194,21 +212,21 @@ describe Chef::Provider::Service::Macosx do describe "#stop_service" do before do - Chef::Resource::Service.stub!(:new).and_return(current_resource) + Chef::Resource::Service.stub(:new).and_return(current_resource) provider.load_current_resource - current_resource.stub!(:running).and_return(true) + current_resource.stub(:running).and_return(true) end it "calls the stop command if one is specified and service is running" do - new_resource.stub!(:stop_command).and_return("kill -9 123") + new_resource.stub(:stop_command).and_return("kill -9 123") provider.should_receive(:shell_out!).with("kill -9 123") provider.stop_service end it "shows warning message if service is not running" do - current_resource.stub!(:running).and_return(false) + current_resource.stub(:running).and_return(false) Chef::Log.should_receive(:debug).with("service[#{service_name}] not running, not stopping") provider.stop_service @@ -226,15 +244,15 @@ describe Chef::Provider::Service::Macosx do describe "#restart_service" do before do - Chef::Resource::Service.stub!(:new).and_return(current_resource) + Chef::Resource::Service.stub(:new).and_return(current_resource) provider.load_current_resource - current_resource.stub!(:running).and_return(true) - provider.stub!(:sleep) + current_resource.stub(:running).and_return(true) + provider.stub(:sleep) end it "issues a command if given" do - new_resource.stub!(:restart_command).and_return("reload that thing") + new_resource.stub(:restart_command).and_return("reload that thing") provider.should_receive(:shell_out!).with("reload that thing") provider.restart_service diff --git a/spec/unit/provider/service/redhat_spec.rb b/spec/unit/provider/service/redhat_spec.rb index 3ce4301026..8cc6fb6549 100644 --- a/spec/unit/provider/service/redhat_spec.rb +++ b/spec/unit/provider/service/redhat_spec.rb @@ -21,18 +21,18 @@ require 'ostruct' shared_examples_for "define_resource_requirements_common" do it "should raise an error if /sbin/chkconfig does not exist" do - File.stub!(:exists?).with("/sbin/chkconfig").and_return(false) - @provider.stub!(:shell_out).with("/sbin/service chef status").and_raise(Errno::ENOENT) - @provider.stub!(:shell_out!).with("/sbin/chkconfig --list chef", :returns => [0,1]).and_raise(Errno::ENOENT) + File.stub(:exists?).with("/sbin/chkconfig").and_return(false) + @provider.stub(:shell_out).with("/sbin/service chef status").and_raise(Errno::ENOENT) + @provider.stub(:shell_out!).with("/sbin/chkconfig --list chef", :returns => [0,1]).and_raise(Errno::ENOENT) @provider.load_current_resource @provider.define_resource_requirements lambda { @provider.process_resource_requirements }.should raise_error(Chef::Exceptions::Service) end it "should not raise an error if the service exists but is not added to any runlevels" do - status = mock("Status", :exitstatus => 0, :stdout => "" , :stderr => "") + status = double("Status", :exitstatus => 0, :stdout => "" , :stderr => "") @provider.should_receive(:shell_out).with("/sbin/service chef status").and_return(status) - chkconfig = mock("Chkconfig", :exitstatus => 0, :stdout => "", :stderr => "service chef supports chkconfig, but is not referenced in any runlevel (run 'chkconfig --add chef')") + chkconfig = double("Chkconfig", :exitstatus => 0, :stdout => "", :stderr => "service chef supports chkconfig, but is not referenced in any runlevel (run 'chkconfig --add chef')") @provider.should_receive(:shell_out!).with("/sbin/chkconfig --list chef", :returns => [0,1]).and_return(chkconfig) @provider.load_current_resource @provider.define_resource_requirements @@ -54,8 +54,8 @@ describe "Chef::Provider::Service::Redhat" do @provider = Chef::Provider::Service::Redhat.new(@new_resource, @run_context) @provider.action = :start - Chef::Resource::Service.stub!(:new).and_return(@current_resource) - File.stub!(:exists?).with("/sbin/chkconfig").and_return(true) + Chef::Resource::Service.stub(:new).and_return(@current_resource) + File.stub(:exists?).with("/sbin/chkconfig").and_return(true) end describe "while not in why run mode" do @@ -65,9 +65,9 @@ describe "Chef::Provider::Service::Redhat" do describe "load current resource" do it "sets the current enabled status to true if the service is enabled for any run level" do - status = mock("Status", :exitstatus => 0, :stdout => "" , :stderr => "") + status = double("Status", :exitstatus => 0, :stdout => "" , :stderr => "") @provider.should_receive(:shell_out).with("/sbin/service chef status").and_return(status) - chkconfig = mock("Chkconfig", :exitstatus => 0, :stdout => "chef 0:off 1:off 2:off 3:off 4:off 5:on 6:off", :stderr => "") + chkconfig = double("Chkconfig", :exitstatus => 0, :stdout => "chef 0:off 1:off 2:off 3:off 4:off 5:on 6:off", :stderr => "") @provider.should_receive(:shell_out!).with("/sbin/chkconfig --list chef", :returns => [0,1]).and_return(chkconfig) @provider.instance_variable_get("@service_missing").should be_false @provider.load_current_resource @@ -75,9 +75,9 @@ describe "Chef::Provider::Service::Redhat" do end it "sets the current enabled status to false if the regex does not match" do - status = mock("Status", :exitstatus => 0, :stdout => "" , :stderr => "") + status = double("Status", :exitstatus => 0, :stdout => "" , :stderr => "") @provider.should_receive(:shell_out).with("/sbin/service chef status").and_return(status) - chkconfig = mock("Chkconfig", :exitstatus => 0, :stdout => "chef 0:off 1:off 2:off 3:off 4:off 5:off 6:off", :stderr => "") + chkconfig = double("Chkconfig", :exitstatus => 0, :stdout => "chef 0:off 1:off 2:off 3:off 4:off 5:off 6:off", :stderr => "") @provider.should_receive(:shell_out!).with("/sbin/chkconfig --list chef", :returns => [0,1]).and_return(chkconfig) @provider.instance_variable_get("@service_missing").should be_false @provider.load_current_resource.should eql(@current_resource) @@ -90,9 +90,9 @@ describe "Chef::Provider::Service::Redhat" do context "when the service does not exist" do before do - status = mock("Status", :exitstatus => 1, :stdout => "", :stderr => "chef: unrecognized service") + status = double("Status", :exitstatus => 1, :stdout => "", :stderr => "chef: unrecognized service") @provider.should_receive(:shell_out).with("/sbin/service chef status").and_return(status) - chkconfig = mock("Chkconfig", :existatus=> 1, :stdout => "", :stderr => "error reading information on service chef: No such file or directory") + chkconfig = double("Chkconfig", :existatus=> 1, :stdout => "", :stderr => "error reading information on service chef: No such file or directory") @provider.should_receive(:shell_out!).with("/sbin/chkconfig --list chef", :returns => [0,1]).and_return(chkconfig) @provider.load_current_resource @provider.define_resource_requirements @@ -128,9 +128,9 @@ describe "Chef::Provider::Service::Redhat" do it_should_behave_like "define_resource_requirements_common" it "should not raise an error if the service does not exist" do - status = mock("Status", :exitstatus => 1, :stdout => "", :stderr => "chef: unrecognized service") + status = double("Status", :exitstatus => 1, :stdout => "", :stderr => "chef: unrecognized service") @provider.should_receive(:shell_out).with("/sbin/service chef status").and_return(status) - chkconfig = mock("Chkconfig", :existatus=> 1, :stdout => "", :stderr => "error reading information on service chef: No such file or directory") + chkconfig = double("Chkconfig", :existatus=> 1, :stdout => "", :stderr => "error reading information on service chef: No such file or directory") @provider.should_receive(:shell_out!).with("/sbin/chkconfig --list chef", :returns => [0,1]).and_return(chkconfig) @provider.load_current_resource @provider.define_resource_requirements diff --git a/spec/unit/provider/service/simple_service_spec.rb b/spec/unit/provider/service/simple_service_spec.rb index 73cb3766d2..1d94534320 100644 --- a/spec/unit/provider/service/simple_service_spec.rb +++ b/spec/unit/provider/service/simple_service_spec.rb @@ -29,15 +29,15 @@ describe Chef::Provider::Service::Simple, "load_current_resource" do @current_resource = Chef::Resource::Service.new("chef") @provider = Chef::Provider::Service::Simple.new(@new_resource, @run_context) - Chef::Resource::Service.stub!(:new).and_return(@current_resource) + Chef::Resource::Service.stub(:new).and_return(@current_resource) @stdout = StringIO.new(<<-NOMOCKINGSTRINGSPLZ) aj 7842 5057 0 21:26 pts/2 00:00:06 vi init.rb aj 7903 5016 0 21:26 pts/5 00:00:00 /bin/bash aj 8119 6041 0 21:34 pts/3 00:00:03 vi simple_service_spec.rb NOMOCKINGSTRINGSPLZ - @status = mock("Status", :exitstatus => 0, :stdout => @stdout) - @provider.stub!(:shell_out!).and_return(@status) + @status = double("Status", :exitstatus => 0, :stdout => @stdout) + @provider.stub(:shell_out!).and_return(@status) end it "should create a current resource with the name of the new resource" do @@ -69,7 +69,7 @@ NOMOCKINGSTRINGSPLZ end it "should read stdout of the ps command" do - @provider.stub!(:shell_out!).and_return(@status) + @provider.stub(:shell_out!).and_return(@status) @stdout.should_receive(:each_line).and_return(true) @provider.load_current_resource end @@ -79,20 +79,20 @@ NOMOCKINGSTRINGSPLZ aj 7842 5057 0 21:26 pts/2 00:00:06 chef aj 7842 5057 0 21:26 pts/2 00:00:06 poos NOMOCKINGSTRINGSPLZ - @status = mock("Status", :exitstatus => 0, :stdout => @stdout) - @provider.stub!(:shell_out!).and_return(@status) + @status = double("Status", :exitstatus => 0, :stdout => @stdout) + @provider.stub(:shell_out!).and_return(@status) @provider.load_current_resource @current_resource.running.should be_true end it "should set running to false if the regex doesn't match" do - @provider.stub!(:shell_out!).and_return(@status) + @provider.stub(:shell_out!).and_return(@status) @provider.load_current_resource @current_resource.running.should be_false end it "should raise an exception if ps fails" do - @provider.stub!(:shell_out!).and_raise(Mixlib::ShellOut::ShellCommandFailed) + @provider.stub(:shell_out!).and_raise(Mixlib::ShellOut::ShellCommandFailed) @provider.action = :start @provider.load_current_resource @provider.define_resource_requirements @@ -108,7 +108,7 @@ NOMOCKINGSTRINGSPLZ describe "when starting the service" do it "should call the start command if one is specified" do - @new_resource.stub!(:start_command).and_return("#{@new_resource.start_command}") + @new_resource.stub(:start_command).and_return("#{@new_resource.start_command}") @provider.should_receive(:shell_out!).with("#{@new_resource.start_command}") @provider.start_service() end diff --git a/spec/unit/provider/service/solaris_smf_service_spec.rb b/spec/unit/provider/service/solaris_smf_service_spec.rb index 64afee078c..887c1f6b5f 100644 --- a/spec/unit/provider/service/solaris_smf_service_spec.rb +++ b/spec/unit/provider/service/solaris_smf_service_spec.rb @@ -29,16 +29,16 @@ describe Chef::Provider::Service::Solaris do @current_resource = Chef::Resource::Service.new('chef') @provider = Chef::Provider::Service::Solaris.new(@new_resource, @run_context) - Chef::Resource::Service.stub!(:new).and_return(@current_resource) + Chef::Resource::Service.stub(:new).and_return(@current_resource) @stdin = StringIO.new @stdout = StringIO.new @stderr = StringIO.new @pid = 2342 @stdout_string = "state disabled" - @stdout.stub!(:gets).and_return(@stdout_string) - @status = mock("Status", :exitstatus => 0, :stdout => @stdout) - @provider.stub!(:shell_out!).and_return(@status) + @stdout.stub(:gets).and_return(@stdout_string) + @status = double("Status", :exitstatus => 0, :stdout => @stdout) + @provider.stub(:shell_out!).and_return(@status) end it "should raise an error if /bin/svcs does not exist" do @@ -49,19 +49,19 @@ describe Chef::Provider::Service::Solaris do describe "on a host with /bin/svcs" do before do - File.stub!(:exists?).with('/bin/svcs').and_return(true) + File.stub(:exists?).with('/bin/svcs').and_return(true) end describe "when discovering the current service state" do it "should create a current resource with the name of the new resource" do - @provider.stub!(:popen4).with("/bin/svcs -l chef").and_return(@status) + @provider.stub(:popen4).with("/bin/svcs -l chef").and_return(@status) Chef::Resource::Service.should_receive(:new).and_return(@current_resource) @provider.load_current_resource end it "should return the current resource" do - @provider.stub!(:popen4).with("/bin/svcs -l chef").and_return(@status) + @provider.stub(:popen4).with("/bin/svcs -l chef").and_return(@status) @provider.load_current_resource.should eql(@current_resource) end @@ -71,14 +71,14 @@ describe Chef::Provider::Service::Solaris do end it "should mark service as not running" do - @provider.stub!(:popen4).and_yield(@pid, @stdin, @stdout, @stderr).and_return(@status) + @provider.stub(:popen4).and_yield(@pid, @stdin, @stdout, @stderr).and_return(@status) @current_resource.should_receive(:running).with(false) @provider.load_current_resource end it "should mark service as running" do - @stdout.stub!(:each).and_yield("state online") - @provider.stub!(:popen4).and_yield(@pid, @stdin, @stdout, @stderr).and_return(@status) + @stdout.stub(:each).and_yield("state online") + @provider.stub(:popen4).and_yield(@pid, @stdin, @stdout, @stderr).and_return(@status) @current_resource.should_receive(:running).with(true) @provider.load_current_resource end @@ -91,14 +91,14 @@ describe Chef::Provider::Service::Solaris do end it "should call svcadm enable -s chef" do - @new_resource.stub!(:enable_command).and_return("#{@new_resource.enable_command}") + @new_resource.stub(:enable_command).and_return("#{@new_resource.enable_command}") @provider.should_receive(:shell_out!).with("/usr/sbin/svcadm enable -s #{@current_resource.service_name}").and_return(@status) @provider.enable_service.should be_true @current_resource.enabled.should be_true end it "should call svcadm enable -s chef for start_service" do - @new_resource.stub!(:start_command).and_return("#{@new_resource.start_command}") + @new_resource.stub(:start_command).and_return("#{@new_resource.start_command}") @provider.should_receive(:shell_out!).with("/usr/sbin/svcadm enable -s #{@current_resource.service_name}").and_return(@status) @provider.start_service.should be_true @current_resource.enabled.should be_true @@ -129,7 +129,7 @@ describe Chef::Provider::Service::Solaris do describe "when reloading the service" do before(:each) do - @status = mock("Process::Status", :exitstatus => 0) + @status = double("Process::Status", :exitstatus => 0) @provider.current_resource = @current_resource end diff --git a/spec/unit/provider/service/systemd_service_spec.rb b/spec/unit/provider/service/systemd_service_spec.rb index a107888b0b..f631bfc31d 100644 --- a/spec/unit/provider/service/systemd_service_spec.rb +++ b/spec/unit/provider/service/systemd_service_spec.rb @@ -30,10 +30,10 @@ describe Chef::Provider::Service::Systemd do describe "load_current_resource" do before(:each) do @current_resource = Chef::Resource::Service.new('rsyslog.service') - Chef::Resource::Service.stub!(:new).and_return(@current_resource) + Chef::Resource::Service.stub(:new).and_return(@current_resource) - @provider.stub!(:is_active?).and_return(false) - @provider.stub!(:is_enabled?).and_return(false) + @provider.stub(:is_active?).and_return(false) + @provider.stub(:is_enabled?).and_return(false) end it "should create a current resource with the name of the new resource" do @@ -52,42 +52,42 @@ describe Chef::Provider::Service::Systemd do end it "should set running to true if the service is running" do - @provider.stub!(:is_active?).and_return(true) + @provider.stub(:is_active?).and_return(true) @current_resource.should_receive(:running).with(true) @provider.load_current_resource end it "should set running to false if the service is not running" do - @provider.stub!(:is_active?).and_return(false) + @provider.stub(:is_active?).and_return(false) @current_resource.should_receive(:running).with(false) @provider.load_current_resource end describe "when a status command has been specified" do before do - @new_resource.stub!(:status_command).and_return("/bin/chefhasmonkeypants status") + @new_resource.stub(:status_command).and_return("/bin/chefhasmonkeypants status") end it "should run the services status command if one has been specified" do - @provider.stub!(:run_command_with_systems_locale).with({:command => "/bin/chefhasmonkeypants status"}).and_return(0) + @provider.stub(:run_command_with_systems_locale).with({:command => "/bin/chefhasmonkeypants status"}).and_return(0) @current_resource.should_receive(:running).with(true) @provider.load_current_resource end it "should run the services status command if one has been specified and properly set status check state" do - @provider.stub!(:run_command_with_systems_locale).with({:command => "/bin/chefhasmonkeypants status"}).and_return(0) + @provider.stub(:run_command_with_systems_locale).with({:command => "/bin/chefhasmonkeypants status"}).and_return(0) @provider.load_current_resource @provider.instance_variable_get("@status_check_success").should be_true end it "should set running to false if it catches a Chef::Exceptions::Exec when using a status command" do - @provider.stub!(:run_command_with_systems_locale).and_raise(Chef::Exceptions::Exec) + @provider.stub(:run_command_with_systems_locale).and_raise(Chef::Exceptions::Exec) @current_resource.should_receive(:running).with(false) @provider.load_current_resource end it "should update state to indicate status check failed when an exception is thrown using a status command" do - @provider.stub!(:run_command_with_systems_locale).and_raise(Chef::Exceptions::Exec) + @provider.stub(:run_command_with_systems_locale).and_raise(Chef::Exceptions::Exec) @provider.load_current_resource @provider.instance_variable_get("@status_check_success").should be_false end @@ -99,13 +99,13 @@ describe Chef::Provider::Service::Systemd do end it "should set enabled to true if the service is enabled" do - @provider.stub!(:is_enabled?).and_return(true) + @provider.stub(:is_enabled?).and_return(true) @current_resource.should_receive(:enabled).with(true) @provider.load_current_resource end it "should set enabled to false if the service is not enabled" do - @provider.stub!(:is_enabled?).and_return(false) + @provider.stub(:is_enabled?).and_return(false) @current_resource.should_receive(:enabled).with(false) @provider.load_current_resource end @@ -118,12 +118,12 @@ describe Chef::Provider::Service::Systemd do describe "start and stop service" do before(:each) do @current_resource = Chef::Resource::Service.new('rsyslog.service') - Chef::Resource::Service.stub!(:new).and_return(@current_resource) + Chef::Resource::Service.stub(:new).and_return(@current_resource) @provider.current_resource = @current_resource end it "should call the start command if one is specified" do - @new_resource.stub!(:start_command).and_return("/sbin/rsyslog startyousillysally") + @new_resource.stub(:start_command).and_return("/sbin/rsyslog startyousillysally") @provider.should_receive(:shell_out!).with("/sbin/rsyslog startyousillysally") @provider.start_service end @@ -134,52 +134,52 @@ describe Chef::Provider::Service::Systemd do end it "should not call '/bin/systemctl start service_name' if it is already running" do - @current_resource.stub!(:running).and_return(true) + @current_resource.stub(:running).and_return(true) @provider.should_not_receive(:run_command_with_systems_locale).with({:command => "/bin/systemctl start #{@new_resource.service_name}"}) @provider.start_service end it "should call the restart command if one is specified" do - @current_resource.stub!(:running).and_return(true) - @new_resource.stub!(:restart_command).and_return("/sbin/rsyslog restartyousillysally") + @current_resource.stub(:running).and_return(true) + @new_resource.stub(:restart_command).and_return("/sbin/rsyslog restartyousillysally") @provider.should_receive(:shell_out!).with("/sbin/rsyslog restartyousillysally") @provider.restart_service end it "should call '/bin/systemctl restart service_name' if no restart command is specified" do - @current_resource.stub!(:running).and_return(true) + @current_resource.stub(:running).and_return(true) @provider.should_receive(:run_command_with_systems_locale).with({:command => "/bin/systemctl restart #{@new_resource.service_name}"}).and_return(0) @provider.restart_service end it "should call the reload command if one is specified" do - @current_resource.stub!(:running).and_return(true) - @new_resource.stub!(:reload_command).and_return("/sbin/rsyslog reloadyousillysally") + @current_resource.stub(:running).and_return(true) + @new_resource.stub(:reload_command).and_return("/sbin/rsyslog reloadyousillysally") @provider.should_receive(:shell_out!).with("/sbin/rsyslog reloadyousillysally") @provider.reload_service end it "should call '/bin/systemctl reload service_name' if no reload command is specified" do - @current_resource.stub!(:running).and_return(true) + @current_resource.stub(:running).and_return(true) @provider.should_receive(:run_command_with_systems_locale).with({:command => "/bin/systemctl reload #{@new_resource.service_name}"}).and_return(0) @provider.reload_service end it "should call the stop command if one is specified" do - @current_resource.stub!(:running).and_return(true) - @new_resource.stub!(:stop_command).and_return("/sbin/rsyslog stopyousillysally") + @current_resource.stub(:running).and_return(true) + @new_resource.stub(:stop_command).and_return("/sbin/rsyslog stopyousillysally") @provider.should_receive(:shell_out!).with("/sbin/rsyslog stopyousillysally") @provider.stop_service end it "should call '/bin/systemctl stop service_name' if no stop command is specified" do - @current_resource.stub!(:running).and_return(true) + @current_resource.stub(:running).and_return(true) @provider.should_receive(:run_command_with_systems_locale).with({:command => "/bin/systemctl stop #{@new_resource.service_name}"}).and_return(0) @provider.stop_service end it "should not call '/bin/systemctl stop service_name' if it is already stopped" do - @current_resource.stub!(:running).and_return(false) + @current_resource.stub(:running).and_return(false) @provider.should_not_receive(:run_command_with_systems_locale).with({:command => "/bin/systemctl stop #{@new_resource.service_name}"}) @provider.stop_service end @@ -188,7 +188,7 @@ describe Chef::Provider::Service::Systemd do describe "enable and disable service" do before(:each) do @current_resource = Chef::Resource::Service.new('rsyslog.service') - Chef::Resource::Service.stub!(:new).and_return(@current_resource) + Chef::Resource::Service.stub(:new).and_return(@current_resource) @provider.current_resource = @current_resource end @@ -206,7 +206,7 @@ describe Chef::Provider::Service::Systemd do describe "is_active?" do before(:each) do @current_resource = Chef::Resource::Service.new('rsyslog.service') - Chef::Resource::Service.stub!(:new).and_return(@current_resource) + Chef::Resource::Service.stub(:new).and_return(@current_resource) end it "should return true if '/bin/systemctl is-active service_name' returns 0" do @@ -223,7 +223,7 @@ describe Chef::Provider::Service::Systemd do describe "is_enabled?" do before(:each) do @current_resource = Chef::Resource::Service.new('rsyslog.service') - Chef::Resource::Service.stub!(:new).and_return(@current_resource) + Chef::Resource::Service.stub(:new).and_return(@current_resource) end it "should return true if '/bin/systemctl is-enabled service_name' returns 0" do diff --git a/spec/unit/provider/service/upstart_service_spec.rb b/spec/unit/provider/service/upstart_service_spec.rb index 8628a4eaf7..154527a7da 100644 --- a/spec/unit/provider/service/upstart_service_spec.rb +++ b/spec/unit/provider/service/upstart_service_spec.rb @@ -39,7 +39,7 @@ describe Chef::Provider::Service::Upstart do it "should return /etc/event.d as the upstart job directory when running on Ubuntu 9.04" do @node.automatic_attrs[:platform_version] = '9.04' - #Chef::Platform.stub!(:find_platform_and_version).and_return([ "ubuntu", "9.04" ]) + #Chef::Platform.stub(:find_platform_and_version).and_return([ "ubuntu", "9.04" ]) @provider = Chef::Provider::Service::Upstart.new(@new_resource, @run_context) @provider.instance_variable_get(:@upstart_job_dir).should == "/etc/event.d" @provider.instance_variable_get(:@upstart_conf_suffix).should == "" @@ -65,17 +65,17 @@ describe Chef::Provider::Service::Upstart do @node.automatic_attrs[:command] = {:ps => "ps -ax"} @current_resource = Chef::Resource::Service.new("rsyslog") - Chef::Resource::Service.stub!(:new).and_return(@current_resource) + Chef::Resource::Service.stub(:new).and_return(@current_resource) - @status = mock("Status", :exitstatus => 0) - @provider.stub!(:popen4).and_return(@status) + @status = double("Status", :exitstatus => 0) + @provider.stub(:popen4).and_return(@status) @stdin = StringIO.new @stdout = StringIO.new @stderr = StringIO.new - @pid = mock("PID") + @pid = double("PID") - ::File.stub!(:exists?).and_return(true) - ::File.stub!(:open).and_return(true) + ::File.stub(:exists?).and_return(true) + ::File.stub(:open).and_return(true) end it "should create a current resource with the name of the new resource" do @@ -99,14 +99,14 @@ describe Chef::Provider::Service::Upstart do it "should set running to true if the status command returns 0" do @stdout = StringIO.new("rsyslog start/running") - @provider.stub!(:popen4).and_yield(@pid, @stdin, @stdout, @stderr).and_return(@status) + @provider.stub(:popen4).and_yield(@pid, @stdin, @stdout, @stderr).and_return(@status) @provider.load_current_resource @current_resource.running.should be_true end it "should set running to false if the status command returns anything except 0" do @stdout = StringIO.new("rsyslog stop/waiting") - @provider.stub!(:popen4).and_yield(@pid, @stdin, @stdout, @stderr).and_return(@status) + @provider.stub(:popen4).and_yield(@pid, @stdin, @stdout, @stderr).and_return(@status) @provider.load_current_resource @current_resource.running.should be_false end @@ -115,41 +115,41 @@ describe Chef::Provider::Service::Upstart do describe "when the status command uses the old format" do it "should set running to true if the status command returns 0" do @stdout = StringIO.new("rsyslog (start) running, process 32225") - @provider.stub!(:popen4).and_yield(@pid, @stdin, @stdout, @stderr).and_return(@status) + @provider.stub(:popen4).and_yield(@pid, @stdin, @stdout, @stderr).and_return(@status) @provider.load_current_resource @current_resource.running.should be_true end it "should set running to false if the status command returns anything except 0" do @stdout = StringIO.new("rsyslog (stop) waiting") - @provider.stub!(:popen4).and_yield(@pid, @stdin, @stdout, @stderr).and_return(@status) + @provider.stub(:popen4).and_yield(@pid, @stdin, @stdout, @stderr).and_return(@status) @provider.load_current_resource @current_resource.running.should be_false end end it "should set running to false if it catches a Chef::Exceptions::Exec" do - @provider.stub!(:popen4).and_yield(@pid, @stdin, @stdout, @stderr).and_raise(Chef::Exceptions::Exec) + @provider.stub(:popen4).and_yield(@pid, @stdin, @stdout, @stderr).and_raise(Chef::Exceptions::Exec) @current_resource.should_receive(:running).with(false) @provider.load_current_resource end it "should set enabled to true when it finds 'starts on'" do - @lines = mock("start on filesystem", :gets => "start on filesystem") - ::File.stub!(:open).and_yield(@lines) + @lines = double("start on filesystem", :gets => "start on filesystem") + ::File.stub(:open).and_yield(@lines) @current_resource.should_receive(:running).with(false) @provider.load_current_resource end it "should set enabled to false when it finds '#starts on'" do - @lines = mock("start on filesystem", :gets => "#start on filesystem") - ::File.stub!(:open).and_yield(@lines) + @lines = double("start on filesystem", :gets => "#start on filesystem") + ::File.stub(:open).and_yield(@lines) @current_resource.should_receive(:running).with(false) @provider.load_current_resource end it "should assume disable when no job configuration file is found" do - ::File.stub!(:exists?).and_return(false) + ::File.stub(:exists?).and_return(false) @current_resource.should_receive(:running).with(false) @provider.load_current_resource end @@ -163,23 +163,23 @@ describe Chef::Provider::Service::Upstart do describe "when a status command has been specified" do before do - @new_resource.stub!(:status_command).and_return("/bin/chefhasmonkeypants status") + @new_resource.stub(:status_command).and_return("/bin/chefhasmonkeypants status") end it "should run the services status command if one has been specified" do - @provider.stub!(:run_command_with_systems_locale).with({:command => "/bin/chefhasmonkeypants status"}).and_return(0) + @provider.stub(:run_command_with_systems_locale).with({:command => "/bin/chefhasmonkeypants status"}).and_return(0) @current_resource.should_receive(:running).with(true) @provider.load_current_resource end it "should track state when the user-provided status command fails" do - @provider.stub!(:popen4).and_yield(@pid, @stdin, @stdout, @stderr).and_raise(Chef::Exceptions::Exec) + @provider.stub(:popen4).and_yield(@pid, @stdin, @stdout, @stderr).and_raise(Chef::Exceptions::Exec) @provider.load_current_resource @provider.instance_variable_get("@command_success").should == false end it "should set running to false if it catches a Chef::Exceptions::Exec when using a status command" do - @provider.stub!(:popen4).and_yield(@pid, @stdin, @stdout, @stderr).and_raise(Chef::Exceptions::Exec) + @provider.stub(:popen4).and_yield(@pid, @stdin, @stdout, @stderr).and_raise(Chef::Exceptions::Exec) @current_resource.should_receive(:running).with(false) @provider.load_current_resource end @@ -201,15 +201,15 @@ describe Chef::Provider::Service::Upstart do describe "enable and disable service" do before(:each) do @current_resource = Chef::Resource::Service.new('rsyslog') - Chef::Resource::Service.stub!(:new).and_return(@current_resource) + Chef::Resource::Service.stub(:new).and_return(@current_resource) @provider.current_resource = @current_resource - Chef::Util::FileEdit.stub!(:new) + Chef::Util::FileEdit.stub(:new) end it "should enable the service if it is not enabled" do @file = Object.new - Chef::Util::FileEdit.stub!(:new).and_return(@file) - @current_resource.stub!(:enabled).and_return(false) + Chef::Util::FileEdit.stub(:new).and_return(@file) + @current_resource.stub(:enabled).and_return(false) @file.should_receive(:search_file_replace) @file.should_receive(:write_file) @provider.enable_service() @@ -217,8 +217,8 @@ describe Chef::Provider::Service::Upstart do it "should disable the service if it is enabled" do @file = Object.new - Chef::Util::FileEdit.stub!(:new).and_return(@file) - @current_resource.stub!(:enabled).and_return(true) + Chef::Util::FileEdit.stub(:new).and_return(@file) + @current_resource.stub(:enabled).and_return(true) @file.should_receive(:search_file_replace) @file.should_receive(:write_file) @provider.disable_service() @@ -230,12 +230,12 @@ describe Chef::Provider::Service::Upstart do before(:each) do @current_resource = Chef::Resource::Service.new('rsyslog') - Chef::Resource::Service.stub!(:new).and_return(@current_resource) + Chef::Resource::Service.stub(:new).and_return(@current_resource) @provider.current_resource = @current_resource end it "should call the start command if one is specified" do - @new_resource.stub!(:start_command).and_return("/sbin/rsyslog startyousillysally") + @new_resource.stub(:start_command).and_return("/sbin/rsyslog startyousillysally") @provider.should_receive(:shell_out!).with("/sbin/rsyslog startyousillysally") @provider.start_service() end @@ -246,7 +246,7 @@ describe Chef::Provider::Service::Upstart do end it "should not call '/sbin/start service_name' if it is already running" do - @current_resource.stub!(:running).and_return(true) + @current_resource.stub(:running).and_return(true) @provider.should_not_receive(:run_command_with_systems_locale).with({:command => "/sbin/start #{@new_resource.service_name}"}) @provider.start_service() end @@ -261,52 +261,52 @@ describe Chef::Provider::Service::Upstart do end it "should call the restart command if one is specified" do - @current_resource.stub!(:running).and_return(true) - @new_resource.stub!(:restart_command).and_return("/sbin/rsyslog restartyousillysally") + @current_resource.stub(:running).and_return(true) + @new_resource.stub(:restart_command).and_return("/sbin/rsyslog restartyousillysally") @provider.should_receive(:shell_out!).with("/sbin/rsyslog restartyousillysally") @provider.restart_service() end it "should call '/sbin/restart service_name' if no restart command is specified" do - @current_resource.stub!(:running).and_return(true) + @current_resource.stub(:running).and_return(true) @provider.should_receive(:run_command_with_systems_locale).with({:command => "/sbin/restart #{@new_resource.service_name}"}).and_return(0) @provider.restart_service() end it "should call '/sbin/start service_name' if restart_service is called for a stopped service" do - @current_resource.stub!(:running).and_return(false) + @current_resource.stub(:running).and_return(false) @provider.should_receive(:run_command_with_systems_locale).with({:command => "/sbin/start #{@new_resource.service_name}"}).and_return(0) @provider.restart_service() end it "should call the reload command if one is specified" do - @current_resource.stub!(:running).and_return(true) - @new_resource.stub!(:reload_command).and_return("/sbin/rsyslog reloadyousillysally") + @current_resource.stub(:running).and_return(true) + @new_resource.stub(:reload_command).and_return("/sbin/rsyslog reloadyousillysally") @provider.should_receive(:shell_out!).with("/sbin/rsyslog reloadyousillysally") @provider.reload_service() end it "should call '/sbin/reload service_name' if no reload command is specified" do - @current_resource.stub!(:running).and_return(true) + @current_resource.stub(:running).and_return(true) @provider.should_receive(:run_command_with_systems_locale).with({:command => "/sbin/reload #{@new_resource.service_name}"}).and_return(0) @provider.reload_service() end it "should call the stop command if one is specified" do - @current_resource.stub!(:running).and_return(true) - @new_resource.stub!(:stop_command).and_return("/sbin/rsyslog stopyousillysally") + @current_resource.stub(:running).and_return(true) + @new_resource.stub(:stop_command).and_return("/sbin/rsyslog stopyousillysally") @provider.should_receive(:shell_out!).with("/sbin/rsyslog stopyousillysally") @provider.stop_service() end it "should call '/sbin/stop service_name' if no stop command is specified" do - @current_resource.stub!(:running).and_return(true) + @current_resource.stub(:running).and_return(true) @provider.should_receive(:run_command_with_systems_locale).with({:command => "/sbin/stop #{@new_resource.service_name}"}).and_return(0) @provider.stop_service() end it "should not call '/sbin/stop service_name' if it is already stopped" do - @current_resource.stub!(:running).and_return(false) + @current_resource.stub(:running).and_return(false) @provider.should_not_receive(:run_command_with_systems_locale).with({:command => "/sbin/stop #{@new_resource.service_name}"}) @provider.stop_service() end diff --git a/spec/unit/provider/service/windows_spec.rb b/spec/unit/provider/service/windows_spec.rb index 7ec4ccf96a..08f5a81a9d 100644 --- a/spec/unit/provider/service/windows_spec.rb +++ b/spec/unit/provider/service/windows_spec.rb @@ -31,11 +31,11 @@ describe Chef::Provider::Service::Windows, "load_current_resource" do Win32::Service = Class.new Win32::Service::AUTO_START = 0x00000002 Win32::Service::DISABLED = 0x00000004 - Win32::Service.stub!(:status).with(@new_resource.service_name).and_return( - mock("StatusStruct", :current_state => "running")) - Win32::Service.stub!(:config_info).with(@new_resource.service_name).and_return( - mock("ConfigStruct", :start_type => "auto start")) - Win32::Service.stub!(:exists?).and_return(true) + Win32::Service.stub(:status).with(@new_resource.service_name).and_return( + double("StatusStruct", :current_state => "running")) + Win32::Service.stub(:config_info).with(@new_resource.service_name).and_return( + double("ConfigStruct", :start_type => "auto start")) + Win32::Service.stub(:exists?).and_return(true) end it "should set the current resources service name to the new resources service name" do @@ -59,9 +59,9 @@ describe Chef::Provider::Service::Windows, "load_current_resource" do describe Chef::Provider::Service::Windows, "start_service" do before(:each) do - Win32::Service.stub!(:status).with(@new_resource.service_name).and_return( - mock("StatusStruct", :current_state => "stopped"), - mock("StatusStruct", :current_state => "running")) + Win32::Service.stub(:status).with(@new_resource.service_name).and_return( + double("StatusStruct", :current_state => "stopped"), + double("StatusStruct", :current_state => "running")) end it "should call the start command if one is specified" do @@ -78,15 +78,15 @@ describe Chef::Provider::Service::Windows, "load_current_resource" do end it "should do nothing if the service does not exist" do - Win32::Service.stub!(:exists?).with(@new_resource.service_name).and_return(false) + Win32::Service.stub(:exists?).with(@new_resource.service_name).and_return(false) Win32::Service.should_not_receive(:start).with(@new_resource.service_name) @provider.start_service @new_resource.updated_by_last_action?.should be_false end it "should do nothing if the service is running" do - Win32::Service.stub!(:status).with(@new_resource.service_name).and_return( - mock("StatusStruct", :current_state => "running")) + Win32::Service.stub(:status).with(@new_resource.service_name).and_return( + double("StatusStruct", :current_state => "running")) @provider.load_current_resource Win32::Service.should_not_receive(:start).with(@new_resource.service_name) @provider.start_service @@ -97,9 +97,9 @@ describe Chef::Provider::Service::Windows, "load_current_resource" do describe Chef::Provider::Service::Windows, "stop_service" do before(:each) do - Win32::Service.stub!(:status).with(@new_resource.service_name).and_return( - mock("StatusStruct", :current_state => "running"), - mock("StatusStruct", :current_state => "stopped")) + Win32::Service.stub(:status).with(@new_resource.service_name).and_return( + double("StatusStruct", :current_state => "running"), + double("StatusStruct", :current_state => "stopped")) end it "should call the stop command if one is specified" do @@ -116,15 +116,15 @@ describe Chef::Provider::Service::Windows, "load_current_resource" do end it "should do nothing if the service does not exist" do - Win32::Service.stub!(:exists?).with(@new_resource.service_name).and_return(false) + Win32::Service.stub(:exists?).with(@new_resource.service_name).and_return(false) Win32::Service.should_not_receive(:stop).with(@new_resource.service_name) @provider.stop_service @new_resource.updated_by_last_action?.should be_false end it "should do nothing if the service is stopped" do - Win32::Service.stub!(:status).with(@new_resource.service_name).and_return( - mock("StatusStruct", :current_state => "stopped")) + Win32::Service.stub(:status).with(@new_resource.service_name).and_return( + double("StatusStruct", :current_state => "stopped")) @provider.load_current_resource Win32::Service.should_not_receive(:stop).with(@new_resource.service_name) @provider.stop_service @@ -142,11 +142,11 @@ describe Chef::Provider::Service::Windows, "load_current_resource" do end it "should stop then start the service if it is running" do - Win32::Service.stub!(:status).with(@new_resource.service_name).and_return( - mock("StatusStruct", :current_state => "running"), - mock("StatusStruct", :current_state => "stopped"), - mock("StatusStruct", :current_state => "stopped"), - mock("StatusStruct", :current_state => "running")) + Win32::Service.stub(:status).with(@new_resource.service_name).and_return( + double("StatusStruct", :current_state => "running"), + double("StatusStruct", :current_state => "stopped"), + double("StatusStruct", :current_state => "stopped"), + double("StatusStruct", :current_state => "running")) Win32::Service.should_receive(:stop).with(@new_resource.service_name) Win32::Service.should_receive(:start).with(@new_resource.service_name) @provider.restart_service @@ -154,17 +154,17 @@ describe Chef::Provider::Service::Windows, "load_current_resource" do end it "should just start the service if it is stopped" do - Win32::Service.stub!(:status).with(@new_resource.service_name).and_return( - mock("StatusStruct", :current_state => "stopped"), - mock("StatusStruct", :current_state => "stopped"), - mock("StatusStruct", :current_state => "running")) + Win32::Service.stub(:status).with(@new_resource.service_name).and_return( + double("StatusStruct", :current_state => "stopped"), + double("StatusStruct", :current_state => "stopped"), + double("StatusStruct", :current_state => "running")) Win32::Service.should_receive(:start).with(@new_resource.service_name) @provider.restart_service @new_resource.updated_by_last_action?.should be_true end it "should do nothing if the service does not exist" do - Win32::Service.stub!(:exists?).with(@new_resource.service_name).and_return(false) + Win32::Service.stub(:exists?).with(@new_resource.service_name).and_return(false) Win32::Service.should_not_receive(:stop).with(@new_resource.service_name) Win32::Service.should_not_receive(:start).with(@new_resource.service_name) @provider.restart_service @@ -176,8 +176,8 @@ describe Chef::Provider::Service::Windows, "load_current_resource" do describe Chef::Provider::Service::Windows, "enable_service" do before(:each) do - Win32::Service.stub!(:config_info).with(@new_resource.service_name).and_return( - mock("ConfigStruct", :start_type => "disabled")) + Win32::Service.stub(:config_info).with(@new_resource.service_name).and_return( + double("ConfigStruct", :start_type => "disabled")) end it "should enable service" do @@ -187,15 +187,15 @@ describe Chef::Provider::Service::Windows, "load_current_resource" do end it "should do nothing if the service does not exist" do - Win32::Service.stub!(:exists?).with(@new_resource.service_name).and_return(false) + Win32::Service.stub(:exists?).with(@new_resource.service_name).and_return(false) Win32::Service.should_not_receive(:configure) @provider.enable_service @new_resource.updated_by_last_action?.should be_false end it "should do nothing if the service is enabled" do - Win32::Service.stub!(:config_info).with(@new_resource.service_name).and_return( - mock("ConfigStruct", :start_type => "auto start")) + Win32::Service.stub(:config_info).with(@new_resource.service_name).and_return( + double("ConfigStruct", :start_type => "auto start")) Win32::Service.should_not_receive(:configure) @provider.enable_service @new_resource.updated_by_last_action?.should be_false @@ -205,8 +205,8 @@ describe Chef::Provider::Service::Windows, "load_current_resource" do describe Chef::Provider::Service::Windows, "disable_service" do before(:each) do - Win32::Service.stub!(:config_info).with(@new_resource.service_name).and_return( - mock("ConfigStruct", :start_type => "auto start")) + Win32::Service.stub(:config_info).with(@new_resource.service_name).and_return( + double("ConfigStruct", :start_type => "auto start")) end it "should disable service" do @@ -216,15 +216,15 @@ describe Chef::Provider::Service::Windows, "load_current_resource" do end it "should do nothing if the service does not exist" do - Win32::Service.stub!(:exists?).with(@new_resource.service_name).and_return(false) + Win32::Service.stub(:exists?).with(@new_resource.service_name).and_return(false) Win32::Service.should_not_receive(:configure) @provider.disable_service @new_resource.updated_by_last_action?.should be_false end it "should do nothing if the service is disabled" do - Win32::Service.stub!(:config_info).with(@new_resource.service_name).and_return( - mock("ConfigStruct", :start_type => "disabled")) + Win32::Service.stub(:config_info).with(@new_resource.service_name).and_return( + double("ConfigStruct", :start_type => "disabled")) @provider.load_current_resource Win32::Service.should_not_receive(:configure) @provider.disable_service diff --git a/spec/unit/provider/service_spec.rb b/spec/unit/provider/service_spec.rb index 3719af56f2..7ddc01ff0b 100644 --- a/spec/unit/provider/service_spec.rb +++ b/spec/unit/provider/service_spec.rb @@ -28,7 +28,7 @@ describe Chef::Provider::Service do @provider = Chef::Provider::Service.new(@new_resource, @run_context) @provider.current_resource = @current_resource - @provider.stub!(:load_current_resource) + @provider.stub(:load_current_resource) end describe "when enabling the service" do @@ -52,14 +52,14 @@ describe Chef::Provider::Service do describe "when disabling the service" do it "should disable the service if enabled and set the resource as updated" do - @current_resource.stub!(:enabled).and_return(true) + @current_resource.stub(:enabled).and_return(true) @provider.should_receive(:disable_service).and_return(true) @provider.run_action(:disable) @provider.new_resource.should be_updated end it "should not disable the service if already disabled" do - @current_resource.stub!(:enabled).and_return(false) + @current_resource.stub(:enabled).and_return(false) @provider.should_not_receive(:disable_service) @provider.run_action(:disable) @provider.new_resource.should_not be_updated @@ -84,14 +84,14 @@ describe Chef::Provider::Service do describe "action_stop" do it "should stop the service if it is running and set the resource as updated" do - @current_resource.stub!(:running).and_return(true) + @current_resource.stub(:running).and_return(true) @provider.should_receive(:stop_service).and_return(true) @provider.run_action(:stop) @provider.new_resource.should be_updated end it "should not stop the service if it's already stopped" do - @current_resource.stub!(:running).and_return(false) + @current_resource.stub(:running).and_return(false) @provider.should_not_receive(:stop_service) @provider.run_action(:stop) @provider.new_resource.should_not be_updated @@ -110,7 +110,7 @@ describe Chef::Provider::Service do end it "should restart the service even if it isn't running and set the resource as updated" do - @current_resource.stub!(:running).and_return(false) + @current_resource.stub(:running).and_return(false) @provider.should_receive(:restart_service).and_return(true) @provider.run_action(:restart) @provider.new_resource.should be_updated @@ -124,19 +124,19 @@ describe Chef::Provider::Service do it "should raise an exception if reload isn't supported" do @new_resource.supports(:reload => false) - @new_resource.stub!(:reload_command).and_return(false) + @new_resource.stub(:reload_command).and_return(false) lambda { @provider.run_action(:reload) }.should raise_error(Chef::Exceptions::UnsupportedAction) end it "should reload the service if it is running and set the resource as updated" do - @current_resource.stub!(:running).and_return(true) + @current_resource.stub(:running).and_return(true) @provider.should_receive(:reload_service).and_return(true) @provider.run_action(:reload) @provider.new_resource.should be_updated end it "should not reload the service if it's stopped" do - @current_resource.stub!(:running).and_return(false) + @current_resource.stub(:running).and_return(false) @provider.should_not_receive(:reload_service) @provider.run_action(:stop) @provider.new_resource.should_not be_updated diff --git a/spec/unit/provider/subversion_spec.rb b/spec/unit/provider/subversion_spec.rb index dd020d4597..f37a42d235 100644 --- a/spec/unit/provider/subversion_spec.rb +++ b/spec/unit/provider/subversion_spec.rb @@ -43,9 +43,9 @@ describe Chef::Provider::Subversion do context "determining the revision of the currently deployed code" do before do - @stdout = mock("stdout") - @stderr = mock("stderr") - @exitstatus = mock("exitstatus") + @stdout = double("stdout") + @stderr = double("stderr") + @exitstatus = double("exitstatus") end it "sets the revision to nil if there isn't any deployed code yet" do @@ -66,9 +66,9 @@ describe Chef::Provider::Subversion do ::File.should_receive(:exist?).at_least(1).times.with("/my/deploy/dir/.svn").and_return(true) ::File.should_receive(:directory?).with("/my/deploy/dir").and_return(true) ::Dir.should_receive(:chdir).with("/my/deploy/dir").and_yield - @stdout.stub!(:string).and_return(example_svn_info) - @stderr.stub!(:string).and_return("") - @exitstatus.stub!(:exitstatus).and_return(0) + @stdout.stub(:string).and_return(example_svn_info) + @stderr.stub(:string).and_return("") + @exitstatus.stub(:exitstatus).and_return(0) expected_command = ["svn info", {:cwd=>"/my/deploy/dir"}] @provider.should_receive(:popen4).with(*expected_command). and_yield("no-pid", "no-stdin", @stdout,@stderr). @@ -81,9 +81,9 @@ describe Chef::Provider::Subversion do ::File.should_receive(:exist?).with("/my/deploy/dir/.svn").and_return(true) ::File.should_receive(:directory?).with("/my/deploy/dir").and_return(true) ::Dir.should_receive(:chdir).with("/my/deploy/dir").and_yield - @stdout.stub!(:string).and_return(example_svn_info) - @stderr.stub!(:string).and_return("") - @exitstatus.stub!(:exitstatus).and_return(1) + @stdout.stub(:string).and_return(example_svn_info) + @stderr.stub(:string).and_return("") + @exitstatus.stub(:exitstatus).and_return(1) @provider.should_receive(:popen4).and_yield("no-pid", "no-stdin", @stdout,@stderr). and_return(@exitstatus) @provider.find_current_revision.should be_nil @@ -99,7 +99,7 @@ describe Chef::Provider::Subversion do end it "creates the current_resource object and sets its revision to the current deployment's revision as long as we're not exporting" do - @provider.stub!(:find_current_revision).and_return("11410") + @provider.stub(:find_current_revision).and_return("11410") @provider.new_resource.instance_variable_set :@action, [:checkout] @provider.load_current_resource @provider.current_resource.name.should eql(@resource.name) @@ -109,8 +109,8 @@ describe Chef::Provider::Subversion do context "resolving revisions to an integer" do before do - @stdout = mock("stdout") - @stderr = mock("stderr") + @stdout = double("stdout") + @stderr = double("stderr") @resource.svn_info_args "--no-auth-cache" end @@ -128,11 +128,11 @@ describe Chef::Provider::Subversion do "Last Changed Author: codeninja\n" + "Last Changed Rev: 11410\n" + # Last Changed Rev is preferred to Revision "Last Changed Date: 2009-03-25 06:09:56 -0600 (Wed, 25 Mar 2009)\n\n" - exitstatus = mock("exitstatus") - exitstatus.stub!(:exitstatus).and_return(0) + exitstatus = double("exitstatus") + exitstatus.stub(:exitstatus).and_return(0) @resource.revision "HEAD" - @stdout.stub!(:string).and_return(example_svn_info) - @stderr.stub!(:string).and_return("") + @stdout.stub(:string).and_return(example_svn_info) + @stderr.stub(:string).and_return("") expected_command = ["svn info http://svn.example.org/trunk/ --no-auth-cache -rHEAD", {:cwd=>Dir.tmpdir}] @provider.should_receive(:popen4).with(*expected_command). and_yield("no-pid","no-stdin",@stdout,@stderr). @@ -142,11 +142,11 @@ describe Chef::Provider::Subversion do it "returns a helpful message if data from `svn info` can't be parsed" do example_svn_info = "some random text from an error message\n" - exitstatus = mock("exitstatus") - exitstatus.stub!(:exitstatus).and_return(0) + exitstatus = double("exitstatus") + exitstatus.stub(:exitstatus).and_return(0) @resource.revision "HEAD" - @stdout.stub!(:string).and_return(example_svn_info) - @stderr.stub!(:string).and_return("") + @stdout.stub(:string).and_return(example_svn_info) + @stderr.stub(:string).and_return("") @provider.should_receive(:popen4).and_yield("no-pid","no-stdin",@stdout,@stderr). and_return(exitstatus) lambda {@provider.revision_int}.should raise_error(RuntimeError, "Could not parse `svn info` data: some random text from an error message") @@ -197,7 +197,7 @@ describe Chef::Provider::Subversion do end it "runs an export with the --force option" do - ::File.stub!(:directory?).with("/my/deploy").and_return(true) + ::File.stub(:directory?).with("/my/deploy").and_return(true) expected_cmd = "svn export --force -q -r12345 http://svn.example.org/trunk/ /my/deploy/dir" @provider.should_receive(:run_command).with(:command => expected_cmd) @provider.run_action(:force_export) @@ -205,7 +205,7 @@ describe Chef::Provider::Subversion do end it "runs the checkout command for action_checkout" do - ::File.stub!(:directory?).with("/my/deploy").and_return(true) + ::File.stub(:directory?).with("/my/deploy").and_return(true) expected_cmd = "svn checkout -q -r12345 http://svn.example.org/trunk/ /my/deploy/dir" @provider.should_receive(:run_command).with(:command => expected_cmd) @provider.run_action(:checkout) @@ -217,17 +217,17 @@ describe Chef::Provider::Subversion do end it "should not checkout if the destination exists or is a non empty directory" do - ::File.stub!(:exist?).with("/my/deploy/dir/.svn").and_return(false) - ::File.stub!(:exist?).with("/my/deploy/dir").and_return(true) - ::File.stub!(:directory?).with("/my/deploy").and_return(true) - ::Dir.stub!(:entries).with("/my/deploy/dir").and_return(['.','..','foo','bar']) + ::File.stub(:exist?).with("/my/deploy/dir/.svn").and_return(false) + ::File.stub(:exist?).with("/my/deploy/dir").and_return(true) + ::File.stub(:directory?).with("/my/deploy").and_return(true) + ::Dir.stub(:entries).with("/my/deploy/dir").and_return(['.','..','foo','bar']) @provider.should_not_receive(:checkout_command) @provider.run_action(:checkout) @resource.should_not be_updated end it "runs commands with the user and group specified in the resource" do - ::File.stub!(:directory?).with("/my/deploy").and_return(true) + ::File.stub(:directory?).with("/my/deploy").and_return(true) @resource.user "whois" @resource.group "thisis" expected_cmd = "svn checkout -q -r12345 http://svn.example.org/trunk/ /my/deploy/dir" @@ -237,24 +237,24 @@ describe Chef::Provider::Subversion do end it "does a checkout for action_sync if there's no deploy dir" do - ::File.stub!(:directory?).with("/my/deploy").and_return(true) + ::File.stub(:directory?).with("/my/deploy").and_return(true) ::File.should_receive(:exist?).with("/my/deploy/dir/.svn").twice.and_return(false) @provider.should_receive(:action_checkout) @provider.run_action(:sync) end it "does a checkout for action_sync if the deploy dir exists but is empty" do - ::File.stub!(:directory?).with("/my/deploy").and_return(true) + ::File.stub(:directory?).with("/my/deploy").and_return(true) ::File.should_receive(:exist?).with("/my/deploy/dir/.svn").twice.and_return(false) @provider.should_receive(:action_checkout) @provider.run_action(:sync) end it "runs the sync_command on action_sync if the deploy dir exists and isn't empty" do - ::File.stub!(:directory?).with("/my/deploy").and_return(true) + ::File.stub(:directory?).with("/my/deploy").and_return(true) ::File.should_receive(:exist?).with("/my/deploy/dir/.svn").and_return(true) - @provider.stub!(:find_current_revision).and_return("11410") - @provider.stub!(:current_revision_matches_target_revision?).and_return(false) + @provider.stub(:find_current_revision).and_return("11410") + @provider.stub(:current_revision_matches_target_revision?).and_return(false) expected_cmd = "svn update -q -r12345 /my/deploy/dir" @provider.should_receive(:run_command).with(:command => expected_cmd) @provider.run_action(:sync) @@ -262,16 +262,16 @@ describe Chef::Provider::Subversion do end it "does not fetch any updates if the remote revision matches the current revision" do - ::File.stub!(:directory?).with("/my/deploy").and_return(true) + ::File.stub(:directory?).with("/my/deploy").and_return(true) ::File.should_receive(:exist?).with("/my/deploy/dir/.svn").and_return(true) - @provider.stub!(:find_current_revision).and_return('12345') - @provider.stub!(:current_revision_matches_target_revision?).and_return(true) + @provider.stub(:find_current_revision).and_return('12345') + @provider.stub(:current_revision_matches_target_revision?).and_return(true) @provider.run_action(:sync) @resource.should_not be_updated end it "runs the export_command on action_export" do - ::File.stub!(:directory?).with("/my/deploy").and_return(true) + ::File.stub(:directory?).with("/my/deploy").and_return(true) expected_cmd = "svn export --force -q -r12345 http://svn.example.org/trunk/ /my/deploy/dir" @provider.should_receive(:run_command).with(:command => expected_cmd) @provider.run_action(:export) diff --git a/spec/unit/provider/template/content_spec.rb b/spec/unit/provider/template/content_spec.rb index 4061d99d7b..dfc5d21c2a 100644 --- a/spec/unit/provider/template/content_spec.rb +++ b/spec/unit/provider/template/content_spec.rb @@ -21,7 +21,7 @@ require 'spec_helper' describe Chef::Provider::Template::Content do let(:new_resource) do - mock("Chef::Resource::Template (new)", + double("Chef::Resource::Template (new)", :cookbook_name => 'openldap', :source => 'openldap_stuff.conf.erb', :local => false, @@ -41,11 +41,11 @@ describe Chef::Provider::Template::Content do cl.load_cookbooks cookbook_collection = Chef::CookbookCollection.new(cl) node = Chef::Node.new - mock("Chef::Resource::RunContext", :node => node, :cookbook_collection => cookbook_collection) + double("Chef::Resource::RunContext", :node => node, :cookbook_collection => cookbook_collection) end let(:content) do - current_resource = mock("Chef::Resource::Template (current)") + current_resource = double("Chef::Resource::Template (current)") Chef::Provider::Template::Content.new(new_resource, current_resource, run_context) end @@ -58,15 +58,15 @@ describe Chef::Provider::Template::Content do end it "finds the template file locally if it is local" do - new_resource.stub!(:local).and_return(true) - new_resource.stub!(:source).and_return('/tmp/its_on_disk.erb') + new_resource.stub(:local).and_return(true) + new_resource.stub(:source).and_return('/tmp/its_on_disk.erb') content.template_location.should == '/tmp/its_on_disk.erb' end it "should use the cookbook name if defined in the template resource" do - new_resource.stub!(:cookbook_name).and_return('apache2') - new_resource.stub!(:cookbook).and_return('openldap') - new_resource.stub!(:source).and_return("test.erb") + new_resource.stub(:cookbook_name).and_return('apache2') + new_resource.stub(:cookbook).and_return('openldap') + new_resource.stub(:source).and_return("test.erb") content.template_location.should == CHEF_SPEC_DATA + '/cookbooks/openldap/templates/default/test.erb' end diff --git a/spec/unit/provider/template_spec.rb b/spec/unit/provider/template_spec.rb index 78d924aa41..514bdc12ff 100644 --- a/spec/unit/provider/template_spec.rb +++ b/spec/unit/provider/template_spec.rb @@ -50,7 +50,7 @@ describe Chef::Provider::Template do end let(:content) do - content = mock('Chef::Provider::File::Content::Template', :template_location => "/foo/bar/baz") + content = double('Chef::Provider::File::Content::Template', :template_location => "/foo/bar/baz") File.stub(:exists?).with("/foo/bar/baz").and_return(true) content end diff --git a/spec/unit/provider/user/dscl_spec.rb b/spec/unit/provider/user/dscl_spec.rb index dd98c55bd1..c7657aa6e5 100644 --- a/spec/unit/provider/user/dscl_spec.rb +++ b/spec/unit/provider/user/dscl_spec.rb @@ -64,7 +64,7 @@ describe Chef::Provider::User::Dscl do describe "get_free_uid" do before do - @provider.stub!(:safe_dscl).and_return("\nwheel 200\nstaff 201\n") + @provider.stub(:safe_dscl).and_return("\nwheel 200\nstaff 201\n") end it "should run safe_dscl with list /Users uid" do @@ -84,7 +84,7 @@ describe Chef::Provider::User::Dscl do describe "uid_used?" do before do - @provider.stub!(:safe_dscl).and_return("\naj 500\n") + @provider.stub(:safe_dscl).and_return("\naj 500\n") end it "should run safe_dscl with list /Users uid" do @@ -107,7 +107,7 @@ describe Chef::Provider::User::Dscl do describe "when determining the uid to set" do it "raises RequestedUIDUnavailable if the requested uid is already in use" do - @provider.stub!(:uid_used?).and_return(true) + @provider.stub(:uid_used?).and_return(true) @provider.should_receive(:get_free_uid).and_return(501) lambda { @provider.set_uid }.should raise_error(Chef::Exceptions::RequestedUIDUnavailable) end @@ -156,8 +156,8 @@ describe Chef::Provider::User::Dscl do current_home_files = [current_home + '/my-dot-emacs', current_home + '/my-dot-vim'] @current_resource.home(current_home) @new_resource.gid(23) - ::File.stub!(:exists?).with('/old/home/toor').and_return(true) - ::File.stub!(:exists?).with('/Users/toor').and_return(true) + ::File.stub(:exists?).with('/old/home/toor').and_return(true) + ::File.stub(:exists?).with('/Users/toor').and_return(true) FileUtils.should_receive(:mkdir_p).with('/Users/toor').and_return(true) FileUtils.should_receive(:rmdir).with(current_home) @@ -170,7 +170,7 @@ describe Chef::Provider::User::Dscl do end it "should raise an exception when the systems user template dir (skel) cannot be found" do - ::File.stub!(:exists?).and_return(false,false,false) + ::File.stub(:exists?).and_return(false,false,false) lambda { @provider.modify_home }.should raise_error(Chef::Exceptions::User) end @@ -284,7 +284,7 @@ describe Chef::Provider::User::Dscl do uuid = "B398449E-CEE0-45E0-80F8-B0B5B1BFDEAA" File.should_receive(:open).with('/var/db/shadow/hash/B398449E-CEE0-45E0-80F8-B0B5B1BFDEAA', "w", 384).and_yield(@output) @new_resource.password("password") - OpenSSL::Random.stub!(:random_bytes).and_return("\377\377\377\377\377\377\377\377") + OpenSSL::Random.stub(:random_bytes).and_return("\377\377\377\377\377\377\377\377") expected_salted_sha1 = "F"*8+"SHA1-"*8 expected_shadow_hash = "00000000"*155 expected_shadow_hash[168] = expected_salted_sha1 @@ -324,8 +324,8 @@ describe Chef::Provider::User::Dscl do end it "shouldn't raise an error if /usr/bin/dscl exists" do - ::File.stub!(:exists?).and_return(true) - lambda { @provider.load_current_resource }.should_not raise_error(Chef::Exceptions::User) + ::File.stub(:exists?).and_return(true) + lambda { @provider.load_current_resource }.should_not raise_error end end diff --git a/spec/unit/provider/user/pw_spec.rb b/spec/unit/provider/user/pw_spec.rb index ea5bcfe740..1d5ad38c9c 100644 --- a/spec/unit/provider/user/pw_spec.rb +++ b/spec/unit/provider/user/pw_spec.rb @@ -62,13 +62,13 @@ describe Chef::Provider::User::Pw do end it "should set the option for #{attribute} if the new resources #{attribute} is not null" do - @new_resource.stub!(attribute).and_return("hola") + @new_resource.stub(attribute).and_return("hola") @provider.set_options.should eql(" #{@new_resource.username} #{option} '#{@new_resource.send(attribute)}' -m") end it "should set the option for #{attribute} if the new resources #{attribute} is not null, without homedir management" do - @new_resource.stub!(:supports).and_return({:manage_home => false}) - @new_resource.stub!(attribute).and_return("hola") + @new_resource.stub(:supports).and_return({:manage_home => false}) + @new_resource.stub(attribute).and_return("hola") @provider.set_options.should eql(" #{@new_resource.username} #{option} '#{@new_resource.send(attribute)}'") end end @@ -76,7 +76,7 @@ describe Chef::Provider::User::Pw do it "should combine all the possible options" do match_string = " adam" field_list.sort{ |a,b| a[0] <=> b[0] }.each do |attribute, option| - @new_resource.stub!(attribute).and_return("hola") + @new_resource.stub(attribute).and_return("hola") match_string << " #{option} 'hola'" end match_string << " -m" @@ -86,8 +86,8 @@ describe Chef::Provider::User::Pw do describe "create_user" do before(:each) do - @provider.stub!(:run_command).and_return(true) - @provider.stub!(:modify_password).and_return(true) + @provider.stub(:run_command).and_return(true) + @provider.stub(:modify_password).and_return(true) end it "should run pw useradd with the return of set_options" do @@ -103,8 +103,8 @@ describe Chef::Provider::User::Pw do describe "manage_user" do before(:each) do - @provider.stub!(:run_command).and_return(true) - @provider.stub!(:modify_password).and_return(true) + @provider.stub(:run_command).and_return(true) + @provider.stub(:modify_password).and_return(true) end it "should run pw usermod with the return of set_options" do @@ -133,12 +133,12 @@ describe Chef::Provider::User::Pw do describe "determining if the user is locked" do it "should return true if user is locked" do - @current_resource.stub!(:password).and_return("*LOCKED*abracadabra") + @current_resource.stub(:password).and_return("*LOCKED*abracadabra") @provider.check_lock.should eql(true) end it "should return false if user is not locked" do - @current_resource.stub!(:password).and_return("abracadabra") + @current_resource.stub(:password).and_return("abracadabra") @provider.check_lock.should eql(false) end end @@ -159,8 +159,8 @@ describe Chef::Provider::User::Pw do describe "when modifying the password" do before(:each) do - @status = mock("Status", :exitstatus => 0) - @provider.stub!(:popen4).and_return(@status) + @status = double("Status", :exitstatus => 0) + @provider.stub(:popen4).and_return(@status) @pid, @stdin, @stdout, @stderr = nil, nil, nil, nil end @@ -172,8 +172,8 @@ describe Chef::Provider::User::Pw do describe "and the passwords are identical" do before(:each) do - @new_resource.stub!(:password).and_return("abracadabra") - @current_resource.stub!(:password).and_return("abracadabra") + @new_resource.stub(:password).and_return("abracadabra") + @current_resource.stub(:password).and_return("abracadabra") end it "logs an appropriate message" do @@ -184,8 +184,8 @@ describe Chef::Provider::User::Pw do describe "and the passwords are different" do before(:each) do - @new_resource.stub!(:password).and_return("abracadabra") - @current_resource.stub!(:password).and_return("sesame") + @new_resource.stub(:password).and_return("abracadabra") + @current_resource.stub(:password).and_return("sesame") end it "should log an appropriate message" do @@ -200,7 +200,7 @@ describe Chef::Provider::User::Pw do it "should send the new password to the stdin of pw usermod" do @stdin = StringIO.new - @provider.stub!(:popen4).and_yield(@pid, @stdin, @stdout, @stderr).and_return(@status) + @provider.stub(:popen4).and_yield(@pid, @stdin, @stdout, @stderr).and_return(@status) @provider.modify_password @stdin.string.should == "abracadabra\n" end @@ -212,7 +212,7 @@ describe Chef::Provider::User::Pw do it "should not raise an exception if pw usermod succeeds" do @status.should_receive(:exitstatus).and_return(0) - lambda { @provider.modify_password }.should_not raise_error(Chef::Exceptions::User) + lambda { @provider.modify_password }.should_not raise_error end end end @@ -228,8 +228,8 @@ describe Chef::Provider::User::Pw do end it "shouldn't raise an error if /usr/sbin/pw exists" do - File.stub!(:exists?).and_return(true) - lambda { @provider.load_current_resource }.should_not raise_error(Chef::Exceptions::User) + File.stub(:exists?).and_return(true) + lambda { @provider.load_current_resource }.should_not raise_error end end end diff --git a/spec/unit/provider/user/solaris_spec.rb b/spec/unit/provider/user/solaris_spec.rb index 5500eac812..d8bd0f9e75 100644 --- a/spec/unit/provider/user/solaris_spec.rb +++ b/spec/unit/provider/user/solaris_spec.rb @@ -27,7 +27,7 @@ describe Chef::Provider::User::Solaris do p.current_resource = @current_resource # Prevent the useradd-based provider tests from trying to write /etc/shadow - p.stub!(:write_shadow_file) + p.stub(:write_shadow_file) p end @@ -52,12 +52,12 @@ describe Chef::Provider::User::Solaris do @new_resource.password "hocus-pocus" # Let these tests run #write_shadow_file - provider.unstub!(:write_shadow_file) + provider.unstub(:write_shadow_file) end it "should use its own shadow file writer to set the password" do provider.should_receive(:write_shadow_file) - provider.stub!(:shell_out!).and_return(true) + provider.stub(:shell_out!).and_return(true) provider.manage_user end @@ -66,10 +66,10 @@ describe Chef::Provider::User::Solaris do password_file.puts "adam:existingpassword:15441::::::" password_file.close provider.password_file = password_file.path - provider.stub!(:shell_out!).and_return(true) + provider.stub(:shell_out!).and_return(true) # may not be able to write to /etc for tests... temp_file = Tempfile.new("shadow") - Tempfile.stub!(:new).with("shadow", "/etc").and_return(temp_file) + Tempfile.stub(:new).with("shadow", "/etc").and_return(temp_file) @new_resource.password "verysecurepassword" provider.manage_user ::File.open(password_file.path, "r").read.should =~ /adam:verysecurepassword:/ diff --git a/spec/unit/provider/user/windows_spec.rb b/spec/unit/provider/user/windows_spec.rb index b11eeaebe5..70adb8025a 100644 --- a/spec/unit/provider/user/windows_spec.rb +++ b/spec/unit/provider/user/windows_spec.rb @@ -35,8 +35,8 @@ describe Chef::Provider::User::Windows do @run_context = Chef::RunContext.new(@node, {}, @events) @current_resource = Chef::Resource::User.new("monkey") - @net_user = mock("Chef::Util::Windows::NetUser") - Chef::Util::Windows::NetUser.stub!(:new).and_return(@net_user) + @net_user = double("Chef::Util::Windows::NetUser") + Chef::Util::Windows::NetUser.stub(:new).and_return(@net_user) @provider = Chef::Provider::User::Windows.new(@new_resource, @run_context) @provider.current_resource = @current_resource @@ -120,7 +120,7 @@ describe Chef::Provider::User::Windows do describe "when creating the user" do it "should call @net_user.add with the return of set_options" do - @provider.stub!(:set_options).and_return(:name=> "monkey") + @provider.stub(:set_options).and_return(:name=> "monkey") @net_user.should_receive(:add).with(:name=> "monkey") @provider.create_user end @@ -128,7 +128,7 @@ describe Chef::Provider::User::Windows do describe "manage_user" do before(:each) do - @provider.stub!(:set_options).and_return(:name=> "monkey") + @provider.stub(:set_options).and_return(:name=> "monkey") end it "should call @net_user.update with the return of set_options" do @@ -150,19 +150,19 @@ describe Chef::Provider::User::Windows do end it "should return true if user is locked" do - @net_user.stub!(:check_enabled).and_return(true) + @net_user.stub(:check_enabled).and_return(true) @provider.check_lock.should eql(true) end it "should return false if user is not locked" do - @net_user.stub!(:check_enabled).and_return(false) + @net_user.stub(:check_enabled).and_return(false) @provider.check_lock.should eql(false) end end describe "locking the user" do it "should call @net_user.disable_account" do - @net_user.stub!(:check_enabled).and_return(true) + @net_user.stub(:check_enabled).and_return(true) @net_user.should_receive(:disable_account) @provider.lock_user end @@ -170,7 +170,7 @@ describe Chef::Provider::User::Windows do describe "unlocking the user" do it "should call @net_user.enable_account" do - @net_user.stub!(:check_enabled).and_return(false) + @net_user.stub(:check_enabled).and_return(false) @net_user.should_receive(:enable_account) @provider.unlock_user end diff --git a/spec/unit/provider/user_spec.rb b/spec/unit/provider/user_spec.rb index d5e694b79c..153db6f283 100644 --- a/spec/unit/provider/user_spec.rb +++ b/spec/unit/provider/user_spec.rb @@ -58,7 +58,7 @@ describe Chef::Provider::User do describe "executing load_current_resource" do before(:each) do @node = Chef::Node.new - #@new_resource = mock("Chef::Resource::User", + #@new_resource = double("Chef::Resource::User", # :null_object => true, # :username => "adam", # :comment => "Adam Jacob", @@ -69,7 +69,7 @@ describe Chef::Provider::User do # :password => nil, # :updated => nil #) - Chef::Resource::User.stub!(:new).and_return(@current_resource) + Chef::Resource::User.stub(:new).and_return(@current_resource) @pw_user = EtcPwnamIsh.new @pw_user.name = "adam" @pw_user.gid = 1000 @@ -78,7 +78,7 @@ describe Chef::Provider::User do @pw_user.dir = "/home/adam" @pw_user.shell = "/usr/bin/zsh" @pw_user.passwd = "*" - Etc.stub!(:getpwnam).and_return(@pw_user) + Etc.stub(:getpwnam).and_return(@pw_user) end it "should create a current resource with the same name as the new resource" do @@ -129,7 +129,7 @@ describe Chef::Provider::User do end it "shouldn't try and convert the group gid if none has been supplied" do - @new_resource.stub!(:gid).and_return(nil) + @new_resource.stub(:gid).and_return(nil) @provider.should_not_receive(:convert_group_name) @provider.load_current_resource end @@ -156,7 +156,7 @@ describe Chef::Provider::User do user.name = "root" user.passwd = "x" @new_resource.password "some new password" - Etc.stub!(:getpwnam).and_return(user) + Etc.stub(:getpwnam).and_return(user) end unless shadow_lib_unavail? @@ -225,8 +225,8 @@ describe Chef::Provider::User do describe "action_create" do before(:each) do - @provider.stub!(:load_current_resource) - # @current_resource = mock("Chef::Resource::User", + @provider.stub(:load_current_resource) + # @current_resource = double("Chef::Resource::User", # :null_object => true, # :username => "adam", # :comment => "Adam Jacob", @@ -240,8 +240,8 @@ describe Chef::Provider::User do # @provider = Chef::Provider::User.new(@node, @new_resource) # @provider.current_resource = @current_resource # @provider.user_exists = false - # @provider.stub!(:create_user).and_return(true) - # @provider.stub!(:manage_user).and_return(true) + # @provider.stub(:create_user).and_return(true) + # @provider.stub(:manage_user).and_return(true) end it "should call create_user if the user does not exist" do @@ -254,15 +254,15 @@ describe Chef::Provider::User do it "should call manage_user if the user exists and has mismatched attributes" do @provider.user_exists = true - @provider.stub!(:compare_user).and_return(true) + @provider.stub(:compare_user).and_return(true) @provider.should_receive(:manage_user).and_return(true) @provider.action_create end it "should set the new_resources updated flag when it creates the user if we call manage_user" do @provider.user_exists = true - @provider.stub!(:compare_user).and_return(true) - @provider.stub!(:manage_user).and_return(true) + @provider.stub(:compare_user).and_return(true) + @provider.stub(:manage_user).and_return(true) @provider.action_create @provider.set_updated_status @new_resource.should be_updated @@ -271,7 +271,7 @@ describe Chef::Provider::User do describe "action_remove" do before(:each) do - @provider.stub!(:load_current_resource) + @provider.stub(:load_current_resource) end it "should not call remove_user if the user does not exist" do @@ -297,18 +297,18 @@ describe Chef::Provider::User do describe "action_manage" do before(:each) do - @provider.stub!(:load_current_resource) + @provider.stub(:load_current_resource) # @node = Chef::Node.new - # @new_resource = mock("Chef::Resource::User", + # @new_resource = double("Chef::Resource::User", # :null_object => true # ) - # @current_resource = mock("Chef::Resource::User", + # @current_resource = double("Chef::Resource::User", # :null_object => true # ) # @provider = Chef::Provider::User.new(@node, @new_resource) # @provider.current_resource = @current_resource # @provider.user_exists = true - # @provider.stub!(:manage_user).and_return(true) + # @provider.stub(:manage_user).and_return(true) end it "should run manage_user if the user exists and has mismatched attributes" do @@ -318,8 +318,8 @@ describe Chef::Provider::User do end it "should set the new resources updated flag to true if manage_user is called" do - @provider.stub!(:compare_user).and_return(true) - @provider.stub!(:manage_user).and_return(true) + @provider.stub(:compare_user).and_return(true) + @provider.stub(:manage_user).and_return(true) @provider.action_manage @provider.set_updated_status @new_resource.should be_updated @@ -340,18 +340,18 @@ describe Chef::Provider::User do describe "action_modify" do before(:each) do - @provider.stub!(:load_current_resource) + @provider.stub(:load_current_resource) # @node = Chef::Node.new - # @new_resource = mock("Chef::Resource::User", + # @new_resource = double("Chef::Resource::User", # :null_object => true # ) - # @current_resource = mock("Chef::Resource::User", + # @current_resource = double("Chef::Resource::User", # :null_object => true # ) # @provider = Chef::Provider::User.new(@node, @new_resource) # @provider.current_resource = @current_resource # @provider.user_exists = true - # @provider.stub!(:manage_user).and_return(true) + # @provider.stub(:manage_user).and_return(true) end it "should run manage_user if the user exists and has mismatched attributes" do @@ -361,8 +361,8 @@ describe Chef::Provider::User do end it "should set the new resources updated flag to true if manage_user is called" do - @provider.stub!(:compare_user).and_return(true) - @provider.stub!(:manage_user).and_return(true) + @provider.stub(:compare_user).and_return(true) + @provider.stub(:manage_user).and_return(true) @provider.action_modify @provider.set_updated_status @new_resource.should be_updated @@ -383,16 +383,16 @@ describe Chef::Provider::User do describe "action_lock" do before(:each) do - @provider.stub!(:load_current_resource) + @provider.stub(:load_current_resource) end it "should lock the user if it exists and is unlocked" do - @provider.stub!(:check_lock).and_return(false) + @provider.stub(:check_lock).and_return(false) @provider.should_receive(:lock_user).and_return(true) @provider.action_lock end it "should set the new resources updated flag to true if lock_user is called" do - @provider.stub!(:check_lock).and_return(false) + @provider.stub(:check_lock).and_return(false) @provider.should_receive(:lock_user) @provider.action_lock @provider.set_updated_status @@ -409,23 +409,23 @@ describe Chef::Provider::User do describe "action_unlock" do before(:each) do - @provider.stub!(:load_current_resource) + @provider.stub(:load_current_resource) # @node = Chef::Node.new - # @new_resource = mock("Chef::Resource::User", + # @new_resource = double("Chef::Resource::User", # :null_object => true # ) - # @current_resource = mock("Chef::Resource::User", + # @current_resource = double("Chef::Resource::User", # :null_object => true # ) # @provider = Chef::Provider::User.new(@node, @new_resource) # @provider.current_resource = @current_resource # @provider.user_exists = true - # @provider.stub!(:check_lock).and_return(true) - # @provider.stub!(:unlock_user).and_return(true) + # @provider.stub(:check_lock).and_return(true) + # @provider.stub(:unlock_user).and_return(true) end it "should unlock the user if it exists and is locked" do - @provider.stub!(:check_lock).and_return(true) + @provider.stub(:check_lock).and_return(true) @provider.should_receive(:unlock_user).and_return(true) @provider.action_unlock @provider.set_updated_status diff --git a/spec/unit/provider_spec.rb b/spec/unit/provider_spec.rb index 7873be0f28..363649ec46 100644 --- a/spec/unit/provider_spec.rb +++ b/spec/unit/provider_spec.rb @@ -93,15 +93,15 @@ describe Chef::Provider do it "does not re-load recipes when creating the temporary run context" do # we actually want to test that RunContext#load is never called, but we # can't stub all instances of an object with rspec's mocks. :/ - Chef::RunContext.stub!(:new).and_raise("not supposed to happen") + Chef::RunContext.stub(:new).and_raise("not supposed to happen") snitch = Proc.new {temporary_collection = @run_context.resource_collection} @provider.send(:recipe_eval, &snitch) end context "when no converge actions are queued" do before do - @provider.stub!(:whyrun_supported?).and_return(true) - @provider.stub!(:load_current_resource) + @provider.stub(:whyrun_supported?).and_return(true) + @provider.stub(:load_current_resource) end it "does not mark the new resource as updated" do diff --git a/spec/unit/recipe_spec.rb b/spec/unit/recipe_spec.rb index 4615bcb4d4..b0cd04b245 100644 --- a/spec/unit/recipe_spec.rb +++ b/spec/unit/recipe_spec.rb @@ -22,84 +22,94 @@ require 'spec_helper' describe Chef::Recipe do - before(:each) do - @cookbook_repo = File.expand_path(File.join(File.dirname(__FILE__), "..", "data", "cookbooks")) - cl = Chef::CookbookLoader.new(@cookbook_repo) - cl.load_cookbooks - @cookbook_collection = Chef::CookbookCollection.new(cl) - @node = Chef::Node.new - @node.normal[:tags] = Array.new - @events = Chef::EventDispatch::Dispatcher.new - @run_context = Chef::RunContext.new(@node, @cookbook_collection, @events) - @recipe = Chef::Recipe.new("hjk", "test", @run_context) - - # Shell/ext.rb is on the run path, and it defines - # Chef::Recipe#resources to call pp, which we don't want when - # we're running tests. - @recipe.stub!(:pp) + + let(:cookbook_repo) { File.expand_path(File.join(File.dirname(__FILE__), "..", "data", "cookbooks")) } + + let(:cookbook_loader) do + loader = Chef::CookbookLoader.new(cookbook_repo) + loader.load_cookbooks + loader + end + + let(:cookbook_collection) { Chef::CookbookCollection.new(cookbook_loader) } + + let(:node) do + Chef::Node.new.tap {|n| n.normal[:tags] = [] } + end + + let(:events) do + Chef::EventDispatch::Dispatcher.new + end + + let(:run_context) do + Chef::RunContext.new(node, cookbook_collection, events) + end + + let(:recipe) do + Chef::Recipe.new("hjk", "test", run_context) end describe "method_missing" do describe "resources" do it "should load a two word (zen_master) resource" do lambda do - @recipe.zen_master "monkey" do + recipe.zen_master "monkey" do peace true end - end.should_not raise_error(ArgumentError) + end.should_not raise_error end it "should load a one word (cat) resource" do lambda do - @recipe.cat "loulou" do + recipe.cat "loulou" do pretty_kitty true end - end.should_not raise_error(ArgumentError) + end.should_not raise_error end it "should load a four word (one_two_three_four) resource" do lambda do - @recipe.one_two_three_four "numbers" do + recipe.one_two_three_four "numbers" do i_can_count true end - end.should_not raise_error(ArgumentError) + end.should_not raise_error end it "should throw an error if you access a resource that we can't find" do - lambda { @recipe.not_home("not_home_resource") }.should raise_error(NameError) + lambda { recipe.not_home("not_home_resource") }.should raise_error(NameError) end it "should require a name argument" do lambda { - @recipe.cat + recipe.cat }.should raise_error(ArgumentError, "You must supply a name when declaring a cat resource") end it "should allow regular errors (not NameErrors) to pass unchanged" do lambda { - @recipe.cat("felix") { raise ArgumentError, "You Suck" } + recipe.cat("felix") { raise ArgumentError, "You Suck" } }.should raise_error(ArgumentError) end it "should add our zen_master to the collection" do - @recipe.zen_master "monkey" do + recipe.zen_master "monkey" do peace true end - @run_context.resource_collection.lookup("zen_master[monkey]").name.should eql("monkey") + run_context.resource_collection.lookup("zen_master[monkey]").name.should eql("monkey") end it "should add our zen masters to the collection in the order they appear" do %w{monkey dog cat}.each do |name| - @recipe.zen_master name do + recipe.zen_master name do peace true end end - @run_context.resource_collection.map{|r| r.name}.should eql(["monkey", "dog", "cat"]) + run_context.resource_collection.map{|r| r.name}.should eql(["monkey", "dog", "cat"]) end it "should return the new resource after creating it" do - res = @recipe.zen_master "makoto" do + res = recipe.zen_master "makoto" do peace true end res.resource_name.should eql(:zen_master) @@ -110,16 +120,16 @@ describe Chef::Recipe do it "locate resource for particular platform" do Object.const_set('ShaunTheSheep', Class.new(Chef::Resource){ provides :laughter, :on_platforms => ["television"] }) - @node.automatic[:platform] = "television" - @node.automatic[:platform_version] = "123" - res = @recipe.laughter "timmy" + node.automatic[:platform] = "television" + node.automatic[:platform_version] = "123" + res = recipe.laughter "timmy" res.name.should eql("timmy") res.kind_of?(ShaunTheSheep) end it "locate a resource for all platforms" do Object.const_set("YourMom", Class.new(Chef::Resource){ provides :love_and_caring }) - res = @recipe.love_and_caring "mommy" + res = recipe.love_and_caring "mommy" res.name.should eql("mommy") res.kind_of?(YourMom) end @@ -127,6 +137,141 @@ describe Chef::Recipe do end end + describe "creating resources via build_resource" do + let(:zm_resource) do + recipe.build_resource(:zen_master, "klopp") do + something "bvb" + end + end + + it "applies attributes from the block to the resource" do + zm_resource.something.should == "bvb" + end + + it "sets contextual attributes on the resource" do + zm_resource.recipe_name.should == "test" + zm_resource.cookbook_name.should == "hjk" + zm_resource.source_line.should include(__FILE__) + end + + it "does not add the resource to the resource collection" do + zm_resource # force let binding evaluation + expect { run_context.resource_collection.resources(:zen_master => "klopp") }.to raise_error(Chef::Exceptions::ResourceNotFound) + end + + end + + describe "creating resources via declare_resource" do + let(:zm_resource) do + recipe.declare_resource(:zen_master, "klopp") do + something "bvb" + end + end + + it "applies attributes from the block to the resource" do + zm_resource.something.should == "bvb" + end + + it "sets contextual attributes on the resource" do + zm_resource.recipe_name.should == "test" + zm_resource.cookbook_name.should == "hjk" + zm_resource.source_line.should include(__FILE__) + end + + it "adds the resource to the resource collection" do + zm_resource # force let binding evaluation + run_context.resource_collection.resources(:zen_master => "klopp").should == zm_resource + end + + end + + describe "when attempting to create a resource of an invalid type" do + + it "gives a sane error message when using method_missing" do + lambda do + recipe.no_such_resource("foo") + end.should raise_error(NoMethodError, %q[No resource or method named `no_such_resource' for `Chef::Recipe "test"']) + end + + it "gives a sane error message when using method_missing 'bare'" do + lambda do + recipe.instance_eval do + # Giving an argument will change this from NameError to NoMethodError + no_such_resource + end + end.should raise_error(NameError, %q[No resource, method, or local variable named `no_such_resource' for `Chef::Recipe "test"']) + end + + it "gives a sane error message when using build_resource" do + expect { recipe.build_resource(:no_such_resource, "foo") }.to raise_error(Chef::Exceptions::NoSuchResourceType) + end + + it "gives a sane error message when using declare_resource" do + expect { recipe.declare_resource(:no_such_resource, "bar") }.to raise_error(Chef::Exceptions::NoSuchResourceType) + end + + end + + describe "when creating a resource that contains an error in the attributes block" do + + it "does not obfuscate the error source" do + lambda do + recipe.zen_master("klopp") do + this_method_doesnt_exist + end + end.should raise_error(NoMethodError, "undefined method `this_method_doesnt_exist' for Chef::Resource::ZenMaster") + + end + + end + + describe "resource cloning" do + + let(:second_recipe) do + Chef::Recipe.new("second_cb", "second_recipe", run_context) + end + + let(:original_resource) do + recipe.zen_master("klopp") do + something "bvb09" + action :score + end + end + + let(:duplicated_resource) do + original_resource + second_recipe.zen_master("klopp") do + # attrs should be cloned + end + end + + it "copies attributes from the first resource" do + duplicated_resource.something.should == "bvb09" + end + + it "does not copy the action from the first resource" do + original_resource.action.should == [:score] + duplicated_resource.action.should == :nothing + end + + it "does not copy the source location of the first resource" do + # sanity check source location: + original_resource.source_line.should include(__FILE__) + duplicated_resource.source_line.should include(__FILE__) + # actual test: + original_resource.source_line.should_not == duplicated_resource.source_line + end + + it "sets the cookbook name on the cloned resource to that resource's cookbook" do + duplicated_resource.cookbook_name.should == "second_cb" + end + + it "sets the recipe name on the cloned resource to that resoure's recipe" do + duplicated_resource.recipe_name.should == "second_recipe" + end + + end + describe "resource definitions" do it "should execute defined resources" do crow_define = Chef::ResourceDefinition.new @@ -136,12 +281,12 @@ describe Chef::Recipe do something params[:something] end end - @run_context.definitions[:crow] = crow_define - @recipe.crow "mine" do + run_context.definitions[:crow] = crow_define + recipe.crow "mine" do peace true end - @run_context.resource_collection.resources(:zen_master => "lao tzu").name.should eql("lao tzu") - @run_context.resource_collection.resources(:zen_master => "lao tzu").something.should eql(true) + run_context.resource_collection.resources(:zen_master => "lao tzu").name.should eql("lao tzu") + run_context.resource_collection.resources(:zen_master => "lao tzu").something.should eql(true) end it "should set the node on defined resources" do @@ -152,12 +297,12 @@ describe Chef::Recipe do something params[:something] end end - @run_context.definitions[:crow] = crow_define - @node.normal[:foo] = false - @recipe.crow "mine" do + run_context.definitions[:crow] = crow_define + node.normal[:foo] = false + recipe.crow "mine" do something node[:foo] end - @recipe.resources(:zen_master => "lao tzu").something.should eql(false) + recipe.resources(:zen_master => "lao tzu").something.should eql(false) end end @@ -170,15 +315,15 @@ describe Chef::Recipe do peace = true end CODE - lambda { @recipe.instance_eval(code) }.should_not raise_error - @recipe.resources(:zen_master => "gnome").name.should eql("gnome") + lambda { recipe.instance_eval(code) }.should_not raise_error + recipe.resources(:zen_master => "gnome").name.should eql("gnome") end end describe "from_file" do it "should load a resource from a ruby file" do - @recipe.from_file(File.join(CHEF_SPEC_DATA, "recipes", "test.rb")) - res = @recipe.resources(:file => "/etc/nsswitch.conf") + recipe.from_file(File.join(CHEF_SPEC_DATA, "recipes", "test.rb")) + res = recipe.resources(:file => "/etc/nsswitch.conf") res.name.should eql("/etc/nsswitch.conf") res.action.should eql([:create]) res.owner.should eql("root") @@ -187,84 +332,88 @@ describe Chef::Recipe do end it "should raise an exception if the file cannot be found or read" do - lambda { @recipe.from_file("/tmp/monkeydiving") }.should raise_error(IOError) + lambda { recipe.from_file("/tmp/monkeydiving") }.should raise_error(IOError) end end describe "include_recipe" do it "should evaluate another recipe with include_recipe" do - @run_context.include_recipe "openldap::gigantor" - res = @run_context.resource_collection.resources(:cat => "blanket") + node.should_receive(:loaded_recipe).with(:openldap, "gigantor") + run_context.include_recipe "openldap::gigantor" + res = run_context.resource_collection.resources(:cat => "blanket") res.name.should eql("blanket") res.pretty_kitty.should eql(false) end it "should load the default recipe for a cookbook if include_recipe is called without a ::" do - @run_context.include_recipe "openldap" - res = @run_context.resource_collection.resources(:cat => "blanket") + node.should_receive(:loaded_recipe).with(:openldap, "default") + run_context.include_recipe "openldap" + res = run_context.resource_collection.resources(:cat => "blanket") res.name.should eql("blanket") res.pretty_kitty.should eql(true) end it "should store that it has seen a recipe in the run_context" do - @run_context.include_recipe "openldap" - @run_context.loaded_recipe?("openldap").should be_true + node.should_receive(:loaded_recipe).with(:openldap, "default") + run_context.include_recipe "openldap" + run_context.loaded_recipe?("openldap").should be_true end it "should not include the same recipe twice" do - @cookbook_collection[:openldap].should_receive(:load_recipe).with("default", @run_context) - @recipe.include_recipe "openldap" - @cookbook_collection[:openldap].should_not_receive(:load_recipe).with("default", @run_context) - @recipe.include_recipe "openldap" + node.should_receive(:loaded_recipe).with(:openldap, "default").exactly(:once) + cookbook_collection[:openldap].should_receive(:load_recipe).with("default", run_context) + recipe.include_recipe "openldap" + cookbook_collection[:openldap].should_not_receive(:load_recipe).with("default", run_context) + recipe.include_recipe "openldap" end end describe "tags" do it "should set tags via tag" do - @recipe.tag "foo" - @node[:tags].should include("foo") + recipe.tag "foo" + node[:tags].should include("foo") end it "should set multiple tags via tag" do - @recipe.tag "foo", "bar" - @node[:tags].should include("foo") - @node[:tags].should include("bar") + recipe.tag "foo", "bar" + node[:tags].should include("foo") + node[:tags].should include("bar") end it "should not set the same tag twice via tag" do - @recipe.tag "foo" - @recipe.tag "foo" - @node[:tags].should eql([ "foo" ]) + recipe.tag "foo" + recipe.tag "foo" + node[:tags].should eql([ "foo" ]) end it "should return the current list of tags from tag with no arguments" do - @recipe.tag "foo" - @recipe.tag.should eql([ "foo" ]) + recipe.tag "foo" + recipe.tag.should eql([ "foo" ]) end it "should return true from tagged? if node is tagged" do - @recipe.tag "foo" - @recipe.tagged?("foo").should be(true) + recipe.tag "foo" + recipe.tagged?("foo").should be(true) end it "should return false from tagged? if node is not tagged" do - @recipe.tagged?("foo").should be(false) + recipe.tagged?("foo").should be(false) end it "should return false from tagged? if node is not tagged" do - @recipe.tagged?("foo").should be(false) + recipe.tagged?("foo").should be(false) end it "should remove a tag from the tag list via untag" do - @recipe.tag "foo" - @recipe.untag "foo" - @node[:tags].should eql([]) + recipe.tag "foo" + recipe.untag "foo" + node[:tags].should eql([]) end it "should remove multiple tags from the tag list via untag" do - @recipe.tag "foo", "bar" - @recipe.untag "bar", "foo" - @node[:tags].should eql([]) + recipe.tag "foo", "bar" + recipe.untag "bar", "foo" + node[:tags].should eql([]) end end end diff --git a/spec/unit/registry_helper_spec.rb b/spec/unit/registry_helper_spec.rb index 49469b27e6..444a82dc7c 100644 --- a/spec/unit/registry_helper_spec.rb +++ b/spec/unit/registry_helper_spec.rb @@ -43,8 +43,8 @@ describe Chef::Provider::RegistryKey do Win32::Registry::Error = Class.new(RuntimeError) - @hive_mock = mock("::Win32::Registry::HKEY_CURRENT_USER") - @reg_mock = mock("reg") + @hive_mock = double("::Win32::Registry::HKEY_CURRENT_USER") + @reg_mock = double("reg") end describe "get_values" do diff --git a/spec/unit/resource/cron_spec.rb b/spec/unit/resource/cron_spec.rb index 7f294fae11..355a7f09ba 100644 --- a/spec/unit/resource/cron_spec.rb +++ b/spec/unit/resource/cron_spec.rb @@ -39,8 +39,8 @@ describe Chef::Resource::Cron do end it "should accept create or delete for action" do - lambda { @resource.action :create }.should_not raise_error(ArgumentError) - lambda { @resource.action :delete }.should_not raise_error(ArgumentError) + lambda { @resource.action :create }.should_not raise_error + lambda { @resource.action :delete }.should_not raise_error lambda { @resource.action :lolcat }.should raise_error(ArgumentError) end diff --git a/spec/unit/resource/directory_spec.rb b/spec/unit/resource/directory_spec.rb index dc042c5a77..a42383c49e 100644 --- a/spec/unit/resource/directory_spec.rb +++ b/spec/unit/resource/directory_spec.rb @@ -39,8 +39,8 @@ describe Chef::Resource::Directory do end it "should accept create or delete for action" do - lambda { @resource.action :create }.should_not raise_error(ArgumentError) - lambda { @resource.action :delete }.should_not raise_error(ArgumentError) + lambda { @resource.action :create }.should_not raise_error + lambda { @resource.action :delete }.should_not raise_error lambda { @resource.action :blues }.should raise_error(ArgumentError) end @@ -49,14 +49,14 @@ describe Chef::Resource::Directory do end it "should accept a string as the path" do - lambda { @resource.path "/tmp" }.should_not raise_error(ArgumentError) + lambda { @resource.path "/tmp" }.should_not raise_error @resource.path.should eql("/tmp") lambda { @resource.path Hash.new }.should raise_error(ArgumentError) end it "should allow you to have specify whether the action is recursive with true/false" do - lambda { @resource.recursive true }.should_not raise_error(ArgumentError) - lambda { @resource.recursive false }.should_not raise_error(ArgumentError) + lambda { @resource.recursive true }.should_not raise_error + lambda { @resource.recursive false }.should_not raise_error lambda { @resource.recursive "monkey" }.should raise_error(ArgumentError) end diff --git a/spec/unit/resource/env_spec.rb b/spec/unit/resource/env_spec.rb index b53cbe478f..a1f599400b 100644 --- a/spec/unit/resource/env_spec.rb +++ b/spec/unit/resource/env_spec.rb @@ -43,7 +43,7 @@ describe Chef::Resource::Env do if bad_value lambda { @resource.action action }.should raise_error(ArgumentError) else - lambda { @resource.action action }.should_not raise_error(ArgumentError) + lambda { @resource.action action }.should_not raise_error end end end @@ -53,7 +53,7 @@ describe Chef::Resource::Env do end it "should accept a string as the env value via 'value'" do - lambda { @resource.value "bar" }.should_not raise_error(ArgumentError) + lambda { @resource.value "bar" }.should_not raise_error end it "should not accept a Hash for the env value via 'to'" do diff --git a/spec/unit/resource/erl_call_spec.rb b/spec/unit/resource/erl_call_spec.rb index 49df9639d1..3efbdca9a0 100644 --- a/spec/unit/resource/erl_call_spec.rb +++ b/spec/unit/resource/erl_call_spec.rb @@ -39,7 +39,7 @@ describe Chef::Resource::ErlCall do end it "should accept run as an action" do - lambda { @resource.action :run }.should_not raise_error(ArgumentError) + lambda { @resource.action :run }.should_not raise_error end it "should allow you to set the code attribute" do diff --git a/spec/unit/resource/file_spec.rb b/spec/unit/resource/file_spec.rb index f937d0035b..9c6365f6d3 100644 --- a/spec/unit/resource/file_spec.rb +++ b/spec/unit/resource/file_spec.rb @@ -44,25 +44,25 @@ describe Chef::Resource::File do lambda { @resource.content 5 }.should raise_error(ArgumentError) lambda { @resource.content :foo }.should raise_error(ArgumentError) lambda { @resource.content "hello" => "there" }.should raise_error(ArgumentError) - lambda { @resource.content "hi" }.should_not raise_error(ArgumentError) + lambda { @resource.content "hi" }.should_not raise_error end it "should only accept false or a number for backup" do lambda { @resource.backup true }.should raise_error(ArgumentError) - lambda { @resource.backup false }.should_not raise_error(ArgumentError) - lambda { @resource.backup 10 }.should_not raise_error(ArgumentError) + lambda { @resource.backup false }.should_not raise_error + lambda { @resource.backup 10 }.should_not raise_error lambda { @resource.backup "blues" }.should raise_error(ArgumentError) end it "should accept a sha256 for checksum" do - lambda { @resource.checksum "0fd012fdc96e96f8f7cf2046522a54aed0ce470224513e45da6bc1a17a4924aa" }.should_not raise_error(ArgumentError) + lambda { @resource.checksum "0fd012fdc96e96f8f7cf2046522a54aed0ce470224513e45da6bc1a17a4924aa" }.should_not raise_error lambda { @resource.checksum "monkey!" }.should raise_error(ArgumentError) end it "should accept create, delete or touch for action" do - lambda { @resource.action :create }.should_not raise_error(ArgumentError) - lambda { @resource.action :delete }.should_not raise_error(ArgumentError) - lambda { @resource.action :touch }.should_not raise_error(ArgumentError) + lambda { @resource.action :create }.should_not raise_error + lambda { @resource.action :delete }.should_not raise_error + lambda { @resource.action :touch }.should_not raise_error lambda { @resource.action :blues }.should raise_error(ArgumentError) end @@ -71,7 +71,7 @@ describe Chef::Resource::File do end it "should accept a string as the path" do - lambda { @resource.path "/tmp" }.should_not raise_error(ArgumentError) + lambda { @resource.path "/tmp" }.should_not raise_error @resource.path.should eql("/tmp") lambda { @resource.path Hash.new }.should raise_error(ArgumentError) end diff --git a/spec/unit/resource/group_spec.rb b/spec/unit/resource/group_spec.rb index df68c5691f..0c3cf4f67f 100644 --- a/spec/unit/resource/group_spec.rb +++ b/spec/unit/resource/group_spec.rb @@ -60,11 +60,11 @@ describe Chef::Resource::Group, "initialize" do end it "should accept domain groups (@ or \ separator) on non-windows" do - lambda { @resource.group_name "domain\@group" }.should_not raise_error(ArgumentError) + lambda { @resource.group_name "domain\@group" }.should_not raise_error @resource.group_name.should == "domain\@group" - lambda { @resource.group_name "domain\\group" }.should_not raise_error(ArgumentError) + lambda { @resource.group_name "domain\\group" }.should_not raise_error @resource.group_name.should == "domain\\group" - lambda { @resource.group_name "domain\\group^name" }.should_not raise_error(ArgumentError) + lambda { @resource.group_name "domain\\group^name" }.should_not raise_error @resource.group_name.should == "domain\\group^name" end end diff --git a/spec/unit/resource/link_spec.rb b/spec/unit/resource/link_spec.rb index fc3f7ff41c..221617f9b3 100644 --- a/spec/unit/resource/link_spec.rb +++ b/spec/unit/resource/link_spec.rb @@ -44,7 +44,7 @@ describe Chef::Resource::Link do if bad_value lambda { @resource.action action }.should raise_error(ArgumentError) else - lambda { @resource.action action }.should_not raise_error(ArgumentError) + lambda { @resource.action action }.should_not raise_error end end end @@ -54,7 +54,7 @@ describe Chef::Resource::Link do end it "should accept a string as the link source via 'to'" do - lambda { @resource.to "/tmp" }.should_not raise_error(ArgumentError) + lambda { @resource.to "/tmp" }.should_not raise_error end it "should not accept a Hash for the link source via 'to'" do @@ -85,15 +85,15 @@ describe Chef::Resource::Link do end it "should accept a group name or id for group" do - lambda { @resource.group "root" }.should_not raise_error(ArgumentError) - lambda { @resource.group 123 }.should_not raise_error(ArgumentError) - lambda { @resource.group "root*goo" }.should raise_error(ArgumentError) + lambda { @resource.group "root" }.should_not raise_error + lambda { @resource.group 123 }.should_not raise_error + lambda { @resource.group "root:goo" }.should raise_error(ArgumentError) end it "should accept a user name or id for owner" do - lambda { @resource.owner "root" }.should_not raise_error(ArgumentError) - lambda { @resource.owner 123 }.should_not raise_error(ArgumentError) - lambda { @resource.owner "root*goo" }.should raise_error(ArgumentError) + lambda { @resource.owner "root" }.should_not raise_error + lambda { @resource.owner 123 }.should_not raise_error + lambda { @resource.owner "root:goo" }.should raise_error(ArgumentError) end describe "when it has to, link_type, owner, and group" do diff --git a/spec/unit/resource/mdadm_spec.rb b/spec/unit/resource/mdadm_spec.rb index 310f420659..daf10bcfea 100644 --- a/spec/unit/resource/mdadm_spec.rb +++ b/spec/unit/resource/mdadm_spec.rb @@ -39,9 +39,9 @@ describe Chef::Resource::Mdadm do end it "should accept create, assemble, stop as actions" do - lambda { @resource.action :create }.should_not raise_error(ArgumentError) - lambda { @resource.action :assemble }.should_not raise_error(ArgumentError) - lambda { @resource.action :stop }.should_not raise_error(ArgumentError) + lambda { @resource.action :create }.should_not raise_error + lambda { @resource.action :assemble }.should_not raise_error + lambda { @resource.action :stop }.should_not raise_error end it "should allow you to set the raid_device attribute" do diff --git a/spec/unit/resource/mount_spec.rb b/spec/unit/resource/mount_spec.rb index fb414018ba..c80f6971f1 100644 --- a/spec/unit/resource/mount_spec.rb +++ b/spec/unit/resource/mount_spec.rb @@ -42,9 +42,9 @@ describe Chef::Resource::Mount do end it "should accept mount, umount and remount as actions" do - lambda { @resource.action :mount }.should_not raise_error(ArgumentError) - lambda { @resource.action :umount }.should_not raise_error(ArgumentError) - lambda { @resource.action :remount }.should_not raise_error(ArgumentError) + lambda { @resource.action :mount }.should_not raise_error + lambda { @resource.action :umount }.should_not raise_error + lambda { @resource.action :remount }.should_not raise_error lambda { @resource.action :brooklyn }.should raise_error(ArgumentError) end diff --git a/spec/unit/resource/route_spec.rb b/spec/unit/resource/route_spec.rb index bca42f1101..4522438402 100644 --- a/spec/unit/resource/route_spec.rb +++ b/spec/unit/resource/route_spec.rb @@ -39,8 +39,8 @@ describe Chef::Resource::Route do end it "should accept add or delete for action" do - lambda { @resource.action :add }.should_not raise_error(ArgumentError) - lambda { @resource.action :delete }.should_not raise_error(ArgumentError) + lambda { @resource.action :add }.should_not raise_error + lambda { @resource.action :delete }.should_not raise_error lambda { @resource.action :lolcat }.should raise_error(ArgumentError) end diff --git a/spec/unit/resource/user_spec.rb b/spec/unit/resource/user_spec.rb index caf12aa416..9972ddbba1 100644 --- a/spec/unit/resource/user_spec.rb +++ b/spec/unit/resource/user_spec.rb @@ -61,9 +61,9 @@ describe Chef::Resource::User, "initialize" do end it "should accept domain users (@ or \ separator) on non-windows" do - lambda { @resource.username "domain\@user" }.should_not raise_error(ArgumentError) + lambda { @resource.username "domain\@user" }.should_not raise_error @resource.username.should == "domain\@user" - lambda { @resource.username "domain\\user" }.should_not raise_error(ArgumentError) + lambda { @resource.username "domain\\user" }.should_not raise_error @resource.username.should == "domain\\user" end end diff --git a/spec/unit/resource/yum_package_spec.rb b/spec/unit/resource/yum_package_spec.rb index 783a539eb2..57ab4dfcd9 100644 --- a/spec/unit/resource/yum_package_spec.rb +++ b/spec/unit/resource/yum_package_spec.rb @@ -78,8 +78,8 @@ describe Chef::Resource::YumPackage, "allow_downgrade" do end it "should allow you to specify whether allow_downgrade is true or false" do - lambda { @resource.allow_downgrade true }.should_not raise_error(ArgumentError) - lambda { @resource.allow_downgrade false }.should_not raise_error(ArgumentError) + lambda { @resource.allow_downgrade true }.should_not raise_error + lambda { @resource.allow_downgrade false }.should_not raise_error lambda { @resource.allow_downgrade "monkey" }.should raise_error(ArgumentError) end end diff --git a/spec/unit/resource_collection_spec.rb b/spec/unit/resource_collection_spec.rb index d8fc0db8e0..cf62f5ff40 100644 --- a/spec/unit/resource_collection_spec.rb +++ b/spec/unit/resource_collection_spec.rb @@ -118,7 +118,7 @@ describe Chef::ResourceCollection do @rc.each_index do |i| results << @rc[i].name end - }.should_not raise_error() + }.should_not raise_error results.each_index do |i| case i when 0 diff --git a/spec/unit/resource_definition_spec.rb b/spec/unit/resource_definition_spec.rb index abac4c1163..f24254cfce 100644 --- a/spec/unit/resource_definition_spec.rb +++ b/spec/unit/resource_definition_spec.rb @@ -58,7 +58,7 @@ describe Chef::ResourceDefinition do lambda { @def.define :smoke do end - }.should_not raise_error(ArgumentError) + }.should_not raise_error lambda { @def.define "george washington" do end @@ -70,7 +70,7 @@ describe Chef::ResourceDefinition do lambda { @def.define :smoke, :cigar => "cuban", :cigarette => "marlboro" do end - }.should_not raise_error(ArgumentError) + }.should_not raise_error end it "should expose the prototype hash params in the params hash" do diff --git a/spec/unit/resource_reporter_spec.rb b/spec/unit/resource_reporter_spec.rb index e2ecde212f..d412234596 100644 --- a/spec/unit/resource_reporter_spec.rb +++ b/spec/unit/resource_reporter_spec.rb @@ -35,21 +35,21 @@ describe Chef::ResourceReporter do before do @node = Chef::Node.new @node.name("spitfire") - @rest_client = mock("Chef::REST (mock)") - @rest_client.stub!(:post_rest).and_return(true) + @rest_client = double("Chef::REST (mock)") + @rest_client.stub(:post_rest).and_return(true) @resource_reporter = Chef::ResourceReporter.new(@rest_client) - @run_id = @resource_reporter.run_id @new_resource = Chef::Resource::File.new("/tmp/a-file.txt") @new_resource.cookbook_name = "monkey" - @cookbook_version = mock("Cookbook::Version", :version => "1.2.3") - @new_resource.stub!(:cookbook_version).and_return(@cookbook_version) + @cookbook_version = double("Cookbook::Version", :version => "1.2.3") + @new_resource.stub(:cookbook_version).and_return(@cookbook_version) @current_resource = Chef::Resource::File.new("/tmp/a-file.txt") @start_time = Time.new @end_time = Time.new + 20 @events = Chef::EventDispatch::Dispatcher.new @run_context = Chef::RunContext.new(@node, {}, @events) @run_status = Chef::RunStatus.new(@node, @events) - Time.stub!(:now).and_return(@start_time, @end_time) + @run_id = @run_status.run_id + Time.stub(:now).and_return(@start_time, @end_time) end context "when first created" do @@ -87,9 +87,9 @@ describe Chef::ResourceReporter do context "when chef fails" do before do - @rest_client.stub!(:create_url).and_return("reports/nodes/spitfire/runs/#{@run_id}"); - @rest_client.stub!(:raw_http_request).and_return({"result"=>"ok"}); - @rest_client.stub!(:post_rest).and_return({"uri"=>"https://example.com/reports/nodes/spitfire/runs/#{@run_id}"}); + @rest_client.stub(:create_url).and_return("reports/nodes/spitfire/runs/#{@run_id}"); + @rest_client.stub(:raw_http_request).and_return({"result"=>"ok"}); + @rest_client.stub(:post_rest).and_return({"uri"=>"https://example.com/reports/nodes/spitfire/runs/#{@run_id}"}); end @@ -255,13 +255,68 @@ describe Chef::ResourceReporter do describe "when generating a report for the server" do before do - @rest_client.stub!(:create_url).and_return("reports/nodes/spitfire/runs/#{@run_id}"); - @rest_client.stub!(:raw_http_request).and_return({"result"=>"ok"}); - @rest_client.stub!(:post_rest).and_return({"uri"=>"https://example.com/reports/nodes/spitfire/runs/#{@run_id}"}); + @rest_client.stub(:create_url).and_return("reports/nodes/spitfire/runs/#{@run_id}"); + @rest_client.stub(:raw_http_request).and_return({"result"=>"ok"}); + @rest_client.stub(:post_rest).and_return({"uri"=>"https://example.com/reports/nodes/spitfire/runs/#{@run_id}"}); @resource_reporter.run_started(@run_status) end + context "when the new_resource does not have a string for name and identity" do + context "the new_resource name and id are nil" do + before do + @bad_resource = Chef::Resource::File.new("/tmp/nameless_file.txt") + @bad_resource.stub(:name).and_return(nil) + @bad_resource.stub(:identity).and_return(nil) + @resource_reporter.resource_action_start(@bad_resource, :create) + @resource_reporter.resource_current_state_loaded(@bad_resource, :create, @current_resource) + @resource_reporter.resource_updated(@bad_resource, :create) + @resource_reporter.resource_completed(@bad_resource) + @run_status.stop_clock + @report = @resource_reporter.prepare_run_data + @first_update_report = @report["resources"].first + end + + it "resource_name in prepared_run_data is a string" do + @first_update_report["name"].class.should == String + end + + it "resource_id in prepared_run_data is a string" do + @first_update_report["id"].class.should == String + end + end + + context "the new_resource name and id are hashes" do + before do + @bad_resource = Chef::Resource::File.new("/tmp/filename_as_hash.txt") + @bad_resource.stub(:name).and_return({:foo=>:bar}) + @bad_resource.stub(:identity).and_return({:foo=>:bar}) + @resource_reporter.resource_action_start(@bad_resource, :create) + @resource_reporter.resource_current_state_loaded(@bad_resource, :create, @current_resource) + @resource_reporter.resource_updated(@bad_resource, :create) + @resource_reporter.resource_completed(@bad_resource) + @run_status.stop_clock + @report = @resource_reporter.prepare_run_data + @first_update_report = @report["resources"].first + end + # Ruby 1.8.7 flattens out hash to string using join instead of inspect, resulting in + # irb(main):001:0> {:foo => :bar}.to_s + # => "foobar" + # instead of the expected + # irb(main):001:0> {:foo => :bar}.to_s + # => "{:foo=>:bar}" + # Hence checking for the class instead of the actual value. + it "resource_name in prepared_run_data is a string" do + @first_update_report["name"].class.should == String + end + + it "resource_id in prepared_run_data is a string" do + @first_update_report["id"].class.should == String + end + end + end + + context "for a successful client run" do before do # TODO: add inputs to generate expected output. @@ -381,10 +436,10 @@ describe Chef::ResourceReporter do @backtrace = ["foo.rb:1 in `foo!'","bar.rb:2 in `bar!","'baz.rb:3 in `baz!'"] @node = Chef::Node.new @node.name("spitfire") - @exception = mock("ArgumentError") - @exception.stub!(:inspect).and_return("Net::HTTPServerException") - @exception.stub!(:message).and_return("Object not found") - @exception.stub!(:backtrace).and_return(@backtrace) + @exception = double("ArgumentError") + @exception.stub(:inspect).and_return("Net::HTTPServerException") + @exception.stub(:message).and_return("Object not found") + @exception.stub(:backtrace).and_return(@backtrace) @resource_reporter.run_list_expand_failed(@node, @exception) @resource_reporter.run_failed(@exception) @report = @resource_reporter.prepare_run_data @@ -602,7 +657,7 @@ describe Chef::ResourceReporter do @resource_reporter.resource_current_state_loaded(@new_resource, :create, @current_resource) @resource_reporter.resource_updated(@new_resource, :create) - @resource_reporter.stub!(:end_time).and_return(@end_time) + @resource_reporter.stub(:end_time).and_return(@end_time) @expected_data = @resource_reporter.prepare_run_data post_url = "https://chef_server/example_url" diff --git a/spec/unit/resource_spec.rb b/spec/unit/resource_spec.rb index dd1a0259e4..e9a60c9861 100644 --- a/spec/unit/resource_spec.rb +++ b/spec/unit/resource_spec.rb @@ -205,8 +205,8 @@ describe Chef::Resource do describe "noop" do it "should accept true or false for noop" do - lambda { @resource.noop true }.should_not raise_error(ArgumentError) - lambda { @resource.noop false }.should_not raise_error(ArgumentError) + lambda { @resource.noop true }.should_not raise_error + lambda { @resource.noop false }.should_not raise_error lambda { @resource.noop "eat it" }.should raise_error(ArgumentError) end end @@ -589,7 +589,7 @@ describe Chef::Resource do it "should print \"skipped due to action :nothing\" message for doc formatter when action is :nothing" do fdoc = Chef::Formatters.new(:doc, STDOUT, STDERR) - @run_context.stub!(:events).and_return(fdoc) + @run_context.stub(:events).and_return(fdoc) fdoc.should_receive(:puts).with(" (skipped due to action :nothing)") @resource.should_skip?(:nothing) end diff --git a/spec/unit/rest/auth_credentials_spec.rb b/spec/unit/rest/auth_credentials_spec.rb index 2c84c1e1bb..477da0faec 100644 --- a/spec/unit/rest/auth_credentials_spec.rb +++ b/spec/unit/rest/auth_credentials_spec.rb @@ -84,7 +84,7 @@ describe Chef::REST::AuthCredentials do end it "generates signature headers for the request" do - Time.stub!(:now).and_return(@request_time) + Time.stub(:now).and_return(@request_time) actual = @auth_credentials.signature_headers(@request_params) actual["HOST"].should == "localhost" actual["X-OPS-AUTHORIZATION-1"].should == "kBssX1ENEwKtNYFrHElN9vYGWS7OeowepN9EsYc9csWfh8oUovryPKDxytQ/" @@ -110,7 +110,7 @@ describe Chef::REST::AuthCredentials do end it "generates the correct signature for version 1.1" do - Time.stub!(:now).and_return(@request_time) + Time.stub(:now).and_return(@request_time) actual = @auth_credentials.signature_headers(@request_params) actual["HOST"].should == "localhost" actual["X-OPS-CONTENT-HASH"].should == "1tuzs5XKztM1ANrkGNPah6rW9GY=" diff --git a/spec/unit/rest_spec.rb b/spec/unit/rest_spec.rb index 23279eddb7..3d6144ab35 100644 --- a/spec/unit/rest_spec.rb +++ b/spec/unit/rest_spec.rb @@ -53,286 +53,288 @@ Y6S6MeZ69Rp89ma4ttMZ+kwi1+XyHqC/dlcVRW42Zl5Dc7BALRlJjQ== -----END RSA PRIVATE KEY-----" describe Chef::REST do - before(:each) do - @log_stringio = StringIO.new - Chef::Log.init(@log_stringio) + let(:base_url) { "http://chef.example.com:4000" } - Chef::REST::CookieJar.stub(:instance).and_return({}) - @base_url = "http://chef.example.com:4000" - @monkey_uri = URI.parse("http://chef.example.com:4000/monkey") - @rest = Chef::REST.new(@base_url, nil, nil) + let(:monkey_uri) { URI.parse("http://chef.example.com:4000/monkey") } + + let(:log_stringio) { StringIO.new } + + let(:request_id) {"1234"} + let(:rest) do + Chef::REST::CookieJar.stub(:instance).and_return({}) + Chef::RequestID.instance.stub(:request_id).and_return(request_id) + rest = Chef::REST.new(base_url, nil, nil) Chef::REST::CookieJar.instance.clear + rest + end + + let(:standard_read_headers) {{"Accept"=>"application/json", "Accept"=>"application/json", "Accept-Encoding"=>"gzip;q=1.0,deflate;q=0.6,identity;q=0.3", "X-REMOTE-REQUEST-ID"=>request_id}} + let(:standard_write_headers) {{"Accept"=>"application/json", "Content-Type"=>"application/json", "Accept"=>"application/json", "Accept-Encoding"=>"gzip;q=1.0,deflate;q=0.6,identity;q=0.3", "X-REMOTE-REQUEST-ID"=>request_id}} + + before(:each) do + Chef::Log.init(log_stringio) end describe "calling an HTTP verb on a path or absolute URL" do it "adds a relative URL to the base url it was initialized with" do - @rest.create_url("foo/bar/baz").should == URI.parse(@base_url + "/foo/bar/baz") + expect(rest.create_url("foo/bar/baz")).to eq(URI.parse(base_url + "/foo/bar/baz")) end it "replaces the base URL when given an absolute URL" do - @rest.create_url("http://chef-rulez.example.com:9000").should == URI.parse("http://chef-rulez.example.com:9000") + expect(rest.create_url("http://chef-rulez.example.com:9000")).to eq(URI.parse("http://chef-rulez.example.com:9000")) end it "makes a :GET request with the composed url object" do - @rest.should_receive(:send_http_request). - with(:GET, @monkey_uri, STANDARD_READ_HEADERS, false). + rest.should_receive(:send_http_request). + with(:GET, monkey_uri, standard_read_headers, false). and_return([1,2,3]) - @rest.should_receive(:apply_response_middleware).with(1,2,3).and_return([1,2,3]) - @rest.should_receive('success_response?'.to_sym).with(1).and_return(true) - @rest.get_rest("monkey") + rest.should_receive(:apply_response_middleware).with(1,2,3).and_return([1,2,3]) + rest.should_receive('success_response?'.to_sym).with(1).and_return(true) + rest.get_rest("monkey") end it "makes a :GET reqest for a streaming download with the composed url" do - @rest.should_receive(:streaming_request).with('monkey', {}) - @rest.get_rest("monkey", true) + rest.should_receive(:streaming_request).with('monkey', {}) + rest.get_rest("monkey", true) end - STANDARD_READ_HEADERS = {"Accept"=>"application/json", "Accept"=>"application/json", "Accept-Encoding"=>"gzip;q=1.0,deflate;q=0.6,identity;q=0.3"} - STANDARD_WRITE_HEADERS = {"Accept"=>"application/json", "Content-Type"=>"application/json", "Accept"=>"application/json", "Accept-Encoding"=>"gzip;q=1.0,deflate;q=0.6,identity;q=0.3"} - it "makes a :DELETE request with the composed url object" do - @rest.should_receive(:send_http_request). - with(:DELETE, @monkey_uri, STANDARD_READ_HEADERS, false). + rest.should_receive(:send_http_request). + with(:DELETE, monkey_uri, standard_read_headers, false). and_return([1,2,3]) - @rest.should_receive(:apply_response_middleware).with(1,2,3).and_return([1,2,3]) - @rest.should_receive('success_response?'.to_sym).with(1).and_return(true) - @rest.delete_rest("monkey") + rest.should_receive(:apply_response_middleware).with(1,2,3).and_return([1,2,3]) + rest.should_receive('success_response?'.to_sym).with(1).and_return(true) + rest.delete_rest("monkey") end it "makes a :POST request with the composed url object and data" do - @rest.should_receive(:send_http_request). - with(:POST, @monkey_uri, STANDARD_WRITE_HEADERS, "\"data\""). + rest.should_receive(:send_http_request). + with(:POST, monkey_uri, standard_write_headers, "\"data\""). and_return([1,2,3]) - @rest.should_receive(:apply_response_middleware).with(1,2,3).and_return([1,2,3]) - @rest.should_receive('success_response?'.to_sym).with(1).and_return(true) - @rest.post_rest("monkey", "data") + rest.should_receive(:apply_response_middleware).with(1,2,3).and_return([1,2,3]) + rest.should_receive('success_response?'.to_sym).with(1).and_return(true) + rest.post_rest("monkey", "data") end it "makes a :PUT request with the composed url object and data" do - @rest.should_receive(:send_http_request). - with(:PUT, @monkey_uri, STANDARD_WRITE_HEADERS, "\"data\""). + rest.should_receive(:send_http_request). + with(:PUT, monkey_uri, standard_write_headers, "\"data\""). and_return([1,2,3]) - @rest.should_receive(:apply_response_middleware).with(1,2,3).and_return([1,2,3]) - @rest.should_receive('success_response?'.to_sym).with(1).and_return(true) - @rest.put_rest("monkey", "data") + rest.should_receive(:apply_response_middleware).with(1,2,3).and_return([1,2,3]) + rest.should_receive('success_response?'.to_sym).with(1).and_return(true) + rest.put_rest("monkey", "data") end end describe "legacy API" do + let(:rest) do + Chef::REST.new(base_url) + end + before(:each) do Chef::Config[:node_name] = "webmonkey.example.com" Chef::Config[:client_key] = CHEF_SPEC_DATA + "/ssl/private_key.pem" - @rest = Chef::REST.new(@base_url) end it 'responds to raw_http_request as a public method' do - @rest.public_methods.map(&:to_s).should include("raw_http_request") + expect(rest.public_methods.map(&:to_s)).to include("raw_http_request") end it 'calls the authn middleware' do data = "\"secure data\"" - auth_headers = STANDARD_WRITE_HEADERS.merge({"auth_done"=>"yep"}) + auth_headers = standard_write_headers.merge({"auth_done"=>"yep"}) - @rest.authenticator.should_receive(:handle_request). - with(:POST, @monkey_uri, STANDARD_WRITE_HEADERS, data). - and_return([:POST, @monkey_uri, auth_headers, data]) - @rest.should_receive(:send_http_request). - with(:POST, @monkey_uri, auth_headers, data). + rest.authenticator.should_receive(:handle_request). + with(:POST, monkey_uri, standard_write_headers, data). + and_return([:POST, monkey_uri, auth_headers, data]) + rest.should_receive(:send_http_request). + with(:POST, monkey_uri, auth_headers, data). and_return([1,2,3]) - @rest.should_receive('success_response?'.to_sym).with(1).and_return(true) - @rest.raw_http_request(:POST, @monkey_uri, STANDARD_WRITE_HEADERS, data) + rest.should_receive('success_response?'.to_sym).with(1).and_return(true) + rest.raw_http_request(:POST, monkey_uri, standard_write_headers, data) end it 'sets correct authn headers' do data = "\"secure data\"" - method, uri, auth_headers, d = @rest.authenticator.handle_request(:POST, @monkey_uri, STANDARD_WRITE_HEADERS, data) + method, uri, auth_headers, d = rest.authenticator.handle_request(:POST, monkey_uri, standard_write_headers, data) - @rest.should_receive(:send_http_request). - with(:POST, @monkey_uri, auth_headers, data). + rest.should_receive(:send_http_request). + with(:POST, monkey_uri, auth_headers, data). and_return([1,2,3]) - @rest.should_receive('success_response?'.to_sym).with(1).and_return(true) - @rest.raw_http_request(:POST, @monkey_uri, STANDARD_WRITE_HEADERS, data) + rest.should_receive('success_response?'.to_sym).with(1).and_return(true) + rest.raw_http_request(:POST, monkey_uri, standard_write_headers, data) end end describe "when configured to authenticate to the Chef server" do + let(:base_url) { URI.parse("http://chef.example.com:4000") } + + let(:rest) do + Chef::REST.new(base_url) + end + before do - @url = URI.parse("http://chef.example.com:4000") Chef::Config[:node_name] = "webmonkey.example.com" Chef::Config[:client_key] = CHEF_SPEC_DATA + "/ssl/private_key.pem" - @rest = Chef::REST.new(@url) end it "configures itself to use the node_name and client_key in the config by default" do - @rest.client_name.should == "webmonkey.example.com" - @rest.signing_key_filename.should == CHEF_SPEC_DATA + "/ssl/private_key.pem" + expect(rest.client_name).to eq("webmonkey.example.com") + expect(rest.signing_key_filename).to eq(CHEF_SPEC_DATA + "/ssl/private_key.pem") end it "provides access to the raw key data" do - @rest.signing_key.should == SIGNING_KEY_DOT_PEM + expect(rest.signing_key).to eq(SIGNING_KEY_DOT_PEM) end it "does not error out when initialized without credentials" do - @rest = Chef::REST.new(@url, nil, nil) #should_not raise_error hides the bt from you, so screw it. - @rest.client_name.should be_nil - @rest.signing_key.should be_nil + rest = Chef::REST.new(base_url, nil, nil) #should_not raise_error hides the bt from you, so screw it. + expect(rest.client_name).to be_nil + expect(rest.signing_key).to be_nil end it "indicates that requests should not be signed when it has no credentials" do - @rest = Chef::REST.new(@url, nil, nil) - @rest.sign_requests?.should be_false + rest = Chef::REST.new(base_url, nil, nil) + expect(rest.sign_requests?).to be_false end it "raises PrivateKeyMissing when the key file doesn't exist" do - lambda {Chef::REST.new(@url, "client-name", "/dev/null/nothing_here")}.should raise_error(Chef::Exceptions::PrivateKeyMissing) + expect {Chef::REST.new(base_url, "client-name", "/dev/null/nothing_here")}.to raise_error(Chef::Exceptions::PrivateKeyMissing) end it "raises InvalidPrivateKey when the key file doesnt' look like a key" do invalid_key_file = CHEF_SPEC_DATA + "/bad-config.rb" - lambda {Chef::REST.new(@url, "client-name", invalid_key_file)}.should raise_error(Chef::Exceptions::InvalidPrivateKey) + expect {Chef::REST.new(base_url, "client-name", invalid_key_file)}.to raise_error(Chef::Exceptions::InvalidPrivateKey) end it "can take private key as a sting :raw_key in options during initializaton" do - Chef::REST.new(@url, "client-name", nil, :raw_key => SIGNING_KEY_DOT_PEM).signing_key.should == SIGNING_KEY_DOT_PEM + expect(Chef::REST.new(base_url, "client-name", nil, :raw_key => SIGNING_KEY_DOT_PEM).signing_key).to eq(SIGNING_KEY_DOT_PEM) end it "raises InvalidPrivateKey when the key passed as string :raw_key in options doesnt' look like a key" do - lambda {Chef::REST.new(@url, "client-name", nil, :raw_key => "bad key string")}.should raise_error(Chef::Exceptions::InvalidPrivateKey) + expect {Chef::REST.new(base_url, "client-name", nil, :raw_key => "bad key string")}.to raise_error(Chef::Exceptions::InvalidPrivateKey) end end context "when making REST requests" do - before(:each) do - Chef::Config[:ssl_client_cert] = nil - Chef::Config[:ssl_client_key] = nil - @url = URI.parse("https://one:80/?foo=bar") - - @host_header = "one:80" - - @http_response = Net::HTTPSuccess.new("1.1", "200", "successful rest req") - @http_response.stub(:read_body) - @http_response.stub(:body).and_return("ninja") - @http_response.add_field("Content-Length", "5") - - @http_client = Net::HTTP.new(@url.host, @url.port) - Net::HTTP.stub(:new).and_return(@http_client) - @http_client.stub(:request).and_yield(@http_response).and_return(@http_response) - - @base_headers = { 'Accept' => 'application/json', - 'X-Chef-Version' => Chef::VERSION, - 'Accept-Encoding' => Chef::REST::RESTRequest::ENCODING_GZIP_DEFLATE} - @req_with_body_headers = @base_headers.merge("Content-Type" => "application/json", "Content-Length" => '13') + let(:body) { "ninja" } + + let(:http_response) do + http_response = Net::HTTPSuccess.new("1.1", "200", "successful rest req") + http_response.stub(:read_body) + http_response.stub(:body).and_return(body) + http_response["Content-Length"] = body.bytesize.to_s + http_response end - describe "streaming downloads to a tempfile" do - before do - @tempfile = StringIO.new - @tempfile.stub(:close!) - @tempfile.stub(:path).and_return("/a-temporary-file") - Tempfile.stub(:new).with("chef-rest").and_return(@tempfile) - Tempfile.stub(:open).and_return(@tempfile) - - @request_mock = {} - Net::HTTP::Get.stub(:new).and_return(@request_mock) - end - - it "should build a new HTTP GET request without the application/json accept header" do - expected_headers = {'Accept' => "*/*", - 'X-Chef-Version' => Chef::VERSION, - 'Accept-Encoding' => Chef::REST::RESTRequest::ENCODING_GZIP_DEFLATE, - 'Host' => @host_header} - Net::HTTP::Get.should_receive(:new).with("/?foo=bar", expected_headers).and_return(@request_mock) - @rest.streaming_request(@url, {}) - end + let(:host_header) { "one:80" } - it "should create a tempfile for the output of a raw request" do - @rest.streaming_request(@url, {}).should equal(@tempfile) - end + let(:url) { URI.parse("https://one:80/?foo=bar") } - it "should read the body of the response in chunks on a raw request" do - @http_response.should_receive(:read_body).and_return(true) - @rest.streaming_request(@url, {}) - end + let(:base_url) { "http://chef.example.com:4000" } - it "should populate the tempfile with the value of the raw request" do - @http_response.should_receive(:read_body).and_yield("ninja") - @rest.streaming_request(@url, {}) - #@tempfile.string.should include("ninja") - end + let!(:http_client) do + http_client = Net::HTTP.new(url.host, url.port) + http_client.stub(:request).and_yield(http_response).and_return(http_response) + http_client + end - it "should close the tempfile if we're doing a raw request" do - @tempfile.should_receive(:close).once.and_return(true) - @rest.streaming_request(@url, {}) - end + let(:rest) do + Net::HTTP.stub(:new).and_return(http_client) + Chef::REST::CookieJar.stub(:instance).and_return({}) + Chef::RequestID.instance.stub(:request_id).and_return(request_id) + rest = Chef::REST.new(base_url, nil, nil) + Chef::REST::CookieJar.instance.clear + rest + end - it "should not raise a divide by zero exception if the size is 0" do - @http_response.stub(:header).and_return({ 'Content-Length' => "5" }) - @http_response.stub(:read_body).and_yield('') - lambda { @rest.streaming_request(@url, {}) }.should_not raise_error - end + let(:base_headers) do + { + 'Accept' => 'application/json', + 'X-Chef-Version' => Chef::VERSION, + 'Accept-Encoding' => Chef::REST::RESTRequest::ENCODING_GZIP_DEFLATE, + 'X-REMOTE-REQUEST-ID' => request_id + } + end - it "should not raise a divide by zero exception if the Content-Length is 0" do - @http_response.stub(:header).and_return({ 'Content-Length' => "0" }) - @http_response.stub(:read_body).and_yield("ninja") - lambda { @rest.streaming_request(@url, {}) }.should_not raise_error - end + let (:req_with_body_headers) do + base_headers.merge("Content-Type" => "application/json", "Content-Length" => '13') + end + before(:each) do + Chef::Config[:ssl_client_cert] = nil + Chef::Config[:ssl_client_key] = nil end describe "as JSON API requests" do - before do - @request_mock = {} - Net::HTTP::Get.stub(:new).and_return(@request_mock) - - @base_headers = {"Accept" => "application/json", - "X-Chef-Version" => Chef::VERSION, - "Accept-Encoding" => Chef::REST::RESTRequest::ENCODING_GZIP_DEFLATE, - "Host" => @host_header + let(:request_mock) { {} } + + let(:base_headers) do #FIXME: huh? + { + 'Accept' => 'application/json', + 'X-Chef-Version' => Chef::VERSION, + 'Accept-Encoding' => Chef::REST::RESTRequest::ENCODING_GZIP_DEFLATE, + 'Host' => host_header, + 'X-REMOTE-REQUEST-ID' => request_id } end + before do + Net::HTTP::Get.stub(:new).and_return(request_mock) + end + it "should always include the X-Chef-Version header" do - Net::HTTP::Get.should_receive(:new).with("/?foo=bar", @base_headers).and_return(@request_mock) - @rest.request(:GET, @url, {}) + Net::HTTP::Get.should_receive(:new).with("/?foo=bar", base_headers).and_return(request_mock) + rest.request(:GET, url, {}) + end + + it "should always include the X-Remote-Request-Id header" do + Net::HTTP::Get.should_receive(:new).with("/?foo=bar", base_headers).and_return(request_mock) + rest.request(:GET, url, {}) end it "sets the user agent to chef-client" do - # must reset to default b/c knife changes the UA + # XXX: must reset to default b/c knife changes the UA Chef::REST::RESTRequest.user_agent = Chef::REST::RESTRequest::DEFAULT_UA - @rest.request(:GET, @url, {}) - @request_mock['User-Agent'].should match(/^Chef Client\/#{Chef::VERSION}/) + rest.request(:GET, url, {}) + expect(request_mock['User-Agent']).to match(/^Chef Client\/#{Chef::VERSION}/) end # CHEF-3140 context "when configured to disable compression" do - before do - @rest = Chef::REST.new(@base_url, nil, nil, :disable_gzip => true) + let(:rest) do + Net::HTTP.stub(:new).and_return(http_client) + Chef::REST.new(base_url, nil, nil, :disable_gzip => true) end it "does not accept encoding gzip" do - @rest.send(:build_headers, :GET, @url, {}).should_not have_key("Accept-Encoding") + expect(rest.send(:build_headers, :GET, url, {})).not_to have_key("Accept-Encoding") end it "does not decompress a response encoded as gzip" do - @http_response.add_field("content-encoding", "gzip") - request = Net::HTTP::Get.new(@url.path) + http_response.add_field("content-encoding", "gzip") + request = Net::HTTP::Get.new(url.path) Net::HTTP::Get.should_receive(:new).and_return(request) # will raise a Zlib error if incorrect - @rest.request(:GET, @url, {}).should == "ninja" + expect(rest.request(:GET, url, {})).to eq("ninja") end end + context "when configured with custom http headers" do - before(:each) do - @custom_headers = { + let(:custom_headers) do + { 'X-Custom-ChefSecret' => 'sharpknives', 'X-Custom-RequestPriority' => 'extremely low' } - Chef::Config[:custom_http_headers] = @custom_headers + end + + before(:each) do + Chef::Config[:custom_http_headers] = custom_headers end after(:each) do @@ -341,84 +343,112 @@ describe Chef::REST do it "should set them on the http request" do url_string = an_instance_of(String) - header_hash = hash_including(@custom_headers) + header_hash = hash_including(custom_headers) Net::HTTP::Get.should_receive(:new).with(url_string, header_hash) - @rest.request(:GET, @url, {}) + rest.request(:GET, url, {}) end end - it "should set the cookie for this request if one exists for the given host:port" do - Chef::REST::CookieJar.instance["#{@url.host}:#{@url.port}"] = "cookie monster" - Net::HTTP::Get.should_receive(:new).with("/?foo=bar", @base_headers.merge('Cookie' => "cookie monster")).and_return(@request_mock) - @rest.request(:GET, @url, {}) + context "when setting cookies" do + let(:rest) do + Net::HTTP.stub(:new).and_return(http_client) + Chef::REST::CookieJar.instance["#{url.host}:#{url.port}"] = "cookie monster" + Chef::RequestID.instance.stub(:request_id).and_return(request_id) + rest = Chef::REST.new(base_url, nil, nil) + rest + end + + it "should set the cookie for this request if one exists for the given host:port" do + Net::HTTP::Get.should_receive(:new).with("/?foo=bar", base_headers.merge('Cookie' => "cookie monster")).and_return(request_mock) + rest.request(:GET, url, {}) + end end it "should build a new HTTP GET request" do - Net::HTTP::Get.should_receive(:new).with("/?foo=bar", @base_headers).and_return(@request_mock) - @rest.request(:GET, @url, {}) + Net::HTTP::Get.should_receive(:new).with("/?foo=bar", base_headers).and_return(request_mock) + rest.request(:GET, url, {}) end it "should build a new HTTP POST request" do - request = Net::HTTP::Post.new(@url.path) - expected_headers = @base_headers.merge("Content-Type" => 'application/json', 'Content-Length' => '13') + request = Net::HTTP::Post.new(url.path) + expected_headers = base_headers.merge("Content-Type" => 'application/json', 'Content-Length' => '13') Net::HTTP::Post.should_receive(:new).with("/?foo=bar", expected_headers).and_return(request) - @rest.request(:POST, @url, {}, {:one=>:two}) - request.body.should == '{"one":"two"}' + rest.request(:POST, url, {}, {:one=>:two}) + expect(request.body).to eq('{"one":"two"}') end it "should build a new HTTP PUT request" do - request = Net::HTTP::Put.new(@url.path) - expected_headers = @base_headers.merge("Content-Type" => 'application/json', 'Content-Length' => '13') + request = Net::HTTP::Put.new(url.path) + expected_headers = base_headers.merge("Content-Type" => 'application/json', 'Content-Length' => '13') Net::HTTP::Put.should_receive(:new).with("/?foo=bar",expected_headers).and_return(request) - @rest.request(:PUT, @url, {}, {:one=>:two}) - request.body.should == '{"one":"two"}' + rest.request(:PUT, url, {}, {:one=>:two}) + expect(request.body).to eq('{"one":"two"}') end it "should build a new HTTP DELETE request" do - Net::HTTP::Delete.should_receive(:new).with("/?foo=bar", @base_headers).and_return(@request_mock) - @rest.request(:DELETE, @url) + Net::HTTP::Delete.should_receive(:new).with("/?foo=bar", base_headers).and_return(request_mock) + rest.request(:DELETE, url) end it "should raise an error if the method is not GET/PUT/POST/DELETE" do - lambda { @rest.request(:MONKEY, @url) }.should raise_error(ArgumentError) + expect { rest.request(:MONKEY, url) }.to raise_error(ArgumentError) end it "returns nil when the response is successful but content-type is not JSON" do - @rest.request(:GET, @url).should == "ninja" + expect(rest.request(:GET, url)).to eq("ninja") end - it "should inflate the body as to an object if JSON is returned" do - @http_response.add_field('content-type', "application/json") - @http_response.stub(:body).and_return('{"ohai2u":"json_api"}') - @rest.request(:GET, @url, {}).should == {"ohai2u"=>"json_api"} + it "should fail if the response is truncated" do + http_response["Content-Length"] = (body.bytesize + 99).to_s + expect { rest.request(:GET, url) }.to raise_error(Chef::Exceptions::ContentLengthMismatch) end - %w[ HTTPFound HTTPMovedPermanently HTTPSeeOther HTTPUseProxy HTTPTemporaryRedirect HTTPMultipleChoice ].each do |resp_name| - it "should call request again on a #{resp_name} response" do - resp_cls = Net.const_get(resp_name) - resp_code = Net::HTTPResponse::CODE_TO_OBJ.keys.detect { |k| Net::HTTPResponse::CODE_TO_OBJ[k] == resp_cls } - http_response = Net::HTTPFound.new("1.1", resp_code, "bob is somewhere else again") - http_response.add_field("location", @url.path) - http_response.stub(:read_body) + context "when JSON is returned" do + let(:body) { '{"ohai2u":"json_api"}' } + it "should inflate the body as to an object" do + http_response.add_field('content-type', "application/json") + expect(rest.request(:GET, url, {})).to eq({"ohai2u"=>"json_api"}) + end - @http_client.stub(:request).and_yield(http_response).and_return(http_response) + it "should fail if the response is truncated" do + http_response.add_field('content-type', "application/json") + http_response["Content-Length"] = (body.bytesize + 99).to_s + expect { rest.request(:GET, url, {}) }.to raise_error(Chef::Exceptions::ContentLengthMismatch) + end + end - lambda { @rest.request(:GET, @url) }.should raise_error(Chef::Exceptions::RedirectLimitExceeded) + %w[ HTTPFound HTTPMovedPermanently HTTPSeeOther HTTPUseProxy HTTPTemporaryRedirect HTTPMultipleChoice ].each do |resp_name| + describe "when encountering a #{resp_name} redirect" do + let(:http_response) do + resp_cls = Net.const_get(resp_name) + resp_code = Net::HTTPResponse::CODE_TO_OBJ.keys.detect { |k| Net::HTTPResponse::CODE_TO_OBJ[k] == resp_cls } + http_response = Net::HTTPFound.new("1.1", resp_code, "bob is somewhere else again") + http_response.add_field("location", url.path) + http_response.stub(:read_body) + http_response + end + it "should call request again" do + + expect { rest.request(:GET, url) }.to raise_error(Chef::Exceptions::RedirectLimitExceeded) - [:PUT, :POST, :DELETE].each do |method| - lambda { @rest.request(method, @url) }.should raise_error(Chef::Exceptions::InvalidRedirect) + [:PUT, :POST, :DELETE].each do |method| + expect { rest.request(method, url) }.to raise_error(Chef::Exceptions::InvalidRedirect) + end end end end - it "should return `false` when response is 304 NotModified" do - http_response = Net::HTTPNotModified.new("1.1", "304", "it's the same as when you asked 5 minutes ago") - http_response.stub(:read_body) - - @http_client.stub(:request).and_yield(http_response).and_return(http_response) + context "when the response is 304 NotModified" do + let (:http_response) do + http_response = Net::HTTPNotModified.new("1.1", "304", "it's the same as when you asked 5 minutes ago") + http_response.stub(:read_body) + http_response + end - @rest.request(:GET, @url).should be_false + it "should return `false`" do + expect(rest.request(:GET, url)).to be_false + end end describe "when the request fails" do @@ -431,128 +461,180 @@ describe Chef::REST do Chef::Log.level = @original_log_level end - it "should show the JSON error message on an unsuccessful request" do - http_response = Net::HTTPServerError.new("1.1", "500", "drooling from inside of mouth") - http_response.add_field("content-type", "application/json") - http_response.stub(:body).and_return('{ "error":[ "Ears get sore!", "Not even four" ] }') - http_response.stub(:read_body) - @rest.stub(:sleep) - @http_client.stub(:request).and_yield(http_response).and_return(http_response) + context "on an unsuccessful response with a JSON error" do + let(:http_response) do + http_response = Net::HTTPServerError.new("1.1", "500", "drooling from inside of mouth") + http_response.add_field("content-type", "application/json") + http_response.stub(:body).and_return('{ "error":[ "Ears get sore!", "Not even four" ] }') + http_response.stub(:read_body) + http_response + end - lambda {@rest.request(:GET, @url)}.should raise_error(Net::HTTPFatalError) - @log_stringio.string.should match(Regexp.escape('INFO: HTTP Request Returned 500 drooling from inside of mouth: Ears get sore!, Not even four')) - end + it "should show the JSON error message" do + rest.stub(:sleep) - it "decompresses the JSON error message on an unsuccessful request" do - http_response = Net::HTTPServerError.new("1.1", "500", "drooling from inside of mouth") - http_response.add_field("content-type", "application/json") - http_response.add_field("content-encoding", "deflate") - unzipped_body = '{ "error":[ "Ears get sore!", "Not even four" ] }' - gzipped_body = Zlib::Deflate.deflate(unzipped_body) - gzipped_body.force_encoding(Encoding::BINARY) if "strings".respond_to?(:force_encoding) + expect {rest.request(:GET, url)}.to raise_error(Net::HTTPFatalError) + expect(log_stringio.string).to match(Regexp.escape('INFO: HTTP Request Returned 500 drooling from inside of mouth: Ears get sore!, Not even four')) + end + end - http_response.stub(:body).and_return gzipped_body - http_response.stub(:read_body) - @rest.stub(:sleep) - @rest.stub(:http_retry_count).and_return(0) - @http_client.stub(:request).and_yield(http_response).and_return(http_response) + context "on an unsuccessful response with a JSON error that is compressed" do + let(:http_response) do + http_response = Net::HTTPServerError.new("1.1", "500", "drooling from inside of mouth") + http_response.add_field("content-type", "application/json") + http_response.add_field("content-encoding", "deflate") + unzipped_body = '{ "error":[ "Ears get sore!", "Not even four" ] }' + gzipped_body = Zlib::Deflate.deflate(unzipped_body) + gzipped_body.force_encoding(Encoding::BINARY) if "strings".respond_to?(:force_encoding) + + http_response.stub(:body).and_return gzipped_body + http_response.stub(:read_body) + http_response + end + it "decompresses the JSON error message" do + rest.stub(:sleep) + rest.stub(:http_retry_count).and_return(0) - lambda {@rest.request(:GET, @url)}.should raise_error(Net::HTTPFatalError) - @log_stringio.string.should match(Regexp.escape('INFO: HTTP Request Returned 500 drooling from inside of mouth: Ears get sore!, Not even four')) + expect {rest.request(:GET, url)}.to raise_error(Net::HTTPFatalError) + expect(log_stringio.string).to match(Regexp.escape('INFO: HTTP Request Returned 500 drooling from inside of mouth: Ears get sore!, Not even four')) + end + it "fails when the compressed body is truncated" do + http_response["Content-Length"] = (body.bytesize + 99).to_s + expect {rest.request(:GET, url)}.to raise_error(Chef::Exceptions::ContentLengthMismatch) + end end - it "should raise an exception on an unsuccessful request" do - http_response = Net::HTTPServerError.new("1.1", "500", "drooling from inside of mouth") - http_response.stub(:body) - http_response.stub(:read_body) - @rest.stub(:sleep) - @http_client.stub(:request).and_yield(http_response).and_return(http_response) - lambda {@rest.request(:GET, @url)}.should raise_error(Net::HTTPFatalError) + context "on a generic unsuccessful request" do + let(:http_response) do + http_response = Net::HTTPServerError.new("1.1", "500", "drooling from inside of mouth") + http_response.stub(:body) + http_response.stub(:read_body) + http_response + end + it "throws an exception" do + rest.stub(:sleep) + expect {rest.request(:GET, url)}.to raise_error(Net::HTTPFatalError) + end end end - - end context "when streaming downloads to a tempfile" do - before do - @tempfile = Tempfile.open("chef-rspec-rest_spec-line-#{__LINE__}--") - Tempfile.stub(:new).with("chef-rest").and_return(@tempfile) - @request_mock = {} - Net::HTTP::Get.stub(:new).and_return(@request_mock) + let!(:tempfile) { Tempfile.open("chef-rspec-rest_spec-line-@{__LINE__}--") } + + let(:request_mock) { {} } + + let(:http_response) do + http_response = Net::HTTPSuccess.new("1.1",200, "it-works") + + http_response.stub(:read_body) + http_response.should_not_receive(:body) + http_response["Content-Length"] = "0" # call set_content_length (in test), if otherwise + http_response + end + + def set_content_length + content_length = 0 + http_response.read_body do |chunk| + content_length += chunk.bytesize + end + http_response["Content-Length"] = content_length.to_s + end - @http_response = Net::HTTPSuccess.new("1.1",200, "it-works") - @http_response.stub(:read_body) - @http_client.stub(:request).and_yield(@http_response).and_return(@http_response) + before do + Tempfile.stub(:new).with("chef-rest").and_return(tempfile) + Net::HTTP::Get.stub(:new).and_return(request_mock) end after do - @tempfile.close! + tempfile.close! end it " build a new HTTP GET request without the application/json accept header" do expected_headers = {'Accept' => "*/*", 'X-Chef-Version' => Chef::VERSION, 'Accept-Encoding' => Chef::REST::RESTRequest::ENCODING_GZIP_DEFLATE, - 'Host' => @host_header} - Net::HTTP::Get.should_receive(:new).with("/?foo=bar", expected_headers).and_return(@request_mock) - @rest.streaming_request(@url, {}) + 'Host' => host_header, + 'X-REMOTE-REQUEST-ID'=> request_id + } + Net::HTTP::Get.should_receive(:new).with("/?foo=bar", expected_headers).and_return(request_mock) + rest.streaming_request(url, {}) + end + + it "build a new HTTP GET request with the X-Remote-Request-Id header" do + expected_headers = {'Accept' => "*/*", + 'X-Chef-Version' => Chef::VERSION, + 'Accept-Encoding' => Chef::REST::RESTRequest::ENCODING_GZIP_DEFLATE, + 'Host' => host_header, + 'X-REMOTE-REQUEST-ID'=> request_id + } + Net::HTTP::Get.should_receive(:new).with("/?foo=bar", expected_headers).and_return(request_mock) + rest.streaming_request(url, {}) end it "returns a tempfile containing the streamed response body" do - @rest.streaming_request(@url, {}).should equal(@tempfile) + expect(rest.streaming_request(url, {})).to equal(tempfile) end it "writes the response body to a tempfile" do - @http_response.stub(:read_body).and_yield("real").and_yield("ultimate").and_yield("power") - @rest.streaming_request(@url, {}) - IO.read(@tempfile.path).chomp.should == "realultimatepower" + http_response.stub(:read_body).and_yield("real").and_yield("ultimate").and_yield("power") + set_content_length + rest.streaming_request(url, {}) + expect(IO.read(tempfile.path).chomp).to eq("realultimatepower") end it "closes the tempfile" do - @rest.streaming_request(@url, {}) - @tempfile.should be_closed + rest.streaming_request(url, {}) + expect(tempfile).to be_closed end it "yields the tempfile containing the streamed response body and then unlinks it when given a block" do - @http_response.stub(:read_body).and_yield("real").and_yield("ultimate").and_yield("power") + http_response.stub(:read_body).and_yield("real").and_yield("ultimate").and_yield("power") + set_content_length tempfile_path = nil - @rest.streaming_request(@url, {}) do |tempfile| + rest.streaming_request(url, {}) do |tempfile| tempfile_path = tempfile.path - File.exist?(tempfile.path).should be_true - IO.read(@tempfile.path).chomp.should == "realultimatepower" + expect(File.exist?(tempfile.path)).to be_true + expect(IO.read(tempfile.path).chomp).to eq("realultimatepower") end - File.exist?(tempfile_path).should be_false + expect(File.exist?(tempfile_path)).to be_false end it "does not raise a divide by zero exception if the content's actual size is 0" do - @http_response.add_field('Content-Length', "5") - @http_response.stub(:read_body).and_yield('') - lambda { @rest.streaming_request(@url, {}) }.should_not raise_error + http_response['Content-Length'] = "5" + http_response.stub(:read_body).and_yield('') + expect { rest.streaming_request(url, {}) }.to raise_error(Chef::Exceptions::ContentLengthMismatch) end it "does not raise a divide by zero exception when the Content-Length is 0" do - @http_response.add_field('Content-Length', "0") - @http_response.stub(:read_body).and_yield("ninja") - lambda { @rest.streaming_request(@url, {}) }.should_not raise_error + http_response['Content-Length'] = "0" + http_response.stub(:read_body).and_yield("ninja") + expect { rest.streaming_request(url, {}) }.to raise_error(Chef::Exceptions::ContentLengthMismatch) + end + + it "it raises an exception when the download is truncated" do + http_response["Content-Length"] = (body.bytesize + 99).to_s + http_response.stub(:read_body).and_yield("ninja") + expect { rest.streaming_request(url, {}) }.to raise_error(Chef::Exceptions::ContentLengthMismatch) end it "fetches a file and yields the tempfile it is streamed to" do - @http_response.stub(:read_body).and_yield("real").and_yield("ultimate").and_yield("power") + http_response.stub(:read_body).and_yield("real").and_yield("ultimate").and_yield("power") + set_content_length tempfile_path = nil - @rest.fetch("cookbooks/a_cookbook") do |tempfile| + rest.fetch("cookbooks/a_cookbook") do |tempfile| tempfile_path = tempfile.path - IO.read(@tempfile.path).chomp.should == "realultimatepower" + expect(IO.read(tempfile.path).chomp).to eq("realultimatepower") end - File.exist?(tempfile_path).should be_false + expect(File.exist?(tempfile_path)).to be_false end it "closes and unlinks the tempfile if there is an error while streaming the content to the tempfile" do - path = @tempfile.path - path.should_not be_nil - @tempfile.stub(:write).and_raise(IOError) - @rest.fetch("cookbooks/a_cookbook") {|tmpfile| "shouldn't get here"} - File.exists?(path).should be_false + path = tempfile.path + expect(path).not_to be_nil + tempfile.stub(:write).and_raise(IOError) + rest.fetch("cookbooks/a_cookbook") {|tmpfile| "shouldn't get here"} + expect(File.exists?(path)).to be_false end it "closes and unlinks the tempfile when the response is a redirect" do @@ -561,80 +643,83 @@ describe Chef::REST do Tempfile.stub(:new).with("chef-rest").and_return(tempfile) redirect = Net::HTTPFound.new("1.1", "302", "bob is taking care of that one for me today") - redirect.add_field("location", @url.path) + redirect.add_field("location", url.path) redirect.stub(:read_body) - @http_client.should_receive(:request).and_yield(redirect).and_return(redirect) - @http_client.should_receive(:request).and_yield(@http_response).and_return(@http_response) - @rest.fetch("cookbooks/a_cookbook") {|tmpfile| "shouldn't get here"} + http_client.should_receive(:request).and_yield(redirect).and_return(redirect) + http_client.should_receive(:request).and_yield(http_response).and_return(http_response) + rest.fetch("cookbooks/a_cookbook") {|tmpfile| "shouldn't get here"} end it "passes the original block to the redirected request" do - http_response = Net::HTTPFound.new("1.1", "302", "bob is taking care of that one for me today") - http_response.add_field("location","/that-thing-is-here-now") - http_response.stub(:read_body) + http_redirect = Net::HTTPFound.new("1.1", "302", "bob is taking care of that one for me today") + http_redirect.add_field("location","/that-thing-is-here-now") + http_redirect.stub(:read_body) block_called = false - @http_client.stub(:request).and_yield(@http_response).and_return(http_response, @http_response) - @rest.fetch("cookbooks/a_cookbook") do |tmpfile| + http_client.stub(:request).and_yield(http_response).and_return(http_redirect, http_response) + rest.fetch("cookbooks/a_cookbook") do |tmpfile| block_called = true end - block_called.should be_true + expect(block_called).to be_true end end end context "when following redirects" do + let(:rest) do + Chef::REST.new(base_url) + end + before do Chef::Config[:node_name] = "webmonkey.example.com" Chef::Config[:client_key] = CHEF_SPEC_DATA + "/ssl/private_key.pem" - @rest = Chef::REST.new(@url) end it "raises a RedirectLimitExceeded when redirected more than 10 times" do - redirected = lambda {@rest.follow_redirect { redirected.call }} - lambda {redirected.call}.should raise_error(Chef::Exceptions::RedirectLimitExceeded) + redirected = lambda {rest.follow_redirect { redirected.call }} + expect {redirected.call}.to raise_error(Chef::Exceptions::RedirectLimitExceeded) end it "does not count redirects from previous calls against the redirect limit" do total_redirects = 0 redirected = lambda do - @rest.follow_redirect do + rest.follow_redirect do total_redirects += 1 redirected.call unless total_redirects >= 9 end end - lambda {redirected.call}.should_not raise_error + expect {redirected.call}.not_to raise_error total_redirects = 0 - lambda {redirected.call}.should_not raise_error + expect {redirected.call}.not_to raise_error end it "does not sign the redirected request when sign_on_redirect is false" do - @rest.sign_on_redirect = false - @rest.follow_redirect { @rest.sign_requests?.should be_false } + rest.sign_on_redirect = false + rest.follow_redirect { expect(rest.sign_requests?).to be_false } end it "resets sign_requests to the original value after following an unsigned redirect" do - @rest.sign_on_redirect = false - @rest.sign_requests?.should be_true + rest.sign_on_redirect = false + expect(rest.sign_requests?).to be_true - @rest.follow_redirect { @rest.sign_requests?.should be_false } - @rest.sign_requests?.should be_true + rest.follow_redirect { expect(rest.sign_requests?).to be_false } + expect(rest.sign_requests?).to be_true end it "configures the redirect limit" do total_redirects = 0 redirected = lambda do - @rest.follow_redirect do + rest.follow_redirect do total_redirects += 1 redirected.call unless total_redirects >= 9 end end - lambda {redirected.call}.should_not raise_error + expect {redirected.call}.not_to raise_error total_redirects = 0 - @rest.redirect_limit = 3 - lambda {redirected.call}.should raise_error(Chef::Exceptions::RedirectLimitExceeded) + rest.redirect_limit = 3 + expect {redirected.call}.to raise_error(Chef::Exceptions::RedirectLimitExceeded) end end diff --git a/spec/unit/run_context_spec.rb b/spec/unit/run_context_spec.rb index 8063dffc77..39b8a8a50d 100644 --- a/spec/unit/run_context_spec.rb +++ b/spec/unit/run_context_spec.rb @@ -45,6 +45,10 @@ describe Chef::RunContext do describe "loading cookbooks for a run list" do before do + @node.run_list << "test" << "test::one" << "test::two" + @node.should_receive(:loaded_recipe).with(:test, "default") + @node.should_receive(:loaded_recipe).with(:test, "one") + @node.should_receive(:loaded_recipe).with(:test, "two") @run_context.load(@node.run_list.expand('_default')) end diff --git a/spec/unit/run_list/run_list_expansion_spec.rb b/spec/unit/run_list/run_list_expansion_spec.rb index 012ee9ea31..907e3d3985 100644 --- a/spec/unit/run_list/run_list_expansion_spec.rb +++ b/spec/unit/run_list/run_list_expansion_spec.rb @@ -66,7 +66,7 @@ describe Chef::RunList::RunListExpansion do describe "after applying a role" do before do - @expansion.stub!(:fetch_role).and_return(Chef::Role.new) + @expansion.stub(:fetch_role).and_return(Chef::Role.new) @expansion.inflate_role('rage', "role[base]") end @@ -89,7 +89,7 @@ describe Chef::RunList::RunListExpansion do @second_role.run_list('recipe[crabrevenge]') @second_role.default_attributes({'foo' => 'boo'}) @second_role.override_attributes({'baz' => 'bux'}) - @expansion.stub!(:fetch_role).and_return(@first_role, @second_role) + @expansion.stub(:fetch_role).and_return(@first_role, @second_role) @expansion.expand end @@ -111,7 +111,7 @@ describe Chef::RunList::RunListExpansion do describe "after expanding a run list with a non existant role" do before do - @expansion.stub!(:fetch_role) { @expansion.role_not_found('crabrevenge', "role[base]") } + @expansion.stub(:fetch_role) { @expansion.role_not_found('crabrevenge', "role[base]") } @expansion.expand end diff --git a/spec/unit/run_list_spec.rb b/spec/unit/run_list_spec.rb index f18f21a82b..220e4ea4a6 100644 --- a/spec/unit/run_list_spec.rb +++ b/spec/unit/run_list_spec.rb @@ -173,9 +173,9 @@ describe Chef::RunList do @role.default_attributes :one => :two @role.override_attributes :three => :four - Chef::Role.stub!(:load).and_return(@role) - @rest = mock("Chef::REST", { :get_rest => @role, :url => "/" }) - Chef::REST.stub!(:new).and_return(@rest) + Chef::Role.stub(:load).and_return(@role) + @rest = double("Chef::REST", { :get_rest => @role, :url => "/" }) + Chef::REST.stub(:new).and_return(@rest) @run_list << "role[stubby]" @run_list << "kitty" @@ -188,7 +188,7 @@ describe Chef::RunList do end it "should log a helpful error if the role is not available" do - Chef::Role.stub!(:from_disk).and_raise(Chef::Exceptions::RoleNotFound) + Chef::Role.stub(:from_disk).and_raise(Chef::Exceptions::RoleNotFound) Chef::Log.should_receive(:error).with("Role stubby (included by 'top level') is in the runlist but does not exist. Skipping expand.") @run_list.expand("_default", "disk") end @@ -218,7 +218,7 @@ describe Chef::RunList do describe "and multiply nested roles" do before do - @multiple_rest_requests = mock("Chef::REST") + @multiple_rest_requests = double("Chef::REST") @role.env_run_list["production"] << "role[prod-base]" @@ -233,7 +233,7 @@ describe Chef::RunList do end it "expands the run list using the specified environment for all nested roles" do - Chef::REST.stub!(:new).and_return(@multiple_rest_requests) + Chef::REST.stub(:new).and_return(@multiple_rest_requests) @multiple_rest_requests.should_receive(:get_rest).with("roles/stubby").and_return(@role) @multiple_rest_requests.should_receive(:get_rest).with("roles/prod-base").and_return(@role_prod_base) @multiple_rest_requests.should_receive(:get_rest).with("roles/nested-deeper").and_return(@role_nested_deeper) @@ -270,8 +270,8 @@ describe Chef::RunList do dog.default_attributes :seven => :nine dog.run_list "three" @role.run_list << "role[dog]" - Chef::Role.stub!(:from_disk).with("stubby").and_return(@role) - Chef::Role.stub!(:from_disk).with("dog").and_return(dog) + Chef::Role.stub(:from_disk).with("stubby").and_return(@role) + Chef::Role.stub(:from_disk).with("dog").and_return(dog) expansion = @run_list.expand("_default", 'disk') expansion.recipes[2].should == "three" @@ -284,7 +284,7 @@ describe Chef::RunList do dog.default_attributes :seven => :nine dog.run_list "role[dog]", "three" @role.run_list << "role[dog]" - Chef::Role.stub!(:from_disk).with("stubby").and_return(@role) + Chef::Role.stub(:from_disk).with("stubby").and_return(@role) Chef::Role.should_receive(:from_disk).with("dog").once.and_return(dog) expansion = @run_list.expand("_default", 'disk') diff --git a/spec/unit/run_status_spec.rb b/spec/unit/run_status_spec.rb index 049b86cf54..6c85364871 100644 --- a/spec/unit/run_status_spec.rb +++ b/spec/unit/run_status_spec.rb @@ -55,7 +55,7 @@ describe Chef::RunStatus do before do @start_time = Time.new @end_time = @start_time + 23 - Time.stub!(:now).and_return(@start_time, @end_time) + Time.stub(:now).and_return(@start_time, @end_time) @run_status.start_clock @run_status.stop_clock end diff --git a/spec/unit/runner_spec.rb b/spec/unit/runner_spec.rb index 28082078c2..68d8b0e011 100644 --- a/spec/unit/runner_spec.rb +++ b/spec/unit/runner_spec.rb @@ -125,24 +125,24 @@ describe Chef::Runner do it "should raise exceptions as thrown by a provider" do provider = Chef::Provider::SnakeOil.new(@run_context.resource_collection[0], @run_context) - Chef::Provider::SnakeOil.stub!(:new).once.and_return(provider) - provider.stub!(:action_sell).once.and_raise(ArgumentError) + Chef::Provider::SnakeOil.stub(:new).once.and_return(provider) + provider.stub(:action_sell).once.and_raise(ArgumentError) lambda { @runner.converge }.should raise_error(ArgumentError) end it "should not raise exceptions thrown by providers if the resource has ignore_failure set to true" do - @run_context.resource_collection[0].stub!(:ignore_failure).and_return(true) + @run_context.resource_collection[0].stub(:ignore_failure).and_return(true) provider = Chef::Provider::SnakeOil.new(@run_context.resource_collection[0], @run_context) - Chef::Provider::SnakeOil.stub!(:new).once.and_return(provider) - provider.stub!(:action_sell).once.and_raise(ArgumentError) - lambda { @runner.converge }.should_not raise_error(ArgumentError) + Chef::Provider::SnakeOil.stub(:new).once.and_return(provider) + provider.stub(:action_sell).once.and_raise(ArgumentError) + lambda { @runner.converge }.should_not raise_error end it "should retry with the specified delay if retries are specified" do @first_resource.retries 3 provider = Chef::Provider::SnakeOil.new(@run_context.resource_collection[0], @run_context) - Chef::Provider::SnakeOil.stub!(:new).once.and_return(provider) - provider.stub!(:action_sell).and_raise(ArgumentError) + Chef::Provider::SnakeOil.stub(:new).once.and_return(provider) + provider.stub(:action_sell).and_raise(ArgumentError) @first_resource.should_receive(:sleep).with(2).exactly(3).times lambda { @runner.converge }.should raise_error(ArgumentError) end diff --git a/spec/unit/scan_access_control_spec.rb b/spec/unit/scan_access_control_spec.rb index 3cfecfaa35..48f820ff85 100644 --- a/spec/unit/scan_access_control_spec.rb +++ b/spec/unit/scan_access_control_spec.rb @@ -49,7 +49,7 @@ describe Chef::ScanAccessControl do describe "when the fs entity exists" do before do - @stat = mock("File::Stat for #{@new_resource.path}", :uid => 0, :gid => 0, :mode => 00100644) + @stat = double("File::Stat for #{@new_resource.path}", :uid => 0, :gid => 0, :mode => 00100644) File.should_receive(:realpath).with(@new_resource.path).and_return(@real_file) File.should_receive(:stat).with(@real_file).and_return(@stat) File.should_receive(:exist?).with(@new_resource.path).and_return(true) @@ -128,7 +128,7 @@ describe Chef::ScanAccessControl do end it "sets the owner of current_resource to the username of the current owner" do - @root_passwd = mock("Struct::Passwd for uid 0", :name => "root") + @root_passwd = double("Struct::Passwd for uid 0", :name => "root") Etc.should_receive(:getpwuid).with(0).and_return(@root_passwd) @scanner.set_all! @@ -163,7 +163,7 @@ describe Chef::ScanAccessControl do end it "sets the group of the current resource to the group name" do - @group_entry = mock("Struct::Group for wheel", :name => "wheel") + @group_entry = double("Struct::Group for wheel", :name => "wheel") Etc.should_receive(:getgrgid).with(0).and_return(@group_entry) @scanner.set_all! diff --git a/spec/unit/search/query_spec.rb b/spec/unit/search/query_spec.rb index 3f41c142ee..7463e3bb3c 100644 --- a/spec/unit/search/query_spec.rb +++ b/spec/unit/search/query_spec.rb @@ -21,8 +21,8 @@ require 'chef/search/query' describe Chef::Search::Query do before(:each) do - @rest = mock("Chef::REST") - Chef::REST.stub!(:new).and_return(@rest) + @rest = double("Chef::REST") + Chef::REST.stub(:new).and_return(@rest) @query = Chef::Search::Query.new end @@ -38,12 +38,12 @@ describe Chef::Search::Query do "start" => 0, "total" => 4 } - @rest.stub!(:get_rest).and_return(@response) + @rest.stub(:get_rest).and_return(@response) end it "should accept a type as the first argument" do - lambda { @query.search("foo") }.should_not raise_error(ArgumentError) - lambda { @query.search(:foo) }.should_not raise_error(ArgumentError) + lambda { @query.search("foo") }.should_not raise_error + lambda { @query.search(:foo) }.should_not raise_error lambda { @query.search(Hash.new) }.should raise_error(ArgumentError) end @@ -85,13 +85,13 @@ describe Chef::Search::Query do end it "should call a block for each object in the response" do - @call_me = mock("blocky") + @call_me = double("blocky") @response["rows"].each { |r| @call_me.should_receive(:do).with(r) } @query.search(:foo) { |r| @call_me.do(r) } end it "should page through the responses" do - @call_me = mock("blocky") + @call_me = double("blocky") @response["rows"].each { |r| @call_me.should_receive(:do).with(r) } @query.search(:foo, "*:*", nil, 0, 1) { |r| @call_me.do(r) } end diff --git a/spec/unit/shell/model_wrapper_spec.rb b/spec/unit/shell/model_wrapper_spec.rb index 35dc591edc..eae3b2b581 100644 --- a/spec/unit/shell/model_wrapper_spec.rb +++ b/spec/unit/shell/model_wrapper_spec.rb @@ -71,8 +71,8 @@ describe Shell::ModelWrapper do @wrapper = Shell::ModelWrapper.new(Chef::Node) # Creating a Chef::Search::Query object tries to read the private key... - @searcher = mock("Chef::Search::Query #{__FILE__}:#{__LINE__}") - Chef::Search::Query.stub!(:new).and_return(@searcher) + @searcher = double("Chef::Search::Query #{__FILE__}:#{__LINE__}") + Chef::Search::Query.stub(:new).and_return(@searcher) end it "falls back to listing the objects when the 'query' is :all" do diff --git a/spec/unit/shell/shell_ext_spec.rb b/spec/unit/shell/shell_ext_spec.rb index 22e9ae674b..c24acbca3e 100644 --- a/spec/unit/shell/shell_ext_spec.rb +++ b/spec/unit/shell/shell_ext_spec.rb @@ -23,21 +23,21 @@ describe Shell::Extensions do before do @shell_client = TestableShellSession.instance - Shell.stub!(:session).and_return(@shell_client) + Shell.stub(:session).and_return(@shell_client) @job_manager = TestJobManager.new @root_context = Object.new @root_context.instance_eval(&ObjectTestHarness) Shell::Extensions.extend_context_object(@root_context) - @root_context.conf = mock("irbconf") + @root_context.conf = double("irbconf") end it "finds a subsession in irb for an object" do target_context_obj = Chef::Node.new - irb_context = mock("context", :main => target_context_obj) - irb_session = mock("irb session", :context => irb_context) + irb_context = double("context", :main => target_context_obj) + irb_session = double("irb session", :context => irb_context) @job_manager.jobs = [[:thread, irb_session]] - @root_context.stub!(:jobs).and_return(@job_manager) + @root_context.stub(:jobs).and_return(@job_manager) @root_context.ensure_session_select_defined @root_context.jobs.select_shell_session(target_context_obj).should == irb_session @root_context.jobs.select_shell_session(:idontexist).should be_nil @@ -45,8 +45,8 @@ describe Shell::Extensions do it "finds, then switches to a session" do @job_manager.jobs = [] - @root_context.stub!(:ensure_session_select_defined) - @root_context.stub!(:jobs).and_return(@job_manager) + @root_context.stub(:ensure_session_select_defined) + @root_context.stub(:jobs).and_return(@job_manager) @job_manager.should_receive(:select_shell_session).and_return(:the_shell_session) @job_manager.should_receive(:switch).with(:the_shell_session) @root_context.find_or_create_session_for(:foo) @@ -54,8 +54,8 @@ describe Shell::Extensions do it "creates a new session if an existing one isn't found" do @job_manager.jobs = [] - @root_context.stub!(:jobs).and_return(@job_manager) - @job_manager.stub!(:select_shell_session).and_return(nil) + @root_context.stub(:jobs).and_return(@job_manager) + @job_manager.stub(:select_shell_session).and_return(nil) @root_context.should_receive(:irb).with(:foo) @root_context.find_or_create_session_for(:foo) end @@ -81,18 +81,18 @@ describe Shell::Extensions do it "turns irb tracing on and off" do @root_context.should respond_to(:trace) @root_context.conf.should_receive(:use_tracer=).with(true) - @root_context.stub!(:tracing?) + @root_context.stub(:tracing?) @root_context.tracing :on end it "says if tracing is on or off" do - @root_context.conf.stub!(:use_tracer).and_return(true) + @root_context.conf.stub(:use_tracer).and_return(true) @root_context.should_receive(:puts).with("tracing is on") @root_context.tracing? end it "prints node attributes" do - node = mock("node", :attribute => {:foo => :bar}) + node = double("node", :attribute => {:foo => :bar}) @shell_client.node = node @root_context.should_receive(:pp).with({:foo => :bar}) @root_context.ohai @@ -111,14 +111,14 @@ describe Shell::Extensions do end it "says if echo is on or off" do - @root_context.conf.stub!(:echo).and_return(true) + @root_context.conf.stub(:echo).and_return(true) @root_context.should_receive(:puts).with("echo is on") @root_context.echo? end it "gives access to the stepable iterator" do - Shell::StandAloneSession.instance.stub!(:reset!) - Shell.session.stub!(:rebuild_context) + Shell::StandAloneSession.instance.stub(:reset!) + Shell.session.stub(:rebuild_context) events = Chef::EventDispatch::Dispatcher.new run_context = Chef::RunContext.new(Chef::Node.new, {}, events) run_context.resource_collection.instance_variable_set(:@iterator, :the_iterator) diff --git a/spec/unit/shell/shell_session_spec.rb b/spec/unit/shell/shell_session_spec.rb index a0fc3028f6..e5fc46e945 100644 --- a/spec/unit/shell/shell_session_spec.rb +++ b/spec/unit/shell/shell_session_spec.rb @@ -52,7 +52,7 @@ describe Shell::ClientSession do @session = Shell::ClientSession.instance @node = Chef::Node.build("foo") @session.node = @node - @session.instance_variable_set(:@client, stub(:sync_cookbooks => {})) + @session.instance_variable_set(:@client, double(:sync_cookbooks => {})) @expansion = Chef::RunList::RunListExpansion.new(@node.chef_environment, []) @node.run_list.should_receive(:expand).with(@node.chef_environment).and_return(@expansion) @@ -87,9 +87,9 @@ describe Shell::StandAloneSession do end it "runs chef with the standalone recipe" do - @session.stub!(:node_built?).and_return(true) - Chef::Log.stub!(:level) - chef_runner = mock("Chef::Runner.new", :converge => :converged) + @session.stub(:node_built?).and_return(true) + Chef::Log.stub(:level) + chef_runner = double("Chef::Runner.new", :converge => :converged) # pre-heat resource collection cache @session.resource_collection @@ -116,7 +116,7 @@ describe Shell::SoloSession do end it "returns a collection based on it's compilation object and the extra recipe provided by chef-shell" do - @session.stub!(:node_built?).and_return(true) + @session.stub(:node_built?).and_return(true) kitteh = Chef::Resource::Cat.new("keyboard") @recipe.run_context.resource_collection << kitteh @session.resource_collection.should include(kitteh) @@ -133,7 +133,7 @@ describe Shell::SoloSession do end it "generates its resource collection from the compiled cookbooks and the ad hoc recipe" do - @session.stub!(:node_built?).and_return(true) + @session.stub(:node_built?).and_return(true) kitteh_cat = Chef::Resource::Cat.new("kitteh") @run_context.resource_collection << kitteh_cat keyboard_cat = Chef::Resource::Cat.new("keyboard_cat") @@ -143,9 +143,9 @@ describe Shell::SoloSession do end it "runs chef with a resource collection from the compiled cookbooks" do - @session.stub!(:node_built?).and_return(true) - Chef::Log.stub!(:level) - chef_runner = mock("Chef::Runner.new", :converge => :converged) + @session.stub(:node_built?).and_return(true) + Chef::Log.stub(:level) + chef_runner = double("Chef::Runner.new", :converge => :converged) Chef::Runner.should_receive(:new).with(an_instance_of(Chef::RunContext)).and_return(chef_runner) @recipe.run_chef.should == :converged diff --git a/spec/unit/shell_spec.rb b/spec/unit/shell_spec.rb index fd4241732f..cce743873f 100644 --- a/spec/unit/shell_spec.rb +++ b/spec/unit/shell_spec.rb @@ -42,8 +42,7 @@ describe Shell do before do Shell.irb_conf = {} - Shell::ShellSession.instance.rspec_reset - Shell::ShellSession.instance.stub!(:reset!) + Shell::ShellSession.instance.stub(:reset!) end describe "reporting its status" do diff --git a/spec/unit/user_spec.rb b/spec/unit/user_spec.rb index 9121babeed..c535e4172b 100644 --- a/spec/unit/user_spec.rb +++ b/spec/unit/user_spec.rb @@ -196,8 +196,8 @@ describe Chef::User do before (:each) do @user = Chef::User.new @user.name "foobar" - @http_client = mock("Chef::REST mock") - Chef::REST.stub!(:new).and_return(@http_client) + @http_client = double("Chef::REST mock") + Chef::REST.stub(:new).and_return(@http_client) end describe "list" do @@ -208,12 +208,12 @@ describe Chef::User do end it "lists all clients on an OSC server" do - @http_client.stub!(:get_rest).with("users").and_return(@osc_response) + @http_client.stub(:get_rest).with("users").and_return(@osc_response) Chef::User.list.should == @osc_response end it "lists all clients on an OHC/OPC server" do - @http_client.stub!(:get_rest).with("users").and_return(@ohc_response) + @http_client.stub(:get_rest).with("users").and_return(@ohc_response) # We expect that Chef::User.list will give a consistent response # so OHC API responses should be transformed to OSC-style output. Chef::User.list.should == @osc_response diff --git a/spec/unit/util/backup_spec.rb b/spec/unit/util/backup_spec.rb index c49694f924..617886cede 100644 --- a/spec/unit/util/backup_spec.rb +++ b/spec/unit/util/backup_spec.rb @@ -27,7 +27,7 @@ describe Chef::Util::Backup do end before(:each) do - @new_resource = mock("new_resource") + @new_resource = double("new_resource") @new_resource.should_receive(:path).at_least(:once).and_return(tempfile.path) @backup = Chef::Util::Backup.new(@new_resource) end diff --git a/spec/unit/util/file_edit_spec.rb b/spec/unit/util/file_edit_spec.rb index 3cf60172d9..d1d87a6bda 100644 --- a/spec/unit/util/file_edit_spec.rb +++ b/spec/unit/util/file_edit_spec.rb @@ -20,116 +20,169 @@ require 'spec_helper' describe Chef::Util::FileEdit do - before(:each) do + let(:starting_content) do + <<-EOF +127.0.0.1 localhost +255.255.255.255 broadcasthost +::1 localhost +fe80::1%lo0 localhost + EOF + end + + let(:localhost_replaced) do + <<-EOF +127.0.0.1 replacement +255.255.255.255 broadcasthost +::1 replacement +fe80::1%lo0 replacement + EOF + end + + let(:localhost_line_replaced) do + <<-EOF +replacement line +255.255.255.255 broadcasthost +replacement line +replacement line + EOF + end + + let(:localhost_deleted) do + # sensitive to deliberate trailing whitespace + "127.0.0.1 \n255.255.255.255 broadcasthost\n::1 \nfe80::1%lo0 \n" + end + + let(:localhost_line_deleted) do + <<-EOF +255.255.255.255 broadcasthost + EOF + end + + let(:append_after_all_localhost) do + <<-EOF +127.0.0.1 localhost +new line inserted +255.255.255.255 broadcasthost +::1 localhost +new line inserted +fe80::1%lo0 localhost +new line inserted + EOF + end - @hosts_content=<<-HOSTS + let(:append_after_content) do + <<-EOF 127.0.0.1 localhost 255.255.255.255 broadcasthost ::1 localhost fe80::1%lo0 localhost -HOSTS +new line inserted + EOF + end - @tempfile = Tempfile.open('file_edit_spec') - @tempfile.write(@hosts_content) - @tempfile.close - @fedit = Chef::Util::FileEdit.new(@tempfile.path) + let(:target_file) do + f = Tempfile.open('file_edit_spec') + f.write(starting_content) + f.close + f end + let(:fedit) { Chef::Util::FileEdit.new(target_file.path) } + after(:each) do - @tempfile && @tempfile.close! + target_file.close! end describe "initialiize" do it "should create a new Chef::Util::FileEdit object" do - Chef::Util::FileEdit.new(@tempfile.path).should be_kind_of(Chef::Util::FileEdit) + expect(fedit).to be_instance_of(Chef::Util::FileEdit) end it "should throw an exception if the input file does not exist" do - lambda{Chef::Util::FileEdit.new("nonexistfile")}.should raise_error + expect{Chef::Util::FileEdit.new("nonexistfile")}.to raise_error(ArgumentError) end - it "should throw an exception if the input file is blank" do - lambda do - Chef::Util::FileEdit.new(File.join(CHEF_SPEC_DATA, "filedit", "blank")) - end.should raise_error + # CHEF-5018: people have monkey patched this and it has accidentally been broken + it "should read the contents into memory as an array" do + expect(fedit.send(:contents)).to be_instance_of(Array) end end + describe "when the file is blank" do + let(:hosts_content) { "" } + + it "should not throw an exception" do + expect{ fedit }.not_to raise_error + end + end + + def edited_file_contents + IO.read(target_file.path) + end + describe "search_file_replace" do it "should accept regex passed in as a string (not Regexp object) and replace the match if there is one" do - @fedit.search_file_replace("localhost", "replacement") - @fedit.write_file - newfile = File.new(@tempfile.path).readlines - newfile[0].should match(/replacement/) + fedit.search_file_replace("localhost", "replacement") + fedit.write_file + expect(edited_file_contents).to eq(localhost_replaced) end it "should accept regex passed in as a Regexp object and replace the match if there is one" do - @fedit.search_file_replace(/localhost/, "replacement") - @fedit.write_file - newfile = File.new(@tempfile.path).readlines - newfile[0].should match(/replacement/) + fedit.search_file_replace(/localhost/, "replacement") + fedit.write_file + expect(edited_file_contents).to eq(localhost_replaced) end it "should do nothing if there isn't a match" do - @fedit.search_file_replace(/pattern/, "replacement") - @fedit.write_file - newfile = File.new(@tempfile.path).readlines - newfile[0].should_not match(/replacement/) + fedit.search_file_replace(/pattern/, "replacement") + fedit.write_file + expect(edited_file_contents).to eq(starting_content) end end describe "search_file_replace_line" do it "should search for match and replace the whole line" do - @fedit.search_file_replace_line(/localhost/, "replacement line") - @fedit.write_file - newfile = File.new(@tempfile.path).readlines - newfile[0].should match(/replacement/) - newfile[0].should_not match(/127/) + fedit.search_file_replace_line(/localhost/, "replacement line") + fedit.write_file + expect(edited_file_contents).to eq(localhost_line_replaced) end end describe "search_file_delete" do it "should search for match and delete the match" do - @fedit.search_file_delete(/localhost/) - @fedit.write_file - newfile = File.new(@tempfile.path).readlines - newfile[0].should_not match(/localhost/) - newfile[0].should match(/127/) + fedit.search_file_delete(/localhost/) + fedit.write_file + expect(edited_file_contents).to eq(localhost_deleted) end end describe "search_file_delete_line" do it "should search for match and delete the matching line" do - @fedit.search_file_delete_line(/localhost/) - @fedit.write_file - newfile = File.new(@tempfile.path).readlines - newfile[0].should_not match(/localhost/) - newfile[0].should match(/broadcasthost/) + fedit.search_file_delete_line(/localhost/) + fedit.write_file + expect(edited_file_contents).to eq(localhost_line_deleted) end end describe "insert_line_after_match" do it "should search for match and insert the given line after the matching line" do - @fedit.insert_line_after_match(/localhost/, "new line inserted") - @fedit.write_file - newfile = File.new(@tempfile.path).readlines - newfile[1].should match(/new/) + fedit.insert_line_after_match(/localhost/, "new line inserted") + fedit.write_file + expect(edited_file_contents).to eq(append_after_all_localhost) end end describe "insert_line_if_no_match" do it "should search for match and insert the given line if no line match" do - @fedit.insert_line_if_no_match(/pattern/, "new line inserted") - @fedit.write_file - newfile = File.new(@tempfile.path).readlines - newfile.last.should match(/new/) + fedit.insert_line_if_no_match(/pattern/, "new line inserted") + fedit.write_file + expect(edited_file_contents).to eq(append_after_content) end it "should do nothing if there is a match" do - @fedit.insert_line_if_no_match(/localhost/, "replacement") - @fedit.write_file - newfile = File.new(@tempfile.path).readlines - newfile[1].should_not match(/replacement/) + fedit.insert_line_if_no_match(/localhost/, "replacement") + fedit.write_file + expect(edited_file_contents).to eq(starting_content) end end end diff --git a/spec/unit/util/selinux_spec.rb b/spec/unit/util/selinux_spec.rb index 710380e6fc..d87cebf95c 100644 --- a/spec/unit/util/selinux_spec.rb +++ b/spec/unit/util/selinux_spec.rb @@ -53,7 +53,7 @@ describe Chef::Util::Selinux do describe "when selinuxenabled binary exists" do before do @selinux_enabled_path = File.join("/sbin", "selinuxenabled") - File.stub!(:executable?) do |file_path| + File.stub(:executable?) do |file_path| file_path.end_with?("selinuxenabled").should be_true file_path == @selinux_enabled_path end @@ -61,7 +61,7 @@ describe Chef::Util::Selinux do describe "when selinux is enabled" do before do - cmd_result = mock("Cmd Result", :exitstatus => 0) + cmd_result = double("Cmd Result", :exitstatus => 0) @test_instance.should_receive(:shell_out!).once.with(@selinux_enabled_path, {:returns=>[0, 1]}).and_return(cmd_result) end @@ -74,7 +74,7 @@ describe Chef::Util::Selinux do describe "when selinux is disabled" do before do - cmd_result = mock("Cmd Result", :exitstatus => 1) + cmd_result = double("Cmd Result", :exitstatus => 1) @test_instance.should_receive(:shell_out!).once.with(@selinux_enabled_path, {:returns=>[0, 1]}).and_return(cmd_result) end @@ -87,7 +87,7 @@ describe Chef::Util::Selinux do describe "when selinux gives an unexpected status" do before do - cmd_result = mock("Cmd Result", :exitstatus => 101) + cmd_result = double("Cmd Result", :exitstatus => 101) @test_instance.should_receive(:shell_out!).once.with(@selinux_enabled_path, {:returns=>[0, 1]}).and_return(cmd_result) end @@ -99,7 +99,7 @@ describe Chef::Util::Selinux do describe "when selinuxenabled binary doesn't exist" do before do - File.stub!(:executable?) do |file_path| + File.stub(:executable?) do |file_path| file_path.end_with?("selinuxenabled").should be_true false end @@ -118,7 +118,7 @@ describe Chef::Util::Selinux do before do @restorecon_enabled_path = File.join("/sbin", "restorecon") - File.stub!(:executable?) do |file_path| + File.stub(:executable?) do |file_path| file_path.end_with?("restorecon").should be_true file_path == @restorecon_enabled_path end @@ -150,7 +150,7 @@ describe Chef::Util::Selinux do describe "when restorecon doesn't exist on the system" do before do - File.stub!(:executable?) do |file_path| + File.stub(:executable?) do |file_path| file_path.end_with?("restorecon").should be_true false end |