| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This failure was getting caused by what I believe to be a bug in
Puppet::Configurer where it always generated a new
Puppet::Transaction::Report, even if one existed in an outer scope.
In puppetd --test, a different Report was getting queried to generate
the exit status than the one that was passed to the transaction -- this
Report had no Metrics and would fail when queried.
This obscured a second bug that Metrics could return nil for values if
the Transaction had applied an empty Catalog, but Transaction::Report
assumes that values will always be integers.
It could be argued that an empty Report should be populated with empty
Metrics before a Transaction is run, which would have prevented
Report#exit_status from raising an exception ... which would have made
these bugs much harder to track down. So, I've decided to leave that
unchanged.
Signed-off-by: Jesse Wolfe <jes5199@gmail.com>
|
|
|
|
|
|
|
|
|
|
| |
It's really slow and has no actual functionality
any more, since we just remove the catalogs from memory
anyway.
This should be a good speed boost for very little effort.
Signed-off-by: Luke Kanies <luke@puppetlabs.com>
|
|
|
|
| |
flag and associated check thereof within the resource evaluation code. This should allow for the transaction to bail out of its processing if it finds that a stop has been requested, based on the state of Puppet::Application.stop_requested?.
|
| |
|
|
|
|
| |
generated them.
|
|
|
|
|
|
|
| |
It now takes multiple events instead of just one. This will
help simplify a bunch of performance optimizations.
Signed-off-by: Luke Kanies <luke@reductivelabs.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is one less bit that the transaction does.
The resource status objects had nearly enough information
to do everything, so I just added that last bit, and moved
everything over. It's all much cleaner now.
I had to change some existing, internal APIs, but mostly
this should be hidden from outside users.
Signed-off-by: Luke Kanies <luke@reductivelabs.com>
|
|
|
|
|
|
| |
This is handled in the Status instances now.
Signed-off-by: Luke Kanies <luke@reductivelabs.com>
|
|
|
|
|
|
|
|
| |
This includes every event generated in the transaction
and a Resource::Status object for each resource managed,
with per-resource information in it.
Signed-off-by: Luke Kanies <luke@reductivelabs.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is a much messier commit than I would like,
mostly because of how 'file' works. I had to
fix multiple special cases, and I had to move others.
The whole system appears to now work, though, and we're
ready to change reports to receive resource status
instances rather than events.
Signed-off-by: Luke Kanies <luke@reductivelabs.com>
|
|
|
|
| |
Signed-off-by: Luke Kanies <luke@madstop.com>
|
|
|
|
|
|
|
|
|
| |
We had some no-longer-correct comments in the Transaction
class, which are now removed. This also moves the timestamp
for reports into the report class, so it's created at
initialization by the report, rather than by the transaction.
Signed-off-by: Luke Kanies <luke@madstop.com>
|
|
|
|
|
|
|
|
|
|
| |
Thus pulls all event-related code out of Transaction.
The Transaction class currently creates a single instance
of this class, so it's nowhere near a "real" event manager,
but at least it has very clean integration points and will
be easy to upgrade as needed.
Signed-off-by: Luke Kanies <luke@madstop.com>
|
|
|
|
|
|
|
|
| |
This allows the Transaction class to reuse the
event creation code when it creates noop and restart
events.
Signed-off-by: Luke Kanies <luke@madstop.com>
|
|
|
|
| |
Signed-off-by: Luke Kanies <luke@madstop.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Events are now queued as they are created, and
the queues are managed through simple interfaces,
rather than collecting events over time and
responding to them inline.
This drastically simplifies event management,
and will make moving it to a separate system
essentially trivial.
Signed-off-by: Luke Kanies <luke@madstop.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This refactors how reports, catalogs, configurers, and transactions
are all related - the Configurer class manages the report, both
creating and sending it, so the transaction is now just responsible
for adding data to it. I'm still a bit uncomfortable of the coupling
between transactions, the report, and configurer, but it's better than
it was.
This also fixes #2944 and #2973.
Signed-off-by: Luke Kanies <luke@madstop.com>
|
|
|
|
| |
Signed-off-by: Luke Kanies <luke@madstop.com>
|
|
|
|
|
|
|
|
|
| |
Puppet::Transaction was handling "tags" strings differently depending on
whether they came in from Puppet[:tags] or another source.
This was causing puppetrun's tags to be misparsed if there was not
exactly one --tag parameter.
I've moved the code to Util::Tagging.
|
|
|
|
|
|
|
|
|
| |
Fix code that was passing an Array of code to a method that was
expecting a single tag.
Includes Markus's suggestions
Signed-off-by: Jesse Wolfe <jes5199@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
This problem affects all types that generate sub-resources at
evaluation or pre-transaction time.
Thus it is fixed in the transaction, where we make sure we assign
all parent tags to the generated child resource.
A more correct fix would be to make sure we copy the whole context
(ie file, line, version, tags). This fix is planned for Rowlf.
Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
#2507 contains two issues:
* a crash when we filters-out an unwanted resource which had edges
pointing to it.
* resources are losing their virtuality when they are transformed from
Puppet::Parser::Resource to Puppet::Resource. This means we weren't able
to distinguish anymore between an exported resource collected in the same
node as it was exported and an exported resource collected in another node.
The net result is that we can't apply exported resources that are
collected in the same node because they are filtered out by the catalog
filter (see the commits for #2391 for more information).
The fix is to keep the virtuality of the resources so that we can
differentiate those two types of exported resources. We keep this until
the catalog is ready to be sent, where we filter out the virtual resouces
only, the other still exported ones needs to be sent to the client.
To be real sure, the transaction also skips virtual resources.
Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
|
|
|
|
|
|
|
| |
This is just an additional info log in the transaction,
and is only done if the version is non-nil.
Signed-off-by: Luke Kanies <luke@madstop.com>
|
|
|
|
|
|
|
|
| |
This feature has been broken since who knows when,
yet no one's noticed. Thus, it's a good
candidate for removal.
Signed-off-by: Luke Kanies <luke@madstop.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The issue is that when we convert Puppet::Parser::Resource catalog
to a Puppet::Resource catalog before storing it to the database,
we don't allow virtual resource to be converted.
Unfortunately exported resources are virtual by design, and as
such aren't converted, and we lose them, so it isn't possible
to store them in the database.
Unfortunately, the client will get the exported resources too.
The fix is dual-fold:
* we make sure exported resource are skipped when the transaction is
applied as a last safeguard
* we filter-out the catalog through the catalog compiler terminus before
the catalog is returned to the client
Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
This keeps the destination directory from getting
purged if the remote source is invalid.
This mostly just removes an optimization that worked
fine when we queried the server for every directory,
but doesn't work now that we do one big query.
Signed-off-by: Luke Kanies <luke@madstop.com>
|
|
|
|
|
|
|
|
|
|
|
| |
I found some cases where duplicate resources
weren't correctly skipped, but I couldn't get
the test to really demonstrate them.
The code at least is demonstrated to work,
anyway.
Signed-off-by: Luke Kanies <luke@madstop.com>
|
|
|
|
|
|
| |
Just cleaning up the code a bit before a modification.
Signed-off-by: Luke Kanies <luke@madstop.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
It now correctly purges files whether we're recursing
locally or remotely.
*Please* test various scenarios you can think of with
this. I've tested:
* Local recursion with no remote source
* Remote recursion with a source
* Recursion with an extra locally managed file
Signed-off-by: Luke Kanies <luke@madstop.com>
|
|
|
|
|
|
|
|
|
|
| |
This commit rips out all of the 'implicit resource' crap,
replacing it with a simple system that just skips
resources that the catalog says are in conflict.
Removes a bunch of code, and fixes the bug to boot.
Signed-off-by: Luke Kanies <luke@madstop.com>
|
|\
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Conflicts:
bin/ralsh
lib/puppet/executables/client/certhandler.rb
lib/puppet/parser/functions/versioncmp.rb
lib/puppet/parser/resource/reference.rb
lib/puppet/provider/augeas/augeas.rb
lib/puppet/provider/nameservice/directoryservice.rb
lib/puppet/provider/ssh_authorized_key/parsed.rb
lib/puppet/type.rb
lib/puppet/type/file/checksum.rb
spec/integration/defaults.rb
spec/integration/transaction/report.rb
spec/unit/executables/client/certhandler.rb
spec/unit/indirector/ssl_rsa/file.rb
spec/unit/node/catalog.rb
spec/unit/provider/augeas/augeas.rb
spec/unit/rails.rb
spec/unit/type/ssh_authorized_key.rb
spec/unit/type/tidy.rb
test/executables/filebucket.rb
test/executables/puppetbin.rb
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The ParsedFile types seem to be the main one that suffers from
this, but the transactions were using the resource titles,
not names, so resources were often not getting prefetched
correctly.
Signed-off-by: Luke Kanies <luke@madstop.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This was important because the use of the label to store attributes
was a holdover from the GRATR library, and if we didn't cease its
use before we switched to RESTful catalogs, then we'd be stuck with
the @label instance variable forever, essentially.
Now we can add and remove variables however we please.
Signed-off-by: Luke Kanies <luke@madstop.com>
|
| |
| |
| |
| | |
Signed-off-by: Luke Kanies <luke@madstop.com>
|
| |
| |
| |
| | |
Signed-off-by: Luke Kanies <luke@madstop.com>
|
| |
| |
| |
| | |
Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
|
| |
| |
| |
| |
| |
| |
| | |
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>
|
| |
| |
| |
| |
| |
| | |
It now works with the new Catalog#add_resource method.
Signed-off-by: Luke Kanies <luke@madstop.com>
|
| |
| |
| |
| |
| |
| |
| | |
This class is a holdover from when I was using GRATR, and it's
obsolete now.
Signed-off-by: Luke Kanies <luke@madstop.com>
|
|\|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Conflicts:
lib/puppet/util/settings.rb
spec/integration/defaults.rb
spec/unit/node/catalog.rb
spec/unit/type/interface.rb
spec/unit/type/ssh_authorized_key.rb
|
| |
| |
| |
| |
| |
| |
| | |
As with Events, this was never used (beyond being
assigned), so I've gotten rid of it.
Signed-off-by: Luke Kanies <luke@madstop.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The class had a 'transaction' accessor that was assigned
but never used, and it is simple enough that it needed
direct arguments rather than named arguments.
The rest of the code is changing the other classes that use
Events.
Signed-off-by: Luke Kanies <luke@madstop.com>
|
| |
| |
| |
| | |
Signed-off-by: Luke Kanies <luke@madstop.com>
|
| |
| |
| |
| | |
Signed-off-by: Luke Kanies <luke@madstop.com>
|
|\|
| |
| |
| |
| |
| |
| | |
Conflicts:
CHANGELOG
lib/puppet/transaction.rb
|
| |
| |
| |
| |
| |
| | |
Previously, we prefetched then generated, which caused generated
resources that needed prefetching not to work. This just reorders
the calls, so generated resources now get prefetched.
|
|\|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Conflicts:
lib/puppet/node/catalog.rb
lib/puppet/type/pfile.rb
lib/puppet/type/pfilebucket.rb
lib/puppet/util/filetype.rb
spec/unit/node/catalog.rb
spec/unit/other/transbucket.rb
spec/unit/ral/provider/mount/parsed.rb
spec/unit/ral/types/file.rb
spec/unit/ral/types/interface.rb
spec/unit/ral/types/mount.rb
spec/unit/ral/types/package.rb
spec/unit/ral/types/schedule.rb
spec/unit/ral/types/service.rb
test/language/compile.rb
test/language/lexer.rb
test/language/snippets.rb
test/lib/puppettest.rb
test/ral/types/basic.rb
test/ral/types/cron.rb
test/ral/types/exec.rb
test/ral/types/file.rb
test/ral/types/file/target.rb
test/ral/types/filebucket.rb
test/ral/types/fileignoresource.rb
test/ral/types/filesources.rb
test/ral/types/group.rb
test/ral/types/host.rb
test/ral/types/parameter.rb
test/ral/types/sshkey.rb
test/ral/types/tidy.rb
test/ral/types/user.rb
test/ral/types/yumrepo.rb
|
| |
| |
| |
| | |
their tags are arrays.
|
| |
| |
| |
| | |
removing the bangs from 'add_vertex!' and 'add_edge!'.
|