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

allow multiple product strings to be matched for flash disk detection #132

Merged
merged 1 commit into from
Mar 17, 2014

Conversation

byxorna
Copy link
Contributor

@byxorna byxorna commented Mar 13, 2014

Allows better support for environments with multiple models/vendors of PCIe flash disks. I will create a separate PR to update documentation indicating that lshw.flashProduct is deprecated, and lshw.flashProducts is the new feature variable.

@byxorna
Copy link
Contributor Author

byxorna commented Mar 13, 2014

@dallasmarlow @Primer42

@@ -100,7 +100,7 @@ class LshwParser(txt: String) extends CommonParser[LshwRepresentation](txt) {
case size => ByteStorageUnit(size.toLong)
}
Disk(size, _type, asset.description, asset.product, asset.vendor)
case n if (n \ "@class" text) == "memory" && (n \ "product" text).toLowerCase.contains(LshwConfig.flashProduct) =>
case n if (n \ "@class" text) == "memory" && LshwConfig.flashProducts.exists(s => (n \ "product" text).toLowerCase.contains(s)) =>
Copy link

Choose a reason for hiding this comment

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

Should (s) be (s.toLowerCase) as well? Cause currently tachION will cause a case mismatch.

Copy link

Choose a reason for hiding this comment

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

Ah never mind, I see was done above in LshwConfig.scala :)

@dallasmarlow
Copy link
Contributor

@byxorna lgtm 🍜

@william-richard
Copy link
Contributor

@byxorna LGTM 🎂

@william-richard
Copy link
Contributor

Stupid question, but will this break configs using the old lshw.flashProduct?

@byxorna
Copy link
Contributor Author

byxorna commented Mar 17, 2014

@Primer42 Nope, it was designed to support lshw.flashProduct as a deprecated option, and rolls it into lshw.flashProducts.

william-richard pushed a commit that referenced this pull request Mar 17, 2014
allow multiple product strings to be matched for flash disk detection
@william-richard william-richard merged commit 8565715 into tumblr:master Mar 17, 2014
dalehamel pushed a commit to Shopify/collins that referenced this pull request Jun 10, 2014
allow multiple product strings to be matched for flash disk detection
dalehamel pushed a commit to Shopify/collins that referenced this pull request Jun 10, 2014
allow multiple product strings to be matched for flash disk detection
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.

3 participants