Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

intelmqsetup: should install a default state file #2175

Open
sebix opened this issue May 13, 2022 · 0 comments
Open

intelmqsetup: should install a default state file #2175

sebix opened this issue May 13, 2022 · 0 comments
Labels
bug Indicates an unexpected problem or unintended behavior component: core usability

Comments

@sebix
Copy link
Member

sebix commented May 13, 2022

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

print('Calling `intelmqctl upgrade-config` to update/create state file.')
controller = IntelMQController(interactive=False, no_file_logging=True,
drop_privileges=False)
controller.upgrade_conf(state_file=state_file, no_backup=True)
if ownership:
change_owner(STATE_FILE_PATH, owner='intelmq', group='intelmq')

  • 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
@sebix sebix added bug Indicates an unexpected problem or unintended behavior usability component: core labels May 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Indicates an unexpected problem or unintended behavior component: core usability
Projects
None yet
Development

No branches or pull requests

1 participant