| Commit message (Collapse) | Author | Age | Files | Lines |
|\
| |
| |
| |
| |
| | |
Conflicts:
lib/puppet/type/file/source.rb
spec/unit/resource/catalog_spec.rb
|
| |\ |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
The introduction of composite namevars caused the resource title used in
resource aliases to be set as an array, even when the resource only had one
namevar. This would fail to conflict with non-alias entries in the resource
table, which used a string for the title, even though the single element array
contained the same string.
Now, we flatten the key used in the resource table, so that single element
arrays are represented as strings, and will properly conflict with resource
titles.
Paired-With: Jacob Helwig <jacob@puppetlabs.com>
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Types and parameters were registering their catalog as their expirer, so that
the catalog could expire them between uses. However, because catalogs are never
reused (and neither are types or parameters), there is no need to expire
anything. Thus, we remove the entire cleanup/expire logic from catalog, type,
and parameter.
Reviewed-By: Jacob Helwig <jacob@puppetlabs.com>
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
The method for adding class resources to the
catalog was only working in cases where the default
values weren't AST objects. This commit fixes
this, along with the tests that were failing
and drew out the problem.
Signed-off-by: Luke Kanies <luke@puppetlabs.com>
Reviewed-by: Nick Lewis <nick@puppetlabs.com>
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
This is again done to make support for hiera easier.
The way we were handling lookup of resource defaults
was over-complicated.
This does a decent bit of cleanup overall, but primarily
focused on resource type defaults and how they get
set during compilation.
Signed-off-by: Luke Kanies <luke@puppetlabs.com>
Reviewed-by: Nick Lewis <nick@puppetlabs.com>
|
|/ /
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The interface to scope is much clearer this way anyway,
but this is needed to integrate Puppet with Hiera[1].
It just provides hash-like behavior to Scope, which Hiera
and others can now easily rely on.
I also went through all of the code that used Scope#lookupvar
and Scope#setvar and changed it if possible, and at the same
time cleaned up a lot of tests that were unnecessarily stubbing
(and thus making it difficult to tell if I had actually broken
anything).
1 - https://github.com/ripienaar/hiera
Signed-off-by: Luke Kanies <luke@puppetlabs.com>
Reviewed-by: Nick Lewis <nick@puppetlabs.com>
|
|\|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
* 2.6.x:
(#7956) Porting cron tests
(#7956) Port resource acceptance tests
Readying for release of 2.6.9
(#6854) Update Red Hat spec file
Bumping release in lib/puppet.rb and updating CHANGELOG.
Bumping RPM spec file to 2.6.9rc1.
(#7506) Organize READMEs; specify supported Ruby versions in README.md
(#6418) Make test 64118 more portable
(#7127) Stop puppet if a prerun command fails
Do not needlessly create multiple reports when creating a transaction
(#4416) Ensure types are providified after reloading
(#4416) Always remove old provider before recreating it
Cleanup indentation, comment, and unused code
Conflicts:
CHANGELOG
README.md
conf/redhat/puppet.spec
lib/puppet.rb
lib/puppet/transaction.rb
spec/unit/configurer_spec.rb
spec/unit/transaction_spec.rb
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Before this change there were several problems with pre and post run
commands, logging, and sending of reports.
1. If a prerun command failed, puppet would attempt to apply the
catalog. Now puppet will not apply the catalog, but it will run the
postrun command and send the report (as it did before).
2. If a postrun command failed, puppet would not send the report. Sending the
report is now in an outer ensure block from the postrun command, so
postrun failures won't prevent the report from being sent.
3. Errors, e.g. Puppet.err, occuring during the prepare step, which
which includes plugin/fact download and prerun commands were not
appended to the report. Now the report log destination is registered as
early as possible, and unregistered as late as possible to ensure
Configurer errors that occur in the run method are included in the report.
4. The transaction was closing the Configurer's report destination out
from underneath it. As a result, postrun errors were not included in the
report.
Paired-with: Nick Lewis <nick@puppetlabs.com>
Reviewed-by: Jacob Helwig <jacob@puppetlabs.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Previously, the transaction would always create a report, which would
some times be overridden with a new report.
Now, the transaction optionally takes a report at initialization time,
and only creates a report of its own if none was provided.
Reviewed-by: Jacob Helwig <jacob@puppetlabs.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This patch changes the logging behavior of Whits so that instead of
talking about whits directly, we refer to the Class, Stage, or recursive
resource that they are sentinals for.
In the case where a "completion" Whit is notified by a resource, getting
a notification at all is counterinutitive, so I've changed the output to
a "debug"-priority message that describes what's happening.
Reviewed-By: Nick Lewis <nick@puppetlabs.com>
|
| |
| |
| |
| | |
Reviewed-By: Mike Stahnke
|
| |
| |
| |
| |
| |
| |
| | |
This will accept a number of manifests as arguments and check their syntax. If
no filenames are specified, it will check the default 'manifest' setting.
Paired-With: Jesse Wolfe
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The logic for distinguishing dynamic / static scopes was borrowed from Nick &
Paul's patch, the main differences here being 1) calling it "dynamic" (true/
false) rather than "parent_relationship" (:inherited/:dynamic) 2) aligning the
default so that it only needs to get set in one place (the one that will
eventually go away) and 3) setting it on createion rather than with a setter.
Setting it in one place, on creation, also makes it easier to see that anytime
we access a scope it will have the correct setting of Scope#dynamic and that
this does not change.
This commit also contains a minor refactor (removing Type#subscope) that is not
strictly tied to the main purpose but lies in the direction we are needing to
go and it simplified things to do it now.
|
|\|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
* 2.6.x:
(maint) Indentation fixes
(#6490) Add plugin initialization callback system to core
Fix #4339 - Locally save the last report to $lastrunreport
Fix #4339 - Save a last run report summary to $statedir/last_run_summary.yaml
Fixed #3127 - removed legacy debug code
Fixed #3127 - Fixed gem selection regex
(#5437) Invalidate cached TypeCollection when there was an error parsing
(#6937) Adjust formatting of recurse's desc
(#6937) Document the recurse parameter of File type.
(#6893) Document the cron type in the case of specials.
(#5670) Don't trigger refresh from a failed resource
Fixed #6554 - Missing $haveftool if/else conditional in install.rb breaking Ruby 1.9
Conflicts (Manually resolved):
lib/puppet/application/agent.rb
lib/puppet/application/apply.rb
lib/puppet/configurer.rb
lib/puppet/resource/type_collection.rb
lib/puppet/type/file.rb
spec/integration/configurer_spec.rb
spec/unit/application/agent_spec.rb
spec/unit/application/apply_spec.rb
spec/unit/configurer_spec.rb
spec/unit/indirector/report/yaml_spec.rb
spec/unit/resource/type_collection_spec.rb
Paired-with: Nick Lewis
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The caching of the TypeCollection in Puppet::Node::Environment would cause
parse errors to occur (and be reported) only once and never again, until
the file had changed on disk. This would also cause empty catalogs to be
sent down to the agents further hiding the problem.
Now, when a file fails to parse, it will be re-parsed every time on every
following compilation, causing the parse error to be reported every time,
and preventing sending down empty catalogs to agents.
Paired-with: Nick Lewis <nick@puppetlabs.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The watch_file mechanism would refuse to monitor paths to files that
didn't exist. This patch makes it possible to watch a file that hasn't
been created yet, so when it is created, you manifests will get
reparsed.
Backported this change to 2.6.x
Paired-With: Jacob Helwig <jacob@puppetlabs.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This commit removes the last remaining use of topsort (in SimpleGraph#splice!) by
fixing #5200 in a way that is compatible with graph fontiers. Instead of replacing
containers with many-to-many relationships, we now replace them with a pair of
sentinals (whits) that bracket them.
Thus a graph consisting of two containers, each containing ten resources, and a
dependency between the containers, which would have gone from 21 edges to 100
edges will instead have only 43, and a graph consisting of two containers (e.g.
stages) each containing a similar graph, which would have gone from 45 edges to
400 will only go to 95.
This change had minor consequences on many parts of the system and required lots
of small changes for consistancy, but the core of it is in Catelog#splice! (which
replaces SimpleGraph#splice!) and Transaction#eval_generate. Everything else is
just adjustments to the fact that some one-step edges are now two-step edges and
tests, event propagation, etc. need to reflect that.
Paired-with: Jesse Wolfe
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
To implement #6911 we will need to be able to make incremental descisions about
order of application based only on the contents of the resource graph and local
"working data." This commit begins to pull the needed structure into a method
(visit_resources) while, for the moment, maintaining the original semantic.
Paired-with: Jesse Wolfe
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
There's no value in including the code when we convert a resource
type to JSON, since you can't convert it back again, so this removes
it.
I also cleaned up a few of the other attributes which were
producing unnecessary information.
Signed-off-by: Luke Kanies <luke@puppetlabs.com>
Reviewed-by: Daniel Pittman <daniel@puppetlabs.com>
|
|\|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
* 2.6.x: (46 commits)
Augmentation of tests for prior commit
Fix to fix for #5755 -- backref serialization issues in zaml
Fixed #5564 - Added some more fqdn_rand documentation
Fixed #4968 - Updated list of options turned on by --test in documentation
(#5061) - allow special hostclass/define variables to be evaluated as defaults.
(#6107) Fix an error when auditing a file with empty content
Remove already initialized constant warning from file_spec.rb tests
(#5566) Treat source only File checksums as syntax errors when used with content
Rename variable used in File type validation to be more clear
Remove invalid "timestamp" and "time", and add missing "ctime" File checksum types.
Remove order dependency when specifying source and checksum on File type
Bug #5755 -- ZAML generates extra newline in some hash backreferences.
bug #5681 -- code fix to handle AIX mount output
Bug #5681 -- parse AIX mount command output.
Spec for #5681 to allow parsing of AIX mount output in mount provider
Fixed #6091 - Changed POSIX path matching to allow multiple leading slashes
Bug #6091 -- test leading double-slash in filenames are allowed.
Fixed #6071 - Fixed typo and improved exec path error message
Fixed #6061 - Allowed -1 as password min/max age
Bug #6061 -- verify that negative {min,max}_password_age are accepted.
...
Manually Resolved Conflicts:
lib/puppet/util/zaml.rb
spec/unit/util/zaml_spec.rb
|
| |\
| | |
| | |
| | |
| | | |
* feature/master/5061:
(#5061) - allow special hostclass/define variables to be evaluated as defaults.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
I have always been annoyed that special variables for defines and hostclasses can not be evaluated as param defaults. Special variables are: $name, $title, $module_name.
Code example:
class x (
foo = $name
) { notice($foo)}
should print x, and with my patch, it does.
Reviewed-by: Paul Berry <paul@puppetlabs.com>
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Renamed some variables to be clearer, made tests use less stubbing,
added some additional tests and got rid of some unecessary logic.
Paired-with: Dan Bode
|
| |/
| |
| |
| |
| |
| |
| |
| | |
The params are added as attributes when the resource is created.
Also, even if the class already exists, if params are passed, we still try to create it.
Reviewed-by: Matt Robinson
|
|\|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
* 2.6.x: (21 commits)
(#5900) Include ResourceStatus#failed in serialized reports
(#5882) Added error-handling for bucketing files in puppet inspect
(#5882) Added error-handling to puppet inspect when auditing
(#5171) Made "puppet inspect" upload audited files to a file bucket
Prep for #5171: Added a missing require to inspect application.
Locked Puppet license to GPLv2
(#5838) Support paths as part of file bucket requests.
(#5838) Improve the quality of file bucket specs.
(#5838) Make file bucket dipper efficient when saving a file that already exists
(#5838) Implemented the "head" method for FileBucketFile::File terminus.
(#5838) Reworked file dipper spec to perform less stubbing.
(#5838) Added support for HEAD requests to the indirector.
(#5838) Refactored error handling logic into find_in_cache.
(#5838) Refactored Puppet::Network::Rights#fail_on_deny
maint: Remove unused Rakefile in spec directory
(#5171) Made filebucket able to perform diffs
(#5710) Removed unnecessary calls to insync?
Prep for fixing #5710: Refactor stub provider in resource harness spec
Maint: test partial resource failure
maint: Inspect reports should have audited = true on events
...
Manually Resolved Conflicts:
lib/puppet/file_bucket/dipper.rb
lib/puppet/indirector.rb
lib/puppet/network/rest_authconfig.rb
spec/unit/file_bucket/dipper_spec.rb
spec/unit/file_bucket/file_spec.rb
spec/unit/indirector_spec.rb
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This property was excluded from serialization because it was believed that its
value could be determined by looking at the events of a ResourceStatus.
However, if a resource can't be retrieved, it will have no events created, and
will have no other way of determining its status.
Reviewed-By: Paul Berry
|
| |
| |
| |
| |
| |
| | |
In 2.6.4 and earlier, "skipped" appeared only when true. A recent
change accidentally caused it to never appear. This change makes it
always appear.
|
|\|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Conflicts:
Rakefile
lib/puppet/resource/type_collection.rb
lib/puppet/simple_graph.rb
lib/puppet/transaction.rb
lib/puppet/transaction/report.rb
lib/puppet/util/metric.rb
spec/integration/indirector/report/rest_spec.rb
spec/spec_specs/runnable_spec.rb
spec/unit/configurer_spec.rb
spec/unit/indirector_spec.rb
spec/unit/transaction/change_spec.rb
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Ruby's default #inspect method can lead to printing factorial-order
output for large graphs of objects. Since we have large graphs of
objects, this is not optimal.
This patch replaces a few well-connected objects' #inspect methods with
methods that produce reduced output, and are thus much faster.
Paired-With: Nick Lewis <nick@puppetlabs.com>
|
| |
| |
| |
| |
| | |
These new attributes save report processors from having to parse the
"resource" attribute.
|
| |
| |
| |
| |
| |
| |
| | |
Puppet::Resource::Status.
This attribute is only used for properly generating log messages and
was never intended to appear in reports.
|
| |
| |
| |
| |
| |
| |
| | |
The attributes Puppet::Resource::Status#changed,
Puppet::Resource::Status#out_of_sync, and
Puppet::Transaction::Event#audited used to only appear in reports when
their state was true. Now they appear always.
|
| | |
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
- #change_count now only counts events that represent successful
changes. It does not count failures, audits, or noops.
- #changed is equivalent to #change_count > 0.
- #out_of_sync_count (a new attribute) counts all events except audits.
- #out_of_sync is equivalent to #out_of_sync_count > 0.
This should hopefully make the summary statistics in reports more useful.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
are tested
This patch removes the Puppet::Transaction::Change class and replaces
it with a method,
Puppet::Transaction::ResourceHarness#apply_parameter. The new code is
shorter, more thoroughly unit tested, and addresses known bugs in
the interaction between auditing and performing changes.
This code does not address drawbacks in the report output (for example
a resource is still flagged as changed even if it merely contains
audit information); those will be addressed in a follow-up patch.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
loading site.pp"
The fix for #4349 caused --parse-only not to detect syntax errors when
--ignore-import was used by adding a return statement that bypassed the
initial import:
commit 760e418d254a8d2198d2c6eb466d783a5930ef47
def perform_initial_import
+ return if Puppet.settings[:ignoreimport]
The problem that #4349 fixed was more generally fixed in commit
99c1019e1d3402ec8e476dc859d5aaef82ec4f69 for ticket #4798 so the return
statement is no longer needed, so reverting the commit for #4349 does
not reintroduce the problem of an import loop error when running puppet
doc.
Paired-with: Jesse Wolfe
|
|\|
| |
| |
| |
| |
| | |
Manually resolved conflicts:
lib/puppet/parser/ast/resource.rb
spec/unit/parser/ast/resource_spec.rb
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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 restricts the change introduced in #4691 to hostclasses, and leaves defined
resources and nodes alone, thus more closely mimicing the 0.25.x behaviour. It
also includes title, as this was similarly affected.
|
|\| |
|
| |
| |
| |
| |
| |
| | |
The class name is now stored internally with an initial capital, which changed
the contents of $name in a way that broke some manifests. This fix stores the
downcased version in $name.
|
|\| |
|
| |
| |
| |
| |
| |
| |
| | |
The responsibility for adding classes to the compiler's classes list (for use
in constructing classes.txt) moved around a bit in the 0.25 to 2.6 transition
before being dropped in a merge conflict resolution. Ooops. This restores it,
and adds tests to prevent regression.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
AST resources.
Move type-name resolution out of Puppet::Resource into the AST resources.
Move find_resource_type out of Puppet::Resource into Scope
Thus, never pass unqualified type names to Puppet::Resource objects.
Thus, Puppet::Resource objects don't need the namespace property,
and Puppet::Resource objects never consult the harddrive to look for
.pp files that might contain their type definitions,
Thus, performance is improved.
Also removes the temporary fix for #4257 that caused #4397
(The code was too eager to look for a class in the topscope)
Paired-With: Paul Berry <paul@puppetlabs.com>
Signed-off-by: Jesse Wolfe <jes5199@gmail.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
definitions (classes, definitions, and nodes).
Previously, type definitions were not represented directly in the AST.
Instead, the parser would instantiate types and insert them into
known_resource_types as soon as they were parsed. This made it
difficult to distinguish which types had come from the file that was
just parsed and which types had been loaded previously, which led to
bug 4496.
A side-effect of this change is that the user is no longer allowed to
define types inside of conditional constructs (such as if/else). This
was allowed before but had unexpected semantics (bugs 4521 and 4522).
It is still possible, however, to place an "include" statement inside
a conditional construct, and have that "include" statement trigger the
autoloading of a file that instantiates types.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Puppet::Node::Environment.
This change is part of an ongoing effort to remove functionality from
TypeCollection that is not related to keeping track of a collection of
types. This reduces TypeCollection's linkage to the environment,
which is a step toward decoupling it from the type loading mechanism.
Also, added a spec test to verify that TypeCollection.version is
correctly recomputed when types are re-imported.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Moved type-name resolution out of Puppet::Parser::TypeLoader, and into
its primary client, Puppet::Resource::TypeCollection. TypeCollection
now always passes fully qualified type names to TypeLoader.
This avoids duplicate type-name resolution logic between TypeLoader
and TypeCollection. That in turn fixes bug 4472, which resulted
from flaws in the type-name resolution logic in TypeLoader.
In addition, it fixes bug 4483, which resulted from improper
interleaving between looking up names using the TypeCollection and the
TypeLoader.
|