Ejemplo n.º 1
0
 def __load_variables(self):
     """
     Load extra variables, specified in the .mercury_config file.
     """
     
     for key in Configuration.get_all_keys("vars"):
         self.variables[key] = Configuration.get("vars", key)
Ejemplo n.º 2
0
 def get(cls, url):
     """
     Get an instance of Remote, initialised with the remote settings.
     """
     
     url = Configuration.get('remotes', url)
     
     if url != None:
         return cls(url)
     else:
         return None
Ejemplo n.º 3
0
 def ca_path(self, skip_default=False):
     """
     Get the path to the CA Key Material, as defined by the configuration file.
     """
     
     ca_path = Configuration.get("ssl", "ca_path")
     
     if ca_path == None and skip_default == False:
         ca_path = os.path.join(os.path.dirname(__file__), "embedded_ca")
     
     return ca_path
Ejemplo n.º 4
0
    def ca_path(self, skip_default=False):
        """
        Get the path to the CA Key Material, as defined by the configuration file.
        """

        ca_path = Configuration.get("ssl", "ca_path")

        if ca_path == None and skip_default == False:
            ca_path = os.path.join(os.path.dirname(__file__), "embedded_ca")

        return ca_path
Ejemplo n.º 5
0
    def get(cls, url):
        """
        Get an instance of Remote, initialised with the remote settings.
        """

        url = Configuration.get('remotes', url)

        if url != None:
            return cls(url)
        else:
            return None
Ejemplo n.º 6
0
 def trusted_certificate_for(self, peer):
     """
     Fetches the trusted certificate for a peer.
     """
     
     return Configuration.get("ssl-known-hosts", "%s|%d" % peer)
Ejemplo n.º 7
0
    def trusted_certificate_for(self, peer):
        """
        Fetches the trusted certificate for a peer.
        """

        return Configuration.get("ssl-known-hosts", "%s|%d" % peer)