Fix to ignore any files without a .json extension found in the role_path... #14

wants to merge 2 commits into


None yet
2 participants

robfraz commented Mar 20, 2013

Just a simple patch to skip over any files on the role_path that don't have a .json extension. Otherwise it fails in a fairly non-helpful way.

robfraz closed this Mar 21, 2013

robfraz deleted the unknown repository branch Mar 21, 2013


miketheman commented Mar 21, 2013

Hi @robfraz,
Curious - the plugin currently looks for json and rb files - was this proving a problem?

robfraz commented Mar 21, 2013

Hi Mike,

A little - but mainly it was me being an idiot :-)

The problem at my end was that someone had put some arbitrary .rb files in the roles directory that didn't follow the ruby DSL for roles. Any ruby in the roles directory gets executed by your script, and one of these arbitrary ruby scripts had a problem that meant it threw an exception. This is what was actually causing the problem, although I didn't realise that until today. Being relatively new to chef, I thought all roles had to be described using JSON - I didn't know you could express them also in ruby code until I started looking at your test code. So, my solution was to just patch spaghetti.rb to skip over any files that weren't .json files. Whilst this did work for me and get me a visualisation, it made your tests fail horribly 8-)

Once I realised what was actually going on, I simply deleted the erroneous ruby script from the roles dir, and all was good. Hence why I deleted the pull request in the end.

Thanks for the great visualisation tool btw! Worked very nicely.




miketheman commented Mar 22, 2013

Hi Rob,

Thanks for taking the time to explain - when I saw the pull, I was initially confused, and your explanation makes total sense.

I'm glad the tests were clear and helped you find the problem and resolve it!


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment