Exemplo n.º 1
0
 def set_options(self, options):
     super(CurlDownload, self).set_options(options)
     if "ssl_verifyhost" in options:
         self.ssl_verifyhost = Utils.to_bool(options["ssl_verifyhost"])
     if "ssl_verifypeer" in options:
         self.ssl_verifypeer = Utils.to_bool(options["ssl_verifypeer"])
     if "ssl_server_cert" in options:
         self.ssl_server_cert = options["ssl_server_cert"]
     if "tcp_keepalive" in options:
         self.tcp_keepalive = Utils.to_int(options["tcp_keepalive"])
     if "ftp_method" in options:
         # raw_val is a string which contains the name of the option as in the CLI.
         # We always convert raw_val to a valid integer
         raw_val = options["ftp_method"].lower()
         if raw_val not in self.VALID_FTP_FILEMETHOD:
             raise ValueError("Invalid value for ftp_method")
         self.ftp_method = self.VALID_FTP_FILEMETHOD[raw_val]
     if "ssh_hosts_file" in options:
         self.ssh_hosts_file = options["ssh_hosts_file"]
     if "ssh_new_host" in options:
         raw_val = options["ssh_new_host"].lower()
         if raw_val not in self.VALID_SSH_NEW_HOST:
             raise ValueError("Invalid value for ssh_new_host")
         self.ssh_new_host = self.VALID_SSH_NEW_HOST[raw_val]
     if "allow_redirections" in options:
         self.allow_redirections = Utils.to_bool(options["allow_redirections"])
Exemplo n.º 2
0
    def get_bool(self, prop, section='GENERAL', escape=True, default=None):
        """
        Get a boolean property from bank or general configration. Optionally in section.
        """
        value = self.get(prop, section, escape, default)

        return Utils.to_bool(value)
Exemplo n.º 3
0
    def set_options(self, options):
        """
        Set download options.

        Subclasses that override this method must call this implementation.
        """
        # Copy the option dict
        self.options = options
        if "skip_check_uncompress" in options:
            self.skip_check_uncompress = Utils.to_bool(
                options["skip_check_uncompress"])
Exemplo n.º 4
0
    def set_options(self, options):
        """
        Set download options.

        Subclasses that override this method must call this implementation.
        """
        # Copy the option dict
        self.options = options
        if "skip_check_uncompress" in options:
            self.skip_check_uncompress = Utils.to_bool(
                options["skip_check_uncompress"])
        # If stop_condition or wait_policy is specified, we reconstruct the retryer
        if "stop_condition" or "wait_policy" in options:
            stop_condition = options.get(
                "stop_condition", BiomajConfig.DEFAULTS["stop_condition"])
            wait_policy = options.get("wait_policy",
                                      BiomajConfig.DEFAULTS["wait_policy"])
            self._set_retryer(stop_condition, wait_policy)