Allow overriding the log level for ironicclient

oslo provides a 'default_log_levels' conf variable for overriding
logging levels for certain modules. This could be used to override
ironicclient's default logging level, however it requires re-setting
all of the log levels for oslo's defaults. This is rather inconvenient.

I think it makes sense to allow the ironic virt driver to have an easy
config option for this. When in debug mode, ironicclient logs every
single API call and response. In an environment with a lot of nodes,
it clutters the logs.

This adds a 'client_log_level' config option to the 'ironic' config
section in nova. If it's unset (default), there's no change in behavior.
If it's set, it takes precedence over the 'default_log_levels',
'verbose', and 'debug' settings that one may have in nova.conf

Example usage:
[ironic]
client_log_level=INFO

DocImpact

Closes-bug: 1325663

Change-Id: Id16d5017e1d9ae5d2b15ff3daca177ab36a32869
Prevent updating UUID of Node, Port and Chassis on DB API level

UUID is seen as something similar to pkey and is not expected
to be updated after creation.
This patch makes update_{node,chassis,port} raise InvalidParameterValue,
if 'uuid' field is passed in.

Closes-Bug: #1333683
Change-Id: I7312036a5144cebe3da7f033f73e881e79e8a2ca
Fixing hardcoded glance protocol

glance protocol was hardcoded as "http".
But someone may be use https for glance like us.

We are already have configuration for glance protocol.
So we should use it.

Change-Id: Iebde9efa5c4bb531b5b8a80061d98ccc360b622c
Closes-Bug: 1334489
Update "Exercising the Services Locally" doc

The sample config used to have several drivers enabled, but this was changed
to default to the 'pxe_ipmitool' production driver. The developer documentation
for "Exercising the Services Locally", has examples using the 'fake_ipmitool'
driver. It won't work since only the pxe_ipmitool driver is available. This adds
instructions for updating the config file to enable fake_ipmitool instead of
pxe_ipmitool.

Users sometimes encounter the 'NodeLocked' exception while trying out the
sample "ironic" commands, due to the periodic sync_power_state task locking
the node. Documentation was added with instructions on how to turn off this
background sync_power_state task via a config setting.

Change-Id: Id53db08df59d13ca7a52505d6b3c0931551f4bf4
Fix 'fake' driver unable to finish a deploy

The 'fake' driver is not returning any status from driver.deploy or
driver.tear_down, which prevents the completion of a provision state
transition with this driver.

Change-Id: I844dc03f35da23eb81235abdc16a79afc9835235
Wait for Neutron port updates when using SSHPower

Adds a sleep after updating Neutron from the PXEDeploy driver. This only
triggers if node is configured to use the SSHPower driver. In this case, it is
presumed to be powering on virtual machines which may present a race between
it booting and Neutron processing DHCP config changes.  This is a temporary
fix until we have better synchronization with external services.  The 15s sleep
is hard-coded currently to avoid adding a temporary config setting.

Closes-bug: #1334447.
Partial-Bug: #1300589.

Change-Id: Iee40d45d34af0c44bc14c202424e919713efb78d
Add the remaining unittests to the ClientWrapper class

This patch also pep8-fy the imports in the test_client_wrapper.py.

Closes-Bug: #1316549
Change-Id: Iaf154886c5c05f94ac045fbc99f93915bb91c878
Updates Ironic Guide with deployment information

This patch updates
Ironic deployment information
Adds 3 deployment diagrams
Describes deployment process

Change-Id: Idbe973c9a5f9805fe9a186a1db77fc66c044eeaf
Merge "Update "Exercising the Services Locally" doc"
Merge "Wait for Neutron port updates when using SSHPower"
Nova Ironic driver get_info() to return memory stats in KBytes

According to the base class 'max_mem' and 'mem' should be returned in
KBytes, other drivers are also converting those values to KBytes so
Ironic should as well.

This patch also add the missing docstring for the get_info() method.

Change-Id: Ia7063b994d506b511271920678868d336a776ec9
Update Nova Ironic Driver destroy() method

* Add DocString

* Add a missing parameter 'destroy_disks', although not used by Ironic
  we should keep the function signature consistent with the base class.

* When calling destroy() passing an non-existent instance log a warning
  message instead of debug. As suggested on the base class:

  "If the instance is not found (for example if networking failed), this
  function should still succeed. It's probably a good idea to log a
  warning in that case."

Change-Id: I0e7d9a9e5522606bafd5ef6d9dbe525ad39026d2
Add/Update docstrings in the Nova Ironic Driver

Add and update the docstrings in the Nova Ironic Driver. The 'node'
parameter from the power_on and power_off method was removed because
it's not part of the interface and wasn't being used.

To maintain the function signature consistent with the base class the
'node' parameter from the get_available_resource() method was renamed to
'nodename'.

Also, the method manage_image_cache() was removed from the driver because
it was simply calling "pass", just like the base class.

Change-Id: I0d2fe07992bde7bf09df934282b0551a35e99c1c
Fix the section name in CONTRIBUTING.rst

The name of the section 'If you're developer, start here'
has changed in the wiki. This commit updates it to correctly
refer to the good section.

Changed urls to use https

Change-Id: I7cec7b6ec209ae9ad95035dac4c9da4e09d6e0dc
Closes-bug: #1335189
Update Nova's available resources at termination

This updates ClusteredComputeManager to override terminate_instance() with
a call to update_available_resource().  The goal here is to limit the lag
between when an Ironic node has been freed and when it will become available
again to the Nova.  This avoids scheduling errors against Ironic node
inventories with high utilization and/or limited node resources.

Change-Id: I767cb97d9b182f1f9528d078b07a85ffbad313ba
Closes-bug: #1334027
Fix glance endpoint tests

Glance endpoints are now located under http_client after reworking
for glance blueprint common-client-library-2. Change located in
glanceclient commit I5addc38eb2e2dd0be91b566fda7c0d81787ffa75

Test support both glanceclient versions for backward compatibility.

Change-Id: Idba3a05bdb09674b44dcc21c9427b4b85a29a1f7
PEP fixes for the Nova driver

Several PEP violations were found when copying the Nova driver
to Nova's tree. This patch applies those fixes within Ironic's tree.

Change-Id: Ib6f082759b4398dd59829e71977bf3187baf4f6f
pep8 cleanup of Nova code

For various reasons, the Nova code in the Ironic tree is not covered by
the pep8 check.  This is a manual pass and cleanup of the scheduler
and driver code until this merges into Nova and can be gated on pep8
coverage again.

Change-Id: I1ab114c4bd152992262b1de8e763b407e92ca69f
Merge "PEP fixes for the Nova driver"
Merge "pep8 cleanup of Nova code"