management.management.commands.startup_manager

Example integration of startup strategies into managestartup command.

This file shows how to refactor the managestartup.py command to use the strategy pattern. Copy the relevant parts into managestartup.py to complete the refactoring.

Classes

Command

A Django management command to check and update the Trustpoint version.

Module Contents

class management.management.commands.startup_manager.Command(stdout=None, stderr=None, no_color=False, force_color=False)[source]

Bases: django.core.management.base.BaseCommand

A Django management command to check and update the Trustpoint version.

help = 'Updates app version'[source]
handle(**_options)[source]

Entrypoint for the command.

Parameters:

_options (dict[str, str])

Return type:

None

manage_startup()[source]

Checks current state of trustpoint and acts accordingly.

Return type:

None

_parse_version(version_str)[source]

Parse a version string into a Version object.

Parameters:

version_str (str) – The version string to parse.

Returns:

The parsed Version object.

Raises:

CommandError – If the version string is invalid.

Return type:

packaging.version.Version