|
15 | 15 | """ |
16 | 16 | from typing import List |
17 | 17 |
|
18 | | -from charon.config import get_config, RadasConfig |
| 18 | +from charon.config import get_config |
| 19 | +from charon.pkgs.radas_signature_handler import sign_in_radas |
19 | 20 | from charon.cmd.internal import ( |
20 | 21 | _decide_mode, _safe_delete |
21 | 22 | ) |
@@ -126,23 +127,22 @@ def sign( |
126 | 127 | if not radas_conf or not radas_conf.validate(): |
127 | 128 | logger.error("The configuration for radas is not valid!") |
128 | 129 | sys.exit(1) |
129 | | - sign_in_radas(repo_url, requester, sign_key, result_path, radas_conf) |
| 130 | + # All ignore files in global config should also be ignored in signing. |
| 131 | + ig_patterns = conf.get_ignore_patterns() |
| 132 | + if ignore_patterns: |
| 133 | + ig_patterns.extend(ignore_patterns) |
| 134 | + args = { |
| 135 | + "repo_url": repo_url, |
| 136 | + "requester": requester, |
| 137 | + "sign_key": sign_key, |
| 138 | + "result_path": result_path, |
| 139 | + "ignore_patterns": ig_patterns, |
| 140 | + "radas_config": radas_conf |
| 141 | + } |
| 142 | + sign_in_radas(**args) # type: ignore |
130 | 143 | except Exception: |
131 | 144 | print(traceback.format_exc()) |
132 | | - sys.exit(2) # distinguish between exception and bad config or bad state |
| 145 | + sys.exit(2) |
133 | 146 | finally: |
134 | 147 | if not debug and tmp_dir: |
135 | 148 | _safe_delete(tmp_dir) |
136 | | - |
137 | | - |
138 | | -def sign_in_radas(repo_url: str, |
139 | | - requester: str, |
140 | | - sign_key: str, |
141 | | - result_path: str, |
142 | | - radas_config: RadasConfig): |
143 | | - '''This function will be responsible to do the overall controlling of the whole process, |
144 | | - like trigger the send and register the receiver, and control the wait and timeout there. |
145 | | - ''' |
146 | | - logger.debug("params. repo_url: %s, requester: %s, sign_key: %s, result_path: %s," |
147 | | - "radas_config: %s", repo_url, requester, sign_key, result_path, radas_config) |
148 | | - logger.info("Not implemented yet!") |
0 commit comments