<s> from pyinfra import local , hook <EOL> TIMEOUT = <NUM_LIT:1> <EOL> FAIL_PERCENT = <NUM_LIT> <EOL> @ hook . before_connect <EOL> def ensure_branch ( data , state ) : <EOL> branch = local . shell ( '<STR_LIT>' ) <EOL> app_branch = data . app_branch <EOL> if branch != app_branch : <EOL> raise hook . Error ( '<STR_LIT>' . format ( <EOL> branch , app_branch <EOL> ) ) <EOL> @ hook . after_deploy <EOL> def notify_people ( data , state ) : <EOL> print ( '<STR_LIT>' ) </s>
