Changes between Version 33 and Version 34 of Internal/InventoryV3


Ignore:
Timestamp:
Nov 17, 2010, 2:02:36 AM (14 years ago)
Author:
ssugrim
Comment:

New version of Gatherer being developed

Legend:

Unmodified
Added
Removed
Modified
  • Internal/InventoryV3

    v33 v34  
    55Versions:
    66
    7  * gather.rb:0.91
     7 * gather.rb:2.04
    88 * writer.rb:1.02
    99 * logcopy:0.04
     
    340340TODO: Have logcopy do sanity check for files and replace them
    341341
    342  
     342=== 11/16/2010 ===
     343gatherer version 2 is now in the works. It's essentially a complete rewrite where we standardise on Lshw as the method of getting hardware information. Instead of doing regexp on lspci, lsusb and the like we instead will use lshw. There may be some issues with usb ethernet devices (depending on how lswh classifies them vs how the database treats them.) That'll have to be worked out.
     344
     345I've revamped the argument processing (useing a standard library) so that it's much cleaner. This is done in the main function body. I'm also using the logger more liberally since this is expected to be a standard. By default logs goto STDOUT, but that can be changed with a flag. It would be nice to make output file path a mandatory argument, but I've not figured out how to do that yet.
     346
     347The new model is much simpler since we only need lshw. There is a parent class called Component that defines a poll method. Each component should be able to poll for it's data, however the flag (to define what information to get from lshw) and the regexp are uninitialized arguments (no defaults so ther is much bitter complainting if I forget one, by design).  I use popen3 to call lshw. This suppresses any extraneous output lshw makes. I also scan std error and raise and exception if I lshw is not found (it's a configurable parameter). Component should not be instantiate-able, instead all other datum should be derived from it, and then provide named accessors to the derived components.