Age | Commit message (Collapse) | Author | Files | Lines |
|
writable? is spelled just like that
A BucketFile is not a Pathname
Removed reference to FileSystem::File
|
|
This changes the API in a new implementation in a file called file_.rb
The intent is that it should replace the implemntation in File,
or perhaps directly in a Puppet::FileSystem class.
|
|
- All previous File and FileTest calls to exist? or exists? go through
the new FileSystem::File abstraction so that the implementation can
later be swapped for a Windows specific one to support symlinks
|
|
|
|
Running specs with rspec 2.13 caused a lot of warnings. Many of them actually
exposed preexisting bugs, the most common being a syntax error when expecting
an Exception. These are worth fixing even if we don't bump to rspec 2.13.
|
|
Without this patch Ruby 1.9 is still complaining loudly about trying to
parse the spec files. The previous attempt to clean up this problem in
edc3ddf works for Ruby 1.8 but not 1.9.
I'd prefer to remove the shebang lines entirely, but doing so will cause
encoding errors in Ruby 1.9. This patch strives for a happy middle
ground of convincing Ruby it is actually working with Ruby while not
confusing it to think it should exec() to rspec.
This patch is the result of the following command run against the source
tree:
find spec -type f -print0 | \
xargs -0 perl -pl -i -e 's,^\#\!\s?/(.*)rspec,\#! /usr/bin/env ruby,'
|
|
* 2.7.x: (26 commits)
Extract host validation in store report processor
Use cross-platform absolute paths in file_serving tests
(#15221) Create /etc/puppet/modules directory for puppet module tool
(Maint:) Fix bad doc strings for two settings ("wether")
Try again to avoid circular dependency in file indirections
Remove useless tests for Envelope
Clear deprecation warnings between tests
Avoid circular requirement in FileMetadata indirection
(Maint) Document common Windows issues
Update CHANGELOG lib/puppet.rb conf/redhat/puppet.spec for 2.7.18
Maint: Note in docs that the file type's "replace" attribute defaults to true
Reject directory traversal in store report processor
Tighten permissions on classfile, resourcefile, lastrunfile, and lastrunreport.
Use "inspect" when listing certificates
Don't allow the creation of SSL objects with invalid certnames
Validate CSR CN and provided certname before signing
Add specs for selector terminuses of file_{content,metadata}
Fix whitespace inside parentheses
Use head method to determine if file is in file bucket
Always use the local file_bucket on master
...
Conflicts:
CHANGELOG
conf/redhat/puppet.spec
lib/puppet.rb
lib/puppet/application/master.rb
lib/puppet/defaults.rb
lib/puppet/file_serving/terminus_selector.rb
lib/puppet/reports/store.rb
lib/puppet/test/test_helper.rb
spec/integration/file_serving/content_spec.rb
spec/integration/file_serving/metadata_spec.rb
spec/shared_behaviours/file_serving.rb
spec/unit/file_serving/terminus_selector_spec.rb
spec/unit/network/handler/ca_spec.rb
test/ral/manager/attributes.rb
|
|
Without this patch some spec files are using `ruby -S rspec` and others
are using `rspec`.
We should standardize on a single form of the interpreter used for spec
files.
`ruby -S rspec` is the best choice because it correctly informs editors
such as Vim with Syntastic that the file is a Ruby file rather than an
Rspec file.
|
|
Previously this would just complain about trying to call `nil.split`.
|
|
As a new-ish puppet user, it is incredibly easy to screw up your
module path (e.g., by adding a directory that directly contains
module/plugin contents to the module path, rather than adding the
*parent* directory. This basically means that there would be a
'lib' directory directly in your module path.)
This commit just adds a few debug messages that may give a user
hints about what could be wrong with their module path when
we are able to detect these sorts of situations.
|
|
plugins
Prior to this if there were no plugins in the modulepath then the plugin mount
(used for pluginsync) would return nil. If the modulepath is valid then the
correct behavior would be to appear as an empty directory, just as a normal
file source would. We can hack this by returning the modulepath and turning
off recursion so it appears empty.
The error message one would see previous is:
Could not evaluate: Could not retrieve information from environment production source(s) puppet://host/plugins
|
|
Allowing this value to be expirable is superfluous; it is only used on the
master, which never expires its cache. Additionally, it was providing partial
support for an event we don't fully support already (hostname and domain
changing during the lifetime of a master).
Reviewed-By: Jacob Helwig <jacob@puppetlabs.com>
(cherry picked from commit 6a1b65760a0d8c6299d5c6d260dc37b5e0637706)
|
|
Allowing this value to be expirable is superfluous; it is only used on the
master, which never expires its cache. Additionally, it was providing partial
support for an event we don't fully support already (hostname and domain
changing during the lifetime of a master).
Reviewed-By: Jacob Helwig <jacob@puppetlabs.com>
|
|
We now use a shebang of: #!/usr/bin/env rspec
This enables the direct execution of spec tests again, which was lost earlier
during the transition to more directly using the rspec2 runtime environment.
|
|
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>
|
|
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
|
|
Replaced 106806 occurances of ^( +)(.*$) with
The ruby community almost universally (i.e. everyone but Luke, Markus, and the other eleven people
who learned ruby in the 1900s) uses two-space indentation.
3 Examples:
The code:
end
# Tell getopt which arguments are valid
def test_get_getopt_args
element = Setting.new :name => "foo", :desc => "anything", :settings => Puppet::Util::Settings.new
assert_equal([["--foo", GetoptLong::REQUIRED_ARGUMENT]], element.getopt_args, "Did not produce appropriate getopt args")
becomes:
end
# Tell getopt which arguments are valid
def test_get_getopt_args
element = Setting.new :name => "foo", :desc => "anything", :settings => Puppet::Util::Settings.new
assert_equal([["--foo", GetoptLong::REQUIRED_ARGUMENT]], element.getopt_args, "Did not produce appropriate getopt args")
The code:
assert_equal(str, val)
assert_instance_of(Float, result)
end
# Now test it with a passed object
becomes:
assert_equal(str, val)
assert_instance_of(Float, result)
end
# Now test it with a passed object
The code:
end
assert_nothing_raised do
klass[:Yay] = "boo"
klass["Cool"] = :yayness
end
becomes:
end
assert_nothing_raised do
klass[:Yay] = "boo"
klass["Cool"] = :yayness
end
|
|
* Replaced 704 occurances of (.*)\b([a-z_]+)\(\) with \1\2
3 Examples:
The code:
ctx = OpenSSL::SSL::SSLContext.new()
becomes:
ctx = OpenSSL::SSL::SSLContext.new
The code:
skip()
becomes:
skip
The code:
path = tempfile()
becomes:
path = tempfile
* Replaced 31 occurances of ^( *)end *#.* with \1end
3 Examples:
The code:
becomes:
The code:
end # Dir.foreach
becomes:
end
The code:
end # def
becomes:
end
|
|
Part 2 re-did the change on the spec files, which it shouldn't have.
|
|
Some spec files like active_record.rb had names that would confuse the
load path and get loaded instead of the intended implentation when the
spec was run from the same directory as the file.
Author: Matt Robinson <matt@puppetlabs.com>
Date: Fri Jun 11 15:29:33 2010 -0700
|
|
Some spec files like active_record.rb had names that would confuse the
load path and get loaded instead of the intended implentation when the
spec was run from the same directory as the file.
Author: Matt Robinson <matt@puppetlabs.com>
Date: Fri Jun 11 15:29:33 2010 -0700
|
|
No message was being displayed on the server if a file could not be
opened by the file server.
Signed-off-by: Jesse Wolfe <jes5199@gmail.com>
|
|
I'd made changes to the internals of the fileserving
system to fix #2544 (mostly switched from passing
the node around and then calculating the environment to just
passing the environment around), but those changes weren't consistent
throughout the fileserving code.
In the process of making them consistent, I realized that the
plain file server actually needs the node name rather than
the environment, so I switched to passing the request around,
because it has both pieces of information.
Also added further integration tests which will hopefully keep
this from cropping up again.
Signed-off-by: Luke Kanies <luke@madstop.com>
|
|
We had to fix the fileserving plumbing to use the request
environment instead of trying to use the node environment.
This was apparently never fixed after we added the environment
to the URI in REST calls.
There's still a bit of refactoring left to clean up the APIs used
in some of this code.
Signed-off-by: Luke Kanies <luke@madstop.com>
|
|
Previously, when you created a module you had to specify
the path. Now Module instances can use the module path
to look up their paths, and there are methods for determining
whether the module is present (if the path is present).
Also cleaned up the methods for figuring out what's in
the module (plugins, etc.).
Signed-off-by: Luke Kanies <luke@madstop.com>
|
|
This switches away from the use of terminii for
each type of fileserving - it goes back to the traditional
fileserving method, and is much cleaner and simpler
as a result.
Signed-off-by: Luke Kanies <luke@madstop.com>
|