parameters: (
          self, address, port, dirname, connection_type, name=None, password=None
      )
return_statement: return self.__connect()
docstring: Establish a network connection and authenticate.
  
          Args:
             address (str): Address of the Bareos Director (hostname or IP).
  
             port (int): Port number of the Bareos Director.
  
             dirname (str, optional):
                Name of the Bareos Director. Deprecated, normally not required.
  
             connection_type (int): See :py:class:`bareos.bsock.connectiontype.ConnectionType`.
  
             name (str, optional):
                Credential name.
  
             password  (str, bareos.util.Password):
                Credential password, in cleartext or as Password object.
  
          Returns:
             bool: True, if the authentication succeeds. In earlier versions, authentication failures returned False. However, now an authentication failure raises an exception.
  
          Raises:
             bareos.exceptions.ConnectionError: If connection can be established.
             bareos.exceptions.PamAuthenticationError: If PAM authentication fails.
             bareos.exceptions.AuthenticationError: If Bareos authentication fails.
docstring_summary: Establish a network connection and authenticate.
docstring_tokens: Establish a network connection and authenticate .
function: def connect(
          self, address, port, dirname, connection_type, name=None, password=None
      ):
          """Establish a network connection and authenticate.
  
          Args:
             address (str): Address of the Bareos Director (hostname or IP).
  
             port (int): Port number of the Bareos Director.
  
             dirname (str, optional):
                Name of the Bareos Director. Deprecated, normally not required.
  
             connection_type (int): See :py:class:`bareos.bsock.connectiontype.ConnectionType`.
  
             name (str, optional):
                Credential name.
  
             password  (str, bareos.util.Password):
                Credential password, in cleartext or as Password object.
  
          Returns:
             bool: True, if the authentication succeeds. In earlier versions, authentication failures returned False. However, now an authentication failure raises an exception.
  
          Raises:
             bareos.exceptions.ConnectionError: If connection can be established.
             bareos.exceptions.PamAuthenticationError: If PAM authentication fails.
             bareos.exceptions.AuthenticationError: If Bareos authentication fails.
          """
          self.address = address
          self.port = int(port)
          if dirname:
              self.dirname = dirname
          else:
              self.dirname = address
          self.connection_type = connection_type
          self.name = name
          if password is None:
              raise bareos.exceptions.ConnectionError(
                  u"Parameter 'password' is required."
              )
          if isinstance(password, Password):
              self.password = password
          else:
              self.password = Password(password)
  
          return self.__connect()
function_tokens: def connect ( self , address , port , dirname , connection_type , name = None , password = None ) : self . address = address self . port = int ( port ) if dirname : self . dirname = dirname else : self . dirname = address self . connection_type = connection_type self . name = name if password is None : raise bareos . exceptions . ConnectionError ( u"Parameter 'password' is required." ) if isinstance ( password , Password ) : self . password = password else : self . password = Password ( password ) return self . __connect ( )