<s> from deployer . host import SSHHost , LocalHost <EOL> import os . path <EOL> class VagrantHost ( SSHHost ) : <EOL> """<STR_LIT>""" <EOL> vagrant_environment = '<STR_LIT>' <EOL> host_machine = LocalHost <EOL> @ property <EOL> def slug ( self ) : <EOL> return '<STR_LIT>' % os . path . split ( self . vagrant_environment ) [ <NUM_LIT:1> ] <EOL> @ property <EOL> def address ( self ) : <EOL> return self . _get_ssh_property ( '<STR_LIT>' ) <EOL> @ property <EOL> def port ( self ) : <EOL> return int ( self . _get_ssh_property ( '<STR_LIT>' ) ) <EOL> @ property <EOL> def username ( self ) : <EOL> return self . _get_ssh_property ( '<STR_LIT>' ) <EOL> @ property <EOL> def key_filename ( self ) : <EOL> return self . _get_ssh_property ( '<STR_LIT>' ) <EOL> def _get_ssh_property ( self , key ) : <EOL> """<STR_LIT>""" <EOL> if not hasattr ( self , '<STR_LIT>' ) : <EOL> host = self . host_machine ( ) <EOL> with host . cd ( self . vagrant_environment ) : <EOL> self . _ssh_config = host . _run_silent ( '<STR_LIT>' ) <EOL> for line in self . _ssh_config . splitlines ( ) : <EOL> k , v = line . strip ( ) . split ( None , <NUM_LIT:1> ) <EOL> if k == key : <EOL> return v </s>
