Hacker News new | past | comments | ask | show | jobs | submit login

Indeed, which is why in ShutIt I used some tricks with the prompt to determine whether a command was finished, and then (optional, but defaulting) checks on exit codes to determine success/failure. It seems to work pretty well, and no need to specify what it expected.

It results in code like this:

https://github.com/ianmiell/shutit-chef-env/blob/master/shut...

which sets up a chef server.




Aside: the bare except clause used here [1] is a bad habit. You should try to avoid it. Python raises things like NameError and TypeError for simple design problems like mistyping variable names. It's extremely rare that you can handle errors like that. Your "except:" would attempt to handle and effectively mask bugs like this.

[1] https://github.com/ianmiell/shutit-chef-env/blob/master/shut...


Thanks for the tip. Laziness is a sin and a virtue.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: