Created
September 27, 2012 08:16
-
-
Save dcarley/3792838 to your computer and use it in GitHub Desktop.
Unable to access original regex from Puppet HostClass
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[1] pry(main)> require 'puppet' | |
=> true | |
[2] pry(main)> Puppet[:code] = "node /^foo\.\d{2}\.bar$/ {}" | |
=> "node /^foo.d{2}.bar$/ {}" | |
[3] pry(main)> node = Puppet::Node::Environment.new(Puppet[:environment]).known_resource_types.nodes.first | |
=> ["foo.d2.bar", | |
#<Puppet::Resource::Type:0x7f6fcc5f5fd0 | |
@arguments={}, | |
@doc="", | |
@line=1, | |
@name=/^foo.d{2}.bar$/, | |
@namespace="", | |
@resource_type_collection= | |
TypeCollection{:hostclasses=>[], :definitions=>[], :nodes=>["foo.d2.bar"]}, | |
@type=:node>] | |
[4] pry(main)> node.last.name | |
=> "foo.d2.bar" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
node.last.instance_var_get(:@name)