fab-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Fab-user] how to use prompts ?


From: Song
Subject: [Fab-user] how to use prompts ?
Date: Sat, 2 Jan 2016 22:42:35 +0800


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

reply via email to

[Prev in Thread] Current Thread [Next in Thread]