-
Notifications
You must be signed in to change notification settings - Fork 881
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
growpart: Fix behaviour for ZFS datasets #5169
Conversation
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.
This is the kind of code that a goto
would make more readable.
Unfortunately, Python has no goto
, so I'll have to think a little harder about how to do this.
LOG.debug("Failed: zpool get size %s", zpool) | ||
return None | ||
return int(size.strip()) | ||
|
||
def devent2dev(devent): |
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.
might wanna rename this function now that it returns more, maybe deventinfo
?
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.
might wanna rename this function now that it returns more, maybe deventinfo?
Agreed, how about a snake case device_entry_info()
or dev_entry_info()
or something?
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.
sounds good, I'll change that tomorrow or the day after.
5589b3e
to
05f7702
Compare
4850aec
to
587c5ea
Compare
…cal#5169) First off, the recursion was bogus, because it called the wrong function, but more importantly, it would lead to infinite recursion anyway, even if we called the right one. Throw a ValueError instead, because we've most likely been called with a bogus value. Add a test to show that. Sponsored by: The FreeBSD Foundation
on FreeBSD, ZFS datasets aren't exposed directly as disks devices, so stats will fail. Currently, this means that growpart will be skipped for FreeBSD ZFS volumes, even tho we are perfectly capable of resizing ZFS. - Return fs from devent2dev(), which is now inappropriately named - Add get_zfs_size() helper, and extend get_size() to accept an `fs` parameter. - Add _call_resizer() helper, to avoid an indent on `if fs == zfs` - Add a unittest to show the behaviour Sponsored by: The FreeBSD Foundation
587c5ea
to
a277569
Compare
on FreeBSD, ZFS datasets aren't exposed directly as disks devices, so stats will fail. Currently, this means that growpart will be skipped for FreeBSD ZFS volumes, even tho we are perfectly capable of resizing ZFS. - Return fs from devent2dev(), which is now inappropriately named - Add get_zfs_size() helper, and extend get_size() to accept an `fs` parameter. - Add _call_resizer() helper, to avoid an indent on `if fs == zfs` - Add a unittest to show the behaviour Sponsored by: The FreeBSD Foundation
a277569
to
457438e
Compare
on FreeBSD, ZFS datasets aren't exposed directly as disks devices, so stats will fail. Currently, this means that growpart will be skipped for FreeBSD ZFS volumes, even tho we are perfectly capable of resizing ZFS. - Return fs from devent2dev(), which is now inappropriately named - Add get_zfs_size() helper, and extend get_size() to accept an `fs` parameter. - Add _call_resizer() helper, to avoid an indent on `if fs == zfs` - Add a unittest to show the behaviour Sponsored by: The FreeBSD Foundation
457438e
to
ff2bb74
Compare
tested on aws: Still works! |
Nice, thanks for this. Busy at a conference now but I'll try to review (and land it if ready) in the next few days. |
Hello! Thank you for this proposed change to cloud-init. This pull request is now marked as stale as it has not seen any activity in 14 days. If no activity occurs within the next 7 days, this pull request will automatically close. If you are waiting for code review and you are seeing this message, apologies! Please reply, tagging TheRealFalcon, and he will ensure that someone takes a look soon. (If the pull request is closed and you would like to continue working on it, please do tag TheRealFalcon to reopen it.) |
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 for the long delay on this one @igalic. This looks good to me, thanks for putting in the work on it!
First off, the recursion was bogus, because it called the wrong function, but more importantly, it would lead to infinite recursion anyway, even if we called the right one. Throw a ValueError instead, because we've most likely been called with a bogus value. Add a test to show that. Sponsored by: The FreeBSD Foundation
First off, the recursion was bogus, because it called the wrong function, but more importantly, it would lead to infinite recursion anyway, even if we called the right one. Throw a ValueError instead, because we've most likely been called with a bogus value. Add a test to show that. Sponsored by: The FreeBSD Foundation
on FreeBSD, ZFS datasets aren't exposed directly as disks devices, so stats will fail. Currently, this means that growpart will be skipped for FreeBSD ZFS volumes, even tho we are perfectly capable of resizing ZFS. - Return fs from devent2dev(), which is now inappropriately named - Add get_zfs_size() helper, and extend get_size() to accept an `fs` parameter. - Add _call_resizer() helper, to avoid an indent on `if fs == zfs` - Add a unittest to show the behaviour Sponsored by: The FreeBSD Foundation
Proposed Commit Message
Additional Context
Test Steps
Checklist
Merge type