# Checking the registry in a resourcre

**URL:** https://discourse.chef.io/t/checking-the-registry-in-a-resourcre/6225
**Category:** Chef Infra (archive)
**Created:** [January 28, 2015, 3:59pm UTC](https://discourse.chef.io/t/checking-the-registry-in-a-resourcre/6225 "2015-01-28T15:59:46Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Dwayne\_Forehand](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/dwayne_forehand/32/168_2.png) [@Dwayne\_Forehand](https://discourse.chef.io/u/Dwayne_Forehand)
#### Post date: [January 28, 2015, 3:59pm UTC](https://discourse.chef.io/t/checking-the-registry-in-a-resourcre/6225/1 "2015-01-28T15:59:46Z")

</div>

In a recipe I can use registry\_value\_exists? to see if a registry value  
exists, but when I try to use the same method in a resource provider I get  
a NoMethodError. How do I check if a registry value exists from within a  
provider?

-Dwayne

---

<div class="post-metadata">

### Author: ![Brandon\_Raabe](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/brandon_raabe/32/40_2.png) [@Brandon\_Raabe](https://discourse.chef.io/u/Brandon_Raabe)
#### Post date: [January 28, 2015, 4:15pm UTC](https://discourse.chef.io/t/checking-the-registry-in-a-resourcre/6225/2 "2015-01-28T16:15:02Z")

</div>

In your provider class, you should be able to 'include  
Chef::DSL::RegistryHelper' to gain access to those same methods within your  
provider.

> <https://github.com/chef/chef/blob/main/lib/chef/dsl/registry_helper.rb>

On Wed, Jan 28, 2015 at 8:59 AM, Dwayne Forehand [dwayne@4handsclapping.com](mailto:dwayne@4handsclapping.com)  
wrote:

> In a recipe I can use registry\_value\_exists? to see if a registry value  
> exists, but when I try to use the same method in a resource provider I get  
> a NoMethodError. How do I check if a registry value exists from within a  
> provider?
> 
> -Dwayne
