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

998 Коммитов

Автор SHA1 Сообщение Дата
Brice Figureau 81f5438f66 Move puppetrun to Application Controller paradigm
Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
2009-02-16 20:12:11 +01:00
Brice Figureau 3390d8db8b Move pi to the Application Controller paradigm
Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
2009-02-16 20:12:10 +01:00
Brice Figureau 8265d6eaf7 Move puppetmasterd to Puppet::Application
Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
2009-02-16 20:12:10 +01:00
Brice Figureau af219bf45f Move puppet to the Application Controller paradigm
Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
2009-02-16 20:12:10 +01:00
Brice Figureau d51398c3eb Move filebucket to the Application Controller paradigm
Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
2009-02-16 20:12:10 +01:00
Brice Figureau 9b9e5e895b Move puppetca to the Application Controller paradigm
Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
2009-02-16 20:12:10 +01:00
Brice Figureau 97e716a97d Introducing the Application Controller
Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
2009-02-16 20:12:02 +01:00
Luke Kanies 495ad66546 Fixing broken filetype tests resulting from the loss of Type[]
Signed-off-by: Luke Kanies <luke@madstop.com>
2009-02-14 22:23:53 -06:00
Luke Kanies 21a714aa75 Fixing some tests that somehow broke in the merge to master
I expect these failed in master but not 0.24.x because I'm
better about stubbing calls to Facter in master.

I stubbed these enough that they should continue to
work.

Signed-off-by: Luke Kanies <luke@madstop.com>
2009-02-14 22:18:36 -06:00
Luke Kanies 327ee17d60 Removing a test that was too dependant on order.
It wasn't a terribly useful test anyway, since
no one depends on that individual configuration.

Signed-off-by: Luke Kanies <luke@madstop.com>
2009-02-14 21:57:14 -06:00
Luke Kanies 8adb599f14 Merge branch '0.24.x' 2009-02-14 21:53:51 -06:00
James Turnbull c0f494334b Minor fix to launchd tests 2009-02-15 11:12:32 +11:00
Luke Kanies e87de9d8f3 Merge branch '0.24.x'
Conflicts:
	test/ral/manager/type.rb
2009-02-14 18:10:37 -06:00
Nigel Kersten 446989b693 Fix spec test for launchd service provider to work with new service status method and add two new status tests.
Now ensures that given the correct input, the correct status for the launchd service is returned.
2009-02-15 10:31:28 +11:00
Luke Kanies 682dd8b933 Fixing password validation to support symbols.
My fix for #1920 broke when you set :absent
or :present.

Signed-off-by: Luke Kanies <luke@madstop.com>
2009-02-14 12:24:42 -06:00
Luke Kanies 44f97aa581 Only backing up within parsedfile when managing files
I was getting failing tests because I was using non-files
for testing and they didn't back up the same, not
surprisingly.

This moves the 'backup' method to the :flat filetype
and then only backs up if the filetype supports it.

Signed-off-by: Luke Kanies <luke@madstop.com>
2009-02-14 12:24:42 -06:00
Luke Kanies 1070b3c6e3 Fixing a test broken by a log demotion
Signed-off-by: Luke Kanies <luke@madstop.com>
2009-02-14 12:24:42 -06:00
Luke Kanies 487b9b1a3e Failure to find node facts is now a failure.
It was previously just a warning, but the node
is essentially non-functional without the facts,
so it makes more sense for it to be a warning.

Signed-off-by: Luke Kanies <luke@madstop.com>
2009-02-14 22:42:51 +11:00
Luke Kanies 610c838146 Fixing #1527 - Failing Facter does not hurt Puppet
At this point, the server's behaviour is a bit undefined
if it tries to compile the catalog with no facts
locally.  The next commits will fix that.

Signed-off-by: Luke Kanies <luke@madstop.com>
2009-02-14 22:42:51 +11:00
Luke Kanies cb0a083a4c Using Puppet::Type.new instead of create
create() got deprecated and I apparently missed
changing this.

Signed-off-by: Luke Kanies <luke@madstop.com>
2009-02-14 22:42:51 +11:00
Luke Kanies 84bd5285db Actualling syncing facts and plugins
Also fixing the argument order while downloading
either of them.  I had my Downloader.new
calls using the wrong argument order.

Signed-off-by: Luke Kanies <luke@madstop.com>
2009-02-14 22:42:51 +11:00
Brice Figureau d5abdfba8a Fix #1933 - Inconsistent resource evaluation order in subsequent evaluation runs
While evaluating the AST, catalog vertices are not always ordered
the same way on different run, leading to some tags (which should
have been applied in evaluation order) to not be associated with
some underlying resources.

This changeset change all accesses to resources inside the compiler
to always use an ordered (in evaluation order) list of added
resources.

Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
2009-02-14 22:32:07 +11:00
Luke Kanies 3fbec12076 Merge branch '0.24.x'
Conflicts:
	lib/puppet/indirector/facts/facter.rb
	lib/puppet/provider/augeas/augeas.rb
	lib/puppet/util/filetype.rb
	spec/unit/indirector/facts/facter.rb
	spec/unit/provider/augeas/augeas.rb
	test/util/filetype.rb
2009-02-13 18:24:34 -06:00
James Turnbull 1bc7404f5e Fixed #1831 - Added sprintf function 2009-02-14 02:11:21 +11:00
James Turnbull 336b6458a2 Fixed #1830 - Added regsubst function 2009-02-14 02:10:08 +11:00
Bryan Kearney 2a855510a3 Bug 1948: Add logic and testing for the command parsing logic 2009-02-14 00:45:10 +11:00
Luke Kanies 39a8b28690 Fixing #1964 - Facts get loaded from plugins
Applying slightly modified patch.

Also added tests.

Signed-off-by: Luke Kanies <luke@madstop.com>
2009-02-12 22:58:57 -06:00
Luke Kanies 7cf085c9eb Adding tests for Puppet::Indirector::Facts::Facter.loadfacts
I just copied the tests from the master branch, changed as
necessary.

Signed-off-by: Luke Kanies <luke@madstop.com>
2009-02-12 22:48:34 -06:00
Luke Kanies d5a193a594 Fixing #1541 - ParsedFile only backs up files once per transaction
This moves responsibility for backups from the filetype
to the consumer of the filetype, but only ParsedFile actually uses
filetypes.

Signed-off-by: Luke Kanies <luke@madstop.com>
2009-02-13 14:16:36 +11:00
Luke Kanies 4e89156b21 Migrated FileType tests to spec, and fleshed them out a bit.
Signed-off-by: Luke Kanies <luke@madstop.com>
2009-02-13 14:16:35 +11:00
Bryan Kearney cc4d6586d4 Bug #1948: Added patch by jab to support the correct ins syntax. Updated the test cases as well 2009-02-13 02:08:49 +11:00
Luke Kanies 5e35166f1b Fixing #961 - closing the http connection after every xmlrpc call
There were apparently some circumstances that
resulted in the connection not being closed; this just closes
it every time if it's still open after the rpc call is complete.

Signed-off-by: Luke Kanies <luke@madstop.com>
2009-02-12 17:08:49 +11:00
Luke Kanies af3f3ae93b Refactoring the XMLRPC::Client error-handling
I split it all into smaller, manageable chunks,
and used methods for each step, instead
of having one huge call.

Note that I made all of the tests first, then
refactored the code, so I'm confident there's no
behavior change.

I don't know that this is actually a lot cleaner,
but it seems that way to me.  I'm open to
skipping this, but I think it makes the whole thing
a lot cleaner.

Signed-off-by: Luke Kanies <luke@madstop.com>
2009-02-12 17:08:48 +11:00
Luke Kanies 319822af6d Fixing #1869 - autoloaded files should never leak exceptions
Ruby's exception hierarchy is a bit strange, in that only
exceptions that sub RuntimeError are caught by default.
This patch explicitly catches the base class, Exception,
which means that LoadError, SyntaxError, and any
RuntimeErrors will all be caught.

This is done for both load() and loadall(); load() uses
Kernel.load, but loadall() uses Kernel.require.

Signed-off-by: Luke Kanies <luke@madstop.com>
2009-02-12 07:39:11 +11:00
Luke Kanies a2270b4a4f Merge branch '0.24.x'
Conflicts:
	CHANGELOG
	spec/unit/type/file/selinux.rb
2009-02-11 13:51:48 -06:00
Luke Kanies 7fd5c7ef5e Moving the transaction specs to the right path
Signed-off-by: Luke Kanies <luke@madstop.com>
2009-02-11 18:49:39 +11:00
Luke Kanies 32c2be9267 Fixed #1884 - exported defines are collected by the exporting host
This was caused by the fix to #1472.  That fix unexported
any resources collected from the local catalog.

The crux of this fix is that it separates 'exported'
and 'virtual' a bit more.  It also removes no-longer-needed
functionality where resources copied their virtual or
exported bits from the enclosing define or class.  This is
now obsolete because we don't evaluate virtual defined resources.

The crux of this commit is that defined resources can stay
exported even though they're evaluated, and that exported state
won't inherit to contained resources such that those then don't
get evaluated.

Signed-off-by: Luke Kanies <luke@madstop.com>
2009-02-11 09:11:31 +11:00
Brice Figureau b22d148e6d Fix #1691 - Realize fails with array of Resource References
The following snippet:
realize( File["/tmp/a","/tmp/b"] )

is parsed into:
AST::Function @name=realize @arguments=
    AST::ASTArray @children = [
       AST::ResourceReference @title= AST::ASTArray @children = [
          String(/tmp/a), String(/tmp/b)
       ]
    ]

When evaluated:
ResourceReference gives -> [ File[/tmp/a], File[/tmp/b] ]

which means the function arguments are:
[[File[/tmp/a], File[/tmp/b]]
after evaluating the @arguments ASTArray of AST::Functions.

Then the collector complains that it can't find the resource
because it is not supposed to work on non-flattened resource
array.

The fix is to flatten in the realize function (although it can
be done more generally in the AST::Function evaluation) before
the resources are given to the Collector.

Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
2009-02-11 08:53:13 +11:00
Brice Figureau 6331bfc9b6 Fix #1682 - Resource titles are not flattened as they should
The following manifest:
$groups = ["foo", "bar"]
$type_groups = ["baz", "quux"]
$user_groups = [$groups, $type_groups]
notify{ $user_groups: }
which outputs:
notice: foo
notice: //Notify[foobar]/message: defined 'message' as 'foo'
notice: baz
notice: //Notify[bazquux]/message: defined 'message' as 'baz'

is not equivalent to
$user_groups = [ ["foo", "bar"], ["baz", "quux"] ]
notify{ $user_groups: }
which outputs:
notice: foo
notice: //Notify[foo]/message: defined 'message' as 'foo'
notice: baz
notice: //Notify[baz]/message: defined 'message' as 'baz'
notice: bar
notice: //Notify[bar]/message: defined 'message' as 'bar'
notice: quux
notice: //Notify[quux]/message: defined 'message' as 'quux'

Obviously the second one manages to flatten the arrays and not the
first one.

This changeset adds flattening to the resource titles evaluations
in order to be consitent in all cases.

Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
2009-02-11 08:51:58 +11:00
Brice Figureau 7e036eb761 Fix #1922 - Functions squash all arguments into a single hash
Revert "Fix #1682 - ASTArray should flatten product of evaluation of its children"
This reverts commit c7ccc4ba7c.
Bug #1824 and #1922 proved the fix for #1682 and #1691 was wrong.

Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
2009-02-11 08:51:58 +11:00
Luke Kanies 671d73c1f7 Prefetching, and thus purging, Nagios resources now works
*only* if you use the default configuration file locations.

In the end, this was a relatively minor change; most of the actual
diff centers around making the code more readable so I could think
my way into the fix, and adding tests for cases that were either
untested or refactored slightly.

Signed-off-by: Luke Kanies <luke@madstop.com>
2009-02-11 08:41:16 +11:00
Luke Kanies 063871fab0 Adding some basic tests for the Naginator provider base class
Signed-off-by: Luke Kanies <luke@madstop.com>
2009-02-11 08:39:40 +11:00
Luke Kanies 012efe359f Fixing #1912 - gid still works with no 'should' value.
This makes 'ralsh' work again with users.

Signed-off-by: Luke Kanies <luke@madstop.com>
2009-02-11 08:38:08 +11:00
Luke Kanies db05c00af0 Fixing #1920 - user passwords no longer allow ':'
I wanted to include a snide remark in the error, but...

Now you just get an exception when creating the user if
the password includes this character.

Signed-off-by: Luke Kanies <luke@madstop.com>
2009-02-11 08:35:11 +11:00
Luke Kanies 916abc2e68 Changing how the Configurer interacts with the cache
This changes the hooks provided via the Indirector Request
for determining how the cache is used.  These hooks are only
used by the Configurer class.  They're messy, but I can't
come up with a better design, and they're at least sufficient.

Signed-off-by: Luke Kanies <luke@madstop.com>
2009-02-06 19:11:54 -06:00
Luke Kanies 5335788411 Fixing tests broken during the #1405 fix.
Most of these were small changes, like moved methods.

Signed-off-by: Luke Kanies <luke@madstop.com>
2009-02-06 18:08:44 -06:00
Luke Kanies 08a5d492dd Adding an Agent::Runner class.
This will eventually be used by puppetrun, but
for now is just called by the old-school Runner handler.

Signed-off-by: Luke Kanies <luke@madstop.com>
2009-02-06 18:08:43 -06:00
Luke Kanies c7d178d04f The Agent now uses its lockfile to determine running state
This makes it so we can easily create and use lots
of agent instances, rather than having a single
global instance with shared state.

Signed-off-by: Luke Kanies <luke@madstop.com>
2009-02-06 18:08:43 -06:00
Luke Kanies c0fcb2137e Creating and using a new Puppet::Daemon class
This replaces the short-lived EventManager class, all of
the service- and timer-related code in puppet.rb, and moves
code from agent.rb, server.rb, and other places into one
class responsible for starting, stopping, pids, and more.

The Daemon module is no longer in existence, so it's been
removed from the classes that were using it.

Signed-off-by: Luke Kanies <luke@madstop.com>
2009-02-06 18:08:43 -06:00
Luke Kanies 4b7023e976 Fixing (and testing) the return of Indirection#save
This broke in a previous commit, and was apparently not
tested well because of how the mocks were set up.  The
integration test caught it.

Signed-off-by: Luke Kanies <luke@madstop.com>
2009-02-06 18:08:43 -06:00