-
Notifications
You must be signed in to change notification settings - Fork 276
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 filesystem type detection #93
Conversation
| @@ -16,7 +16,7 @@ def destroy | |||
| end | |||
|
|
|||
| def fstype | |||
| /TYPE=\"(\S+)\"/.match(blkid(@resource[:name]))[1] | |||
| / TYPE=\"(\S+)\"/.match(blkid(@resource[:name]))[1] | |||
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.
Shouldn't that be
/\bTYPE=\"(\S+)\"/.match(blkid(@resource[:name]))[1]?
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.
+1 for boundary matching, instead of space character.
|
Thanks @mhaskel. I also agree and added acomit to change this. Should I squash both commits into one? I never know which is best. |
Sometimes `blkid` shows a `SEC_TYPE="ext2"` in addition to `TYPE="ext3"`. It has something to do with a filesystem being backwards compatible with ext2. This commit fixes the regex that matches TYPE=.. to prevent it from matching SEC_TYPE.
db6bd79
to
4694b25
Compare
|
Squashed on @raphink's advice. |
Fix filesystem type detection
|
Thanks for the contribution @ckaenzig ! |
Fix filesystem type detection
Sometimes
blkidshows aSEC_TYPE="ext2"in addition toTYPE="ext3".It has something to do with a filesystem being backwards compatible with
ext2. This commit fixes the regex that matches TYPE=.. to prevent it
from matching SEC_TYPE.
Unfortunately I couldn't figure out how to add a test case for this. Any advice welcome if you think a test is necessary, thanks!