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

Fix filesystem type detection #93

Merged
merged 1 commit into from
Feb 4, 2015

Conversation

ckaenzig
Copy link
Contributor

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.

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!

@@ -16,7 +16,7 @@ def destroy
end

def fstype
/TYPE=\"(\S+)\"/.match(blkid(@resource[:name]))[1]
/ TYPE=\"(\S+)\"/.match(blkid(@resource[:name]))[1]
Copy link
Contributor

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]

?

Copy link

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.

@underscorgan
Copy link
Contributor

Thanks for the contribution @ckaenzig! I agree with @raphink's comment. Can you update that and then we should be good to merge this.

@ckaenzig
Copy link
Contributor Author

ckaenzig commented Feb 4, 2015

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.
@ckaenzig
Copy link
Contributor Author

ckaenzig commented Feb 4, 2015

Squashed on @raphink's advice.

underscorgan pushed a commit that referenced this pull request Feb 4, 2015
@underscorgan underscorgan merged commit 975e867 into puppetlabs:master Feb 4, 2015
@underscorgan
Copy link
Contributor

Thanks for the contribution @ckaenzig !

@ckaenzig ckaenzig deleted the fix-fstype-detection branch February 4, 2015 16:20
cegeka-jenkins pushed a commit to cegeka/puppet-lvm that referenced this pull request Oct 23, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants