…l be done as a separate PR in order to keep this PR small.
…are done in a single PR :( 1-) VersionVI and VersionVII classes are moved to their own classes. 2-) VersionVII class only gets the data instead of full System object. 3-) A new integration testing infrastructure is started (similar to Chef integration tests). 4-) Loader code is refactored. 5-) New integration tests for Loader are added.
The name "attributes" to refer to the map of attributes<->plugins providing attributes was confusing because it was inaccurate and often used near a local variable named "attributes" containing a very different kind of data (such as an Array of strings referring to attributes another plugin depended on). Renaming to "provides_map" clears up the confusion.
Only test code was accessing this, modified to use the public API of the class.
Code to map a plugin to the attributes it provides or look up a plugin by provided attributes was located in different parts of the code base where it operated directly on the underlying data structure. Extracting to a class lets us access the information we want using domain specific terminology so things are easier to understand.
- Refactor privateaddress logic into smaller, more clear methods based on comments from @btm - Make rspec descriptions a little more readable
Hash keys are ordered in Ruby > 1.9, so the plugin behaved differently between 1.8 and newer versions. In order to make the code (and tests) more deterministic, let's sort network interfaces before doing work.
On hosts with virtual interfaces on RFC1918 networks, the ip_scopes plugin may set `node.privateaddress` to a virtual address. This can cause problems with automation that relies on the `privateaddress` attribute. This patch prefers non-ppp interfaces when setting `privateaddress`, though it will use ppp interfaces if they are the only ones.
$ php -v PHP 5.3.27 with Suhosin-Patch (cli) (built: Aug 30 2013 04:30:30) Copyright (c) 1997-2013 The PHP Group Zend Engine v2.3.0, Copyright (c) 1998-2013 Zend Technologies Conflicts: lib/ohai/plugins/php.rb