-
Notifications
You must be signed in to change notification settings - Fork 142
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
Allow the user to specify the partition type #328
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.
Looks good to me. Let's see what our CI thinks about this. The test failure is likely to be cause by some udev-related issues. We have been seeing something similar recently.
data/org.freedesktop.UDisks2.xml
Outdated
@@ -1406,7 +1406,7 @@ | |||
@size: The desired size of the partition, in bytes. | |||
@type: The type of partition to create (cf. the #org.freedesktop.UDisks2.Partition:Type property) or blank to use the default for the partition table type and OS. | |||
@name: The name for the new partition or blank if the partition table do not support names. | |||
@options: Options (currently unused except for <link linkend="udisks-std-options">standard options</link>). | |||
@options: Options - known options (in addition to <link linkend="udisks-std-options">standard options</link>) includes <parameter>partition-type</parameter> (of type 's'). |
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.
include
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.
Instead of "includes"? That's what I thought but everywhere else even if there's only one option it also says "includes".
Either this is a consistency thing everyone went with or the writers all somehow read: "includes parameter partition-type
" even though the tag is obviously not read.
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.
known options...include... makes sense to me. Don't really care about consistency here. :)
data/org.freedesktop.UDisks2.xml
Outdated
@@ -1439,7 +1443,7 @@ | |||
@size: The desired size of the partition, in bytes. | |||
@type: The type of partition to create (cf. the #org.freedesktop.UDisks2.Partition:Type property) or blank to use the default for the partition table type and OS. | |||
@name: The name for the new partition or blank if the partition table do not support names. | |||
@options: Options (currently unused except for <link linkend="udisks-std-options">standard options</link>). | |||
@options: Options - known options (in addition to <link linkend="udisks-std-options">standard options</link>) includes <parameter>partition-type</parameter> (of type 's'). |
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.
same here with include
@@ -95,7 +95,7 @@ def test_create_mbr_partition(self): | |||
sys_num = int(self.read_file('%s/partition' % part_syspath)) | |||
dbus_num.assertEqual(sys_num) | |||
|
|||
def test_create_extended_partition(self): | |||
def create_extended_partition(self, ext_options, log_options, fstype=''): |
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.
It's not fstype
, it is the partition type (see the docs for details)
Jenkins, this is ok to test. |
I can confirm I'm seeing very weird issues even without this patch when trying to create 3 partitions on a single disk. The extended tests in this PR probably just it. |
So you say I should remove that test? Honestly it's not very good either since it would probably pass without this patch. |
Could be a good idea for now. We need to deal with the issues when creating partitions in general and it wouldn't make much sense to add tests that would always fail at this point. |
Done. Once merged, we'll see how that affects your newly added tests from here, @squimrel |
@vpodzime Ohh wow in fact this fixes the test I just removed! Well done. |
Thanks. :) Let's see if it really makes things work better. Please resolve the conflict that was introduced by me extending the tests a bit. |
Implement feature requested in #318. Allow the user to specify the "partition-type" option in "CreatePartition" to explicitly specify whether the partition should be a primary, extended or logical partition.
Not sure if I like this implementation since theoretically the partition type can always be guessed correctly except if the partition type should be extended. (Note that doing so would alter existing behavior and therefore break applications that rely on the current behavior.)
Deriving "extended" from the filesystem partition seems legit and is already done by udisks.
Note that on my end the
test_fill_with_primary_partitions
fails after adding the second partition due to this error:I've got no clue why that happens. Help wanted.
Implement feature requested in #318.
Allow the user to specify the "partition-type" option in
"CreatePartition" to explicitly specify whether the partition should be
a primary, extended or logical partition.