(component, minimum_year)
| 331 | |
| 332 | |
| 333 | def _ensure_minio_component_version(component, minimum_year): |
| 334 | full_args = [component, '--version'] |
| 335 | with subprocess.Popen(full_args, stdout=subprocess.PIPE, |
| 336 | stderr=subprocess.PIPE, encoding='utf-8') as proc: |
| 337 | if proc.wait(10) != 0: |
| 338 | return False |
| 339 | stdout = proc.stdout.read() |
| 340 | pattern = component + r' version RELEASE\.(\d+)-.*' |
| 341 | version_match = re.search(pattern, stdout) |
| 342 | if version_match: |
| 343 | version_year = version_match.group(1) |
| 344 | return int(version_year) >= minimum_year |
| 345 | else: |
| 346 | raise FileNotFoundError( |
| 347 | "minio component older than the minimum year") |
| 348 | |
| 349 | |
| 350 | def _wait_for_minio_startup(mcdir, address, access_key, secret_key): |
no test coverage detected