intelmq
intelmq copied to clipboard
intelmqsetup: should install a default state file
Currently, intelmqsetup
calls intelmq upgrade-config
also on new installations. This results in a lot of "nothing to do" migrations:
Calling `intelmqctl upgrade-config` to update/create state file.
Writing initial state file.
Successfully wrote initial state file.
Found no previous version or forced, doing all upgrades.
Upgrading to version 1.0.0.dev7.
Migrate modify bot configuration format: Nothing to do.
Upgrading to version 1.1.0.
Replace deprecated Shadowserver feednames: Nothing to do.
Checking for deprecated runtime configurations (stomp collector, cymru parser, ripe expert, collector feed parameter): Nothing to do.
Upgrading to version 1.1.1.
...
and so on.
Instead, for new installations, an "empty" state.conf
file should be created, like we do it with the packages: https://build.opensuse.org/package/view_file/home:sebix:intelmq/intelmq/state.json?expand=1
Before https://github.com/certtools/intelmq/blob/0221a2507b05dcccaea9ac239bb9e13fa48ce4bc/intelmq/bin/intelmqsetup.py#L177-L182
- it needs to be checked if the file already exists
- if yes: continue with current code
- if not: create the file with the current version as sole entry in
version_history
(see link to the example above) and correct file permissions - continue with current code