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(lxd): Properly handle unicode from LXD socket #5309

Merged
merged 3 commits into from
May 23, 2024

Conversation

TheRealFalcon
Copy link
Member

Proposed Commit Message

fix(lxd): Properly handle unicode from LXD socket

Fixes GH-5300

Additional Context

See #5300

Merge type

  • Squash merge using "Proposed Commit Message"
  • Rebase and merge unique commits. Requires commit messages per-commit each referencing the pull request number (#<PR_NUM>)

Copy link
Collaborator

@blackboxsw blackboxsw left a comment

Choose a reason for hiding this comment

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

functionally looks good.
I think we are missing correct mocks here in tests/unittests/sources/test_lxd.py::TestReadMetadata::test_read_metadata_handles_unexpected_content_or_http_status as we are failing on our mock here in py 3.11 due to our mocking of response.text instead of response.content. May need to update that unittest to avoid the 8 failures there.

@TheRealFalcon
Copy link
Member Author

Doh, I missed the unit test failures. Thanks! Should be updated now.

Copy link
Collaborator

@blackboxsw blackboxsw left a comment

Choose a reason for hiding this comment

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

Bring it home!

@@ -506,6 +507,10 @@ def test_instance_cloud_id_across_reboot(
assert client.execute(f"test -f /run/cloud-init/{cloud_file}").ok
assert client.execute("test -f /run/cloud-init/cloud-id").ok

def test_unicode(self, class_client: IntegrationInstance):
client = class_client
assert "💩" == client.read_from_file("/var/tmp/unicode_data")
Copy link
Collaborator

Choose a reason for hiding this comment

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

And, who says we don't know how to have fun in this project?

@blackboxsw blackboxsw merged commit 699159e into canonical:main May 23, 2024
27 of 29 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.

None yet

2 participants