Enhance decorators in agent and automate creation of command_map

sync_command and async_command in ironic_python_agent/extensions/base.py
are implemented so that they change decorated method signature,
which is really bad practice. Example:

@sync_command
def orig_method(self, **kw):
...

sync_command decorator returns lambda which has one additional
argument 'command_name'

def sync_command(func):
    def decorated(self, command_name, **kw):
         ...
         func(self, **kw)
         ...
    return decorated

Additional parameter 'command_name' is moved from decorated function to
decorator signature in both decorators. Every call of decorated functions
is fixed, BaseAgentExtension.execute is updated to not send this extra
argument. BaseAgentExtension.__init__ automatically generates command_map
from decorated methods.

Change-Id: Iff0f495bc8d9c731892feb0f4759a7f10ee76328
Closes-Bug: 1314148
Add docstrings for agent.py

Does what it says.

Partial-Bug: 1367915

Change-Id: If2617f30c75c4a844c20a60afa41330daf84053a
Merge "Enhance decorators in agent and automate creation of command_map"
Remove PyPy from default tox runlist

PyPy has been failing locally for a month or two. On Ubuntu 14.04: 
"No module named _bsddb", on 12.04: "Not a .py file: 
/data/dev/work/ironic-python-agent/.tox/pypy/build/setuptools/
setuptools/cli-32.exe"

PyPy isn't enabled as a job in the gate yet (even non-voting). Until 
we sort the gate out and fix the above errors, we should remove it 
from the default tox runlist.

Change-Id: I34c0a72edebc296b79c6058e64ffb98f60979bcb
Add support to build iso image

This script adds support to build iso image from the given
kernel and ramdisk

Change-Id: I15dd8b8663af15b4194299986792ad8e6487508b
Implements: blueprint ilo-virtualmedia-ipa
Preserve environment variables when doing sudo

This commit adds the '-E' option for all the sudo commands
in build script of agent which causes it to preserve environment
variables.

Change-Id: Ic3fbc4ee8189cc82ef99359bf61eef33dae40a5a
Closes-Bug: 1371418
Merge "Add docstrings for agent.py"
Merge "Preserve environment variables when doing sudo"
Merge "Add support to build iso image"
Add docstrings for api/ tree

Does what it says.

Partial-Bug 1367915

Change-Id: Id1a718d652f6d98e6acb1d667f42d9c3cc82aef5
Delete unused method get_agent_mac_address()

Does what it says.

Change-Id: I01e20e3a1e7317c17da6fc04ee0b0a672cf8247b
Merge "Add docstrings for api/ tree"
Merge "Delete unused method get_agent_mac_address()"
Use LLDP to get switch port mapping

Provides a function to listen for LLDP packets on the network.
Listens on one or all of the network interfaces, and then parses the found
packets.

Change-Id: I1545a41f46cd0916aab9c43ce036865454fa66e0
Co-Authored-By: Josh Gachnang <josh@pcsforeducation.com>
(cherry picked from commit c036c64b08b5c0ec6fe13e0919b9145598bfe72e)
Adding support for decommissioning

The pluggable hardware manager should be able be used for decommissioning,
such as erasing disks, updating firmwares, changing BIOS settings, and
anything else specific hardware needs. This works with the agent driver
to store state in Ironic and request out of band reboots (which may be
required to make BIOS/firmware updates work).

Change-Id: Ia42a8e75d2b8887b2351de97c2137fe21a7f4041
(cherry picked from commit f59ef2d87d029c9b9efbe17bc492c695b1fe5e3a)
Add versioning to Agent decommission

As the agent will likely be rebooting while decommissioning (to apply BIOS/
firmware upgrades), it is possible the version of the agent will change
between boots. Including a version string in the Hardware Manager allows
the Hardware Manager builder to bump versions for any breaking changes.
I recommend that the entire decommission process be restarted if there
is a version mismatch, but that will be up to individual drivers to
implement.

This change also adds a new return value for Agent REST commands called
'DECOM_VERSION_MISMATCH' that will signal no command was run, and
Ironic should update its stored value. A 'hardware_manager_version'
will be returned with AsyncCommandResult, and should be set in the
Ironic driver_info field and sent with any decommission command.

Change-Id: I2ae0e93573e0348f023aa124a07bb16921b5c53e
(cherry picked from commit b7ac093d1ead146c06c0fd8649707c66ee3c1d4d)