Jira (PUP-8301) Puppet::Type.eachtype raises an error instead of returning nil if no types are loaded

2 views
Skip to first unread message

Henrik Lindberg (JIRA)

unread,
Jan 8, 2018, 9:42:03 AM1/8/18
to puppe...@googlegroups.com
Henrik Lindberg updated an issue
 
Puppet / Bug PUP-8301
Puppet::Type.eachtype raises an error instead of returning nil if no types are loaded
Change By: Henrik Lindberg
Summary: Puppet::Type.eachtype raises an error instead of returning nil  of  if  no types are loaded
Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v7.0.2#70111-sha1:88534db)
Atlassian logo

Henrik Lindberg (JIRA)

unread,
Jan 8, 2018, 9:44:03 AM1/8/18
to puppe...@googlegroups.com

Glenn Sarti (JIRA)

unread,
Jan 8, 2018, 10:00:15 AM1/8/18
to puppe...@googlegroups.com
Glenn Sarti commented on Bug PUP-8301

Using irb

C:\Source\puppet [pup-7894-tasksched2-attempt2 ≡]> be irb
irb(main):001:0> require 'puppet'
=> true
irb(main):002:0> Puppet::Type.eachtype
NoMethodError: undefined method `each' for nil:NilClass
        from C:/Source/puppet/lib/puppet/metatype/manager.rb:39:in `eachtype'
        from (irb):2
        from C:/tools/ruby2.3.1x64/bin/irb.cmd:19:in `<main>'
 
<load a single type>
 
irb(main):004:0> Puppet::Type.type(:user)
=> Puppet::Type::User
irb(main):005:0> Puppet::Type.eachtype
LocalJumpError: no block given (yield)
        from C:/Source/puppet/lib/puppet/metatype/manager.rb:42:in `block in eachtype'
        from C:/Source/puppet/lib/puppet/metatype/manager.rb:39:in `each'
        from C:/Source/puppet/lib/puppet/metatype/manager.rb:39:in `eachtype'
        from (irb):5
        from C:/tools/ruby2.3.1x64/bin/irb.cmd:19:in `<main>'
irb(main):006:0>

Glenn Sarti (JIRA)

unread,
Jan 8, 2018, 10:01:16 AM1/8/18
to puppe...@googlegroups.com

Rob Braden (JIRA)

unread,
Aug 8, 2018, 8:13:02 PM8/8/18
to puppe...@googlegroups.com
Rob Braden updated an issue
 
Change By: Rob Braden
Team: Platform Core Coremunity
This message was sent by Atlassian JIRA (v7.7.1#77002-sha1:e75ca93)
Atlassian logo

Josh Cooper (Jira)

unread,
Jun 11, 2021, 8:08:01 PM6/11/21
to puppe...@googlegroups.com
Josh Cooper commented on Bug PUP-8301
 
Re: Puppet::Type.eachtype raises an error instead of returning nil if no types are loaded

This was fixed in 98e4a10c5e0, Puppet::Type always defines the @types variable prior to extending the metatype manager.

This message was sent by Atlassian Jira (v8.13.2#813002-sha1:c495a97)
Atlassian logo
Reply all
Reply to author
Forward
0 new messages