<feed xmlns='http://www.w3.org/2005/Atom'>
<title>puppet.git/lib/puppet/node, branch ticket/master/7841</title>
<subtitle>Puppet repo</subtitle>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/ricky/public_git/puppet.git/'/>
<entry>
<title>Fix issue with forward and backslashes in Windows paths</title>
<updated>2011-07-26T21:55:55+00:00</updated>
<author>
<name>Josh Cooper</name>
<email>josh@puppetlabs.com</email>
</author>
<published>2011-07-22T19:44:15+00:00</published>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/ricky/public_git/puppet.git/commit/?id=9279d0954eb20d75e18a666fd572b5492e157608'/>
<id>9279d0954eb20d75e18a666fd572b5492e157608</id>
<content type='text'>
The environment validates its modulepath and manifestdir settings, but
it uses Dir.getwd to convert a relative path into an absolute path. The
problem is that on Windows, Dir.getwd returns a path with backslashes.
(Interestingly this only happens when puppet is loaded, not in irb for
example.) And since we do not yet support backslashes in Windows paths
or UNC paths, the directory is not included in the environment.

For the time being, I am using File.expand_path to normalize the path.
It has the side-effect of converting backslashes to forward slashes.
This is sufficient to work around backslashes in Dir.getwd. In the near
future, I will be refactoring how paths are split, validated, tested,
etc, and I have a REMIND in place to fix the environment.

But as a result of this change it exposed a bug in our rdoc parser
dealing with the finding the root of a path. The parser assumed that the
root was '/', but caused an infinite loop when passed a Windows path.

I added a test for this case, which is only run on Windows, because on
Unix File.dirname("C:/") == '.'.

After all of that, I had to disable one of the rdoc spec tests, because
it attempted to reproduce a specific bug, which caused rdoc to try to
create a directory of the form: C:/.../files/C:/.... Of course, this
fails because ':' is not a valid filename character on Windows.

Paired-with: Nick Lewis &lt;nick@puppetlabs.com&gt;
Reviewed-by: Jacob Helwig &lt;jacob@puppetlabs.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The environment validates its modulepath and manifestdir settings, but
it uses Dir.getwd to convert a relative path into an absolute path. The
problem is that on Windows, Dir.getwd returns a path with backslashes.
(Interestingly this only happens when puppet is loaded, not in irb for
example.) And since we do not yet support backslashes in Windows paths
or UNC paths, the directory is not included in the environment.

For the time being, I am using File.expand_path to normalize the path.
It has the side-effect of converting backslashes to forward slashes.
This is sufficient to work around backslashes in Dir.getwd. In the near
future, I will be refactoring how paths are split, validated, tested,
etc, and I have a REMIND in place to fix the environment.

But as a result of this change it exposed a bug in our rdoc parser
dealing with the finding the root of a path. The parser assumed that the
root was '/', but caused an infinite loop when passed a Windows path.

I added a test for this case, which is only run on Windows, because on
Unix File.dirname("C:/") == '.'.

After all of that, I had to disable one of the rdoc spec tests, because
it attempted to reproduce a specific bug, which caused rdoc to try to
create a directory of the form: C:/.../files/C:/.... Of course, this
fails because ':' is not a valid filename character on Windows.

Paired-with: Nick Lewis &lt;nick@puppetlabs.com&gt;
Reviewed-by: Jacob Helwig &lt;jacob@puppetlabs.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Rework Puppet::Util::Cacher to only expire using TTLs</title>
<updated>2011-07-22T03:10:28+00:00</updated>
<author>
<name>Nick Lewis</name>
<email>nick@puppetlabs.com</email>
</author>
<published>2011-07-21T18:53:06+00:00</published>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/ricky/public_git/puppet.git/commit/?id=d198fedf65e472b384666fc9ae3bef487852068a'/>
<id>d198fedf65e472b384666fc9ae3bef487852068a</id>
<content type='text'>
We have removed every usage of cached_attr in which the attribute needs to be
manually expired. Thus, the only meaningful behavior provided by
Puppet::Util::Cacher is expiration based on TTLs. This commit reworks the
cacher to only support that behavior.

Rather than accepting an options hash, of which :ttl is the only available
option, cached_attr now requires a second argument, which is the TTL.

TTLs are now used to compute expirations, which are stored and used for
expiring values. Previously, we stored a timestamp and used it and the TTL to
determine whether the attribute was expired. This had the potentially
undesirable side effect that the lifetime of a cached attribute could be
extended after its insertion by modifying the TTL setting for the cache. Now,
the lifetime of an attribute is determined when it is set, and is thereafter
immutable, aside from deliberately re-setting the expiration for that
particular attribute.

Reviewed-By: Jacob Helwig &lt;jacob@puppetlabs.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
We have removed every usage of cached_attr in which the attribute needs to be
manually expired. Thus, the only meaningful behavior provided by
Puppet::Util::Cacher is expiration based on TTLs. This commit reworks the
cacher to only support that behavior.

Rather than accepting an options hash, of which :ttl is the only available
option, cached_attr now requires a second argument, which is the TTL.

TTLs are now used to compute expirations, which are stored and used for
expiring values. Previously, we stored a timestamp and used it and the TTL to
determine whether the attribute was expired. This had the potentially
undesirable side effect that the lifetime of a cached attribute could be
extended after its insertion by modifying the TTL setting for the cache. Now,
the lifetime of an attribute is determined when it is set, and is thereafter
immutable, aside from deliberately re-setting the expiration for that
particular attribute.

Reviewed-By: Jacob Helwig &lt;jacob@puppetlabs.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>(#8268) Require windows drive letters in absolute file paths</title>
<updated>2011-07-19T21:03:42+00:00</updated>
<author>
<name>Josh Cooper</name>
<email>josh@puppetlabs.com</email>
</author>
<published>2011-07-19T05:44:10+00:00</published>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/ricky/public_git/puppet.git/commit/?id=45ae5b4a9ced26dfcd3e324391f9a26cb02bf93d'/>
<id>45ae5b4a9ced26dfcd3e324391f9a26cb02bf93d</id>
<content type='text'>
When testing whether a file path is absolute, the regexp was only
handling POSIX style file paths. This commit requires Windows
style file paths to start with a drive letter. A future commit
will refacter the various places we do path validation to
support both Windows drive letters and UNC paths.

Reviewed-by: Jacob Helwig &lt;jacob@puppetlabs.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When testing whether a file path is absolute, the regexp was only
handling POSIX style file paths. This commit requires Windows
style file paths to start with a drive letter. A future commit
will refacter the various places we do path validation to
support both Windows drive letters and UNC paths.

Reviewed-by: Jacob Helwig &lt;jacob@puppetlabs.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Making Fact json handling more resilient</title>
<updated>2011-07-15T18:16:09+00:00</updated>
<author>
<name>Luke Kanies</name>
<email>luke@puppetlabs.com</email>
</author>
<published>2011-07-07T07:03:51+00:00</published>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/ricky/public_git/puppet.git/commit/?id=7e5ca648112a2703ba827f96f36fe2a5f7d1c751'/>
<id>7e5ca648112a2703ba827f96f36fe2a5f7d1c751</id>
<content type='text'>
We were failing if any values were nil, and values
were often nil, at least in testing.

We now only include non-nil values, and we handle nil
values just fine.

Signed-off-by: Luke Kanies &lt;luke@puppetlabs.com&gt;
Reviewed-by: Nick Lewis &lt;nick@puppetlabs.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
We were failing if any values were nil, and values
were often nil, at least in testing.

We now only include non-nil values, and we handle nil
values just fine.

Signed-off-by: Luke Kanies &lt;luke@puppetlabs.com&gt;
Reviewed-by: Nick Lewis &lt;nick@puppetlabs.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Revert "Fixing Facts pson methods more resilient"</title>
<updated>2011-04-22T00:20:28+00:00</updated>
<author>
<name>Max Martin</name>
<email>max@puppetlabs.com</email>
</author>
<published>2011-04-21T23:56:03+00:00</published>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/ricky/public_git/puppet.git/commit/?id=2a2226c0b71aafcda953057d3ecc8df5638447f2'/>
<id>2a2226c0b71aafcda953057d3ecc8df5638447f2</id>
<content type='text'>
This reverts commit 07a7a68a25eb9b21189751c27f90f972224ea533.
The JSON patch series has caused problems with the inventory service,
and further discussion is needed to decide how to serialize objects to
PSON with regards to future compatibility.

Conflicts:

	spec/unit/node/facts_spec.rb

Paired-with:Matt Robinson &lt;matt@puppetlabs.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This reverts commit 07a7a68a25eb9b21189751c27f90f972224ea533.
The JSON patch series has caused problems with the inventory service,
and further discussion is needed to decide how to serialize objects to
PSON with regards to future compatibility.

Conflicts:

	spec/unit/node/facts_spec.rb

Paired-with:Matt Robinson &lt;matt@puppetlabs.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Fixing Facts pson methods more resilient</title>
<updated>2011-04-15T00:07:08+00:00</updated>
<author>
<name>Luke Kanies</name>
<email>luke@puppetlabs.com</email>
</author>
<published>2011-04-13T04:01:09+00:00</published>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/ricky/public_git/puppet.git/commit/?id=07a7a68a25eb9b21189751c27f90f972224ea533'/>
<id>07a7a68a25eb9b21189751c27f90f972224ea533</id>
<content type='text'>
They were currently failing if any values were nil,
which happened a lot.

We also prefer not to include nil values, since it muddies
the json unnecessarily.

Reviewed-by: Daniel Pittman &lt;daniel@puppetlabs.com&gt;
Signed-off-by: Luke Kanies &lt;luke@puppetlabs.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
They were currently failing if any values were nil,
which happened a lot.

We also prefer not to include nil values, since it muddies
the json unnecessarily.

Reviewed-by: Daniel Pittman &lt;daniel@puppetlabs.com&gt;
Signed-off-by: Luke Kanies &lt;luke@puppetlabs.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Revert "(#6928) Removed --ignoreimport"</title>
<updated>2011-04-13T23:57:11+00:00</updated>
<author>
<name>Nick Lewis</name>
<email>nick@puppetlabs.com</email>
</author>
<published>2011-04-13T23:57:11+00:00</published>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/ricky/public_git/puppet.git/commit/?id=5915814c47649bb4b957b4be4fcee5919b859451'/>
<id>5915814c47649bb4b957b4be4fcee5919b859451</id>
<content type='text'>
This reverts commit 24a277c5e805ce16e0b86e17e6cb2fbe1945ae07.

Despite not needing --ignoreimport as an option anymore, it's still used
internally and has to stay.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This reverts commit 24a277c5e805ce16e0b86e17e6cb2fbe1945ae07.

Despite not needing --ignoreimport as an option anymore, it's still used
internally and has to stay.
</pre>
</div>
</content>
</entry>
<entry>
<title>(#6928) Removed --ignoreimport</title>
<updated>2011-04-13T22:41:03+00:00</updated>
<author>
<name>Nick Lewis</name>
<email>nick@puppetlabs.com</email>
</author>
<published>2011-04-13T21:38:23+00:00</published>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/ricky/public_git/puppet.git/commit/?id=24a277c5e805ce16e0b86e17e6cb2fbe1945ae07'/>
<id>24a277c5e805ce16e0b86e17e6cb2fbe1945ae07</id>
<content type='text'>
This was only used with --parseonly, which is gone.

Paired-With: Jesse Wolfe
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This was only used with --parseonly, which is gone.

Paired-With: Jesse Wolfe
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge branch '2.6.x' into next</title>
<updated>2011-04-07T19:21:42+00:00</updated>
<author>
<name>Max Martin</name>
<email>max@puppetlabs.com</email>
</author>
<published>2011-04-07T19:21:42+00:00</published>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/ricky/public_git/puppet.git/commit/?id=20bff91c8b8e450d913deeb1750a00a14f1b1061'/>
<id>20bff91c8b8e450d913deeb1750a00a14f1b1061</id>
<content type='text'>
* 2.6.x:
  (maint) Indentation fixes
  (#6490) Add plugin initialization callback system to core
  Fix #4339 - Locally save the last report to $lastrunreport
  Fix #4339 - Save a last run report summary to $statedir/last_run_summary.yaml
  Fixed #3127 - removed legacy debug code
  Fixed #3127 - Fixed gem selection regex
  (#5437) Invalidate cached TypeCollection when there was an error parsing
  (#6937) Adjust formatting of recurse's desc
  (#6937) Document the recurse parameter of File type.
  (#6893) Document the cron type in the case of specials.
  (#5670) Don't trigger refresh from a failed resource
  Fixed #6554 - Missing $haveftool if/else conditional in install.rb breaking Ruby 1.9

Conflicts (Manually resolved):
	lib/puppet/application/agent.rb
	lib/puppet/application/apply.rb
	lib/puppet/configurer.rb
	lib/puppet/resource/type_collection.rb
	lib/puppet/type/file.rb
	spec/integration/configurer_spec.rb
	spec/unit/application/agent_spec.rb
	spec/unit/application/apply_spec.rb
	spec/unit/configurer_spec.rb
	spec/unit/indirector/report/yaml_spec.rb
	spec/unit/resource/type_collection_spec.rb

Paired-with: Nick Lewis
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* 2.6.x:
  (maint) Indentation fixes
  (#6490) Add plugin initialization callback system to core
  Fix #4339 - Locally save the last report to $lastrunreport
  Fix #4339 - Save a last run report summary to $statedir/last_run_summary.yaml
  Fixed #3127 - removed legacy debug code
  Fixed #3127 - Fixed gem selection regex
  (#5437) Invalidate cached TypeCollection when there was an error parsing
  (#6937) Adjust formatting of recurse's desc
  (#6937) Document the recurse parameter of File type.
  (#6893) Document the cron type in the case of specials.
  (#5670) Don't trigger refresh from a failed resource
  Fixed #6554 - Missing $haveftool if/else conditional in install.rb breaking Ruby 1.9

Conflicts (Manually resolved):
	lib/puppet/application/agent.rb
	lib/puppet/application/apply.rb
	lib/puppet/configurer.rb
	lib/puppet/resource/type_collection.rb
	lib/puppet/type/file.rb
	spec/integration/configurer_spec.rb
	spec/unit/application/agent_spec.rb
	spec/unit/application/apply_spec.rb
	spec/unit/configurer_spec.rb
	spec/unit/indirector/report/yaml_spec.rb
	spec/unit/resource/type_collection_spec.rb

Paired-with: Nick Lewis
</pre>
</div>
</content>
</entry>
<entry>
<title>(#5437) Invalidate cached TypeCollection when there was an error parsing</title>
<updated>2011-04-01T18:15:47+00:00</updated>
<author>
<name>Jacob Helwig</name>
<email>jacob@puppetlabs.com</email>
</author>
<published>2011-04-01T18:15:47+00:00</published>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/ricky/public_git/puppet.git/commit/?id=1b66c28fb2ac5f5f10ce32b87ec459a480dcf161'/>
<id>1b66c28fb2ac5f5f10ce32b87ec459a480dcf161</id>
<content type='text'>
The caching of the TypeCollection in Puppet::Node::Environment would cause
parse errors to occur (and be reported) only once and never again, until
the file had changed on disk.  This would also cause empty catalogs to be
sent down to the agents further hiding the problem.

Now, when a file fails to parse, it will be re-parsed every time on every
following compilation, causing the parse error to be reported every time,
and preventing sending down empty catalogs to agents.

Paired-with: Nick Lewis &lt;nick@puppetlabs.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The caching of the TypeCollection in Puppet::Node::Environment would cause
parse errors to occur (and be reported) only once and never again, until
the file had changed on disk.  This would also cause empty catalogs to be
sent down to the agents further hiding the problem.

Now, when a file fails to parse, it will be re-parsed every time on every
following compilation, causing the parse error to be reported every time,
and preventing sending down empty catalogs to agents.

Paired-with: Nick Lewis &lt;nick@puppetlabs.com&gt;
</pre>
</div>
</content>
</entry>
</feed>
