Граф коммитов

3918 Коммитов

Автор SHA1 Сообщение Дата
Luke Kanies f73e13e746 Adding more file tests and fixing conflicting tests
Signed-off-by: Luke Kanies <luke@madstop.com>
2008-11-15 22:29:36 -06:00
Luke Kanies cc1297031d Completely refactoring the tidy type.
This was necessary because of how I changed file recursion.

The type works much more intelligently now -- files to
be removed have a file resource generated for them, and that
resource handles deletion.

Also fixes #1717; neither age nor size is required now.

Signed-off-by: Luke Kanies <luke@madstop.com>
2008-11-15 02:25:48 -06:00
Luke Kanies 720dcbe090 Cleaning up the tidy type a bit
Signed-off-by: Luke Kanies <luke@madstop.com>
2008-11-15 02:25:48 -06:00
Luke Kanies 053d7bfa67 These changes are all about making sure file data is expired when appropriate.
All file tests now pass.

Signed-off-by: Luke Kanies <luke@madstop.com>
2008-11-15 02:25:47 -06:00
Luke Kanies a8d9976d0a Catalogs always consider resource data to be expired if not mid-transaction.
This way we'll cache when in a transaction, but otherwise always
hit the disk so the data is fresh.  This works because we
really only use resources mid-transaction, but it behaves correctly
if we happen to use a resource outside of a transaction.

Signed-off-by: Luke Kanies <luke@madstop.com>
2008-11-15 02:25:47 -06:00
Luke Kanies 8b0843913c Properly cleaning up ssl ca configuration during testing
Signed-off-by: Luke Kanies <luke@madstop.com>
2008-11-11 13:58:55 -08:00
Luke Kanies 73fa3977d7 Adding caching support to parameters, and using cached attributes for file source and metadata.
As hoped, this drastically simplifies the code around retaining
this data.

Signed-off-by: Luke Kanies <luke@madstop.com>
2008-11-11 13:31:31 -08:00
Luke Kanies 0ecbf79faf Adding cached attribute support to resources.
The Catalog is the expirer, which means that a resource
with no catalog will not cache data.

Also switching files to use a cached attribute for its stat.

And modifying catalogs to expire data at the end of every
transaction.

Signed-off-by: Luke Kanies <luke@madstop.com>
2008-11-11 13:12:21 -08:00
Luke Kanies 29b97943e7 Allowing a nil expirer for caching classes.
If there's no expirer, then the value is regenerated every
time.

Signed-off-by: Luke Kanies <luke@madstop.com>
2008-11-11 13:01:14 -08:00
Luke Kanies cd09d6b90d Refactoring the Cacher interface to always require attribute declaration.
Previously you could dynamically use cached values, but the new interface
requires a single static declaration of the attribute:

    cached_attr(:myattr) { my_init_code() }

This is cleaner, because it makes it easy to turn the code into an init method
and generally makes the whole thing easier to think about.

Most of this commit is going through the different classes that already using the
Caching engine.

Signed-off-by: Luke Kanies <luke@madstop.com>
2008-11-11 12:53:38 -08:00
Luke Kanies 14af971bc6 Changing the Cacher.invalidate method to Cacher.expire.
Signed-off-by: Luke Kanies <luke@madstop.com>
2008-11-11 12:53:37 -08:00
Luke Kanies 99a0770a30 Fixing a critical bug in the Cacher module.
Basically, the first generated value was always
considered expired the next time it was asked for.
The fix was to create an initial timestamp in the Cacher
module, thus providing a floor for validity.

This is definitely a murky bug, and is especially hard to
test.

Also refactoring the internals just a bit.

Signed-off-by: Luke Kanies <luke@madstop.com>
2008-11-11 12:53:36 -08:00
Luke Kanies fe0b818c41 Fixing tests broken by fileserving and other refactoring.
Signed-off-by: Luke Kanies <luke@madstop.com>
2008-11-08 12:52:52 -06:00
Luke Kanies eed37f7133 Fixing a test broken by previous refactoring
Signed-off-by: Luke Kanies <luke@madstop.com>
2008-11-07 16:59:13 -06:00
Luke Kanies 45c6382e99 Finishing the refactoring of the resource generation interface.
All of the code works, and there are integration tests all around
to prove it.  I think.

Signed-off-by: Luke Kanies <luke@madstop.com>
2008-11-07 16:55:00 -06:00
Luke Kanies 0840719367 Refactoring and clarifying the resource generation methods.
It now works with the new Catalog#add_resource method.

Signed-off-by: Luke Kanies <luke@madstop.com>
2008-11-07 16:10:52 -06:00
Luke Kanies cc046460e3 Refactoring Catalog#add_resource to correctly handle implicit resources.
It now ignores or removes implicit resources that conflict,
and it yields all resources that are valid.

This makes it simple for calling classes to pass in a list
of resources but only perform a chunk of work for valid (i.e.,
non-conflicting) resources.

This refactor is entirely meant as a way of cleaning up the
Transaction#generate interface to the catalog.

Signed-off-by: Luke Kanies <luke@madstop.com>
2008-11-07 12:48:37 -06:00
Luke Kanies a73cad9c8f Adding SimpleGraph#leaves, which I apparently did not migrate from PGraph
Signed-off-by: Luke Kanies <luke@madstop.com>
2008-11-06 14:25:37 -06:00
Luke Kanies 2a685f9194 Removing mention of obsolete edgelist_class from GRATR.
Signed-off-by: Luke Kanies <luke@madstop.com>
2008-11-06 12:40:40 -06:00
Luke Kanies 7e20f06136 Changing the catalog's relationship graph into a normal graph.
It was previously another catalog instance, but I was only
ever actually using the graphing abilities.

Signed-off-by: Luke Kanies <luke@madstop.com>
2008-11-06 12:39:40 -06:00
Luke Kanies 2ba0336430 Removing the PGraph class and subsuming it into SimpleGraph.
This class is a holdover from when I was using GRATR, and it's
obsolete now.

Signed-off-by: Luke Kanies <luke@madstop.com>
2008-11-06 12:14:05 -06:00
Luke Kanies e92c1cc724 Moving Catalog#write_graph to SimpleGraph, where it belongs.
Signed-off-by: Luke Kanies <luke@madstop.com>
2008-11-06 11:55:34 -06:00
Luke Kanies 0149e2e125 Converting the file 'source' property to a parameter.
This makes a lot of sense because source was always
more of a metaparameter than a property -- it affected
the 'should' values of other properties, but it shouldn't
have done any other work.

It will hopefully make everything else much cleaner.

This is such a large commit mostly because of the need
to fix a lot of tests.

Signed-off-by: Luke Kanies <luke@madstop.com>
2008-11-05 23:04:33 -06:00
Luke Kanies 35c623e65b Removing mid-transaction resources from the catalog.
This basically just cleans up dynamic resources.

Signed-off-by: Luke Kanies <luke@madstop.com>
2008-11-05 21:44:42 -06:00
Luke Kanies f4800e8aeb Adding a method to Checksums to extract the sum type
Signed-off-by: Luke Kanies <luke@madstop.com>
2008-11-05 17:49:36 -06:00
Luke Kanies 44fadd1847 Aliasing "must_not" just like we alias "must"
Signed-off-by: Luke Kanies <luke@madstop.com>
2008-11-05 17:25:23 -06:00
Luke Kanies a9dbb5de66 Deduplicating slashes in the fileserving code
Signed-off-by: Luke Kanies <luke@madstop.com>
2008-11-04 17:22:27 -06:00
Luke Kanies bb6619a748 Fixing the augeas type tests to work when augeas is missing
Signed-off-by: Luke Kanies <luke@madstop.com>
2008-11-04 17:15:45 -06:00
Luke Kanies e728873376 Reducing the number of calls to terminus() to reduce interference with caching
Signed-off-by: Luke Kanies <luke@madstop.com>
2008-11-04 16:20:46 -06:00
Luke Kanies aa8d09149c Switched all value management in props/params to internal classes.
This is a significant refactor of some very murky code, and it's
all much cleaner and more readable now.  All of the 'newvalue' methods
and any value-related code is in a ValueCollection class.

This puts us in a good position to refactor the Property and Parameter
classes more completely.

Signed-off-by: Luke Kanies <luke@madstop.com>
2008-11-04 16:20:46 -06:00
Luke Kanies e5b503380c Fixing #1677 - fixing the selinux tests in master.
Signed-off-by: Luke Kanies <luke@madstop.com>
2008-11-04 16:20:46 -06:00
Luke Kanies 77d73e0230 Changing the meaning of the unused Puppet::Type#parameter method to return an instance
rather than a value.

This parallels and largely obviates the 'property' method.

Signed-off-by: Luke Kanies <luke@madstop.com>
2008-11-04 16:20:45 -06:00
Luke Kanies 05e1325891 Moving a file purging test to rspec
Signed-off-by: Luke Kanies <luke@madstop.com>
2008-11-04 16:20:45 -06:00
Luke Kanies 6f7ccff8bb Fixing #1641 - file recursion now only passes original parameters to child resources.
Previously, parameter values provided by remote sources or default values
were all passed to children, which provided strange state maintenance.

Signed-off-by: Luke Kanies <luke@madstop.com>
2008-11-04 16:20:45 -06:00
Luke Kanies a4d4444ba2 Removing obsolete methods and tests:
Removing obsolete handleignore method
    Removing obsolete FileSource class
    Removing a now-obsolete test/unit test
    Removing a now-obsolete recursive filebucket test

Signed-off-by: Luke Kanies <luke@madstop.com>
2008-11-04 16:20:45 -06:00
Luke Kanies b4f4866b45 Making it so (once again) files with sources set can still be deleted
(which I think is kinda stupid, but apparently people want it).

Signed-off-by: Luke Kanies <luke@madstop.com>
2008-11-04 16:20:45 -06:00
Luke Kanies caf15c27b8 Fixing and migrating more file tests.
This is an unfortunately messy commit; I should have tried harder
to separate the different tasks into different commits, but it's
not worth going back and doing now.

This is the first commit in the long road of fixing the existing file
tests, and in the process refactoring and better testing the code.

The refactoring in this commit is mostly around the 'stat' instance
variable that tests whether the file exists (and provides its metadata
if it does) and the 'insync?' method in the source property.

Signed-off-by: Luke Kanies <luke@madstop.com>
2008-11-04 16:20:45 -06:00
Luke Kanies cccd838538 Adding a starting point for spec tests for tidy.
So far it just validates that lstat is used instead of stat.

Signed-off-by: Luke Kanies <luke@madstop.com>

Conflicts:

	spec/unit/type/tidy.rb
2008-11-04 16:20:44 -06:00
Luke Kanies 255c9fbcc0 Setting puppetmasterd up to serve all indirected classes.
Signed-off-by: Luke Kanies <luke@madstop.com>
2008-11-03 22:15:09 -06:00
Luke Kanies 7fdf2bb23f Retrieving the CA certificate before the client certificate.
We have to have a CA cert first, because the host will
start using the client cert as soon as it's available,
but it's not functional without a CA cert.

Also removing extra stupid stuff from wait_for_cert --
the connection is now always recycled, which is much simpler.

Signed-off-by: Luke Kanies <luke@madstop.com>
2008-11-03 22:06:27 -06:00
Luke Kanies a00c1f2bb5 Handling the case where a symbol (e.g., :ca) is used for a certificate name.
Signed-off-by: Luke Kanies <luke@madstop.com>
2008-11-03 21:41:30 -06:00
Luke Kanies cf3a11cb64 Fixing :bindaddress setting to work with the new server subsystem.
It now automatically switches values depending on server type,
while still allowing overriding.

Signed-off-by: Luke Kanies <luke@madstop.com>
2008-11-03 21:39:58 -06:00
Luke Kanies a78c971829 Fixing CertificateRequest#save to accept arguments.
This happens when called over REST.

Signed-off-by: Luke Kanies <luke@madstop.com>
2008-11-03 21:39:13 -06:00
Luke Kanies e70c1a067a Fixing forward-compatibility issues resulting from no global resources
Signed-off-by: Luke Kanies <luke@madstop.com>
2008-10-31 16:10:45 -05:00
Luke Kanies 4596d2d80e Fixing a test I broke when fixing a reporting bug
Signed-off-by: Luke Kanies <luke@madstop.com>
2008-10-31 16:05:18 -05:00
Luke Kanies e76cac7df1 Merge branch '0.24.x'
Conflicts:

	CHANGELOG
2008-10-31 16:01:28 -05:00
Bryan Kearney f0635179b6 Added unit tests for the augeas type and provider 2008-10-30 06:59:33 +11:00
Brice Figureau 2d37f09aa0 Fix #1402 - Allow multiline comments
Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
2008-10-29 10:30:38 +01:00
Brice Figureau 9f30306d2c Fix #857 - Multiple class of the same name don't append code
The following manifest wasn't working:
class one {
notice('class one')
}

class one {
notice('second class one')
}

include one

It all boiled down to class code not being arrays.
Encapsulating code in ASTArray when needed is enough to append code,
because of the property of ASTArray to evaluate all their members in
turn.

Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
2008-10-29 10:28:32 +01:00
James Turnbull 649a9e009a Fixed augeas examples in type 2008-10-29 15:53:39 +11:00