| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When the parsefile provider for host parses /etc/hosts, it throws any
inlinecomment away. As a result they are also purged in /etc/hosts after
a puppetrun that detects a change. That could be dangerous because you
will lose information even about unmanaged resources.
So if you have something like
192.168.0.1 hostentry_not_managed_by_puppet # Important comment
in /etc/hosts the endresult will be
192.168.0.1\thostentry_not_managed_by_puppet
This patch introduces a new property "comment" for the host type. The
provider is nearly a complete rewrite and a lot shorter and hopefully
easier to understand.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
I noticed that the hostprovider will remove all inline comments from the
/etc/hosts file, when puppet updates at least one entry. Puppet will also
remove comments from entries, the user doesnt want to manage with
puppet.
To split up changes a bit this commit will only introduce tests for the
host type and the hostprovider. A few will fail, indicating the bug:
The hostprovider parses all entries and builds a hash. When building
the recordhash all comments are discarded. When puppet has to update at
least one entry it uses the to_line function to convert the record hash
back to a file. Because the comments are not stored in the hash, they
cannot be written back to the file.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
spec/integration/indirector/rest_spec.rb has been deleted in puppet’s
next branch because it was found that the things being tested were
already covered in spec/unit/network/http/*. Also, the tests being
deleted were so overly mocked they weren’t testing much, and firing up
webrick as part of the tests was slow and causes intermittent failures
on Hudson.
This was discussed on the dev mailing list in the really long thread "No
puppet developer patches to the puppet-dev list".
Reviewed-by: Jesse Wolfe <jesse@puppetlabs.com>
|
|
|
|
|
|
|
|
|
| |
The patch for #4726 causes old unit tests of the rrd reporting
infrastructure to run on my machine. These tests were calling the old
report api, which does not succeed.
Also, the rrd settings had unintentionally been moved out of the
:metrics section, making it possible that the rrd report directory would
fail to get created during testing.
|
|
|
|
|
|
|
|
| |
There was a section of code that didn't take the legacy RRD library into
account. This caused a unit test failure, but only if you have the RRD
legacy library installed, which I did.
Paired-with: Jesse Wolfe <jesse@puppetlabs.com>
|
|
|
|
|
| |
This is based on the discussion on ticket, simplified slightly and with test
adjustment.
|
|
|
|
|
|
| |
The currious part is that this wasn't noticed before since it appears to block
server-first migration to 2.6.x and doesn’t appear to be the consequence of a
recent (2.6.3) change (unless, as is quite possible, I’m missing something).
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When the responsibility for type-name resolution was moved to the AST nodes in
commit 449315a2c705df2396852462a1d1e14774b9f117, at least one instance was
missed: the space ship operator
Myclass <<| tag == foo |>>
fails unless Myclass has been previously loaded. This commit adds the lookup
to AST::Collection nodes in the same way it was added to the other node types.
Note that I haven't audited the other note types for similar cases.
|
|
|
|
| |
My code smell routines bobbled this one, so I'm fixing it manually.
|
| |
|
| |
|
|
|
|
| |
Reviewed-by: Jesse Wolfe <jesse@puppetlabs.com>
|
|
|
|
|
|
|
| |
The query methods for the newly added password age properties didn't have the
same name as the properties, and thus the default retrieve method wan't finding
them and never got the current value from the provider. They were therefore
always seen as :absent and puppet always thought they needed to be set.
|
|
|
|
|
|
|
|
|
|
| |
In my fix for #4894 (commit a097b939ab52bafb681cf7c5dcaf11717add07e6) I made
and tested the fix in one case and then copied most of it (all but a variable
initialization, Doh!) to two other locations. This caused tests that would
have failed with a socket-in-use error to fail with a different error rather
than retrying.
Also fixed the spelling of "simultaneous."
|
| |
|
|
|
|
|
|
| |
We already had an internal implementation of which hiding under an assumed
name (Puppet::Util.binary); this commit calls it out of hiding and uses it
consisantly.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is a behavior change. Before this patch, we always used the currently
connected node's certname to compile the catalog, despite the value of
the catalog URI REST request.
With this patch we now use the URI as the compiled node name.
This is safe because the default auth.conf (and default inserted rules
when no auth.conf is present) only allow the given connected node to
compile its own catalog.
But this also allows for greater flexibility with auth.conf. For instance
it can be used by a monitoring system to check multiple nodes catalogs
with only one certificate:
path ~ ^/catalog/([^/]+)$
method find
allow $1
allow monitoring-station.domain.com
Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
|
|
|
|
|
|
| |
If multiple processes are running the spec tests they may conflict trying to
listen on a port. If this happens the test waits 0.1 seconds and retries for
up to 100 times before marking the test pending due to too many conflicts.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The Puppet::Util.sync method was not thread safe and also leaked memory. I'm
not certain, but I believe the first is ironic and the second is merely a bug.
This patch addresses the problem by 1) refactoring so the sync objects
are never returned (and thus no one can cache a reference to one) 2) adding
reference counting 3) deleting them when they are no longer needed 4) doing
the thread safty dance.
It wasn't the first (or even second) solution considered, but it's the one
that I was able to make work in a way that I'm convinced is correct. Its
main advantage is that it puts all the tricky bits in one place.
|
|
|
|
|
|
|
| |
The autoloading is not thread safe, which means two threads could both
autoload the same function at the same time.
Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
It is a resurgence of #2366 that appeared because of the commit
8971d8.
Before this commit, for associating documentation comments, we
were preferring line numbers coming from the parser currently reducing rule,
instead of the current lexer line number (which can be in advance
of several tokens due to the nature of LALR parsers).
We now merge the ast line number before fetching the comment from the
lexer.
Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
|
|
|
|
|
| |
As per Nigel, this fixes the test broken by commit 00eedac5 in which a :combine
was added in lib but the corresponding change was not made in the test.
|
|
|
|
|
| |
The dbconnection option, if set to a positive integer, will be passed to
active record as the connection pool size (pool).
|
|
|
|
|
| |
Multiple attemps were made to contact the author of this code in order to
obtain a Contributor Licence Agreement, but we were unable to do so.
|
|
|
|
|
| |
This commit implements the base path-to-source functionality and adds an
(adapted) version of Matt's code on top of it.
|
|
|
|
|
|
|
|
|
|
|
| |
This commit removes code contributed by Ryan McBride, an author we have been
unable to contact to sign a Contributor License Agreement. It also removes
code writen by Matt Robinson (a Puppet Labs employee) which only made sense
in the context of the removed code. The code in question comes from these
commits:
6ac36eb4 Matt Robinson
55a9009c Ryan McBride
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Using File.open(file, "w") calls open(2) with O_CREAT|O_TRUNC which
means when the file exists it is immediately truncated.
But the file is not locked yet, so another process can either write or
read to the file, leading to file corruption.
The fix is to truncate only when the file is exclusively locked. This can
be done on some operating system with O_EXLOCK open(2) flag.
I chose the more portable option of:
* open
* flock
* truncate
* write
* close
It might also be good to flush and fsync the file after writing it,
otherwise in case of crash an incomplete file can stay on disk.
Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
|
|
|
|
|
|
|
| |
In case of connection, dns or timeout error, puppet-load would not report
the error correctly or could crash.
Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch allows puppet-load to compile multiple nodes catalog.
This is done by using multiple --node. Puppet-load will use round-robin
to chose which nodes catalog to ask for a given simulated client.
It is also possible to pass a directory of facts yaml file in which
puppet-load will load given --node facts file.
This can work only if #5020 is applied to the puppetmaster first.
Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
Running "/etc/rc.d/SERVICE rcvar" outputs different formats for
different versions of FreeBSD. This patch adds support for those
formats, as well as tests.
Based on patches from:
o Joost van Beurden
o Russell Jackson
Paired-With: Matt Robinson
|
|
|
|
|
|
| |
This should allow to run puppetdoc on ruby 1.8.5.
Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
| |
RDoc has some standard parsers for .c,.cc or fortran files (don't ask why).
Unfortunately our html generator doesn't support the data structures
generated by those parsers and we were bombing on unknown methods.
This patch makes sure we generate html only for our own top level objects.
Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
|
|
|
|
|
|
|
|
|
|
|
| |
Accesing an array with an integer index (ie $array[1]) is producing
a ruby error: can't convert String into Integer
This is because the array index is not properly converted to an number
before the array element lookup is performed.
Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
|
|
|
|
|
|
|
|
|
| |
I fixed a few of these in a previous patch, but Hudson found more. I
replaced the pattern of using Time.now and then doing date math to
calculate intervals with the pattern of hard setting the intervals using
utc times for the test.
Reviewed-by: Paul Berry <paul@puppetlabs.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The internal format of parameters was changed between 0.25.x and 2.6.x, making
them incompatible when serialized. This was fixed for PSON under ticket #3656
(by modifying the data as it was serialized) in:
commit f66095d35bc5f9645eb19bbb8cefa342c0181d2d
and
commit 2edf7fe968ac3d8af9865f65100940747c1fa894
but nothing was done about the other serialization formats. This commit adds
a callback to zaml property serialization and uses it to route data through the
fixup method added in the commits above, thus fixing the problem "the same way"
as it was fixed for PSON under #3656.
It does nothing about marshal, mostly because I have not totaly gone over to
the dark side (yet).
|
|
|
|
|
|
|
|
| |
This script helps people quickly test different branches of various
puppet related projects like facter, puppet-scaffold, puppet-dashboard,
etc... It allows the user to simply clone puppet and start running
different puppet version without installing puppet or any other setup
costs.
|
|
|
|
|
|
|
|
|
|
|
|
| |
Turns out that:
zero = Time.now # Reset the current time to X:00:00
current = zero - (zero.hour * 3600) - (zero.min * 60) - zero.sec
current is actually 1am on a day where the time falls back (Nov 7th),
not midnight as the test expected.
Reviewed-by: Paul Berry <paul@puppetlabs.com>
|
|
|
|
|
|
|
| |
Standardize how we create tmpdirs by using the puppet function instead
of Dir.tmpdir.
Paired-with: Paul Berry <paul@puppetlabs.com>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Just to follow up on 5112 I have a dirty patch that appears to work.
Nominally tested it on 10.4, 10.5, & 10.6. 10.4 now applies catalogs
instead of failing. All versions successfully manage a test services
state as well.
Does anyone have a better suggestion than '-o /dev/stdout'? Seems a
mite hacky to me.
Also I think that the 10.4 machines are going to a have a \ ( slash )
file in whatever puppets working dir was. plutil seems to have been
interpreting as literal file name.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In 0.25.x the type & title of a resource were wrapped in a Puppet::Resource::Reference
object whereas in 2.6.x they are attributes of the resource itself without the
additional indirection (see 7089446697ad550c22012bc2b5572030727d67e1).
When pson serialization is used this isn’t a problem but with formats in which
we just blindly emit the structure either because we have no choice (marshal)
or because we just use the default (yaml) it is a compatibility-breaking change.
This patch resoloves the problem by adding a dummy reference object to cause
the "correct" serialization; it is intended as a stop-gap for 2.6.x and should
NOT be merged into next.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is a reconciliation/melding of Paul's
(#4534) Class inheritance with parameterized classes is no longer ignored
and Markus's
Fix for #4778 -- evaluate parameterized classes when they are instantiated
Extracted the code from Resource::Type#mk_plain_resource that evaluates
parents and tags the catalog, and moved that into a new method called
instantiate_resource. Instantiate_resource is now also called from
Parser::Ast::Resource#evaluate, so that the notation
"class { classname: }"
now executes this code too. Likewise adds class evaluation so that it behaves
the same (with regard to lazy / strict evaluation) as
include classname
|
|
|
|
|
|
|
|
|
|
|
| |
This was a regression, not covered by a test; previously the string
"foo\
bar"
would be interpreded as "foobar" but this was changed to "foo\\\nbar" in
2.6.x with my string interpolation refactor. This change restores the
behaviour.
|
| |
|
|
|
|
|
|
|
|
|
| |
The PSON library needlessly assumed that the data to be transmitted was well-
formed unicode. This made Latin-1 users (and anyone who needed to serialize
arbitrary binary data) sad. This patch goes some of the way to resolving the
issues, by passing through non-unicode data rather than just failing, adds
tests, and cleans up a pernicious assumption about escape characters in ruby
regular expressions not marked "n" (no-encoding).
|
|
|
|
|
| |
This is intended to be a minimal fix, with tests, to prevent chage from running
unless needed.
|