<s> import sys <EOL> from lib import shellhelpers as shell <EOL> class ChefInstaller ( object ) : <EOL> '''<STR_LIT>''' <EOL> from lib . omnibus import Omnibus <EOL> SUPPORTED_METHODS = [ '<STR_LIT>' ] <EOL> cmdline_options = [ <EOL> ( '<STR_LIT>' , '<STR_LIT>' , { } ) , <EOL> ( '<STR_LIT>' , '<STR_LIT>' , { '<STR_LIT:action>' : '<STR_LIT:store_true>' } ) , <EOL> ( '<STR_LIT>' , '<STR_LIT>' , { } ) , <EOL> ( '<STR_LIT>' , '<STR_LIT>' , { } ) <EOL> ] <EOL> @ staticmethod <EOL> def install ( install_method , options ) : <EOL> exit_code = <NUM_LIT:0> <EOL> installer = getattr ( ChefInstaller , install_method . capitalize ( ) ) ( options ) <EOL> if not installer . chef_installed ( ) : <EOL> exit_code = installer . install ( ) <EOL> else : <EOL> sys . stdout . write ( "<STR_LIT>" ) <EOL> sys . exit ( exit_code ) <EOL> def execute ( self ) : <EOL> parser = shell . CmdlineParser ( self . cmdline_options ) <EOL> options = parser . parse ( ) <EOL> install_method = options [ '<STR_LIT>' ] <EOL> if install_method not in self . SUPPORTED_METHODS : <EOL> error = "<STR_LIT>" "<STR_LIT>" . format ( install_method ) <EOL> sys . stderr . write ( error ) <EOL> sys . exit ( <NUM_LIT:1> ) <EOL> del options [ '<STR_LIT>' ] <EOL> self . install ( install_method , options ) <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> runner = ChefInstaller ( ) <EOL> runner . execute ( ) </s>
