| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
| | |
| | |
| | |
| | |
| | |
| | | |
It is based on net/telnet.
Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
This is the base for upcoming telnet and ssh transport mechanism
to send commands to network devices.
Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Those will be used to parse IPs, compute netmaks or prefix length.
Unfortunately ruby IPAddr doesn't support those directly.
Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
rspec2 automatically sets a bunch of load-path stuff we were by hand, so we
can just stop. As a side-effect we can now avoid a whole pile of stupid things
to try and include the spec_helper.rb file...
...and then we can stop protecting spec_helper from evaluating twice, since we
now require it with a consistent name. Yay.
Reviewed-By: Pieter van de Bruggen <pieter@puppetlabs.com>
|
|/ /
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Ruby < 1.8.7 doesn't have this method and we're using it in a test, so
tests won't run on 1.8.6 until this is in place.
It's probably a good thing to use much in implementation since it's
written in pure Ruby when using < 1.8.7 and in C when in > 1.8.7, but
then if you're using older Rubies you're probably not expecting much for
performance anyway.
Reviewed-by: Daniel Pittman <daniel@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.
Paired-With: Max Martin <max@puppetlabs.com>
Reviewed-By: Jacob Helwig <jacob@puppetlabs.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Running the specs under Ruby 1.9 didn't work using the lambda to recurse
down directories to find the spec_helper. Standardizing the way to find
spec_helper like the rest of specs seemed like the way to go.
Here's the command line perl I used to make the change:
perl -p -i -e "s/Dir.chdir.*lambda.*spec_helper.*$/require
File.expand_path(File.dirname(__FILE__) + '\/..\/..\/spec_helper')/"
`find spec -name "*_spec.rb"`
Then I fixed the number of dots for files that weren't two levels from
the spec dir and whose tests failed.
Reviewed-by: Nick Lewis <nick@puppetlabs.com>
|
|\|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
* 2.6.x: (36 commits)
Updated CHANGELOG for 2.6.7rc1
(#5073) Download plugins even if you're filtering on tags
Fix #5610: Prevent unnecessary RAL lookups
Revert "Merge branch 'ticket/2.6.x/5605' of git://github.com/stschulte/puppet into 2.6.next"
(#6723) Fix withenv environment restoration bug
(#6689) Remove extraneous include of Puppet::Util in InventoryActiveRecord
Remove extra trailing whitespace from lib/puppet/resource.rb
(#5428) More fully "stub" Puppet::Resource::Reference for use with storedconfigs
(#6707) Fix typo in rest_authconfig.rb
(#6689) Make inventory_active_record terminus search quickly
(#5392) Give a better error when realizing a non-existant resource
(#2645) Adding a less-stubby test to verify the "system" attribute's behavior
Update CHANGELOG for 2.6.6
maint: Remove serialization of InventoryFact values
maint: Rename InventoryHost to InventoryNode
Fixed #2645 - Added support for creating system users
maint: Remove spec run noise
maint:Refactor of mount provider integration tests
(#6338) Support searching on metadata in InventoryActiveRecord terminus
(#6338) Implement search for InventoryActiveRecord facts terminus
...
This merge includes essentially reverting #4904's change to the mount
type since tests that came in from 2.6.x specified different
behavior and what's correct is not clear to me. I've reopened #4904 and
added it to our backlog, and talked to Nigel about the RFC that's
currently out on the puppet-users mailing list for a bigger refactor of
how the mount provider works.
Manually Resolved Conflicts:
spec/spec_helper.rb
spec/unit/indirector/queue_spec.rb
|
| |
| |
| |
| |
| |
| | |
Ensured that withenv properly restores the environment after it runs a block and added testing for the method.
Reviewed-by: Matt Robinson and Daniel Pittman
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
For example with the following:
test.conf:
[master]
rrddir = /var/lib/puppet/rrd
templatedir = /var/lib/puppet/templates
[env_a]
templatedir = $rrddir/templates
rrddir = /tmp/env_a/
The command:
RUBYLIB=lib bin/puppet master --config ./test.conf --environment env_a --configprint templatedir
originally produced '/var/lib/puppet/rrd/templates' instead of the
expected '/tmp/env_a/templates'
Reviewed-by: Jesse Wolfe <jesse@puppetlabs.com>
|
| |
| |
| |
| |
| |
| |
| |
| | |
The 'should interpolate found values using the current environment' wasn't
actually testing what it was describing, since the environment variable is
special cased.
Reviewed-by: Jesse Wolfe <jesse@puppetlabs.com>
|
| |
| |
| |
| |
| |
| |
| | |
Puppet::Util.execute with an arbitrary code block for ease in spec
testing.
Reviewed-by: Max Martin <max@puppetlabs.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The structure of the AST has changed from 2.6.x to master, so the code
to generate documentation from the AST had to change.
Generating documentation for resources other than classes, nodes and
defines is still broken, see ticket #6634
Paired-with: Daniel Pittman <daniel@puppetlabs.com>
|
|\|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This was a particularly nasty merge, so rather than hold up merges into
next any longer, I'm going to push this merge with a few outstanding
problems. The tests that were failing in the following areas have been
marked pending, and will be addressed separately, immediately following
this push.
TODO:
Verify that brice's rdoc change is still valid: tests to show that line
numbers from class, define and node get into the ast
Fix mount parsed_spec spec/unit/provider/mount/parsed_spec.rb
* 2.6.next: (85 commits)
(#5148) Fix failing spec due to timezone
(#5148) Add support for PSON to facts
(#6338) Remove inventory indirection, and move to facts indirection
(#6445) Fix inline docs: puppet agent does not accept --mkusers
Update CHANGELOG and version for 2.6.6rc1
(#6541) Fix content with checksum truncation bug
(#6418) Recursive files shouldn't be audited
(#6541) maint: whitespace cleanup on the file integration spec
(#6541) Fix content with checksum truncation bug
(#5466) Write specs for output of puppet resource
(#5466) Monkey patch Symbol so that you can sort them
(#5466) Fixed puppet resource bug with trailing ,
Update CHANGELOG for 2.6.5
(#4922) Don't truncate remotely-sourced files on 404
(#6338) Remove unused version control tags
Maint: Align tabs in a code block in the Augeas type.
(#6509) Inline docs: Fix erroneous code block in directoryservice provider for computer type
Maint: Rewrite comments about symlinks to reflect best practice.
(#6509) Inline docs: Fix broken lists in Launchd provider.
(#6509) Inline docs: Fix broken code blocks in zpool type
...
Manually Resolved Conflicts:
lib/puppet/application/inspect.rb
lib/puppet/defaults.rb
lib/puppet/file_bucket/dipper.rb
lib/puppet/network/http/handler.rb
lib/puppet/node/facts.rb
lib/puppet/parser/parser.rb
lib/puppet/parser/parser_support.rb
lib/puppet/util/command_line/puppet
lib/puppet/util/command_line/puppetd
lib/puppet/util/command_line/puppetmasterd
lib/puppet/util/monkey_patches.rb
lib/puppet/util/rdoc/parser.rb
spec/unit/application/agent_spec.rb
spec/unit/file_bucket/file_spec.rb
spec/unit/indirector/file_bucket_file/file_spec.rb
spec/unit/network/http/handler_spec.rb
spec/unit/parser/parser_spec.rb
spec/unit/provider/mount/parsed_spec.rb
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The test here was previously fragile, in that it would break when new
applications were introduced, and in that it depended on the order of items
returned from reading the directories on disk.
It is now insensitive to those changes, and still verifies that the results we
require occur, reducing long term maintenance cost.
Reviewed-by: James Turnbull <james@puppetlabs.com>
|
| |\
| | |
| | |
| | | |
bug/2.6.next/5720-puppetdoc-fails-on-parameterized-class
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
It can happen that when parsing a file puppet parses other manifests
if they get imported (this is at least true for site.pp, even in
ignoreimport=true). Thus those files are now "watched".
But puppetdoc needs to analyze all files, and since 99c101 we are now
checking if the file was already parsed to not reparse it again.
If that was the case, though, we weren't analyzing the produced code.
Thus it was possible to not produce documentation for the site.pp content.
Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
The following manifest was crashing puppetdoc:
class test {
include "test::$operatingsystem"
}
Because the quoted string is "rendered" as a concat AST, which in turn
ended being an array when entering RDoc.
Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
|
| |\ \
| | |/
| |/| |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
- previously, Puppet would search $LOAD_PATH and just
load applications in the first $LOAD_PATH to have
the directory puppet/application. Now multiple paths
can contain applications.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
into next"
This reverts commit 448a439f5abc3d51accececb678e9c5f547f7615, reversing
changes made to 06939c51a3f675137b53fac8a521132a4c9cfcbe.
As per discussion in http://projects.puppetlabs.com/issues/5691#note-5
|
|\ \ \ |
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
This is special feature that changes the process name of the running puppet
entity to display its current activity.
It is disabled by default, and can be enabled by sending the QUIT signal
to the process in question (or calling enable through the code).
This system can work only if some "probes" are integrated in the core puppet
codebase. Since tools to visualize process names have a large refresh time
(ie more than 1s) it only makes sense to track long activities (like compilation,
transaction or file serving).
Those probes are the subject of a subsequent patch.
This system tracks every thread activity and form a strings which will
be used as the process name. Due to the way it is implemented it is
possible that it doesn't work on all platforms (I tested successfully
on osx and linux). On some systems the space available is dependent on
the original size of the full command. That's why if this string is longer
than a 50 characters, the string is scrolled (like stock market tickers).
Note: This is not intended to be a generic instrumentation system. Also, being
block based means that it can reduce performance if the instrumentation
probes are used in tight inner loops.
Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
|
|\ \ \ \
| | |/ /
| |/| | |
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
We previously had an ordering dependency in the autoflush option, which was
statically read from defaults when the log destination was configured.
We add a hook in the defaults to update the log subsystem, which in turn
updates log destinations, when autoflush is changed.
This would work as desired:
puppet agent --autoflush --logdest=file
This would not work, as autoflush would be false:
puppet agent --logdest=file --autoflush
Now those changes propagate correctly.
Paired-with: matt@puppetlabs.com
|
| | | |
| | | |
| | | |
| | | | |
There is no good answer to tests that depend on the order of itteration over hashes.
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
This commit addresses the original issue that the change reverted in the previous
commit for #5755 was intended to fix by removing the special case on labels in
emit (lables, even if they are never generated, are not "new lines" and thus
@recent_nl should always be set to false when one is emitted).
It also partially addresses a related issue wherein temporary strings generated
when field names are constructed recycle their object_id (they are temporary)
and thus cause incorrect back references. This commit "fixes" the problem by
never generating backrefs to strings (treating them as immutable).
It does not address other suspected issues such as thread safety durring serialization
due to the use of class variables to store the seen-object hash or the use of object
ids as "permanently unique" identifiers.
Paired with: Daniel Pittman
Advice & Commiseration: Jesse Wolfe
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
This data structure generates YAML with an extra newline that violates the
syntax rules and all:
list = [1]
{ :a => list, :b => list }.to_yaml
This breaks real client use of the YAML catalogs, not to mention our own use
of cached catalogs...
|
|\| | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
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
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
The biggest change is that we no longer need to monkey patch rspec to
get confine behavior. Describe blocks can now be conditional like
confine used to be. "describe" blocks with "shared => true" are now
"shared_examples_for".
Paired-With: Nick Lewis
|
| | | | |
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
This attribute was only relevant in reports, and in reports it was
redundant with Puppet::Transaction::Report#configuration_version and
Puppet::Transaction::Report#puppet_version.
|
| |\ \ \ |
|
| | | |/
| | |/|
| | | |
| | | |
| | | |
| | | |
| | | | |
The #write method in lib/puppet/type/file/content.rb relies on the block
passed to #sum_stream getting executed. "none", "mtime", and "ctime"
aren't real checksums, so they violated that assumption and just
returned empty results. This patch causes that block to get executed.
|
| |/ /
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
This patch removes the escaping of valid UTF-8 sequences as "\uXXXX".
This code was unreliable, as it relied on Iconv's ability to convert
those codepoints between UTF-8 and UTF-16, but some versions of Iconv
barf on some valid codepoints.
Invalid UTF-8 sequences are still passed through unchanged. We believe
that this is fine; if you are concerned about complience with the JSON
standard, what we are doing is equivalent to:
* interpreting binary files as Latin-1 encoded character sequences
* JSON-encoding those characters according to RFC 4627
* outputting the JSON as Latin-1
This allows all raw binary files to be transmitted losslessly.
Paired-With: Paul Berry <paul@puppetlabs.com>
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Doing a require to a relative path can cause files to be required more
than once when they're required from different relative paths. If you
expand the path fully, this won't happen. Ruby 1.9 also requires that
you use expand_path when doing these requires.
Paired-with: Jesse Wolfe
|
|\ \ \ |
|
| |/ /
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
This patch removes the escaping of valid UTF-8 sequences as "\uXXXX".
This code was unreliable, as it relied on Iconv's ability to convert
those codepoints between UTF-8 and UTF-16, but some versions of Iconv
barf on some valid codepoints.
Invalid UTF-8 sequences are still passed through unchanged. We believe
that this is fine; if you are concerned about complience with the JSON
standard, what we are doing is equivalent to:
* interpreting binary files as Latin-1 encoded character sequences
* JSON-encoding those characters according to RFC 4627
* outputting the JSON as Latin-1
This allows all raw binary files to be transmitted losslessly.
Paired-With: Paul Berry <paul@puppetlabs.com>
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
destination.
Using an Array as a log destination is unreliable because Puppet's log
mechanism stores log destinations in a hash whose key is the
destination itself. Since arrays can change their hash when they are
modified, this was causing the log destination hash to become
corrupted, producing sporadic spec test failures.
|
| | |
| | |
| | |
| | |
| | |
| | | |
In configurer_spec.rb, replaced some mock classes with actual
Puppet::Transaction::Report objects. In log_spec.rb, stopped using
the Array type as a log destination, since doing so was unreliable.
|
|\| |
| | |
| | |
| | |
| | |
| | | |
Resolved conflicts manually:
spec/integration/indirector/bucket_file/rest_spec.rb
spec/integration/indirector/certificate_revocation_list/rest_spec.rb
|
| | |
| | |
| | |
| | |
| | |
| | | |
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.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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>
|
| | |
| | |
| | |
| | |
| | |
| | | |
This should allow to run puppetdoc on ruby 1.8.5.
Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Standardize how we create tmpdirs by using the puppet function instead
of Dir.tmpdir.
Paired-with: Paul Berry <paul@puppetlabs.com>
|
|\ \ \
| |_|/
|/| |
| | |
| | |
| | | |
Conflicts:
lib/puppet/util/monkey_patches.rb
-- two unrelated additions had been made, kept them both.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Rewrote SimpleGraph to use a more efficient internal representation.
To preserve compatibility with older clients, graphs are still
serialized to YAML using the format used by Puppet 2.6. However, a
newer, more compact format can be enabled by setting
"use_new_yaml_format" to true. Deserialization from YAML accepts
either the old 2.6 format or the newer format. In a later release,
once we no longer need to be compatible with 2.6, we will be able to
switch to the new format.
To make deserialization accept multiple formats, it was necessary to
use the yaml_initialize method. This method is not supported in
versions of Ruby prior to 1.8.3, so a monkey patch is included to add
support for it to Ruby 1.8.1 and 1.8.2.
Thanks to Markus Roberts for the SimpleGraph rewrite. Thanks to Jesse
Wolfe for figuring out how to write the yaml_initialize monkey patch.
|
|\ \ \
| | |/
| |/| |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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).
|