<s> """<STR_LIT>""" <EOL> import logging <EOL> import os <EOL> import os . path <EOL> import sys <EOL> current_dir = os . path . dirname ( os . path . realpath ( __file__ ) ) <EOL> sys . path . append ( current_dir ) <EOL> import switch_virtualenv <EOL> from compass . utils import flags <EOL> from compass . utils import logsetting <EOL> flags . add ( '<STR_LIT>' , <EOL> help = '<STR_LIT>' , <EOL> default = '<STR_LIT>' ) <EOL> def main ( ) : <EOL> """<STR_LIT>""" <EOL> flags . init ( ) <EOL> logsetting . init ( ) <EOL> rolelist = [ ] <EOL> roles_dir = flags . OPTIONS . roles_dir <EOL> for item in os . listdir ( roles_dir ) : <EOL> if item . endswith ( '<STR_LIT>' ) or item . endswith ( '<STR_LIT>' ) : <EOL> rolelist . append ( os . path . join ( roles_dir , item ) ) <EOL> else : <EOL> logging . info ( '<STR_LIT>' , item , roles_dir ) <EOL> for role in rolelist : <EOL> logging . info ( '<STR_LIT>' , role ) <EOL> cmd = "<STR_LIT>" % role <EOL> status = os . system ( cmd ) <EOL> logging . info ( '<STR_LIT>' , cmd , status ) <EOL> if status : <EOL> sys . exit ( <NUM_LIT:1> ) <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> main ( ) </s>
