-
Notifications
You must be signed in to change notification settings - Fork 155
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
revert changes on fstype from mount #2049
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -1279,6 +1279,24 @@ def test_render_includes_unmounted_new_partition(self): | |||||
self.assertTrue(disk2.id in rendered_ids) | ||||||
self.assertTrue(disk2p1.id in rendered_ids) | ||||||
|
||||||
def test_bind_mount(self): | ||||||
model = make_model() | ||||||
make_disk(model, path="/dev/vda") | ||||||
fake_up_blockdata(model) | ||||||
model.apply_autoinstall_config( | ||||||
[ | ||||||
{ | ||||||
"id": "tmpfs1", | ||||||
"type": "mount", | ||||||
"spec": "none", | ||||||
"path": "/tmp", | ||||||
"size": "4194304", | ||||||
"fstype": "tmpfs", | ||||||
}, | ||||||
] | ||||||
) | ||||||
self.assertEqual(model.render()["storage"]["config"][0]["fstype"], "tmpfs") | ||||||
|
||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Try adding something like this:
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hi @dbungert
With that code I could reproduce the issue, enabling me to debug further.
Indeed, the serialization code skips if the attribute starts with
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
As the serialization code doesn't look at underscore attributes, or the property apparently, I'm suggesting that we revert fstype from a property like you had originally suggested - but fix the code that breaks on the ZFS codepath. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
This is now added on d4e2cf5 As for the ZFS unit test case, I'm not sure how to proceed; if you can point me to a similar test already done or some pointers, I would be grateful. |
||||||
|
||||||
class TestPartitionNumbering(unittest.TestCase): | ||||||
def setUp(self): | ||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, I really don't want this bit here. I want this as part of the ZFS class.
So to abstract that we can add something to Mount and ZFS that isn't a property that allows retrieving the fstype - like the property originally, but with a different name (and not a property) so serialization isn't broken, and then ZFS can handle the special case.