<s> from __future__ import absolute_import <EOL> import sys <EOL> import argparse <EOL> import provision . config as config <EOL> import provision . nodelib as nodelib <EOL> def parser ( ) : <EOL> parser = argparse . ArgumentParser ( ) <EOL> config . add_auth_args ( parser , config ) <EOL> parser . add_argument ( '<STR_LIT>' , '<STR_LIT>' , default = [ ] , action = '<STR_LIT>' ) <EOL> parser . add_argument ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> parser . add_argument ( '<STR_LIT>' , '<STR_LIT>' , default = config . DEFAULT_IMAGE_NAME ) <EOL> parser . add_argument ( '<STR_LIT>' , '<STR_LIT>' , default = config . DEFAULT_LOCATION_ID , type = int ) <EOL> parser . add_argument ( '<STR_LIT>' , '<STR_LIT>' , <EOL> help = '<STR_LIT>' ) <EOL> parser . add_argument ( '<STR_LIT>' , '<STR_LIT>' , default = config . DEFAULT_SIZE ) <EOL> parser . add_argument ( '<STR_LIT>' , '<STR_LIT>' , default = [ ] , action = '<STR_LIT>' , <EOL> help = '<STR_LIT>' ) <EOL> parser . add_argument ( '<STR_LIT>' , '<STR_LIT>' , default = True ) <EOL> parser . add_argument ( '<STR_LIT>' , '<STR_LIT>' , default = config . DEFAULT_NAME_PREFIX ) <EOL> return parser <EOL> def deploy ( args = None ) : <EOL> parsed = config . reconfig ( parser , args ) <EOL> deployment = nodelib . Deployment ( name = parsed . name , bundles = parsed . bundles , <EOL> prefix = parsed . prefix , image_name = parsed . image , <EOL> subvars = parsed . subvars ) <EOL> driver = nodelib . get_driver ( parsed . secret_key , parsed . userid , parsed . provider ) <EOL> node = deployment . deploy ( driver , parsed . location , parsed . size ) <EOL> if parsed . verbose : <EOL> print ( node ) <EOL> if parsed . description_file : <EOL> node . write_json ( parsed . description_file ) <EOL> return node <EOL> def deploy_retcode ( ) : <EOL> node = deploy ( ) <EOL> return node . sum_exit_status ( ) <EOL> def main ( ) : <EOL> return config . handle_errors ( deploy_retcode ) <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> sys . exit ( main ( ) ) </s>
