diff options
author | Luke Kanies <luke@madstop.com> | 2007-11-28 15:56:24 -0600 |
---|---|---|
committer | Luke Kanies <luke@madstop.com> | 2007-11-28 15:56:24 -0600 |
commit | bbf8a8bfc6a817ea19c4dabe3ce89f09d42df68d (patch) | |
tree | 82ed142f31a6643b869de4316283e29da0add906 /lib | |
parent | 11ae473e3852adcc382a3efea2329586d2e4bcb3 (diff) | |
download | puppet-bbf8a8bfc6a817ea19c4dabe3ce89f09d42df68d.tar.gz puppet-bbf8a8bfc6a817ea19c4dabe3ce89f09d42df68d.tar.xz puppet-bbf8a8bfc6a817ea19c4dabe3ce89f09d42df68d.zip |
Making a few changes to the transportable class to enhance backward compatibility
Diffstat (limited to 'lib')
-rw-r--r-- | lib/puppet/transportable.rb | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/lib/puppet/transportable.rb b/lib/puppet/transportable.rb index a448e28a5..615a95d2b 100644 --- a/lib/puppet/transportable.rb +++ b/lib/puppet/transportable.rb @@ -207,11 +207,18 @@ module Puppet end def to_ref - return nil unless self.type and self.name unless defined? @ref - @ref = Puppet::ResourceReference.new(self.type, self.name) + if self.type and self.name + @ref = Puppet::ResourceReference.new(self.type, self.name) + elsif self.type and ! self.name # This is old-school node types + @ref = Puppet::ResourceReference.new("node", self.type) + elsif ! self.type and self.name + @ref = Puppet::ResourceReference.new("component", self.name) + else + @ref = nil + end end - @ref.to_s + @ref.to_s if @ref end def to_type |