Song
2016-01-02 14:42:35 UTC
I am using Fabric 1.10.2 I am trying to control an interactive prompt referred to http://docs.fabfile.org/en/latest/usage/env.html#prompts , but it is unclear about describing how to use prompts in conjunction with the run() method.
def pt5():
#with settings(prompts={'Do you want to continue [Y/n]? ': 'Y'}):
env.prompts={'Do you want to continue [Y/n]? ': 'Y'}
with settings(prompts=(env.prompts)):
run('apt-get update')
run('apt-get upgrade')
or
def pt5():
with settings(prompts={'Do you want to continue [Y/n]? ': 'Y'}):
#env.prompts={'Do you want to continue [Y/n]? ': 'Y'}
#with settings(prompts=(env.prompts)):
run('apt-get update')
run('apt-get upgrade')
But both prompts were not working at all, Anybody know how to use prompts{} ?
Thanks in advance .
GM
def pt5():
#with settings(prompts={'Do you want to continue [Y/n]? ': 'Y'}):
env.prompts={'Do you want to continue [Y/n]? ': 'Y'}
with settings(prompts=(env.prompts)):
run('apt-get update')
run('apt-get upgrade')
or
def pt5():
with settings(prompts={'Do you want to continue [Y/n]? ': 'Y'}):
#env.prompts={'Do you want to continue [Y/n]? ': 'Y'}
#with settings(prompts=(env.prompts)):
run('apt-get update')
run('apt-get upgrade')
But both prompts were not working at all, Anybody know how to use prompts{} ?
Thanks in advance .
GM