Skip to content

ENT-14056: Moved cache/config-files from .cfengine to .cache/.config#181

Open
SimonThalvorsen wants to merge 1 commit into
cfengine:masterfrom
SimonThalvorsen:master
Open

ENT-14056: Moved cache/config-files from .cfengine to .cache/.config#181
SimonThalvorsen wants to merge 1 commit into
cfengine:masterfrom
SimonThalvorsen:master

Conversation

@SimonThalvorsen
Copy link
Copy Markdown
Contributor

Ticket: ENT-14056

@SimonThalvorsen SimonThalvorsen force-pushed the master branch 7 times, most recently from 3361734 to 88a9675 Compare May 29, 2026 15:01
@cf-bottom
Copy link
Copy Markdown

Thank you for submitting a pull request! Maybe @craigcomstock can review this?

@SimonThalvorsen SimonThalvorsen marked this pull request as draft June 1, 2026 09:12
@SimonThalvorsen
Copy link
Copy Markdown
Contributor Author

SimonThalvorsen commented Jun 1, 2026

Ticket: ENT-14056
Signed-off-by: Simon Halvorsen <simon.halvorsen@northern.tech>
@SimonThalvorsen SimonThalvorsen changed the title ENT-14056: Move cache/config-files from .cfengine to .cache/.config ENT-14056: Moved cache/config-files from .cfengine to .cache/.config Jun 1, 2026
@SimonThalvorsen SimonThalvorsen marked this pull request as ready for review June 1, 2026 14:23
@olehermanse olehermanse requested a review from larsewi June 1, 2026 14:36
Comment thread cf_remote/utils.py
dirs_exist_ok=True,
ignore=shutil.ignore_patterns("json", "packages"),
)
print("config-files has been moved to '%s'" % conf_dir)
Copy link
Copy Markdown
Member

@olehermanse olehermanse Jun 1, 2026

Choose a reason for hiding this comment

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

Suggested change
print("config-files has been moved to '%s'" % conf_dir)
print("Migration: config files have been moved to '%s'" % conf_dir)

Comment thread cf_remote/utils.py
os.path.join(cache_dir, "packages"),
dirs_exist_ok=True,
)
print("cache-files has been moved to '%s'" % cache_dir)
Copy link
Copy Markdown
Member

@olehermanse olehermanse Jun 1, 2026

Choose a reason for hiding this comment

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

Suggested change
print("cache-files has been moved to '%s'" % cache_dir)
print("Migration: cache files have been moved to '%s'" % cache_dir)

Comment thread cf_remote/utils.py
Comment on lines +377 to +384
choice = input("Remove directory %s ? [y/N]" % old_dir).strip().lower() or "n"
if choice in "yes":
shutil.rmtree(old_dir)
print("%s has been removed" % old_dir)
return
if choice in "no":
return
print("Unknown input.")
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We can't prompt for input like this. cf-remote could be running in a script or similar. I think this migration should be safe to run without prompts, if the copies are successful, the old dir should be removed to avoid confusion / duplication.

Comment thread cf_remote/utils.py
Comment on lines +345 to +348
override_dir = os.getenv("CF_REMOTE_DIR")
# Set manually by user, assume they want to keep it like that
if override_dir:
return
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

It's debatable, but I think I would run the migration for the default paths even if a specific dir is specified. If they have something in the default location, they probably want that moved in case the old location will stop working in the future, for example.

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.

3 participants