extract server product/vendor information with lshw #77

Merged
merged 10 commits into from Apr 9, 2013

Projects

None yet

3 participants

@cburroughs
Contributor

Changes:

  • parse server product/vendor out of lshw
  • "DynamicEnum" to handle adding new field
  • Populate by default in DB with description
  • Display in web ui

I've tested using this code with existing instance and nothing (obvious) exploded, adding new assets and see lshw extract it, and searching

  • Per mailing list, spec tests are a bit wonky, but that does not seem new.
cburroughs added some commits Mar 15, 2013
@cburroughs cburroughs Parse server and store base server information
For lack of a better term, we will call the "thing that holds a
motherboard" the base server and keep track of the basic asset
information (description, product, vendor).  Description is less
likely to be useful, but it is easier to include it than not.  Unlike
cpus/nic/disks there is only one bit of basic server information (aka
it's not a Seq).

(Note that all dependencies do not yet compile, but this is the most
self contained unit for just the parsing code.)
f3e2e52
@cburroughs cburroughs Tell helpes about lshw server base changes
This is done via findOrCreateFromName instead of extending the
existing enum (which is not feasible).  This limits the abilty to
check things like "is this a valid id", since they are now dynamically
created.
58d23bb
@cburroughs cburroughs Include server base information in overview and hw detail
Displays empty if unknown.
9c787dd
@cburroughs cburroughs ensure that new basic lshw fields are in the DB at start, and thus
displayed in the default search index
f302657
@cburroughs cburroughs de-nullification 28c0b7e
@cburroughs cburroughs search dropdowns for base vendor/product 5945aee
@cburroughs cburroughs sadly some vendors will append unique strings to the product id,
making a dropdown inappropriate
b4add6d
@cburroughs cburroughs correctly handle pre-existing cases with no ServerBase 290bbc9
@fjaeckel
fjaeckel commented Apr 8, 2013

I'd be interested in having that in master.

@bmatheny
Contributor
bmatheny commented Apr 8, 2013

There are a few bugs/issues that should be addressed. I had intended on doing that but have not had time. Documenting below so the first person who has time.

  • Evolutions have no downs, only ups
  • There is no BASE_DESCRIPTION created by the migration
  • ServerBase should get an isEmpty method that should be used in the view. This data should only be displayed if the server base is not empty.
  • API docs need to be updated with new response format, could be in separate pull request
@cburroughs
Contributor
  • isEmpty
  • added BASE_DESCRIPTION to evolution

I'm not sure how to approach the down evolution. Just deleting the rows from asset_meta means there are references to invalid ids in asset_meta_value; that means AssetMeta.findById fails and you can't view assets that had those attributes. Deleting everything from asset_meta_value that references those ids feels like I'd be changing the data entered, not just the schema.

I think docs needs to be a separate pull request anyway since we are using gh-pages (having docs in the same tree and 'building' to the branch would be nice while working on both btw). Anything besides GET /api/asset/:tag and http://tumblr.github.io/collins/concepts.html#managed-tags that would need to be updated?

@bmatheny
Contributor
bmatheny commented Apr 9, 2013

We can figure out the down evolution later (prior to pushing a new release). Agreed on the docs (separate PR and which docs need updating). LGTM.

@bmatheny bmatheny merged commit 50b214c into tumblr:master Apr 9, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment