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

Ignore parted warnings if possible #216

Merged
merged 1 commit into from
Jun 16, 2017
Merged

Ignore parted warnings if possible #216

merged 1 commit into from
Jun 16, 2017

Conversation

squimrel
Copy link
Contributor

@squimrel squimrel commented Jun 13, 2017

Ignore parted exceptions of type warning and information if parted marks them as ignorable. Fixes #214.

I haven't tested this yet *cough*. Plus I should probably add at least one test case in which a parted warning is ignored. So please don't merge yet.

@squimrel
Copy link
Contributor Author

squimrel commented Jun 14, 2017

This seems to work but I have a hard time creating a test case that throws a parted warning so I gave up on it. make test-plug-part still passes.
RFC

Copy link
Contributor

@vpodzime vpodzime left a comment

Choose a reason for hiding this comment

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

Otherwise this looks good to me, thanks!

/*
* Only treat exceptions as errors if they aren't at least errors or can't
* be ignored.
*/
Copy link
Contributor

Choose a reason for hiding this comment

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

aren't should be are, shouldn't it?

return PED_EXCEPTION_UNHANDLED;
}
g_warning ("[parted] %s", ex->message);
return PED_EXCEPTION_IGNORE;
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd prefer if the logic was inverted here. So something like if THIS_CAN_BE_IGNORED -> ignore; else raise

Ignore parted exceptions of type warning or information if parted marks
them as ignorable.
@squimrel
Copy link
Contributor Author

There you go.

Copy link
Contributor

@vpodzime vpodzime left a comment

Choose a reason for hiding this comment

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

Thanks!

@vpodzime
Copy link
Contributor

Jenkins, this is ok to test.

@vpodzime vpodzime merged commit 7c6c5c0 into storaged-project:master Jun 16, 2017
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