Remove repeated code and optimize case statement.

Note that internally Ruby uses === for case statement so when testing
for an object's class, "case object" is the correct way.  See

http://ruby.about.com/od/beginningruby/qt/On-Case-And-Class.htm

Previously the object under question has been converted to a string for
comparison.  This works now, but it's a little dangerous because it
assumes that the string representation of certain classes (String,
Symbol, Hash, etc.) do not change over time.
Changes to the Debian, Redhat, and Ubuntu models (and their sub-types) to support setting of the domain name for the model (with a default value of "localdomain") and to support adding that hostname and domainname to the /etc/hosts file (so that the name will resolve correctly, at least locally).
refactored object -> noun mapping for API URI creation. No longer directly evals vs Object. Now can be changed within Object depending on state.

Fixes incorrect noun for Active Model which is a Policy object in a final state
Merge remote-tracking branch 'harrypan/tb/case_class' into harrypan/case_class
Added removed comments
Cleaned up old debug lines
Removed obsolete unit test
Getting Web Options should return an empty Hash object and not nil if nothing is found.
Wasn't passing the noun key on multiple item web request. Required for generating uri.
Changes to ensure that the hostname and domainname set in the model are reflected in the /etc/hosts file on the local system (take 3). The first commit on this topic had issues with the sed command used in the post-boot script constructed by these four models. The second commit got around the issues with the first commit by restricting the pattern matched in the /etc/hosts file created by the OS install to just the line that had an IP address of "127.0.1.1". This commit loosens that restriction (by using two 'sed' commands instead of just one) so that the lines that look like 127.x.x.x but don't match 127.0.0.1 will be modified to look something like "127.x.x.x    hostname.domainname    hostname" (which will effectively set the fully qualified hostname and the domainname for most modern Linux systems).  This change has been tested under Ubuntu 11.10 (Oneiric), but should work under Ubuntu 12.04 (Precise), Debian Wheezy, and RedHat6 (which is also used by the CentOS model).
added logging for file transfer with image.svc
Take four on a set of changes to ensure that the hostname and domainname set in the model are reflected in the /etc/hosts file on the local system. The previous commit on this topic might have had issues if there were multiple 127.x.x.x lines in the file (aside from the non-loopback line).  This commit only changes the first 127.x.x.x line in the /etc/hosts file and leaves the /etc/hosts- file in place as a backup of the original file (for comparison). Eventually we might want to remove this file at the end of the grep/sed command sequence that is modifying it.
Fix for range error in matching the non-loopback local IP addresses during the sed command...
Fix to range of tail command (was pulling one extra line...starts with line 1, not line 0
Merge remote-tracking branch 'upstream/master'
Fixes issue with non-persistent hostname in the Ubuntu Precise model (per virtualswede's request in issue #119)
Fixes issue with non-persistent hostname in the remaining models that use this same construct in their os_boot.erb file (per ChrisLundquist's comment to the merge request already submitted as issue #122)
Fixes broken range requests for Centos/RHEL based distros
Updated preseed config so that warnings will not be thrown if old LVM config exists on disk
Fixes #130 and a couple of other (unreported) issues that resulted from recent changes to the way that the Razor configuration is obtained by the RazorDaemon class defined within this script.  Previously, this class accessed the configuration directly (as an object), but changes that were made to the razor_daemon.rb script to fix a log rotation error (Pull Request #117) meant that the configuration was now returned through the Razor web API (which means that the keys in the resulting hash are all prefixed with an "@" sign). As a result, the previous code (which used a line like "node_expire_timeout = razor_config['node_expire_timeout']" to obtain the "timeout" value to use for node expiration) no longer returned the desired value from the Razor configuration.  Instead, a line like "node_expire_timeout = razor_config['@node_expire_timeout']" had to be used to obtain this same value.  This commit makes all of the appropriate changes to the razor_daemon.rb script to resolve issues from this recent change to how the Razor configuration values are returned to the razor_daemon.rb script from its RazorDaemon class. This also fixes an undiscovered issue with retrieving the daemon minimum cycle time (how long the daemon waits between cycles of it's event handling loop) from the Razor configuration as well as an undiscovered issue with how the persistence host/port are reported as part of the error that is printed when the database connection fails.
Merge remote-tracking branch 'upstream/master'