[chef] LWRP - attributes required


Chronological Thread 
  • From: Wade Peacock < >
  • To: " " < >
  • Subject: [chef] LWRP - attributes required
  • Date: Thu, 28 May 2015 17:40:35 +0000
  • Accept-language: en-CA, en-US
  • Authentication-results: spf=none (sender IP is ) ;

Hey All,

 

Is it possible in the resource file of a LWRP to have attributes required for certain action type.

 

Exampe:

 

actions    :foo, :bar

 

default_action :foo

 

attribute :name, :kind_of => String, :name_attribute => true

attribute :section, :kind_of => String, :required => true (only for :bar action)

attribute :item, :kind_of => String, :required => true (only for :foo action )

attribute :value, :kind_of => [String,Integer], :required => true

 

Is the :respond_to the right thing?

 

I tried with no success:  

attribute :section, :kind_of => String, :required => true, :respond_to foo?

 

 

 

Wade Peacock

Cloud System Eng - Senior System Engineer/Automation  |  Vision Critical  

direct +1.604.629.9358  mobile +1.604.363.8137  

web visioncritical.com  | @VisionCritical on Twitter  |  Visit Vision Critical on LinkedIn   

 

New York | London | Hong Kong | Vancouver | Paris | San Francisco | Sydney | Tokyo | Toronto | Cologne | Minneapolis | Chicago | Ottawa | Detroit

Click here to watch our clients share their Vision Critical successes: www.visioncritical.com/client-stories

 




Archive powered by MHonArc 2.6.16.

§