<s> import time , sys , os , config , data <EOL> from comodit_client . api . exceptions import PythonApiException <EOL> from comodit_client . rest . exceptions import ApiException <EOL> def override_email ( email ) : <EOL> data . web [ "<STR_LIT>" ] [ "<STR_LIT>" ] = email <EOL> def get_override ( var , key , default_value ) : <EOL> if var . __dict__ . has_key ( key ) : <EOL> return var . __dict__ [ key ] <EOL> else : <EOL> return default_value <EOL> def create_host ( env , name , platform , distribution , applications ) : <EOL> print "<STR_LIT>" % name <EOL> host = env . hosts ( ) . create ( name , "<STR_LIT>" , platform [ '<STR_LIT:name>' ] , distribution [ '<STR_LIT:name>' ] ) <EOL> context = host . get_platform ( ) <EOL> for key , value in platform [ '<STR_LIT>' ] . iteritems ( ) : <EOL> context . settings ( ) . create ( key , value ) <EOL> context = host . get_distribution ( ) <EOL> for key , value in distribution [ '<STR_LIT>' ] . iteritems ( ) : <EOL> context . settings ( ) . create ( key , value ) <EOL> for app in applications : <EOL> host . install ( app [ '<STR_LIT:name>' ] , app [ '<STR_LIT>' ] ) <EOL> return host </s>
