I have edited your code with some minor things:
expecting
requires a list- Fabric/Fexpect sudo() and run() cannot be nested. You probably just need sudo()
You have to escape regexp symbols, such as
[]
with a slash\[
or just make the 'expectation' shorter:prompts = [] prompts += expect('Are you sure.*', 'N') with expecting(prompts): sudo("/something.sh apply /some.file" , user="someuser")
Also, perhaps you should not hide('commands')
, depending on what prompt something.sh
uses.