Library load ordering


#1

What’s the correct way to ensure that a library in cookbook A can reliably
refer to a method in a module declared in a library in cookbook B?

Is declaring the dependency on cookbook B in cookbook A’s metadata
sufficent? (It seems not.)

We’re experiencing load-ordering race conditions and I’d like to figure out
how to quash them once and for all.

Thanks,

–Michael


#2

On Wednesday, June 11, 2014 at 3:40 PM, Michael Fischer wrote:

What’s the correct way to ensure that a library in cookbook A can reliably refer to a method in a module declared in a library in cookbook B?

Is declaring the dependency on cookbook B in cookbook A’s metadata sufficent? (It seems not.)
This should be sufficient, provided you’re on Chef 11.x and you do not have a circular dependency.

We’re experiencing load-ordering race conditions and I’d like to figure out how to quash them once and for all.

Thanks,

–Michael

Daniel DeLeo


#3

On Wed, Jun 11, 2014 at 3:41 PM, Daniel DeLeo dan@kallistec.com wrote:

On Wednesday, June 11, 2014 at 3:40 PM, Michael Fischer wrote:

What’s the correct way to ensure that a library in cookbook A can
reliably refer to a method in a module declared in a library in cookbook B?

Is declaring the dependency on cookbook B in cookbook A’s metadata
sufficent? (It seems not.)
This should be sufficient, provided you’re on Chef 11.x and you do not
have a circular dependency.

Good catch on the circular dependency; thanks.

–Michael


#4

Speaking of circular dependencies, I ran into a few of those (error on my
part due to a misleading Foodcritic warning) and was wondering if there was
a tool that would catch them along the lines of rubocop/foodcritic.


~~ StormeRider ~~

“Every world needs its heroes […] They inspire us to be better than we
are. And they protect from the darkness that’s just around the corner.”

(from Smallville Season 6x1: “Zod”)

On why I hate the phrase “that’s so lame”… http://bit.ly/Ps3uSS

On Wed, Jun 11, 2014 at 3:47 PM, Michael Fischer mfischer@zendesk.com
wrote:

On Wed, Jun 11, 2014 at 3:41 PM, Daniel DeLeo dan@kallistec.com wrote:

On Wednesday, June 11, 2014 at 3:40 PM, Michael Fischer wrote:

What’s the correct way to ensure that a library in cookbook A can
reliably refer to a method in a module declared in a library in cookbook B?

Is declaring the dependency on cookbook B in cookbook A’s metadata
sufficent? (It seems not.)
This should be sufficient, provided you’re on Chef 11.x and you do not
have a circular dependency.

Good catch on the circular dependency; thanks.

–Michael