summaryrefslogtreecommitdiffstats
path: root/lib/puppet/rails/host.rb
Commit message (Collapse)AuthorAgeFilesLines
* (#4487) When setting environment on a host, ensure it is a string.Josh Cooper2011-04-261-0/+7
| | | | | | | | | | | | | | | | | Before this change when environment strings were read out of the storeconfigs database, they were eventually converted up to Puppet::Node::Environment objects. When these objects are returned to the storeconfigs database, ActiveRecord dumps them as YAML, which begins the death-spiral of YAML. This change makes it so the host will always store the environment as a string, preventing the Puppet::Node::Environment object from being YAMLized, and stored as such in the database. This change was based on one by Richard Crowley. Paired-with: Jacob Helwig <jacob@puppetlabs.com> Reviewed-by: Jesse Wolfe <jesse@puppetlabs.com> Signed-off-by: Richard Crowley <r@rcrowley.org>
* [#4813] Remove dead code from puppet/rails/host.rbMatt Robinson2010-11-101-72/+0
| | | | | | | | | | | | | | | def self.clean – became orphaned in commit 28cee40689440388994a4768bd301ae32c8ecc05 def self.store – became orphaned in commit 863c50b1273a7fa48d74fb74948938214b45967c def fact – was added as a helper method for unit tests in commit 9f4870637ce57d548d23c0b3330200014327c268. The test file that used this method was removed in commit 93246c0c70796a606fc8c05b51e1feb09c94e377 def update_connect_time – Not sure when this was ever used. I also ran a client master storeconfigs run a few times and didn’t see any problems, so I’m pretty sure deleting these methods is safe.
* Fixed network and indirection referenceJames Turnbull2010-07-201-0/+1
|
* Code smell: Two space indentationMarkus Roberts2010-07-091-252/+252
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Replaced 106806 occurances of ^( +)(.*$) with The ruby community almost universally (i.e. everyone but Luke, Markus, and the other eleven people who learned ruby in the 1900s) uses two-space indentation. 3 Examples: The code: end # Tell getopt which arguments are valid def test_get_getopt_args element = Setting.new :name => "foo", :desc => "anything", :settings => Puppet::Util::Settings.new assert_equal([["--foo", GetoptLong::REQUIRED_ARGUMENT]], element.getopt_args, "Did not produce appropriate getopt args") becomes: end # Tell getopt which arguments are valid def test_get_getopt_args element = Setting.new :name => "foo", :desc => "anything", :settings => Puppet::Util::Settings.new assert_equal([["--foo", GetoptLong::REQUIRED_ARGUMENT]], element.getopt_args, "Did not produce appropriate getopt args") The code: assert_equal(str, val) assert_instance_of(Float, result) end # Now test it with a passed object becomes: assert_equal(str, val) assert_instance_of(Float, result) end # Now test it with a passed object The code: end assert_nothing_raised do klass[:Yay] = "boo" klass["Cool"] = :yayness end becomes: end assert_nothing_raised do klass[:Yay] = "boo" klass["Cool"] = :yayness end
* Code smell: Avoid needless decorationsMarkus Roberts2010-07-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Replaced 704 occurances of (.*)\b([a-z_]+)\(\) with \1\2 3 Examples: The code: ctx = OpenSSL::SSL::SSLContext.new() becomes: ctx = OpenSSL::SSL::SSLContext.new The code: skip() becomes: skip The code: path = tempfile() becomes: path = tempfile * Replaced 31 occurances of ^( *)end *#.* with \1end 3 Examples: The code: becomes: The code: end # Dir.foreach becomes: end The code: end # def becomes: end
* Code smell: Avoid explicit returnsMarkus Roberts2010-07-091-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Replaced 583 occurances of (DEF) (LINES) return (.*) end with 3 Examples: The code: def consolidate_failures(failed) filters = Hash.new { |h,k| h[k] = [] } failed.each do |spec, failed_trace| if f = test_files_for(failed).find { |f| failed_trace =~ Regexp.new(f) } filters[f] << spec break end end return filters end becomes: def consolidate_failures(failed) filters = Hash.new { |h,k| h[k] = [] } failed.each do |spec, failed_trace| if f = test_files_for(failed).find { |f| failed_trace =~ Regexp.new(f) } filters[f] << spec break end end filters end The code: def retrieve return_value = super return_value = return_value[0] if return_value && return_value.is_a?(Array) return return_value end becomes: def retrieve return_value = super return_value = return_value[0] if return_value && return_value.is_a?(Array) return_value end The code: def fake_fstab os = Facter['operatingsystem'] if os == "Solaris" name = "solaris.fstab" elsif os == "FreeBSD" name = "freebsd.fstab" else # Catchall for other fstabs name = "linux.fstab" end oldpath = @provider_class.default_target return fakefile(File::join("data/types/mount", name)) end becomes: def fake_fstab os = Facter['operatingsystem'] if os == "Solaris" name = "solaris.fstab" elsif os == "FreeBSD" name = "freebsd.fstab" else # Catchall for other fstabs name = "linux.fstab" end oldpath = @provider_class.default_target fakefile(File::join("data/types/mount", name)) end
* Code smell: Inconsistent indentation and related formatting issuesMarkus Roberts2010-07-091-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Replaced 163 occurances of defined\? +([@a-zA-Z_.0-9?=]+) with defined?(\1) This makes detecting subsequent patterns easier. 3 Examples: The code: if ! defined? @parse_config becomes: if ! defined?(@parse_config) The code: return @option_parser if defined? @option_parser becomes: return @option_parser if defined?(@option_parser) The code: if defined? @local and @local becomes: if defined?(@local) and @local * Eliminate trailing spaces. Replaced 428 occurances of ^(.*?) +$ with \1 1 file was skipped. test/ral/providers/host/parsed.rb because 0 * Replace leading tabs with an appropriate number of spaces. Replaced 306 occurances of ^(\t+)(.*) with Tabs are not consistently expanded in all environments. * Don't arbitrarily wrap on sprintf (%) operator. Replaced 143 occurances of (.*['"] *%) +(.*) with Splitting the line does nothing to aid clarity and hinders further refactorings. 3 Examples: The code: raise Puppet::Error, "Cannot create %s: basedir %s is a file" % [dir, File.join(path)] becomes: raise Puppet::Error, "Cannot create %s: basedir %s is a file" % [dir, File.join(path)] The code: Puppet.err "Will not start without authorization file %s" % Puppet[:authconfig] becomes: Puppet.err "Will not start without authorization file %s" % Puppet[:authconfig] The code: $stderr.puts "Could not find host for PID %s with status %s" % [pid, $?.exitstatus] becomes: $stderr.puts "Could not find host for PID %s with status %s" % [pid, $?.exitstatus] * Don't break short arrays/parameter list in two. Replaced 228 occurances of (.*) +(.*) with 3 Examples: The code: puts @format.wrap(type.provider(prov).doc, :indent => 4, :scrub => true) becomes: puts @format.wrap(type.provider(prov).doc, :indent => 4, :scrub => true) The code: assert(FileTest.exists?(daily), "Did not make daily graph for %s" % type) becomes: assert(FileTest.exists?(daily), "Did not make daily graph for %s" % type) The code: assert(prov.target_object(:first).read !~ /^notdisk/, "Did not remove thing from disk") becomes: assert(prov.target_object(:first).read !~ /^notdisk/, "Did not remove thing from disk") * If arguments must wrap, treat them all equally Replaced 510 occurances of lines ending in things like ...(foo, or ...(bar(1,3), with \1 \2 3 Examples: The code: midscope.to_hash(false), becomes: assert_equal( The code: botscope.to_hash(true), becomes: # bottomscope, then checking that we see the right stuff. The code: :path => link, becomes: * Replaced 4516 occurances of ^( *)(.*) with The present code base is supposed to use four-space indentation. In some places we failed to maintain that standard. These should be fixed regardless of the 2 vs. 4 space question. 15 Examples: The code: def run_comp(cmd) puts cmd results = [] old_sync = $stdout.sync $stdout.sync = true line = [] begin open("| #{cmd}", "r") do |f| until f.eof? do c = f.getc becomes: def run_comp(cmd) puts cmd results = [] old_sync = $stdout.sync $stdout.sync = true line = [] begin open("| #{cmd}", "r") do |f| until f.eof? do c = f.getc The code: s.gsub!(/.{4}/n, '\\\\u\&') } string.force_encoding(Encoding::UTF_8) string rescue Iconv::Failure => e raise GeneratorError, "Caught #{e.class}: #{e}" end else def utf8_to_pson(string) # :nodoc: string = string.gsub(/["\\\x0-\x1f]/) { MAP[$&] } string.gsub!(/( becomes: s.gsub!(/.{4}/n, '\\\\u\&') } string.force_encoding(Encoding::UTF_8) string rescue Iconv::Failure => e raise GeneratorError, "Caught #{e.class}: #{e}" end else def utf8_to_pson(string) # :nodoc: string = string.gsub(/["\\\x0-\x1f]/) { MAP[$&] } string.gsub!(/( The code: end } rvalues: rvalue | rvalues comma rvalue { if val[0].instance_of?(AST::ASTArray) result = val[0].push(val[2]) else result = ast AST::ASTArray, :children => [val[0],val[2]] end } becomes: end } rvalues: rvalue | rvalues comma rvalue { if val[0].instance_of?(AST::ASTArray) result = val[0].push(val[2]) else result = ast AST::ASTArray, :children => [val[0],val[2]] end } The code: #passwdproc = proc { @password } keytext = @key.export( OpenSSL::Cipher::DES.new(:EDE3, :CBC), @password ) File.open(@keyfile, "w", 0400) { |f| f << keytext } becomes: # passwdproc = proc { @password } keytext = @key.export( OpenSSL::Cipher::DES.new(:EDE3, :CBC), @password ) File.open(@keyfile, "w", 0400) { |f| f << keytext } The code: end def to_manifest "%s { '%s':\n%s\n}" % [self.type.to_s, self.name, @params.collect { |p, v| if v.is_a? Array " #{p} => [\'#{v.join("','")}\']" else " #{p} => \'#{v}\'" end }.join(",\n") becomes: end def to_manifest "%s { '%s':\n%s\n}" % [self.type.to_s, self.name, @params.collect { |p, v| if v.is_a? Array " #{p} => [\'#{v.join("','")}\']" else " #{p} => \'#{v}\'" end }.join(",\n") The code: via the augeas tool. Requires: - augeas to be installed (http://www.augeas.net) - ruby-augeas bindings Sample usage with a string:: augeas{\"test1\" : context => \"/files/etc/sysconfig/firstboot\", changes => \"set RUN_FIRSTBOOT YES\", becomes: via the augeas tool. Requires: - augeas to be installed (http://www.augeas.net) - ruby-augeas bindings Sample usage with a string:: augeas{\"test1\" : context => \"/files/etc/sysconfig/firstboot\", changes => \"set RUN_FIRSTBOOT YES\", The code: names.should_not be_include("root") end describe "when generating a purgeable resource" do it "should be included in the generated resources" do Puppet::Type.type(:host).stubs(:instances).returns [@purgeable_resource] @resources.generate.collect { |r| r.ref }.should include(@purgeable_resource.ref) end end describe "when the instance's do not have an ensure property" do becomes: names.should_not be_include("root") end describe "when generating a purgeable resource" do it "should be included in the generated resources" do Puppet::Type.type(:host).stubs(:instances).returns [@purgeable_resource] @resources.generate.collect { |r| r.ref }.should include(@purgeable_resource.ref) end end describe "when the instance's do not have an ensure property" do The code: describe "when the instance's do not have an ensure property" do it "should not be included in the generated resources" do @no_ensure_resource = Puppet::Type.type(:exec).new(:name => '/usr/bin/env echo') Puppet::Type.type(:host).stubs(:instances).returns [@no_ensure_resource] @resources.generate.collect { |r| r.ref }.should_not include(@no_ensure_resource.ref) end end describe "when the instance's ensure property does not accept absent" do it "should not be included in the generated resources" do @no_absent_resource = Puppet::Type.type(:service).new(:name => 'foobar') becomes: describe "when the instance's do not have an ensure property" do it "should not be included in the generated resources" do @no_ensure_resource = Puppet::Type.type(:exec).new(:name => '/usr/bin/env echo') Puppet::Type.type(:host).stubs(:instances).returns [@no_ensure_resource] @resources.generate.collect { |r| r.ref }.should_not include(@no_ensure_resource.ref) end end describe "when the instance's ensure property does not accept absent" do it "should not be included in the generated resources" do @no_absent_resource = Puppet::Type.type(:service).new(:name => 'foobar') The code: func = nil assert_nothing_raised do func = Puppet::Parser::AST::Function.new( :name => "template", :ftype => :rvalue, :arguments => AST::ASTArray.new( :children => [stringobj(template)] ) becomes: func = nil assert_nothing_raised do func = Puppet::Parser::AST::Function.new( :name => "template", :ftype => :rvalue, :arguments => AST::ASTArray.new( :children => [stringobj(template)] ) The code: assert( @store.allowed?("hostname.madstop.com", "192.168.1.50"), "hostname not allowed") assert( ! @store.allowed?("name.sub.madstop.com", "192.168.0.50"), "subname name allowed") becomes: assert( @store.allowed?("hostname.madstop.com", "192.168.1.50"), "hostname not allowed") assert( ! @store.allowed?("name.sub.madstop.com", "192.168.0.50"), "subname name allowed") The code: assert_nothing_raised { server = Puppet::Network::Handler.fileserver.new( :Local => true, :Config => false ) } becomes: assert_nothing_raised { server = Puppet::Network::Handler.fileserver.new( :Local => true, :Config => false ) } The code: 'yay', { :failonfail => false, :uid => @user.uid, :gid => @user.gid } ).returns('output') output = Puppet::Util::SUIDManager.run_and_capture 'yay', @user.uid, @user.gid becomes: 'yay', { :failonfail => false, :uid => @user.uid, :gid => @user.gid } ).returns('output') output = Puppet::Util::SUIDManager.run_and_capture 'yay', @user.uid, @user.gid The code: ).times(1) pkg.provider.expects( :aptget ).with( '-y', '-q', 'remove', 'faff' becomes: ).times(1) pkg.provider.expects( :aptget ).with( '-y', '-q', 'remove', 'faff' The code: johnny one two billy three four\n" # Just parse and generate, to make sure it's isomorphic. assert_nothing_raised do assert_equal(text, @parser.to_file(@parser.parse(text)), "parsing was not isomorphic") end end def test_valid_attrs becomes: johnny one two billy three four\n" # Just parse and generate, to make sure it's isomorphic. assert_nothing_raised do assert_equal(text, @parser.to_file(@parser.parse(text)), "parsing was not isomorphic") end end def test_valid_attrs The code: "testing", :onboolean => [true, "An on bool"], :string => ["a string", "A string arg"] ) result = [] should = [] assert_nothing_raised("Add args failed") do @config.addargs(result) end @config.each do |name, element| becomes: "testing", :onboolean => [true, "An on bool"], :string => ["a string", "A string arg"] ) result = [] should = [] assert_nothing_raised("Add args failed") do @config.addargs(result) end @config.each do |name, element|
* Fix for #2863 (calling each on uninitialized tag list)Markus Roberts2009-12-101-7/+2
| | | | | | | | | | | | | This is a fix for the core issue of #2863, calling each on a nil tag (instead of empty) tag list for a resource with no tags, combined with various cleanup in related code to forestall reintroduction of a similar bug. * Replace the direct @var access with an initializing getter * Rename it from @tags_hash to @tags_list since it's not a hash * Do the same with the otherwise identical params setup. * Eliminate the now-redundant external initialization for params. * Remove the parameters method as it was never used and obviously faulty (calling a non-existent get_params_hash method).
* Feature #2378 - Implement "thin_storeconfigs"Brice Figureau2009-07-181-1/+6
| | | | | | | | | | | | | | | Thin storeconfigs is a limited version of storeconfigs that is more performant and still allows the exported/collected resources system wich is the primary use of storeconfigs. It works by storing to the database only the exported resources, tags and host facts. Since usually those exported resources are less than the number of total resources for a node, it is expected to be faster than regular storeconfigs (especially for the first run). Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
* Removed extra whitespace from end of linesIan Taylor2009-06-061-4/+4
|
* Fixing #2187 - Puppet::Resource is expected by Rails supportLuke Kanies2009-04-241-2/+2
| | | | | | | | | | | | | We previously used and expected Puppet::Parser::Resource instances, but 0.25 converts them all to Puppet::Resource instances before they're passed out of the compiler, so the Rails integration had to be changed to expect that. There's still some muddling, because the rails resources only generate parser resources, but that works for now because that's what we expect when collecting resources. Signed-off-by: Luke Kanies <luke@madstop.com>
* Added class_name tags to has_many relationshipssteve mcintosh2009-04-221-3/+3
|
* renaming a methodLuke Kanies2009-04-221-9/+9
| | | | Signed-off-by: Luke Kanies <luke@madstop.com>
* Saving rails resources as I create them, which saves about 10%Luke Kanies2009-04-221-0/+2
| | | | Signed-off-by: Luke Kanies <luke@madstop.com>
* Adding some more fine-grained benchmarks to Rails supportLuke Kanies2009-04-221-16/+21
| | | | Signed-off-by: Luke Kanies <luke@madstop.com>
* Adding a Rails-specific benchmarking moduleLuke Kanies2009-04-221-37/+38
| | | | | | | This just slightly simplifies adding lots of time-debug stuff in Rails. Signed-off-by: Luke Kanies <luke@madstop.com>
* Adding more time debugging to Rails code, and refactoring a bitLuke Kanies2009-04-221-9/+1
| | | | | | | | There is an accumulation in the resource tags (hackish enough but soon to be replaced), and I've fixed a small bug in the tags merging that was causing lots of extra work (like 3x). Signed-off-by: Luke Kanies <luke@madstop.com>
* Refactoring the Rails integrationLuke Kanies2009-04-221-60/+149
| | | | | | | | This moves all code from the Parser class into the ActiveRecord classes, and gets rid of 'ar_hash_merge'. Signed-off-by: Luke Kanies <luke@madstop.com>
* Adding ActiveRecord terminus classes for Node and Facts.Luke Kanies2009-04-221-1/+25
| | | | | | | | | This is most of the way to replacing standard StoreConfigs integration with the Indirector. We still need to convert the Catalog and then change all of the integraiton points (which is mostly the 'store' call in the Compiler). Signed-off-by: Luke Kanies <luke@madstop.com>
* Fix #2010 - add protection code for some storeconfig corruptionBrice Figureau2009-03-041-14/+28
| | | | | | | | | | | | | | This patch adds a more robust and self-healing storedconfig in case of logically corrupted database as the one in #2010 (where multiple resources of same references are present in the database for the same host). The problem is that the resources are stored in a hash with the resource ref as the key, so we collapse resource of different id but same reference. The patch fixed this by using a hash by resource id, and maintaining a list of old extraneous resource in the db that are removved after the storeconfig pass. Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
* Use Puppet.debug instead of own debug flagPeter Meier2009-02-221-7/+5
| | | | | | It's better to use puppet's logging environment than an own. Especially if the default is quite verbose and can't be set by config flag.
* Change the way the tags and params are handled in railsBrice Figureau2009-02-061-15/+54
| | | | | | | | | | | | | The rationale behind this patch is that it takes a lots of time to let rails unserialize the ParamValue and ResourceTag object on each compilation, just to throw them away the second after. The idea is to fetch directly (and batched host per host) the parameters and tags from the database and then returns them as hash. This allows the no-modification case to takes at least 2 times less than before. Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
* Slight denormalisation to store a host's environment as a first classThom May2008-11-261-0/+4
| | | | | object in the database Fixes: #1392
* * Tweaks for puppetshow UI cleanupBlake Barnett2008-02-281-2/+1
|
* Fixing #923 (again). The host storage method was notLuke Kanies2007-12-101-3/+1
| | | | | | correctly searching for the host, so it was creating a new host on each run, which is what was causing the conflict.
* Theoretically, this patch is to fix #917 (which it does), butLuke Kanies2007-11-281-3/+1
| | | | | | | | | | | | | | | | | | | there were enough problems fixing it that I decided something more drastic needed to be done. This uses the new Puppet::ResourceReference class to canonize what a resource reference looks like and how to retrieve resources via their references. Specifically, it guarantees that resource types are always capitalized, even when they include '::' in them. While many files are modified in this commit, the majority of changes are quite small, and most of the changes are fixing the tests to use capitalized types. As we look at consolidating some of our resource types, we could consolidate the ResourceReference stuff at the same time, but at least the Puppet::Parser::ResourceReference class subclasses the main Puppet::ResourceReference class.
* Removing the Id tags from all of the filesLuke Kanies2007-10-031-1/+0
|
* A round of bugfixing. Many more tests now pass -- I think we are largely ↵Luke Kanies2007-08-201-9/+5
| | | | down to tests that (yay!) fail in trunk.
* Undo previous commit, which was an errorlutter2007-08-031-24/+5
| | | | git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2735 980ebf18-57e1-0310-9a29-db15c13687c0
* Do not set any options if they aren't set in /etc/sysconfig/puppetmaster - ↵lutter2007-08-031-5/+24
| | | | | | otherwise we clobber settings from puppet.conf git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2734 980ebf18-57e1-0310-9a29-db15c13687c0
* Fixing some failing tests.luke2007-06-181-0/+1
| | | | git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2616 980ebf18-57e1-0310-9a29-db15c13687c0
* Significantly optimizing the database queries -- I am getting about 40% ↵luke2007-06-141-3/+5
| | | | | | better times now. See http://www.madstop.com/optimizing_the_activerecord_integration.html. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2585 980ebf18-57e1-0310-9a29-db15c13687c0
* Changed the host to "eager fetch" all the resources and their associated ballman2007-06-121-1/+3
| | | | | | | | tables. Also removed some unecessary lines from resource.rb that were causng it to re-read information it already loaded from the db. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2568 980ebf18-57e1-0310-9a29-db15c13687c0
* Major rework of the rails feature. Changed the relationship between ballman2007-06-121-30/+62
| | | | | | | | | | | | | | | | host and facts (now many-to-many with fact_name through fact_values). Also changed the relationship between resource and params (similarly many-to-many with param_names through param_values). Added the resource_tags and puppet_tags. The latter has the tag names and the former is the man-to-many link with resources. There is a little clean up left but the schema is in order. Also a test for the tags stuff is required. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2565 980ebf18-57e1-0310-9a29-db15c13687c0
* Removed acts_as_taggable from the rails stuff. I haven't removed the tables ↵ballman2007-05-111-8/+0
| | | | | | from the schema nor the indexes yet. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2505 980ebf18-57e1-0310-9a29-db15c13687c0
* Refactoring some of the rails code. The speed is now pretty good, but the ↵luke2007-03-241-43/+20
| | | | | | tagging stuff does not seem to be working and is certainly working very ineffficiently. Blake says he is going to take a look at that. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2350 980ebf18-57e1-0310-9a29-db15c13687c0
* Rails is now significantly faster. I refactored all of the queries; they ↵luke2007-03-221-22/+76
| | | | | | are mostly reduced to three queries, each of which is relatively fast, although there are still a ton of file- and tag-related queries that I cannot find the source of. Note that this speedup requires indexes, which will only get added if you start puppetmasterd with --dbmigrate (although you cannot always start with that, as there is an error in the init code). I expect that the indexes will not help unless you forcibly reindex your database, but after that you should see significant speed improvements. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2344 980ebf18-57e1-0310-9a29-db15c13687c0
* Undo the param_name param_value mergeshadoi2007-02-171-8/+15
| | | | git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2209 980ebf18-57e1-0310-9a29-db15c13687c0
* Update relationshipsshadoi2007-02-161-2/+3
| | | | | | | | Remove dynamic class generation for now. Include the fact class git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2201 980ebf18-57e1-0310-9a29-db15c13687c0
* Merge fact_names & fact_values, and param_names & param_values.shadoi2007-02-151-13/+7
| | | | git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2191 980ebf18-57e1-0310-9a29-db15c13687c0
* Fixing #391. Keeping track of times of compile and freshness checks.luke2007-01-041-1/+8
| | | | git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2034 980ebf18-57e1-0310-9a29-db15c13687c0
* Re-add support for tags and file/linesshadoi2006-12-191-0/+6
| | | | git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1953 980ebf18-57e1-0310-9a29-db15c13687c0
* All rails *and* language tests now pass, with the exception of a ↵luke2006-12-191-40/+34
| | | | | | language/resource test that passes by itself but fails when run as part of the whole suite. Also, I added deletion where appropriate, so that unspecified resources, parameters, and facts are now deleted, as one would expect. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1951 980ebf18-57e1-0310-9a29-db15c13687c0
* Fixing most of the rails stuff. I think everything basically works now, and ↵luke2006-12-191-50/+15
| | | | | | now I am just going through and making sure things get deleted when they are supposed (i.e., you remove a resource and it gets deleted from the host's config). git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1950 980ebf18-57e1-0310-9a29-db15c13687c0
* Go back to restype and remove STI classes, they were more trouble than they ↵shadoi2006-12-151-14/+3
| | | | | | were worth. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1940 980ebf18-57e1-0310-9a29-db15c13687c0
* Adding some selectability to host creation for testing. Using ↵luke2006-12-151-10/+40
| | | | | | find_or_create_by results in lots of saves instead of one big one at the end, which causes initial saving to be much slower. To switch between them, just modify the value of "create" at the top of Host.store. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1936 980ebf18-57e1-0310-9a29-db15c13687c0
* I like to checkin one-liners a lot. I'm cool. shadoi2006-12-151-2/+1
| | | | | | | set the type when we create the object, might be a bit faster git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1935 980ebf18-57e1-0310-9a29-db15c13687c0
* Don't use find_or_create_by_title since titles aren't unique.shadoi2006-12-151-1/+1
| | | | git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1934 980ebf18-57e1-0310-9a29-db15c13687c0
* Remove old files, don't require pp anymoreshadoi2006-12-151-1/+0
| | | | git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1933 980ebf18-57e1-0310-9a29-db15c13687c0
* Some rails modificationsluke2006-12-151-14/+19
| | | | git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1931 980ebf18-57e1-0310-9a29-db15c13687c0