summaryrefslogtreecommitdiffstats
path: root/lib
Commit message (Collapse)AuthorAgeFilesLines
...
* | | | | | Merge branch 'feature/master/6144' of https://github.com/ghoneycutt/puppet ↵Jesse Wolfe2011-03-292-20/+92
|\ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | into next
| * | | | | | (#6144) add missing zfs propertiesGarrett Honeycutt2011-02-082-20/+92
| |/ / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Alphabetized properties * Added documentation for acceptable values * Added the following properties: atime canmount checksum devices exec logbias nbmand readonly refquota refreservation setuid shareiscsi sharesmb version volsize vscan xattr zoned vscan
* | | | | | Merge branch 'feature/2.6.next/5909' of https://github.com/bodepd/puppet ↵Jesse Wolfe2011-03-291-0/+47
|\ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | into next
| * | | | | | (5909) Function to dyncamically generate resources.Dan Bode2011-03-161-0/+47
| | |_|_|/ / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This function allows you to dynamically generate resources, passing them as a hash to the create_resources function. This was originally written to be used together with an ENC. Resources can be programitally generated as yaml and passed to a class. classes: webserver::instances: instances: instance1: foo: bar instance2: foo: blah Then puppet code can consume the hash parameters and convert then into resources class webserver::instances ( $instances = {} ) { create_resources('webserver::instance', $instances) } Now I can dynamically determine how webserver instances are deployed to nodes by updating the YAML files.
* | | | | | Merge branch 'feature/master/5432' of https://github.com/keymon/puppet into nextJesse Wolfe2011-03-295-1/+961
|\ \ \ \ \ \
| * | | | | | (#5432) Use AIX native commands to manage users and groupsHector Rivas Gandara2011-01-103-117/+100
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | More elegant Array|String => String conversion in AixObject. Fixed some bugs and code/comments cleaned.
| * | | | | | (#5432) Use AIX native commands to manage users and groupsHector Rivas Gandara2011-01-105-318/+516
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Specific providers should be created for AIX to manage users and groups. AIX bases the authentication management on a set of commands: mkuser, rmuser, chuser, lsuser, mkgroup, rmgroup, chgroup, lsg This commit implements such providers. The types where extended with: - feature: :manages_aix_lam - newparam(ia_load_module): authentication module to use in user and group AIX providers. - newproperty("attributes"): AIX attributes that are not managed by puppet directely. Notes:: - AIX users can have expiry date defined with minute granularity, but puppet does not allow it. There is a ticket open for that (#5431) - AIX maximum password age is in WEEKs, not days. Squashed commit of the following: commit dd9efff227f60dd7d11e33f754870f6344526097 Author: Hector Rivas Gandara <keymon@gmail.com> Date: Tue Dec 28 14:42:35 2010 +0100 Added new property "attributes" in AIX group provider for AIX attributes that are not managed by puppet directely. commit cd23fff3a3a4963f12c0029d43db3c530a0e4fa3 Author: Hector Rivas Gandara <keymon@gmail.com> Date: Tue Dec 28 14:33:50 2010 +0100 Converted file from Windows to Unix format commit c6929e9b557802fe908469ca51339ce249242c94 Author: Hector Rivas Gandara <keymon@gmail.com> Date: Tue Dec 28 14:32:29 2010 +0100 Added new property "attributes" in AIX user provider for AIX attributes that are not managed by puppet directely. commit d2814dc9d7730635a17a9bdbbc6ef9518f23b39d Author: Hector Rivas Gandara <keymon@gmail.com> Date: Tue Dec 28 12:48:07 2010 +0100 Added feature :ia_load_module and new parameter (newparam) ia_load_module, to define authentication module to use in user and group AIX providers. commit 95a4e960a93c1b75a4a0053c07fa192bf552d63b Author: Hector Rivas Gandara <keymon@gmail.com> Date: Tue Dec 28 12:46:20 2010 +0100 Fixed typo in if sentence
| * | | | | | (#5432) Use AIX native commands to manage users and groupsHector Rivas Gandara2011-01-103-11/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixed providers for new aixobject.rb Fixed incorrect variable naming.
| * | | | | | (#5432) Use AIX native commands to manage users and groupsHector Rivas Gandara2010-12-273-78/+201
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Refactorized the aixobject.rb to allow new providers using commands with colon separated output.
| * | | | | | (#5432) Use AIX native commands to manage users and groupsHector Rivas Gandara2010-12-273-0/+652
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Specific providers should be created for AIX to manage users and groups. AIX bases the authentication management on a set of commands: mkuser, rmuser, chuser, lsuser, mkgroup, rmgroup, chgroup, lsgroup, etc. This commit implements such providers. Notes:: - AIX users can have expiry date defined with minute granularity, but puppet does not allow it. There is a ticket open for that (#5431) - AIX maximum password age is in WEEKs, not days. - I force the compat IA module. TODO:: - Add new AIX specific attributes, specilly registry and SYSTEM.
* | | | | | | (#6830) Fix instance_variables now comes back as symbolsMatt Robinson2011-03-291-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | YAML_ATTRIBUTES was being declared as strings and then intersected with the list of instance_variables, which in Ruby 1.9 comes back as symbols, so results in an empty list every time. Reviewed-by: Jesse Wolfe <jesse@puppetlabs.com>
* | | | | | | (#6830) Fix MD5 handling to work with Ruby 1.9Matt Robinson2011-03-291-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In Ruby 1.9 you have to require 'digest/md5' instead of just 'md5'. The following irb sessions from each version of Ruby should explain the changes in how MD5 is used between Ruby versions and why this patch was made. ruby-1.9.2-p136 :001 > require 'md5' LoadError: no such file to load -- md5 ruby-1.9.2-p136 :002 > require 'digest/md5' => true ruby-1.9.2-p136 :003 > Digest::MD5.hexdigest('mystring') => "169319501261c644a58610f967e8f9d0" ruby-1.9.2-p136 :004 > Digest::MD5.new('mystring') => #<Digest::MD5: d41d8cd98f00b204e9800998ecf8427e> ruby-1.8.7-p330 :001 > require 'digest/md5' => [] ruby-1.8.7-p330 :002 > require 'md5' => ["MD5"] ruby-1.8.7-p330 :003 > Digest::MD5.hexdigest('mystring') => "169319501261c644a58610f967e8f9d0" ruby-1.8.7-p330 :004 > MD5.new('mystring') => #<MD5: 169319501261c644a58610f967e8f9d0> ruby-1.8.7-p330 :005 > MD5.new('mystring').to_s => "169319501261c644a58610f967e8f9d0" ruby-1.8.7-p330 :006 > Digest::MD5.new('mystring') ArgumentError: wrong number of arguments (1 for 0) Reviewed-by: Jesse Wolfe <jesse@puppetlabs.com>
* | | | | | | (#6830) Fix File class scopingMatt Robinson2011-03-292-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As seen in other Ruby 1.9 compatibility patches already. Fixes errors like: undefined method `dirname' for Puppet::Type::File:Class Reviewed-by: Jesse Wolfe <jesse@puppetlabs.com>
* | | | | | | (#6830) Handle case where array is actually a stringMatt Robinson2011-03-291-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Another case where in Ruby 1.8 you can call enumerable methods on strings that you can't in Ruby 1.9. undefined method `collect' for "dev2 dev1":String Reviewed-by: Jesse Wolfe <jesse@puppetlabs.com>
* | | | | | | (#6830) Fix case where instance_variables returns symbols in Ruby 1.9Matt Robinson2011-03-291-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | class Foo def initialize @a = 2 @b = "two" end end p Foo.new.instance_variables In Ruby 1.8 this prints ["@a", "@b"] In Ruby 1.9 this prints [:@a, :@b] Reviewed-by: Jesse Wolfe <jesse@puppetlabs.com>
* | | | | | | Merge branch 'ticket/next/5477' into nextJesse Wolfe2011-03-255-13/+8
|\ \ \ \ \ \ \
| * | | | | | | (#5477) Allow watch_file to watch non-existent files, especially site.ppJesse Wolfe2011-03-255-13/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The watch_file mechanism would refuse to monitor paths to files that didn't exist. This patch makes it possible to watch a file that hasn't been created yet, so when it is created, you manifests will get reparsed. Paired-With: Max Martin <max@puppetlabs.com> Reviewed-By: Jacob Helwig <jacob@puppetlabs.com>
* | | | | | | | Merge commit '2.6.next^1' into nextJesse Wolfe2011-03-252-8/+7
|\ \ \ \ \ \ \ \ | | |_|_|_|/ / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These changes were superseded by existing commits in next: lib/puppet/parser/compiler.rb spec/unit/parser/compiler_spec.rb
| * | | | | | | Merge branch 'ticket/2.6.next/5221' into 2.6.nextNick Lewis2011-03-241-0/+1
| |\ \ \ \ \ \ \ | | |_|_|_|_|/ / | |/| | | | | |
| | * | | | | | (#5221) Fix fileset path absoluteness checking with trailing slashJames Turnbull2011-03-241-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Reviewed-By: Nick Lewis Reviewed-By: Pieter van de Bruggen
| * | | | | | | Merge branch 'feature/2.6.next/4576' of https://github.com/bodepd/puppet ↵Jesse Wolfe2011-03-241-1/+1
| |\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | into 2.6.next
| | * | | | | | | (4576) - if ENC declares invalid class, it is logged at warning.Dan Bode2011-03-161-1/+1
| | | |_|_|/ / / | | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | used to be at info, so you had to run the master on verbose to see it an ENC was trying to declare a class that could not be loaded.
| * | | | | | | (#4769) Fix negative timeout support for newer rubiesNick Lewis2011-03-241-8/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In new versions of Ruby, negative timeouts are unsupported. So munge negatives to zero in the parameter. Reviewed-By: Jacob Helwig
* | | | | | | | (#6855) ResourceType#search now accepts a regexLuke Kanies2011-03-251-1/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We treat the regex relatively plainly, but this is more reasonable than just '*'. Signed-off-by: Luke Kanies <luke@puppetlabs.com> Reviewed-by: Max Martin <max@puppetlabs.com>
* | | | | | | | Merge branch 'tickets/master/6850-resource_type_listing_and_converting' into ↵Luke Kanies2011-03-254-6/+39
|\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | next
| * | | | | | | | Fixing #6851 - ResourceType#find/search loads typesLuke Kanies2011-03-252-9/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously we could only find types from site.pp, but we now automatically load the specified type (for find) or all types. This also adds a TypeLoader#import_all capable of importing all manifests (ruby or puppet) on a given system. Signed-off-by: Luke Kanies <luke@puppetlabs.com> Reviewed-by: Daniel Pittman <daniel@puppetlabs.com>
| * | | | | | | | Fixing Module#path detectionLuke Kanies2011-03-251-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For some reason FileTest.exist? was returning false, and FileTest.directory? returns true. I've also added much better tests for this behavior. Signed-off-by: Luke Kanies <luke@puppetlabs.com> Reviewed-by: Daniel Pittman <daniel@puppetlabs.com>
| * | | | | | | | Fixed #6850 - Clean up ResourceType#to_psonLuke Kanies2011-03-252-3/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There's no value in including the code when we convert a resource type to JSON, since you can't convert it back again, so this removes it. I also cleaned up a few of the other attributes which were producing unnecessary information. Signed-off-by: Luke Kanies <luke@puppetlabs.com> Reviewed-by: Daniel Pittman <daniel@puppetlabs.com>
* | | | | | | | | (#6830) Fix stat method calls to not use an unneeded argumentMatt Robinson2011-03-259-9/+9
| |_|_|_|/ / / / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | With this change under ruby 1.9.2 the number of failing specs goes from 2003 to 635. Also, puppet apply and master both seem to work. Agent still has OpenSSL issues. Ruby 1.8 doesn't complain if you pass arguments to a runtime defined method that doesn't take arguments. Ruby 1.9 does class Foo define_method('bar') do puts 'baz' end end Foo.new.bar("idonttakearguments") In Ruby 1.8 this prints: baz In Ruby 1.9 this errors with: 19_test.rb:3:in `block in <class:Foo>': wrong number of arguments (1 for 0) (ArgumentError) Reviewed-by:
* | | | | | | | (#4576) Raise an error when a node is classified into a non-existent classJesse Wolfe2011-03-241-10/+6
|/ / / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In 2.6.x, this was upgraded from "info" to "warning". This change for Statler escalates the warning to an exception which will abort the compile. This makes compiling fail consistently when you try to use an undefined class from any of: node classifiers, the class keyword, and the include function. Paired-with: Jacob Helwig <jacob@puppetlabs.com>
* | | | | | | Merge branch '2.6.next' into nextMax Martin2011-03-236-161/+198
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 2.6.next: Fixed #6562 - Minor kick documentation fix (#6658) Propagate ENC connection errors to the agent (#4884) Remove typo from spec test (#4884) Modify tests to pass on non-OS X systems (#4884) Revise new exec tests, add a few more (#4884) Add an shell provider for execs (#4884) Fix Test::Unit exec tests (#4884) Break the exec type out to have a posix provider (#4884) Add consistent path validation and behavior (#4884) Add expand_path to requiring the spec_helper (#4884) Autorequire shared behaviors and method to silence warnings (#4884) Fix whitespace (#4884) Get rid of open3 require since it wasn't being used (#5814) Improved cron type specs (#5814) cron_spec shouldn't depend on cron provider Manually Resolved Conflicts: lib/puppet/util/command_line/puppetrun spec/spec_helper.rb spec/unit/type/exec_spec.rb spec/unit/type_spec.rb test/ral/type/exec.rb
| * | | | | | Merge branch 'tickets/2.6.x/6562' into 2.6.nextJames Turnbull2011-03-221-1/+0
| |\ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * tickets/2.6.x/6562: Fixed #6562 - Minor kick documentation fix
| | * | | | | | Fixed #6562 - Minor kick documentation fixJames Turnbull2011-03-221-1/+0
| | | | | | | |
| * | | | | | | Merge branch 'ticket/2.6.next/6658' into 2.6.nextMatt Robinson2011-03-181-2/+1
| |\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * ticket/2.6.next/6658: (#6658) Propagate ENC connection errors to the agent
| | * | | | | | | (#6658) Propagate ENC connection errors to the agentMatt Robinson2011-03-181-2/+1
| | | |/ / / / / | | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When the master failed to run the External Node Classifier script it would log an error on the master, but the agent didn't get back the full error or the stack trace for it's logs. By raising when there's an ENC script problem on the master, this causes the error messages to propagate to the agent. Paired-with: Jacob Helwig <jacob@puppetlabs.com>
| * | | | | | | Merge branch ↵Max Martin2011-03-175-159/+197
| |\ \ \ \ \ \ \ | | |/ / / / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 'feature/2.6.next/4884-an-exec-provider-that-executes-unfiltered-bash-code' into 2.6.next * feature/2.6.next/4884-an-exec-provider-that-executes-unfiltered-bash-code: (#4884) Revise new exec tests, add a few more (#4884) Add an shell provider for execs (#4884) Fix Test::Unit exec tests (#4884) Break the exec type out to have a posix provider (#4884) Add consistent path validation and behavior (#4884) Add expand_path to requiring the spec_helper (#4884) Autorequire shared behaviors and method to silence warnings (#4884) Fix whitespace (#4884) Get rid of open3 require since it wasn't being used
| | * | | | | | (#4884) Revise new exec tests, add a few moreMax Martin2011-03-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Revised a few of the new tests for the exec type and provider to ensure that they were testing what they meant to, and added in a couple of new tests. Reviewed-by:Daniel Pittman
| | * | | | | | (#4884) Add an shell provider for execsMatt Robinson2011-03-151-0/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This makes it possible to use shell builtins when the exec is inline bash commands. Paired-with: Max Martin
| | * | | | | | (#4884) Break the exec type out to have a posix providerDaniel Pittman2011-03-152-156/+135
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is in preparation for allowing other new providers to handle exec commands differently. Reviewed-by: Max Martin and Matt Robinson
| | * | | | | | (#4884) Add consistent path validation and behaviorDaniel Pittman2011-03-152-0/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Many path parameters were implementing their own inconsistent validation and behavior. Now those parameters can have a parent class that makes things a lot more consistent. Reviewed-by: Matt Robinson and Max Martin
| | * | | | | | (#4884) Get rid of open3 require since it wasn't being usedMatt Robinson2011-03-151-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Paired-with: Max Martin
* | | | | | | | (#6820) Fix File class lookup in the file type for Ruby 1.9Matt Robinson2011-03-231-14/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Was getting the following error when we simply called File.dirname err: Got an uncaught exception of type NoMethodError: undefined method `dirname' for Puppet::Type::File:Class The constant lookup has changed in Ruby 1.9 to look at local scopes first, so we need to make it clearer that File is the Ruby File class and not something scoped in Puppet. Reviewed-by: Jacob Helwig <jacob@puppetlabs.com>
* | | | | | | | (#6820) Fix nagios parser to use proper hash syntax for Ruby 1.9Matt Robinson2011-03-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Reviewed-by: Jacob Helwig <jacob@puppetlabs.com>
* | | | | | | | (#6820) Fix RDOC parser to work with Ruby 1.9Matt Robinson2011-03-231-3/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Lovely RDOC changed where it put everything in Ruby 1.9. Now there's some conditional logic depending on Ruby version to determine which files to requrie. The tests still fail, but at least they run now. Reviewed-by: Jacob Helwig <jacob@puppetlabs.com>
* | | | | | | | (#6820) Fix invalid next that should be a returnMatt Robinson2011-03-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The old code under ruby 1.8.7 if it was hit would result in: unexpected next (LocalJumpError) In Ruby 1.9 it doesn't even give you the chance to run the code since you get: compile error (SyntaxError) The code isn't tested so the intented behavior isn't clear, but in context this looks like the right change. Reviewed-by: Jacob Helwig <jacob@puppetlabs.com>
* | | | | | | | (#2782) Fix constant_defined?Matt Robinson2011-03-231-1/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Thanks to Al Hoang for the bit of code for choosing how to use constant_defined? depending on the version of Ruby. In Ruby 1.9 const_defined? has a new parameter for inherit (from Ruby docs) mod.const_defined?(sym, inherit=true) -> true or false Returns true if a constant with the given name is defined by mod, or its ancestors if inherit is not false. Unfortunately, the documentation isn't terribly clear about the behavior if inherit=false. In Ruby 1.8 the inherit parameter doesn't exist. It appears that setting inherit=false makes it behave like it used to in Ruby 1.8, but there may be sublties of autoloading that prove this wrong or ways in which were setting constants that changed and cause problems regardless of the behavior of const_defined? Ruby 1.8.7: irb(main):001:0> module Foo irb(main):002:1> end => nil irb(main):003:0> A = 'find_me?' => "find_me?" irb(main):004:0> Foo.const_defined?('A') => false Ruby 1.9.2: ruby-1.9.2-p136 :001 > module Foo ruby-1.9.2-p136 :002?> end => nil ruby-1.9.2-p136 :003 > A = 'find_me?' => "find_me?" ruby-1.9.2-p136 :004 > Foo.const_defined?('A') => true ruby-1.9.2-p136 :005 > Foo.const_defined?('A', false) => false Also noteworthy is that something about constants behavior changed between 1.9.1 and 1.9.2, though not in regard to the little test above, but we should only be testing against 1.9.2 anyway. At least with this change in we'll be able to start debugging test failures instead of just getting failures at the level of syntax errors. Reviewed-by: Jacob Helwig <jacob@puppetlabs.com>
* | | | | | | | Merge branch 'feature/next/6257-pip_package_provider' into nextMatt Robinson2011-03-221-0/+109
|\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * feature/next/6257-pip_package_provider: (#6527) Fix uninstall problem and refactor (#6527) Added pip package provider.
| * | | | | | | | (#6527) Fix uninstall problem and refactorMatt Robinson2011-03-221-12/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Uninstall wasn't working properly because the instances method relied on the pip command having been defined by calling lazy_pip. This lazy_pip pattern is a nice way of getting around Puppet's problem of disqualifying providers at the beginning of a run because the command doesn't yet exist even though part way through the run the command might exist. Really, we need to fix puppet to lazily evaluate a provider command for validity only at the time the provider is needed. The refactoring also pointed out that query could just reuse the logic from instances. The tests were also refactored to use real resources instead of stubbed ones, and they reflect the implementation changes to instances. Paired-with: Richard Crowley <r@rcrowley.org>
| * | | | | | | | (#6527) Added pip package provider.Richard Crowley2011-03-221-0/+115
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Python's pip package manager is analogous to RubyGems and should be included in Puppet. Reviewed-by: Matt Robinson <matt@puppetlabs.com>
* | | | | | | | | Fix error "invalid multibyte char (US-ASCII)" under Ruby 1.9Matt Robinson2011-03-221-3/+3
|/ / / / / / / / | | | | | | | | | | | | | | | | | | | | | | | | Reviewed-by: Nick Lewis <nick@puppetlabs.com>