intuit / simple_deploy

Maintenance Mode - Simple Deploy is an opinionated CLI tool for managing AWS Cloud Formation Stacks.
MIT License
64 stars 22 forks source link

Fix pty option setting in execute command #229

Closed wbingli closed 10 years ago

wbingli commented 10 years ago

This is a fix for using sudo in execute command. Otherwise you may get "sorry, you must have a tty to run sudo" error.

bw-intuit commented 10 years ago

@thbishop Any concerns with setting this globally for both execute and deploy? An option could be to expose it as a flag, but I'm not sure if that is necessary. Thoughts?

thbishop commented 10 years ago

@brettweavnet-intuit given there are different folks using this in different contexts, i'm leaning towards a cli flag for the short term. after some usage/feedback, we can default it if it makes sense. good with that?

bw-intuit commented 10 years ago

@thbishop makes sense. @wbinglee I'll merge and then integrate it as a flag if that solution works for you. Thanks

wbingli commented 10 years ago

Thanks, guys.

Basically I'm using Centos, which has this issue using sudo : http://www.cyberciti.biz/faq/linux-unix-bsd-sudo-sorry-you-must-haveattytorun/

This fix is based on Capistrano settings for it: default_run_options[:pty] = true

I'm curious how it works for you without this settings. Do you comment out "Defaults requiretty" in your base image or other linux distribution?

bw-intuit commented 10 years ago

@wbinglee yup, we remove that from our sudo config. I can see having it as a valid requirement and simple deploy setting it being useful if you need it added.

wbingli commented 10 years ago

@brettweavnet-intuit it will be nice to have this setting.

bw-intuit commented 10 years ago

@wbinglee I'll merge this in and then add a flag to execute which will enable this functionality. Does that sound good?