Skip to content

Commit

Permalink
MAINT: remove obsolete BOTS file
Browse files Browse the repository at this point in the history
finally removes the now obsolete BOTS file

closes #1543
  • Loading branch information
Sebastian Wagner committed Mar 30, 2021
1 parent a54e483 commit 8330a45
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1,325 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ CHANGELOG
------------------

### Configuration
- The `BOTS` file is no longer used and has been removed (by Sebastian Wagner).

### Core
- `intelmq.lib.harmonization`:
Expand All @@ -18,6 +19,7 @@ CHANGELOG
- New function `list_all_bots` to list all available/installed bots as replacement for the BOTS file (#368, #552, #644, #757, #1069, #1750, PR#1751 by Sebastian Waldbauer).

### Development
- `rewrite_config_files.py`: Removed obsolete BOTS-file-related rewriting functionality.

### Harmonization
Update allowed classification fields to 2020-01-28 version (#1409, #1476). Old namings are still supported until at least version 3.0.
Expand Down
20 changes: 5 additions & 15 deletions intelmq/bin/rewrite_config_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,10 @@
import os
import traceback

from intelmq.lib.utils import object_pair_hook_bots


def rewrite(fobj, bots=False):
if not bots:
text = json.load(fobj)
else:
text = json.load(fobj, object_pairs_hook=object_pair_hook_bots)
if not bots:
clean = json.dumps(text, indent=4, sort_keys=True, separators=(',', ': ')) + '\n'
else:
clean = json.dumps(text, indent=4, separators=(',', ': ')) + '\n'

def rewrite(fobj):
text = json.load(fobj)
clean = json.dumps(text, indent=4, sort_keys=True, separators=(',', ': ')) + '\n'
fobj.seek(0)
fobj.write(clean)
fobj.truncate()
Expand All @@ -35,7 +27,7 @@ def rewrite(fobj, bots=False):
description="Test files")
parser.add_argument('-c', '--config',
help='Path to the intelmq directory containing'
'bots/BOTS, etc/*.conf',
'etc/*.conf',
default='.')
args = parser.parse_args()

Expand All @@ -46,8 +38,6 @@ def rewrite(fobj, bots=False):
with open(fn, 'r+') as f:
rewrite(f)

with open(os.path.join(config_file_path, 'bots/BOTS'), 'r+') as f:
rewrite(f, bots=True)
except IOError:
traceback.print_exc()
print('Could not open files. Wrong directory? Also see the --help.')
Loading

0 comments on commit 8330a45

Please sign in to comment.