| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
| |
class_scope was moved to scope.
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
| |
When a class is evaluated, its parent class
needs to be evaluated first. This forces that
evaluation. We somehow lost it when we converted
the resource types out of AST.
Signed-off-by: Luke Kanies <luke@reductivelabs.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This code is impressively difficult, because
sometimes resource types act like resources (classes
and nodes are singletons) and sometimes like resource
types (defined and builtin resources).
So, to get nodes to show as Node[foo] and classes as
Class[Foo::Bar], but defined resources to show up as
Foo::Bar[baz], we have to do some silliness.
Signed-off-by: Luke Kanies <luke@reductivelabs.com>
|
|
|
|
|
|
|
|
|
|
|
| |
I was using 'params' and 'parameters', so
I fixed that and extracted the differences in
how they handle parameters into a stubbable method.
This allowed me to almost entirely remove the subclass's
'initialize' method.
Signed-off-by: Luke Kanies <luke@reductivelabs.com>
|
|
|
|
|
|
|
| |
This is used for AST resources (and fixed the last
of the tests I broke in spec/).
Signed-off-by: Luke Kanies <luke@reductivelabs.com>
|
|
|
|
|
|
|
|
| |
This involves a bit of refactoring in the rest
of the code to make it all work, but most of the
changes are fixing or removing old tests.
Signed-off-by: Luke Kanies <luke@reductivelabs.com>
|
|
|
|
| |
Signed-off-by: Luke Kanies <luke@reductivelabs.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This commit is hopefully less messy than it
first appears, but it's certainly cross-cutting.
The reason for all of this is that we previously only
looked up builtin resource types from outside the parser,
but now that the defined resource types are available globally
via environments, we can push that lookup code to Resource.
Once we do that, however, we have to have environment and
namespace information in every resource.
Here I remove the Resource::Reference classes (except
the AST class), and use Resource instances instead. I
did this because the shared code between the two classes
got incredibly complicated, such that they should have had
a hierarchical relationship disallowed by their constants.
This complexity convinced me just to get rid of References
entirely.
I also make Puppet::Parser::Resource a subclass
of Puppet::Resource.
There are still broken tests in test/, but this was a big
enough commit I wanted to get it in.
Signed-off-by: Luke Kanies <luke@reductivelabs.com>
|
|
|
|
|
|
|
|
|
| |
This is functional syntactically but not yet through
the whole system, because of the changes made to
how resource types are managed. See the next
commit for that fix.
Signed-off-by: Luke Kanies <luke@reductivelabs.com>
|
|
|
|
|
|
|
| |
These were also set to true and are holdovers
from YAGNI stuff from years ago.
Signed-off-by: Luke Kanies <luke@reductivelabs.com>
|
|
|
|
|
|
|
|
|
| |
This can happen because we're almost always converting
to environment instances from strings.
Shouldn't happen often, but it's easier to be more failure-tolerant.
Signed-off-by: Luke Kanies <luke@reductivelabs.com>
|
|
|
|
|
|
|
|
|
| |
We previously only supported a single namespace when searching for
resource types et al, but the whole system actually relies on
an array of namespaces and search paths, so this adds
that functionality all the way down, as it were.
Signed-off-by: Luke Kanies <luke@reductivelabs.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This will allow us to remove all of the parameter
validation from the other Resource classes.
This is possible because resource types defined
in the language are visible outside of the parser,
via the environment.
This will enable lots of code removal and simplication.
Signed-off-by: Luke Kanies <luke@reductivelabs.com>
|
|
|
|
| |
Signed-off-by: Luke Kanies <luke@reductivelabs.com>
|
|
|
|
| |
Signed-off-by: Luke Kanies <luke@reductivelabs.com>
|
|
|
|
| |
Signed-off-by: Luke Kanies <luke@reductivelabs.com>
|
|
|
|
| |
Signed-off-by: Luke Kanies <luke@reductivelabs.com>
|
|
|
|
|
|
|
|
| |
We need the ability to set the namespace and
environment at initialization so the resource
can look up qualified types.
Signed-off-by: Luke Kanies <luke@reductivelabs.com>
|
|
|
|
|
|
|
|
| |
This isn't 100% functional yet - I need to refactor
some of the internals to make the class lookup work
everywhere.
Signed-off-by: Luke Kanies <luke@reductivelabs.com>
|
|
|
|
| |
Signed-off-by: Luke Kanies <luke@reductivelabs.com>
|
|
|
|
|
| |
Ruby was spewing warnings that there weren't enough parentheses.
I have fixed this by adding parentheses.
|
| |
|
|
|
|
| |
Force FileBucket to always send absolute (real) paths
|
|
|
|
|
|
| |
This change to the REST branch restores some sanity by explicitly
allowing a destination URL for indirector save() calls,
removing a hack that I was using to accomplish this.
|
|
|
|
| |
puppetrun uses REST to trigger puppet runs.
|
|
|
|
| |
Rename Puppet::Agent::Runner to Puppet::Run, for consistency
|
|
|
|
|
|
|
| |
The XMLRPC interface for RAL resources was broken, and has been
completely replaced by the REST interface.
Signed-off-by: Jesse Wolfe <jes5199@gmail.com>
|
|
|
|
|
|
|
|
| |
ralsh --host works now, and is using REST.
A node running puppetd --listen will allow ralsh to find, search, and
modify live resources, via REST.
Signed-off-by: Jesse Wolfe <jes5199@gmail.com>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
FileBucket Files have been reimplemented as an indirector terminus so that
they can be transmitted over REST.
The old Network::Client.dipper has been replaced with a compatibility later
in FileBucket::Dipper that uses the indirector to access filebucket termini.
Slightly revised patch:
* No longer allows nil contents in FileBucket outside of initialization
* Uses File.exist? instead of the deprecated File.exists?
* Tweaks JSON serialization and de-serialization to include "path"
Deferred issues:
* Feature #3371 "FileBucket should not keep files in memory".
* Feature #3372 "Replace FileBucket Dipper with more idiomatic calls"
|
|
|
|
| |
Signed-off-by: Jesse Wolfe <jes5199@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch re-implements the status() remote procedure as a REST interface.
A running server returns key-value pairs, currently the only implemented
key is "is_alive" which will always be set to true.
Some future tool will consume this by:
Puppet::Status.indirection.terminus_class = :rest
Puppet::Status.find('https://puppet:8140/production/status/default')
Now with unit tests.
plus fixes a typo.
plus integration test and default security setting.
plus tests suggested by Brice.
Signed-off-by: Jesse Wolfe <jes5199@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The issue is that case/selectors are downcasing the value before it
is compared to the options.
Unfortunately regex are matching in a case sensitive way, which would
make the following manifest fail:
$var = "CaseSensitive"
case $var {
/CaseSensitive/: {
notice("worked")
}
default: {
fail "miserably"
}
}
This patch fixes the issue by making sure the regexp match is done
one the original (not downcased) value, but still doing a case
sensitive match.
Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
|
|
|
|
| |
Signed-off-by: Luke Kanies <luke@madstop.com>
|
|
|
|
| |
Signed-off-by: Luke Kanies <luke@madstop.com>
|
|
|
|
|
|
|
|
|
|
| |
This fixes most of #1943, except the checksum indirection
still uses this.
This basically always chooses the most recent file when
finding files, and saves the file with the default format.
Signed-off-by: Luke Kanies <luke@madstop.com>
|
|
|
|
| |
Signed-off-by: Luke Kanies <luke@madstop.com>
|
|
|
|
|
|
|
|
| |
These replace the yaml and file dirs,
since in #1943 we're merging the file and yaml
Terminus classes.
Signed-off-by: Luke Kanies <luke@madstop.com>
|
|
|
|
|
|
|
|
| |
This is toward fixing #1943 - we need the ability
to easily convert between file extensions and file
formats.
Signed-off-by: Luke Kanies <luke@madstop.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>
|
|
|
|
|
|
|
| |
It's no longer necessary, given the new ResourceTypeCollection
class.
Signed-off-by: Luke Kanies <luke@reductivelabs.com>
|
|
|
|
|
|
|
|
|
| |
We now use references to the ResourceTypeCollection
instances through the environment, which is much cleaner.
The next step is to remove the Interpreter class.
Signed-off-by: Luke Kanies <luke@reductivelabs.com>
|
|
|
|
|
|
|
| |
We previously passed a hash of options but now just
the environment.
Signed-off-by: Luke Kanies <luke@reductivelabs.com>
|
|
|
|
|
|
|
|
|
|
| |
We previously defined the method statically.
This also renames the method to match how the environment
thinks of them - known resource types, rather than resource
type collection.
Signed-off-by: Luke Kanies <luke@reductivelabs.com>
|
|
|
|
|
|
|
| |
This stops hiding some really difficult to track down
problems.
Signed-off-by: Luke Kanies <luke@reductivelabs.com>
|
|
|
|
|
|
|
| |
This is so everyone doesn't have to define the same method
everywhere.
Signed-off-by: Luke Kanies <luke@reductivelabs.com>
|
|
|
|
|
|
|
| |
It was previously handled by the Interpreter,
but we're planning on getting of that.
Signed-off-by: Luke Kanies <luke@reductivelabs.com>
|
|
|
|
|
|
|
|
|
| |
This is the last step enabling us to make it so no one
needs to maintain these references to the parser. Instead,
everyone will just get access to the type collection from
the Environment.
Signed-off-by: Luke Kanies <luke@reductivelabs.com>
|