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

Fix dry-run mode with Pro enabled. #2046

Merged
merged 1 commit into from
Aug 8, 2024
Merged

Conversation

mwhudson
Copy link
Collaborator

@mwhudson mwhudson commented Aug 8, 2024

In dry run mode we copy the apt config from the running system into the "target". Some files associated with Ubuntu Pro are not readable to regular users and they aren't required to get some kind of working config in the target so skip them.

@mwhudson mwhudson force-pushed the dry-run-vs-pro branch 2 times, most recently from 9f3ed2b to 2f694a8 Compare August 8, 2024 05:26
Copy link
Member

@ogayot ogayot left a comment

Choose a reason for hiding this comment

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

LGTM

r.append(name)
return r

shutil.copytree(f"{source}/etc/apt", f"{target}/etc/apt", ignore=_ignore_pro)
Copy link
Member

Choose a reason for hiding this comment

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

Alternatively, you can use ignore=shutil.ignore_patterns("*esm*", "*advantage*"), that I just learnt about.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Oh yes, I saw that but somehow blanked on the fact that I could use it for my needs.

In dry run mode we copy the apt config from the running system into the
"target". Some files associated with Ubuntu Pro are not readable to
regular users and they aren't required to get some kind of working
config in the target so skip them.
@mwhudson mwhudson merged commit dc55153 into canonical:main Aug 8, 2024
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants