| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
| |
move Util::CommandLine methods into instances instead of on the class,
as suggested by Markus
Signed-off-by: Jesse Wolfe <jes5199@gmail.com>
|
|
|
|
|
|
|
|
|
|
| |
This patch moves file content writing to the content properties and
always write (or read) contents by chunks.
This reduces drastically puppetd memory consumption when handling large
sourced files.
Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
|
|
|
|
|
|
| |
refactor CommandLine to be an object
Signed-off-by: Jesse Wolfe <jes5199@gmail.com>
|
|
|
|
|
|
| |
Extract the logic to determine the subcommand name into a method.
Signed-off-by: Jesse Wolfe <jes5199@gmail.com>
|
|
|
|
|
|
| |
restore the help text for the apply command
Signed-off-by: Jesse Wolfe <jes5199@gmail.com>
|
|
|
|
|
|
|
|
|
| |
Added some tests to make the single executable command behavior
explicit.
Added logic to display the usage message if we're on a tty and no
arguments are passed.
Signed-off-by: Jesse Wolfe <jes5199@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
| |
Added some tests to make the single executable command behavior
explicit.
Added logic to display the usage message if we're on a tty and no
arguments are passed.
Signed-off-by: Jesse Wolfe <jes5199@gmail.com>
|
| |
|
|
|
|
| |
Signed-off-by: Luke Kanies <luke@reductivelabs.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
I had only done this partway, because it seemed easier,
but not surprisingly, it ended up being more complex.
In addition to those renames, this commit includes fixes
to whatever tests I needed to fix to confirm that things
were again working. I think most of these broken
tests have been broken for a while.
Signed-off-by: Luke Kanies <luke@reductivelabs.com>
|
|
|
|
|
|
|
|
|
|
| |
Basically, these classes (ResourceType and ResourceTypeCollection)
don't really belong in Parser, so I'm moving them to the
Resource namespace. This will be where anything RAL-related goes
from now on, and as we migrate functionality out of Puppet::Type,
it should go here.
Signed-off-by: Luke Kanies <luke@reductivelabs.com>
|
|
|
|
| |
Signed-off-by: Luke Kanies <luke@reductivelabs.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
This will soon replace all of the env/parser mungling
we have to do. A given process will only be able to
have one collection of code per environment in memory.
This is somewhat limiting, in theory, but some global means
of looking up code collection (LoadedCode instances) must
exist for the pure ruby stuff to work.
Signed-off-by: Luke Kanies <luke@reductivelabs.com>
|
|
|
|
|
| |
This is the patch from Mike Pountney <Mike.Pountney@gmail.com> off
the list with the additional test Luke requested.
|
|
|
|
|
|
|
|
| |
The original pure ruby yaml patch missed some edge cases; specifically, classes
that were modified by the syck version to directly call it and thus never
reached the pure ruby version. This adds monkey patches to all of those case
which we might reasonably care about (omitting, for example, calls within the
syck version to itself) and tests which show that the monkey patch works.
|
|
|
|
| |
Signed-off-by: Luke Kanies <luke@madstop.com>
|
|
|
|
|
|
|
|
|
|
|
| |
Previously, the Log class knew a lot about RAL objects,
but now the Logging module is the only one that does.
This greatly simplifies the Log class, which is good,
and means that whatever complexity does need to exist
is directly exposed in the Logging middleware module.
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: Luke Kanies <luke@madstop.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
File checksum is "md5" by default. When managing local files (not sourced
or content) it might be desirable to not checksum files, especially
when managing deep hierarchies containing many files.
This patch allows to write such manifests:
file {
"/path/to/deep/hierarchy":
owner => brice, recurse => true, checksum => none
}
Then puppet(d) won't checksum those files, just manage their ownership.
Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
|
|
|
|
|
|
|
| |
Some tests didn't define this setting which caused this method
to fail.
Signed-off-by: Luke Kanies <luke@reductivelabs.com>
|
|\
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Conflicts:
lib/puppet/agent.rb
lib/puppet/application/puppet.rb
lib/puppet/configurer.rb
man/man5/puppet.conf.5
spec/integration/defaults.rb
spec/unit/configurer.rb
|
| |
| |
| |
| |
| |
| |
| |
| | |
Actually, File::PATH_SEPARATOR, which is generally, but not always, ":").
Since libdir is also the default for the plugin handler, users will need to
specify it explicitly if a multipart libdir is given (and it will need to be
one of the segments given in the libdir for the plugins to be found).
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Selinux modules files also ends in ".pp".
Puppetdoc tries to parse them as if they are regular puppet files and
then fails.
This patch makes sure puppetdoc tells RDoc to exclude parsing .pp
files in the modules files section.
Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
When the definition/hostclass/node AST types were removed, the
parentclass method was renamed to 'parent'.
This patch fixes the incorrect rdoc usage (and some deeper
integration test so that it won't happen again).
Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
|
|\|
| |
| |
| |
| |
| | |
Conflicts:
lib/puppet/ssl/host.rb
spec/spec_helper.rb
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
We don't actually rely on iconv's UTF-8 support, so its absence
shouldn't cause the PSON feature to fail on system (e.g. HPUX)
where it isn't fully implemented.
This change exposed a dependency on library load order that was causing
Puppet::Util::Log to raise an error. I've removed the dependency of
Puppet::Type from Puppet::Util::Log.
Signed-off-by: Jesse Wolfe <jes5199@gmail.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This appears to be regression introduced by threading changes. The fix was
to rearrange things to keep the old behaviour (don't clear the settings
until you know the config file parses) and the new (don't nest calls to
synchronize) by:
1. Splitting clear into two parts--clear, which works as before, and
unsafe_clear which it calls and which expects synchronization to be
handled externally.
2. Rearranging the code to recover the previous calling order
3. Trapping syntax errors and turning them into logged messages and a
no-op effect.
4. Fixing reparse to not wrap a call to this code with a synchronize.
5. Tests.
Signed-off-by: Markus Roberts <Markus@reality.com>
|
| |
| |
| |
| |
| |
| |
| |
| | |
This spec wasn't cleaing up after itself, and raised several exceptions
when trying to register the same queue type again.
Part of the #2879 test idempotency suite.
Signed-off-by: Jesse Wolfe <jes5199@gmail.com>
|
| |
| |
| |
| |
| |
| |
| | |
An Autoload spec was depending on files having not yet been autoloaded.
Detected as part of #2879.
Signed-off-by: Jesse Wolfe <jes5199@gmail.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This makes the SELinux library marginally more robust by dealing
consistently with a missing proc/mounts, and also resoves the test
failures in a way that allows meaningful test runs on non-SELinux
systems.
Signed-off-by: Markus Roberts <Markus@reality.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
spec/unit/util/ldap/connection.rb
the ldap/connection spec creates a mock LDAP class that causes `require 'ldap'`
to explode. If `require 'ldap'` happens first, then we're OK.
Signed-off-by: Jesse Wolfe <jes5199@gmail.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Add a flag "manage_internal_file_permissions" which is enabled by
default. Disabling this flag prevents Puppet from managing the owner,
group, or mode of files created from Puppet::Util::Settings::FileSetting
I think this is a wide enough net to follow Luke's suggestion of
"disable management of everything", and it certainly satisfies the
requests I'm aware of, but if I've missed anything, let me know.
Signed-off-by: Jesse Wolfe <jes5199@gmail.com>
|
|\|
| |
| |
| |
| |
| |
| |
| | |
Conflicts:
lib/puppet/agent.rb
lib/puppet/application/puppetd.rb
lib/puppet/parser/ast/leaf.rb
lib/puppet/util/rdoc/parser.rb
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Symlinks confuse the "What file system am I on?" logic. This patch just
runs the paths through a beefed up version of the standard 'realpath'
method.
Includes some of Markus's suggested changes.
Signed-off-by: Jesse Wolfe <jes5199@gmail.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Check that a specific file supports selinux properties before trying to
set them.
This patch is functionally identical to the one Darrell Fuhriman
submitted with the bug report.
Signed-off-by: Jesse Wolfe <jes5199@gmail.com>
|
| |
| |
| |
| |
| |
| |
| | |
Monkey-patch workaround for RDoc so it doesn't get confused by rubygems
stub executables.
Signed-off-by: Jesse Wolfe <jes5199@gmail.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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 patches fixes a bug where setting an invalid option for "--color"
caused the word "nil" to be printed on every line of the log, instead
of printing out log messages.
Invalid color options now just produce uncolored output.
It seems to me that this isn't important enough to issue a warning
about an invalid setting.
Signed-off-by: Jesse Wolfe <jes5199@gmail.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This commit extracts these three classes into a single
ResourceType class in the Parser heirarchy, now completely
independent of the AST heirarchy.
Most of the other changes are just changing the interface
to the new class, which is greatly simplified over the previous
classes.
This opens up the possibility of drastically simplifying a lot
of this other code, too -- in particular, replacing the reference
to the parser with a reference to the (soon to be renamed)
LoadedCode class.
Signed-off-by: Luke Kanies <luke@madstop.com>
|
| |
| |
| |
| | |
Signed-off-by: Luke Kanies <luke@madstop.com>
|
| |
| |
| |
| |
| |
| |
| | |
This is so that you can still use docs without AST
being the parent class.
Signed-off-by: Luke Kanies <luke@madstop.com>
|
| |
| |
| |
| |
| |
| |
| |
| | |
Puppetdoc wasn't parsing the realize function.
This patch let puppetdoc find realize and display in RDoc html
mode the list of realized resource per class or node.
Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Add a flag "manage_internal_file_permissions" which is enabled by
default. Disabling this flag prevents Puppet from managing the owner,
group, or mode of files created from Puppet::Util::Settings::FileSetting
I think this is a wide enough net to follow Luke's suggestion of
"disable management of everything", and it certainly satisfies the
requests I'm aware of, but if I've missed anything, let me know.
Signed-off-by: Jesse Wolfe <jes5199@gmail.com>
|
| |
| |
| |
| |
| |
| |
| |
| | |
Wrap Puppet::Settings.use in a block that disables noop mode during the
execution of the block and ensures that noop returns to its original
value afterwards. This allows internal puppet catalog operations like
ssl directory creation to occur even when puppet is run in --noop mode.
This should actually solve a broader class of related bugs.
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This patch fix this bug by adding more to_s methods to ast member
so that puppetdoc can just to_s the AST to reconstruct the original
puppet code.
Of course this is not perfect, but should work most of the time.
Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
When puppetdoc rdoc dies with an unhandled exception, the error
message produced didn't mention the file and line where the parser
choked.
This patch fixes this by trying to locate on which AST structure
the rdoc system failed.
Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
class klass {
include a, b, c
}
wasn't producing any rdoc documentation.
We were thinking code was always embedded in an array which is not
the case for mono-instruction code.
Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
|