Граф коммитов

5483 Коммитов

Автор SHA1 Сообщение Дата
Luke Kanies 0b95a8528e Working #3139 - scheduling moved to resource harness
We previously had the schedule checking code in Puppet::Type,
but it's more of a transactional function, and in order to
do proper auditing in the transactional area, we need the
cache checking done there.  Scheduling is one
of the few functions that actually uses cached data currently.

Signed-off-by: Luke Kanies <luke@puppetlabs.com>
2010-02-17 06:50:53 -08:00
Markus Roberts 4627b8fe11 Improving fix for #1175; tightening thread safety
The previous code maintained thread safety up to work-duplication (so that a
collision would, at worse, result in effective cache flushing and cause some
additional work to be done).  The preceding patch addressed the single thread
issue of environment specific functions; this patch brings the thread safety
up to the previous standard.
2010-02-17 06:50:53 -08:00
Markus Roberts ccc869ea48 Part 2 of fix for #1175 (functions in environments)
Jesse and I are shooting for the minimal viable fix here, with the idea that
a great deal of refactoring is needed but isn't appropriate at this time.  The
changes in this commit are:

* Index the function-holding modules by environment

* We need to know the "current environment" when we're defining a function so
we can attach it to the proper module, and this information isn't dynamically
available when user-defined functions are being created (we're being called by
user written code that doesn't "know" about environments) so we cheat and
stash the value in Puppet::Node::Environment

* since we must do this anyway, it turns out to be cleaner & safer to do the
same when we are evaluating a functon.  This is the main change from the prior
version of this patch.

* Add a special *root* environment for the built in functions, and extend all
scopes with it.

* Index the function characteristics (name, type, docstring, etc.) by environment

* Make the autoloader environment aware, so that it uses the modulepath for the
specified environment rather than the default

* Turn off caching of the modulepath since it potentially changes for each node

* Tweak tests that weren't environment aware
2010-02-17 06:50:53 -08:00
Jesse Wolfe 7c6b883645 [#1621] Composite keys for resources
This patch implements the fundamental pieces of the move to composite
keys:
    * Instead of having a single namevar, we have a non-empty collection
      of them, and two resources are the same if and only if all of them
      match.  Note that the present situation is a special case of this,
      where the collection always has exactly one member.
    * As currently, namevar is determined by the type.
    * Instead just of inferring the single namevar from the title we let
      types decompose the title into values for several (perhaps all) of
      the namevar components; note that the present situation is again a
      special case of this.

Signed-off-by: Jesse Wolfe <jes5199@gmail.com>
2010-06-21 14:15:25 -07:00
Markus Roberts 2396ebac90 Use the 'root' feature rather than directly checking the uid
Jesse fixed all these but David and others moved them and introduced some more so...
2010-02-17 06:50:53 -08:00
Jesse Wolfe 8128311690 fix tests to reflect methods moved from type/file/owner to provider/file/posix 2010-02-17 06:50:53 -08:00
Jesse Wolfe 28702a4128 variable name error in refactor 2010-02-17 06:50:53 -08:00
Jesse Wolfe 19c70b501a Remove over-eager error branch in a complicated If 2010-02-17 06:50:53 -08:00
Jesse Wolfe 09881cf0e2 Confine out a lib that puppet was failing to load on non-win32 2010-02-17 06:50:53 -08:00
Jesse Wolfe d72fd9d8fc Confine out tests that fail on unix 2010-02-17 06:50:53 -08:00
Jesse Wolfe d1b86ec961 Behavior change for //UNC_Paths broke an old test 2010-02-17 06:50:53 -08:00
Markus Roberts ba506c1990 Resolving conflicts with jes5199:ticket/master/2935-settings-mode
Jesse moved the code David was patching; the conflict resolution omits David's
change (since the code isn't there to be changed) and this moves the change to
the new location.
2010-02-17 06:50:53 -08:00
David Schmitt f15a32461d Fix Exec type 2010-02-17 06:50:53 -08:00
David Schmitt 86bd838770 Move syslog into a feature 2010-02-17 06:50:53 -08:00
David Schmitt fc92408b77 Adapt Util::Storage specs and avoid trying to lock on directories 2010-02-17 06:50:53 -08:00
David Schmitt 58100ed223 Relax path qualification check on FileServing::Fileset 2010-02-17 06:50:53 -08:00
David Schmitt 1c016a1ed4 Implement quoting on the exec commands and repair specs 2010-02-17 06:50:53 -08:00
David Schmitt 6a928940a4 Avoid trying to symlink() on windows 2010-02-17 06:50:53 -08:00
David Schmitt 47c9dd16df Implement "forking" for Windows 2010-02-17 06:50:53 -08:00
David Schmitt c59d864ecd Avoid non-win32 signals on win32 runtime 2010-02-17 06:50:53 -08:00
David Schmitt bbba9f9f52 Avoid trying to set uid/gid on windows 2010-02-17 06:50:53 -08:00
David Schmitt a90bcb08c3 Start extracting the owner managment for files into providers 2010-02-17 06:50:53 -08:00
David Schmitt b51be2809a Expand file type to be able to handle Win32 and UNC paths
Win32 paths start with a drive letter, a colon and a slash;
UNC paths start with two slashes, the name of the server and another slash.

Signed-off-by: David Schmitt <david@dasz.at>
2010-02-17 06:50:53 -08:00
James Turnbull 17a9ad16e9 Updated version to 2.6.0 2010-06-10 10:02:22 +10:00
James Turnbull a2e809bbb2 Fixed RSpec deprecation notice in lexer tests 2010-06-10 09:49:10 +10:00
David Schmitt f054d5b6ab Make specs work on win32
lib/:
* Fix Puppet::Parser::Files
* Fix Puppet::Util::Settings

spec/:
* unit/application/kick.rb: only run on posix
* unit/application.rb
* unit/parser/compiler.rb
* unit/parser/files.rb
* unit/resource.rb
* unit/resource/catalog.rb
* unit/resource/type_collection.rb
* unit/transaction.rb
* unit/type/tidy.rb
* unit/util/settings.rb
* unit/util/settings/file_setting.rb
* unit/application.rb
2010-02-17 06:50:53 -08:00
David Schmitt 54c453853d Delete tempfiles on win32 2010-02-17 06:50:53 -08:00
David Schmitt 97c043f440 Fix path handling
*) Use File.expand_path as indicator for being an absolute path
*) Use basename instead of parsing the path manually
2010-02-17 06:50:53 -08:00
David Schmitt f80b4c73bb Print stacktraces if requested 2010-02-17 06:50:53 -08:00
David Schmitt 1d98e679a0 Adapt defaults to Win32 environment
This needs the workaround from http://rubyforge.org/tracker/index.php?func=detail&aid=28206&group_id=85&atid=411
2010-02-17 06:50:53 -08:00
David Schmitt ea9bb49266 More win32? feature def 2010-02-17 06:50:53 -08:00
David Schmitt 1645d8e7ca Define posix and win32 features 2010-02-17 06:50:53 -08:00
David Schmitt b3aa3ecdc5 Improve error message 2010-02-17 06:50:53 -08:00
David Schmitt d67f60fc16 Fix ProviderDpkg specs to avoid any real executions 2010-02-17 06:50:53 -08:00
David Schmitt e119b04f77 Avoid setting the timeout before we know which timeout we should set.
Signed-off-by: David Schmitt <david@dasz.at>
2010-02-17 06:50:53 -08:00
David Schmitt d40e6d4bb6 Bug: tidy specs need FileBucket::Dipper 2010-02-17 06:50:53 -08:00
David Schmitt a6b52bb01b Avoid trying to lock on non-files
This is not supported on windows and makes little sense on POSIX
2010-02-17 06:50:53 -08:00
Luke Kanies 533ef68e47 Removing obsolete FCollection stub from Functions
Signed-off-by: Luke Kanies <luke@puppetlabs.com>
2010-02-17 06:50:53 -08:00
Luke Kanies bc90df6e7c Functions are added to a module instead of Scope
We were previously adding them directly to Scope, but
now they're in a module that Scope includes.

This is the first half of #1175 - we can now maintain
environment-specific collections of functions.  We need
some way of tracking which environment a given function
is loaded from.

Well, maybe it's the first third - the core functions
probably need to be added to all of these modules,
or there needs to be a 'common' module that is included by
all of them.

Signed-off-by: Luke Kanies <luke@reductivelabs.com>
2010-02-17 06:50:53 -08:00
Luke Kanies 17e40e7451 Slightly restructuring "Functions" file
Signed-off-by: Luke Kanies <luke@reductivelabs.com>
2010-02-17 06:50:53 -08:00
Rein Henrichs 9d0a38ee1b [#3921] Add facts_terminus setting to Puppet settings
* defaults to "facter"
2010-02-17 06:50:53 -08:00
Rein Henrichs 2874729efa [#3921] Remove unnecessary require 'puppet/resource'
* Remove require statements
* explicity define namespace modules/classes for
  Puppet::Resource::Status to avoid require dependency cycle.
2010-02-17 06:50:53 -08:00
Markus Roberts 58a3d27f30 Fix for #3949 and related
Syck/Yaml quietly passes on undefined classes as strings, so that if objects
of those classes are loaded and re-serialized they passthrough unmodified.
While not technically correct, it's still the POLS behavior, and we now support
it.
2010-02-17 06:50:53 -08:00
James Turnbull b755f7faaf Fixed #3912 - Added client certificate name as an internal fact called "clientcert" 2010-02-17 06:50:53 -08:00
Matt Robinson b5f14c6eea {#3866] Rename the method metaclass to singleton_class to avoid the deprecation warnings from Rails ActiveSupport
The metaid.rb file came straight from why the lucky stiff's "seeing
metaclasses clearly" article.  Rails used this too, but they recently
deprecated the name metaclass in favor of singleton_class to match what
ruby-core decided to do.  meta, eigen and singlton class were all
suggested and in the end singleton was agreed upon.

http://redmine.ruby-lang.org/issues/show/1082
2010-02-17 06:50:53 -08:00
Luke Kanies 2b5bd49275 Fixing #3822 - checksums will be loaded from filebuckets
If you have the following code or equivalent:

    file { "/foo": content => "{md5}foobar" }

Puppet will attempt to pull the content associated with
that file from whatever the default filebucket is for the
resource in question.

Signed-off-by: Luke Kanies <luke@puppetlabs.com>
2010-02-17 06:50:53 -08:00
Luke Kanies 94390de11d foo
Signed-off-by: Luke Kanies <luke@puppetlabs.com>
2010-02-17 06:50:53 -08:00
Luke Kanies 3b7aac584f For #3822 - Reducing checksum code duplication
The FileBucket code had a bunch of checksum code
that was already available in a library, and it used a
checksum format (type + data) that was incompatible with
what we were using everywhere else.

This just fixes that code duplication.

Signed-off-by: Luke Kanies <luke@puppetlabs.com>
2010-02-17 06:50:53 -08:00
Ross West ca7b166dfb Fixed unsupported perlstyle regex and few other minor bugs
Signed-off-by: Ross West <westr@connection.ca>
2010-02-17 06:50:53 -08:00
Ross West 85f2565ad3 Signed-off-by: Ross West <westr@connection.ca>
Code cleanup/spacing fixed
2010-02-17 06:50:53 -08:00