Age | Commit message (Collapse) | Author | Files | Lines |
|
This adds checks for the specification's assertions that virutal and
exported resources are not in the produced catalog, but are available
for later operations (realization) and reference (reading a parameter
value). This cannot check that the exported resources are made available
to catalog processors, since that is implementation dependent.
In order to check this the compile_to_catalog method needed to be
changed to filter out expoerted resources, just like the catalog
indirection does. This required a change to the create_resources test.
|
|
When a title array is empty, there are no resources created.
|
|
Prior to this commit, empty string titles did not cause an error.
However according to the specifications, a string should have a
minimum length of one. With this commit, the parser will now
raise an issue when an empty string title is given.
|
|
The implementation for *=> looks to have been a copy-paste from the =>
implementation, however the expression attribute on AttributesOperation
is just `expr` and not `value_expr`.
|
|
This adds tests around the behavior of the current and the future
evaluator's resource instantiation expressions. There are many cases in
the current system where the tests are commented out because there isn't
any consistent behavior.
|
|
There were a few formatting problems with the dump action. This fixes
those up and adds tests around the dump functionality.
|
|
This changes the following:
* Assignment has lower precedence than resource expressions
* Local defaults are supported in resource instantiation expressions
* A Resource body may have a new expression AttributesOperation that
must evaluate to a hash.
* Stricter validation of resource titles
* Changes to TreeModelDumper wrt how BlockExpression is rendered (to
improve debugging output). As a consequence many tests needed
adjustments.
* Tests that previously passed have been modified because of stricter
validation.
This also includes maintenance. Removing dead code/fixing stale comments
and documentation.
|
|
The implementation no longer needs to transform resource expressions
to 3x AST. This changes the transformer to raise an error if attempted.
The spec test for resource transformation is also dropped. No new
test added that transformer raises exceptions for resource
transformation since all transformation eventually will be dropped.
|
|
(PUP-2912) Puppet FS symlinks in build/unpack
|
|
Prior to this commit build/unpack were trying to use the Ruby stdlib symlink to
deal with symlinks. This fails on platforms (Windows) that Puppet says supports
symlinks because it does not duck punch Ruby stdlib.
This commit switches the specs and code for build/unpack to use Puppet FS lib's
symlink functions. This should allow it to function correctly on Windows hosts that Puppet
supports symlinks.
|
|
(PUP-2912) Build/unpack spec tests w/o symlinks
|
|
Prior to this commit we would try to use symlinks in the tests on platforms that
do not support symlinking.
This commit uses the Puppet feature checker to conditionally try the tests if
Puppet thinks the platform supports symlinks (Unixes, Linuxes, Win 2k8+).
|
|
(PUP-2860) optimizations and maintenance
|
|
(PUP-2912) PMT Build symlink exception
|
|
Prior to this commit a malformed name in the dependencies for a downloaded forge
module dependency would cause the PMT to fail unexpectedly.
This commit causes the PMT to ignore malformed dependencies.
|
|
|
|
fiddyspence/feature/2945/warning_on_windows_package_source
(PUP-398) Windows package provider source munging and test
|
|
Adding spec tests to check for symlinks in build/install.
|
|
Adding munge and slashreplace method to windows package provider
to ensure successful installation of packages. Validation in the
type validate() not possible because we haven't chosen a provider
at that point. Outputs debug as a means of notifying the user that
the source has been changed.
|
|
adrienthebo/fixup/master/pup-2871-install-uninstall-options-pacman
Fixup/master/pup 2871 install uninstall options pacman
|
|
Prior to this commit there wasn't much verification for module dependencies.
This commit adds verification the module dependencies have sane names and version
ranges. If verification fails, it will raise an argument exception.
|
|
These methods should not be called by any outside class; this commit
makes them private and removes the tests that invoke them directly.
|
|
In the same manner as 9137faf uninstall_options were being appended as a
nested array value; this commit changes the uninstall method to
concatentate options to the array.
|
|
Before this commit, install_options were passed as a nested array to
pacman/yaourt. This commit changes that to concatentate the values
with the argument vector.
|
|
|
|
|
|
Since all types now are PAnyType, there is no need to have
an extra abstratin called PAbstractType, it just adds level in
the ancestor hierarchy that needs to be consulted for methods, one
extra step to go when checking is_a? against PAbstractType instead of
PAnyType, etc.
|
|
The old (intermediate) lexer was still hanging around even if it was
not being used. Cycles were also wasted on unit testing it.
The new lexer "Lexer2" has been in use for quite some time and the
old lexer is not useful even as a reference at this point.
This speeds up both loading and unit testing.
|
|
(maint) Add test to ensure upstart is default init daemon in Ubuntu
|
|
Re-word the description of a test in `webrick_spec.rb` as it is testing the
behavior of `masterhttplog` and not `masterlog`.
|
|
(maint) Remove pending face specs
|
|
Previously, it was possible for puppet to create an HTTPS connection
with VERIFY_NONE, and cache the connection. As a result, the pool code
could hand out an insecure connection, when the caller expected a secure
one (VERIFY_PEER).
In practice this isn't an issue, because puppet only uses insecure HTTPS
connections when bootstrapping its SSL key and certs, and that happens
before `Configurer#run` overrides the default non-caching pool
implementation. However, it could be an issue if a provider were to
request a insecure connection *during* catalog application, as that
connection would be cached, and possibly reused by puppet, e.g. when
sending the report.
This commit modifies the connection pool to only cache HTTP or secure
HTTPS connections. All other connections are closed after one HTTP
request/response.
|
|
Add yard doc for http pooling. Also adds a test to verify multiple
persistent connections can be borrowed from the pool.
|
|
Remove expectations that were secondary to the actual test, also
clarify behavior that was being tested.
|
|
Previously, I was concerned that a caller could borrow a connection
from the pool, and perform a long operation before returning it to the
pool. That could make it trivial for the caller to add expired
connections back to the pool, and cause issues for the next HTTP
request.
However, that is not likely, because connections are only borrowed for
the duration of the `Connection#get`, `#post`, etc calls, and those
methods don't take a block. The connection methods that do take a
block, e.g. `#request_get` are deprecated, and are not used within
puppet.
|
|
Previously, the `redirect_limit` specified the maximum number of HTTP
requests that the connection would make, not the maximum number of
redirects that it would follow. As a result, a limit of 0 would prevent
any HTTP requests from being made. This was introduced in 60f22eb1 when
the redirect logic was added.
This commit changes the limit so that 0 means don't follow redirects,
1 means follow one redirect, etc.
|
|
Previously, the connection would mutate its host, port, etc when
following redirects. This wasn't really an issue, because connections
were always single use.
Now that connections can be cached, we do not want to mutate the
original site information even when following permanent redirects.
|
|
Previously, the `Connection#connection` method was used in
`connection_spec.rb` to validate the state of the Net::HTTP object
created by the puppet connection.
Since the puppet connection no longer owns an Net::HTTP object (it may
use newly created or cached instances), the `#connection` method
doesn't make sense, and since it was private, can be removed.
The tests that relied on the private method have been updated, and in
some cases moved to the factory_spec, e.g. verifying proxy settings.
|
|
When starting a persistent HTTP connection, we do not expliclty specify
`Connection: Keep-Alive`, because that is the default in HTTP/1.1[1].
This commit adds a test to ensure we are using HTTP 1.1 or later.
Amazingly ruby has defaulted to 1.1 as far back as ruby 1.8.7[2].
[1] http://tools.ietf.org/html/rfc7230#appendix-A.1.2
[2] https://github.com/ruby/ruby/blob/v1_8_7/lib/net/http.rb#L282
|
|
The puppet connection class doesn't have an ssl_host instance variable.
|
|
Previously, the puppet connection class owned the Net::HTTP factory and
passed it to the pool when requesting a connection. However, the caching
pool only needs the factory when creating a new connection.
This commit makes the factory stateless and pushes it into the
respective pools. The SSL verifier is stateful (contains peer certs)
and remains in puppet's connection class.
When a pool needs to create a connection, it calls back into the puppet
connection object to initialize SSL on the Net::HTTP object. In the case
of the caching poool, it needs to do this before starting the
connection, which will perform the TCP connect and SSL handshake
operations.
|
|
DummyPool was a bad name, renaming to what it actually does.
|
|
Previously, the dummy and caching pools allowed the caller to take a
connection from the pool and retain ownership of the connection. This is
undesirable because if the caller encounters an exception while using
the connection, then they have to remember to close it, otherwise the
underlying socket will leak.
There is also the issue that a caller may forget to add it back to the
pool before the pool is closed, in which case the socket will again
leak.
This commit changes the api to a block form to ensure connections are
always returned to the pool or closed.
Note the `reuse` flag is used to ensure the connection is returned to
the pool even if the caller does a non-local return:
with_connection(..) { |conn| return }
|
|
This commit adds a pool for caching puppet network connections. The pool
maintains a hash indexed by site. Each site refers to an array of
sessions, where each session refers to a puppet HTTP connection and its
timeout.
It is expected the consumers of the pool will follow the pattern:
conn = pool.take_connection(site)
# do something with conn
pool.add_connection(site, conn)
Whenever a connection is (re-)added to the pool, the pool will assign a
expiration timeout. When a caller next requests a connection, the pool
will lazily close any expired connection(s) for that site.
The timeout exists, because if there is a long delay between the time
that an open connection is added to the pool and when it is taken, the
remote peer may close the connection, e.g. apache. As a result, we
only want to cache connections for a short time. Currently the timeout
defaults to 15 seconds.
|
|
This commit adds a DummyPool that doesn't perform any caching of network
connections. It also adds the pool to the context system, but does so
using a Proc to defer evaluation of the pool. This way we are not
loading networking code while bootstrapping puppet.
|
|
Previously, puppet connections were directly responsible for creating
Net::HTTP objects. This was okay because there was only one code path
where new Net::HTTP objects needed to be created.
However, in order to support different connection pool behaviors,
caching and non-caching of Net::HTTP objects, we want to have two pool
implementations, and each of them will need the ability to create
Net::HTTP objects.
This commit creates a factory object for creating Net::HTTP objects,
and has the puppet connection delegate to it.
|
|
An HTTP session binds a puppet HTTP connection and an expiration time.
|
|
This commit adds a site helper method for use_ssl?
|
|
This commit adds a Site#move_to method that creates a new site pointing
to a new location. Note that we don't preserve the path from the new
site, as sites are only concerned with the HTTP connection layer, not
the HTTP request path and query parameters.
|
|
This commit creates a site value object containing a scheme, host, and
port. A site identifies an HTTP(S) connection. It does not currently
take into account proxy host, port, user, password, as these are global
puppet settings.
The Site class defines the `eql?` and `hash` methods making it suitable
for use as the key in a hash table.
|