From 92d533947d1e7c077ab2029c7e7616a2262957c6 Mon Sep 17 00:00:00 2001 From: Dennis Gilmore Date: Oct 24 2017 20:21:16 +0000 Subject: Merge #7107 `Python3 pep8 and pylint fixes for koji-cleanup-signed` --- diff --git a/scripts/koji-cleanup-signed.py b/scripts/koji-cleanup-signed.py deleted file mode 100755 index a6f6b84..0000000 --- a/scripts/koji-cleanup-signed.py +++ /dev/null @@ -1,48 +0,0 @@ -#!/usr/bin/python -# clean up eol signed rpm -# Copyright (C) 2013 Red Hat, Inc. -# SPDX-License-Identifier: GPL-2.0 - -from __future__ import print_function -import os - -keys = ['069C8460', '30C9ECF8', - '4F2A6FD2', '897DA07A', - '1AC70CE6', '6DF2196F', - 'DF9B0AE9', '0B86274E', - '4EBFC273', 'D22E77F2', - '57BBCCBA', 'E8E40FDE', - '97A1071F', '069C8460', - '10d90a9e', 'a82ba4b7', - 'f8df67e6', '1aca3465', - 'de7f38bd', 'a4d647e9', - 'fb4b18e6', 'ba094068', - '246110c1', 'efe550f5', - '95a43f54', 'a0a7badb', - '8e1431d5', 'a29cb19c', - '873529b8', '34ec9cba', - '030d5aed', '81b46521', - ] - -prefix = 'data/signed' - -rootpath = '/mnt/koji/packages' - - -for root, dirs, files in os.walk(rootpath, topdown=False): - for name in files: - filepath = os.path.join(root, name) - for key in keys: - if os.path.join(prefix, str.lower(key)) in filepath: - print(filepath) - if os.path.exists(filepath): - os.remove(filepath) - continue - for name in dirs: - filepath = os.path.join(root, name) - for key in keys: - if os.path.join(prefix, str.lower(key)) in filepath: - print(filepath) - if os.path.exists(filepath): - os.rmdir(filepath) - continue diff --git a/scripts/koji_cleanup_signed.py b/scripts/koji_cleanup_signed.py new file mode 100755 index 0000000..d8c5dba --- /dev/null +++ b/scripts/koji_cleanup_signed.py @@ -0,0 +1,51 @@ +#!/usr/bin/python +# clean up eol signed rpm +# Copyright (C) 2013 Red Hat, Inc. +# SPDX-License-Identifier: GPL-2.0 +"""Remove signed rpms after a release is end-of-life +""" + +from __future__ import print_function +import os + +KEYS = [ + '069C8460', '30C9ECF8', + '4F2A6FD2', '897DA07A', + '1AC70CE6', '6DF2196F', + 'DF9B0AE9', '0B86274E', + '4EBFC273', 'D22E77F2', + '57BBCCBA', 'E8E40FDE', + '97A1071F', '069C8460', + '10d90a9e', 'a82ba4b7', + 'f8df67e6', '1aca3465', + 'de7f38bd', 'a4d647e9', + 'fb4b18e6', 'ba094068', + '246110c1', 'efe550f5', + '95a43f54', 'a0a7badb', + '8e1431d5', 'a29cb19c', + '873529b8', '34ec9cba', + '030d5aed', '81b46521' +] + +PREFIX = 'data/signed' + +ROOT_PATH = '/mnt/koji/packages' + + +for root, dirs, files in os.walk(ROOT_PATH, topdown=False): + for name in files: + filepath = os.path.join(root, name) + for key in KEYS: + if os.path.join(PREFIX, str.lower(key)) in filepath: + print(filepath) + if os.path.exists(filepath): + os.remove(filepath) + continue + for name in dirs: + filepath = os.path.join(root, name) + for key in KEYS: + if os.path.join(PREFIX, str.lower(key)) in filepath: + print(filepath) + if os.path.exists(filepath): + os.rmdir(filepath) + continue