Skip to content

Added --allow-expired flag to list and download expired packages#172

Merged
larsewi merged 1 commit intocfengine:masterfrom
SimonThalvorsen:CFE-4609
Feb 19, 2026
Merged

Added --allow-expired flag to list and download expired packages#172
larsewi merged 1 commit intocfengine:masterfrom
SimonThalvorsen:CFE-4609

Conversation

@SimonThalvorsen
Copy link
Contributor

Ticket: CFE-4609
Changelog: title

@SimonThalvorsen SimonThalvorsen force-pushed the CFE-4609 branch 2 times, most recently from f389c81 to a3c870c Compare February 16, 2026 13:30
Copy link
Contributor

@larsewi larsewi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GJ 🚀 Only some nit picks

remote_download=False,
trust_keys=None,
insecure=False
insecure=False,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change seems to be unrelated to this commit. Either remove it or put it in a separate commit.

if version and version not in release_versions:
expired_versions = [rel.version for rel in releases.expired_releases]

using_expired_version = version and version in expired_versions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider using parenthesis to make intent explicit / more clear to the reader

Suggested change
using_expired_version = version and version in expired_versions
using_expired_version = version and (version in expired_versions)


using_expired_version = version and version in expired_versions

if version and version in expired_versions and not allow_expired:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here you can use variable from above

Suggested change
if version and version in expired_versions and not allow_expired:
if using_expired_version and not allow_expired:


if version and version in expired_versions and not allow_expired:
raise CFRUserError("Use flag --allow-expired to list expired version")
elif version and version not in release_versions and not using_expired_version:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
elif version and version not in release_versions and not using_expired_version:
elif version and (version not in release_versions) and not using_expired_version:

print("Using {}:".format(release))
if using_expired_version:
log.warning(
f"You are using an expired CFEngine version {version} which is no longer supported and may contain known vulnerabilities. Proceed at your own risk."
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

f-strings are not supported in Python 3.5, which we have to support for a few more years.

Suggested change
f"You are using an expired CFEngine version {version} which is no longer supported and may contain known vulnerabilities. Proceed at your own risk."
"You are using an expired CFEngine version {} which is no longer supported and may contain known vulnerabilities. Proceed at your own risk.".format(version)

The tests should have failed. I created a follow-up ticket to investigate this CFE-4636

print(artifact.url)
if using_expired_version:
log.warning(
f"You are using an expired CFEngine version {version} which is no longer supported and may contain known vulnerabilities. Proceed at your own risk."
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
f"You are using an expired CFEngine version {version} which is no longer supported and may contain known vulnerabilities. Proceed at your own risk."
"You are using an expired CFEngine version {} which is no longer supported and may contain known vulnerabilities. Proceed at your own risk.".format(version)

…ackages

Ticket: CFE-4609
Changelog: title

Signed-off-by: Simon Halvorsen <simon.halvorsen@northern.tech>
@larsewi larsewi merged commit 82392ef into cfengine:master Feb 19, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments