Skip to content

intelmqsetup: should install a default state file #2175

@sebix

Description

@sebix

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugIndicates an unexpected problem or unintended behaviorcomponent: coreusability

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions