def get_ssh_gateway_config(vm_):
 ssh_gateway = config.get_cloud_config_value('ssh_gateway', vm_, __opts__, default=None, search_global=False)
 if (not isinstance(ssh_gateway, str)):
  return None
 ssh_gateway_config = {'ssh_gateway': ssh_gateway}
 ssh_gateway_config['ssh_gateway_port'] = config.get_cloud_config_value('ssh_gateway_port', vm_, __opts__, default=None, search_global=False)
 ssh_gateway_config['ssh_gateway_user'] = config.get_cloud_config_value('ssh_gateway_username', vm_, __opts__, default=None, search_global=False)
 ssh_gateway_config['ssh_gateway_key'] = config.get_cloud_config_value('ssh_gateway_private_key', vm_, __opts__, default=None, search_global=False)
 ssh_gateway_config['ssh_gateway_password'] = config.get_cloud_config_value('ssh_gateway_password', vm_, __opts__, default=None, search_global=False)
 key_filename = ssh_gateway_config['ssh_gateway_key']
 if ((key_filename is not None) and (not os.path.isfile(key_filename))):
  raise SaltCloudConfigError("The defined ssh_gateway_private_key '{0}' does not exist".format(key_filename))
 elif ((key_filename is None) and (not ssh_gateway_config['ssh_gateway_password'])):
  raise SaltCloudConfigError('No authentication method. Please define:  ssh_gateway_password or ssh_gateway_private_key')
 return ssh_gateway_config

def get_ssh_gateway_config ( vm_ ) : ssh_gateway = config . get_cloud_config_value ( 'ssh_gateway' , vm_ , __opts__ , default = None , search_global = False ) if ( not isinstance ( ssh_gateway , str ) ) : return None ssh_gateway_config = { 'ssh_gateway' : ssh_gateway } ssh_gateway_config [ 'ssh_gateway_port' ] = config . get_cloud_config_value ( 'ssh_gateway_port' , vm_ , __opts__ , default = None , search_global = False ) ssh_gateway_config [ 'ssh_gateway_user' ] = config . get_cloud_config_value ( 'ssh_gateway_username' , vm_ , __opts__ , default = None , search_global = False ) ssh_gateway_config [ 'ssh_gateway_key' ] = config . get_cloud_config_value ( 'ssh_gateway_private_key' , vm_ , __opts__ , default = None , search_global = False ) ssh_gateway_config [ 'ssh_gateway_password' ] = config . get_cloud_config_value ( 'ssh_gateway_password' , vm_ , __opts__ , default = None , search_global = False ) key_filename = ssh_gateway_config [ 'ssh_gateway_key' ] if ( ( key_filename is not None ) and ( not os . path . isfile ( key_filename ) ) ) : raise SaltCloudConfigError ( "The defined ssh_gateway_private_key '{0}' does not exist" . format ( key_filename ) ) elif ( ( key_filename is None ) and ( not ssh_gateway_config [ 'ssh_gateway_password' ] ) ) : raise SaltCloudConfigError ( 'No authentication method. Please define:  ssh_gateway_password or ssh_gateway_private_key' ) return ssh_gateway_config
return the ssh_gateway configuration .