<s> import os <EOL> import sys <EOL> from fabric . api import env , sudo , put <EOL> DEPLOYMENTS = { <EOL> '<STR_LIT>' : { <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : os . path . expanduser ( '<STR_LIT>' ) <EOL> } , <EOL> '<STR_LIT>' : { <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : os . path . expanduser ( '<STR_LIT>' ) <EOL> } , <EOL> } <EOL> def check_key_filename ( deployment_name ) : <EOL> if '<STR_LIT>' in DEPLOYMENTS [ deployment_name ] and not os . path . exists ( DEPLOYMENTS [ deployment_name ] [ '<STR_LIT>' ] ) : <EOL> print ( "<STR_LIT>" % <EOL> DEPLOYMENTS [ deployment_name ] [ '<STR_LIT>' ] ) <EOL> return False <EOL> return True <EOL> def setup_env ( deployment_name ) : <EOL> env . update ( DEPLOYMENTS [ deployment_name ] ) <EOL> if not check_key_filename ( deployment_name ) : <EOL> sys . exit ( <NUM_LIT:1> ) <EOL> def deploy ( deployment_name , scripts = '<STR_LIT>' ) : <EOL> setup_env ( deployment_name ) <EOL> sudo ( '<STR_LIT>' ) <EOL> for script in scripts . split ( '<STR_LIT:U+0020>' ) : <EOL> put ( script , '<STR_LIT>' % script , use_sudo = True ) <EOL> sudo ( '<STR_LIT>' ) </s>
