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

3771 Коммитов

Автор SHA1 Сообщение Дата
Luke Kanies 0e491591d2 Cleaning up the AST::Resource code a bit
Mostly renaming 'obj' to 'resource', since the whole
'obj' thing is a holdover from before we had the
term 'resource'.

Also pulling a bit of code out of a loop, since it
didn't need to be there.

Signed-off-by: Luke Kanies <luke@madstop.com>
2009-02-10 16:02:52 -06: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
James Turnbull 535fa89af0 Fixed #1538 - Yumrepo sets permissions wrongly on files in /etc/yum.repos.d 2009-02-11 08:48:27 +11:00
James Turnbull f7b04dfc7e Fixed #1936 - Added /* */ support to the vim file 2009-02-11 08:44:52 +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 897539e857 Removing a redundant instance prefect call.
For some reason, Puppet::Type#evaluate was calling
'prefetch' on instances that support it, but prefetching
is only a class-level functionality, normally -- in fact, it makes
no sense unless done at the class level.

This patch just removes the code.

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 a9f34aff85 Fixing the Rakefile to use 'git format-patch'.
Some releases of git no longer install hundreds
of binaries, so the 'git-format-patch' binary
is unavailable.

Signed-off-by: Luke Kanies <luke@madstop.com>
2009-02-11 08:36:31 +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
James Turnbull aa219e76b1 Adding README.rst file 2009-02-10 15:19:57 +11:00
James Turnbull 1d3f11778c Added Reductive Labs build library 2009-02-10 02:13:33 +11:00
Brice Figureau f01882da62 Change the way the tags and params are handled in rails
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>
2009-02-06 21:54:33 +11:00
Brice Figureau b7ab54c7f0 Add methods to return hash instead of objects to params and tags
Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
2009-02-06 21:54:33 +11:00
Brice Figureau 5c64435271 Rails serialization module to help serialize/unserialize some Puppet Objects
Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
2009-02-06 21:54:33 +11:00
James Turnbull b27fccd434 Fixed #1852 - Correct behaviour when no SELinux bindings 2009-01-27 10:03:05 +11:00
Luke Kanies 15d4360859 Merge commit 'turnbull/0.24.x' into 0.24.x 2009-01-07 20:43:05 +01:00
James Turnbull 7403330c4f Updated Red Hat spec file 0.24.7 2008-12-16 22:54:35 +11:00
Luke Kanies 8befc18917 Updated to version 0.24.7 2008-12-16 04:19:44 +01:00
Luke Kanies cf19bd8dea Not using a temporary file when locking files for writing.
The temporary file was not actually useful, because we
could never really get atomic renames, for annoying,
complicated reasons.

This hopefully finally fixes #1812.

Signed-off-by: Luke Kanies <luke@madstop.com>
2008-12-15 19:27:45 +11:00
Luke Kanies b966ea02a9 Modifying the corruption-checking test.
It is now more likely to fail if there's a problem,
since the yaml should be corrupt, causing a yaml failure.

Also removing the equivalent test from the Storage module.

Signed-off-by: Luke Kanies <luke@madstop.com>
2008-12-15 19:27:45 +11:00
Andrew Shafer 1f34bcac62 Issue 1804 VDev with the same devices should be in sync
Added VDev and MultiVDev properties to the ZPool type to handle logic
Vdevs with the same devices are now in sync even if the order changes
2008-12-15 11:48:31 +11:00
James Turnbull 6d5a1295c9 Documentation fixes 2008-12-13 23:49:01 +11:00
Luke Kanies 45144a1b9d Fixing #1812 (hopefully) - adding read and write locks to yaml.
It's obviously not really possible to test that this fixes it,
but I'm confident that the locks work, and now we're using them,
so it *should*.

Signed-off-by: Luke Kanies <luke@madstop.com>
2008-12-12 09:44:42 +11:00
Luke Kanies 2385a78a7c Preparing to fix #1812 - Moving locking code to a module
This moves the locking code out of Puppet::Util into a
separate module, to make the code cleaner.

Signed-off-by: Luke Kanies <luke@madstop.com>
2008-12-12 09:44:42 +11:00
Brice Figureau 2961b832de Fix #1815 - puppetdoc --all crash on resource override 2008-12-10 22:55:38 +01:00
Andrew Shafer e5c36fd865 Fix ZFS autorequire test
Couldn't find a default provider because the world is not my laptop
2008-12-08 23:20:43 -07:00
John Ferlito da71ad53cc Add a unique name to objects so we can determine uniqueness when read back in
The nagios object definitions have been updated to correlate with Nagios
    3.0.6.

        In Nagios it is possible to have multiple service checks with the
    same service_description. eg I could have an check with a
    service_description of 'SSH' for multiple hosts. So in puppet we can't
    use it as a unique name for the resource. This patch modifies the code
    to use $name as the unique name. For some types eg command_name $name
    ends up in the config and thus we can tell which puppet resources match
    to which nagios ones.  For other types like service there is no direct
    mapping from $name to a nagios attibute. So we use a custom attribute
    called _naginator_name.

Signed-off-by: John Ferlito <johnf@inodes.org>
2008-12-09 14:42:26 +11:00
James Turnbull 4418b3436e Fix launchd service test on non-OSX platforms 2008-12-09 14:28:35 +11:00
Nigel Kersten 4b2bdf9814 Fix the spec tests to work on other platforms, do the confine around OS X versions more sanely 2008-12-09 14:25:55 +11:00
Nigel Kersten 544a3e1ecb remove unnecessary mk_resource_methods call 2008-12-09 14:19:42 +11:00
James Turnbull 50ac03a2a4 CHANGELOG updates 2008-12-09 14:18:31 +11:00
John Ferlito a0a6d2cfa8 Add a unique name to objects so we can determine uniqueness when read back in
The nagios object definitions have been updated to correlate with Nagios
    3.0.6.

        In Nagios it is possible to have multiple service checks with the
    same service_description. eg I could have an check with a
    service_description of 'SSH' for multiple hosts. So in puppet we can't
    use it as a unique name for the resource. This patch modifies the code
    to use $name as the unique name. For some types eg command_name $name
    ends up in the config and thus we can tell which puppet resources match
    to which nagios ones.  For other types like service there is no direct
    mapping from $name to a nagios attibute. So we use a custom attribute
    called _naginator_name.

Signed-off-by: John Ferlito <johnf@inodes.org>
2008-12-09 11:46:21 +11:00
Andrew Shafer 68ffd46c9f Bug #1803 Zfs should auto require the ancestor file systems 2008-12-08 19:44:29 +11:00
Andrew Shafer 7e2da7eeb2 Refactor #1802 Use 'zfs get -H -o value' instead of parsing output for value
just simplifying code
2008-12-08 00:07:54 -07:00
Luke Kanies 8616d74b47 Fixing #1800 - tidy now correctly ignores missing files and directories
Signed-off-by: Luke Kanies <luke@madstop.com>
2008-12-08 17:06:44 +11:00
Luke Kanies 6075d10373 Fixing #1794 - returning sync when it is already initialized
Signed-off-by: Luke Kanies <luke@madstop.com>
2008-12-08 15:47:03 +11:00
Luke Kanies 18fe5c3ac2 Fixing #1750 again - All of the properties and now :ensure check replace?
Signed-off-by: Luke Kanies <luke@madstop.com>
2008-12-08 15:45:06 +11:00
Brice Figureau b22303e316 Fix rake abort when there is a matching confine
Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
2008-12-08 08:29:23 +11:00
Nigel Kersten 0caa9c57c6 spec tests for type and provider and some code cleanup to adhere to DRY 2008-12-06 12:10:37 +11:00
Nigel Kersten 0f2fc88a39 Finished work on rules creation and deletion 2008-12-06 12:10:37 +11:00
Nigel Kersten ed49153c28 new better way of doing stdin 2008-12-06 12:10:36 +11:00
Nigel Kersten 05e05bb70a finished rights flush, working on rules 2008-12-06 12:10:36 +11:00
Nigel Kersten 1e37230c8d macauthorization type 2008-12-06 12:10:36 +11:00
Nigel Kersten 4ed73efa94 reset macauthorization tree. Initial checkin of new type/provider 2008-12-06 12:10:36 +11:00
Nigel Kersten 5d32cd9ad0 add NetInfo deprecation notice to user and group providers, make the directoryservice user provider the default, remove default for darwin from NetInfo providers 2008-12-06 12:06:57 +11:00
Nigel Kersten 99ab9405fa Warn that the NetInfo nameservice provider is deprecated. Use directoryservice instead 2008-12-06 12:06:56 +11:00
Nigel Kersten c4412ec90c add some more sanity checks around stdin 2008-12-06 12:04:29 +11:00