29 Commits

Author SHA1 Message Date
John L. Villalovos
dcbba2b121 Enforce all flake8 rules except E129
Bring ironic-python-agent in line with the other ironic projects.

Stop ignoring all E12* errors except E129
Stop ignoring E711

Change-Id: Icb9bc198473d1b5e807c20869eb2af7f4d7ac360
2015-10-02 10:01:00 -07:00
Naohiro Tamura
cae39ae14d Fix default ironic api port number
This patch corrects the default ironic api port number to 6385 from
6835. The default value of 'ipa-api-url' is not used in production
environment since conductor and bare metal node have its own IP
address, but could be used in development environment.
Therefor this patch fixes this trivial error.

- default=APARAMS.get('ipa-api-url', 'http://127.0.0.1:6835'),
+ default=APARAMS.get('ipa-api-url', 'http://127.0.0.1:6385'),

Change-Id: Idb85e95b354a68111f94e8cddd5c1b6227e676ef
2015-09-23 14:11:29 +09:00
Dmitry Tantsur
096830414b Add support for inspection using ironic-inspector
Adds a new module ironic_python_agent.inspector and new entry point
for extensions, which will allow vendor-specific inspection.

Inspection is run on service start up just before the lookup.
Due to this early start, and due to the fact we don't even know
MAC address of nodes on inspection (to say nothing about IP addresses),
exception handling is a bit different from other agent features:
we try hard not to error out until we send at least something to inspector.

Change-Id: I00932463d41819fd0a050782e2c88eddf6fc08c6
2015-09-07 18:22:54 +02:00
Jay Faulkner
ac040f5152 Add docstrings for cmd/agent and extensions/clean
Adding documentation for methods in these files that were missing
docstrings.

Change-Id: I2ad9f85605720ab2295dec3d0436ff0af07847c2
Partial-bug: 1367915
2015-09-03 16:15:54 -07:00
Josh Gachnang
2c28cca71d Enable --debug for debug logging
oslo_log wasn't getting the correct config values passed in, so adding
'--debug' to the command line wouldn't enable debug logging.

Added docs about --debug and --standalone (the only two flags I've
seen used/supported).

Change-Id: Ie1ba64992444a65a40f2d65933942153b93e70c1
2015-08-28 12:25:06 -07:00
Ghe Rivero
10a3a800e7 Use oslo_log lib
Module 'log' from oslo-incubator was removed after release of oslo_log
library.

Change-Id: Ia00e26071fc0cab4fd3f3334ca94860bc7b1c75c
2015-03-24 08:43:35 +01:00
Lucas Alvares Gomes
c6cd3a8190 Move _get_agent_params() to a common place
The function _get_agent_params() parse the parameters passed to the agent
via kernel cmdline or vmedia. Other parts of the code needs to access
these parameters as well, so this patch is moving _get_agent_params()
and the related functions to a common place (utils.py).

Change-Id: I860f84d1d13511fff56d4aa56358ee597a9760d5
2015-03-10 17:43:17 +00:00
Jay Faulkner
ff5b0643d2 Enable setting standalone mode via APARAMS
All other IPA options are settable via APARAMS (kernel command line
or the kernel commandline-like interface provided by virtualmedia).
Being able to set this at PXE time allows for operators to boot
and functionally test new agent images without having to recompile
post testing (to change standalone setting).

Change-Id: Ie796a98c995704db09945b6f890e9bf4d07eaa1a
Closes-bug: 1426546
2015-02-27 14:25:13 -06:00
jiangfei
7d1cc976cd use oslo_config replace oslo.config
oslo.conifg 1.6.0 has moved its namespace from old
oslo.config to oslo_config

requirements has updated to oslo.conifg 1.6.0

Change-Id: I16b8dc680f8a7697b7fbbd888f5162d924b4c0fe
2015-02-07 14:09:44 +08:00
Jenkins
8dd54446e3 Merge "Add standalone mode for IPA" 2015-01-06 23:17:32 +00:00
Josh Gachnang
417bf086a5 Add standalone mode for IPA
This allows a developer to run IPA without an Ironic API. This can
be useful for testing (especially functional testing) or testing
integration of things like hardware managers.

Change-Id: I2dc49fbe306430bf5b05a36fe56de5275fc128b2
2014-12-16 17:59:29 -08:00
Jenkins
3dda038707 Merge "Use oslo.utils and oslo.concurrency" 2014-12-17 01:44:47 +00:00
Jim Rollenhagen
15aaa03833 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>
2014-12-09 11:59:00 -08:00
Oleksii Chuprykov
86ef5d368d Use oslo.utils and oslo.concurrency
Update openstack/common files and use oslo.utils, oslo.concurrency
instead of modules from oslo-incubator.

Additionally, sort and set requirements.txt to correct versions in
openstack/requirements in order to ensure pep8 passes.

Change-Id: I15f88a31a4c889bba27cd0cd1c7fc481c0c0b51e
2014-12-09 00:06:23 +00:00
Clif Houck
7341511b98 Fix badly named function _get_kernel_params()
Renamed _get_kernel_params() to _get_agent_params() and
appropriate module-level attribute KPARAMS to APARAMS.

Updated agent tests to match new function name.

Change-Id: I4cdf1defee7487785967a092c81c906d40bf3214
Closes-Bug: #1367917
2014-12-05 00:34:39 +00:00
Jenkins
c8824b6356 Merge "Use _ instead of - for config options" 2014-12-03 19:46:12 +00:00
jiangfei
597d6245b1 Use _ instead of - for config options
Config options containing "-" don't work when reading
configuration from a file; change these to "_". Leave
the old options for backwards compatibility.

Closes-Bug: #1386486

Change-Id: Ie10a548191effa2a505309d9d4ee32003f9676a2
2014-12-03 16:09:17 +00:00
Jay Faulkner
7bf485ea87 Improve docstrings for cmd/agent.py
Added missing docstrings and improved existing docstrings for every
method in cmd/agent.py

Change-Id: Ib8dbbf70bca139a43d75d59fb09dce899466e888
Partial-bug: 1367915
2014-11-14 03:20:08 +00:00
Ramakrishnan G
8c0584c121 Add vmedia boot support in IPA
This commit adds support for booting IPA from virtual
media cdrom.  When IPA is booted over virtual media cdrom,
the parameters to the IPA are passed in a text file within
the virtual media floppy.

Change-Id: Ia04585416aada85022af73fb2b945bd3895606f0
Closes-Bug: #1358723
2014-09-02 12:51:50 +05:30
Ellen Hui
b4f1a0b2d3 Tries to advertise valid default IP
During the first heartbeat, the heartbeater asks the agent to check
its advertised address; if the advertised IP is still the default
(None), the agent tries to replace it with the IP of the first network
interface it finds.  If it fails to find either a network interface or
an IP address, the agent raises an exception.

Change-Id: I6d435d39e99ed0ff5c8b4883b6aa0b356f6cb4ae
Closes-Bug: #1309110
2014-06-10 20:54:34 +00:00
Russell Haering
f69dd99a79 Switch to oslo.config for CLI parsing
Use oslo.config instead of argparse for CLI parsing. As a side effect,
a bunch of logging arguments including --debug become available with
this change.

Change-Id: Ia8c4e91448f2a8cb15eb570125ac9c236e13274c
2014-05-28 23:11:47 -07:00
Jim Rollenhagen
620f05eb33 Accept new parameters for prepare_image
The parameters sent to `prepare_image` changed in
https://review.openstack.org/#/c/86490/

This patch brings `prepare_image` up to date with that change.
It also changes the way configdrive is written to disk, to match
that Ironic is now allowing Nova to build an ISO partition and
send the raw image to the agent.

This patch also swaps out subprocess.call for processutils.execute
in the standby module, since the commands were being changed anyway.

Lastly, this patch changes the expected `hashes` dict to be a
string parameter called `checksum`, to match what glance returns.

Change-Id: Id8af9be920ba51e7e1ce60f4ffd1477e413582c9
2014-04-24 13:00:24 -07:00
Jim Rollenhagen
46e9776d42 Use configurable driver name in lookup URL
Allow configuration via command line arguments or kernel parameters.
Default to agent_ipmitool, the reference driver.

Depends on https://review.openstack.org/#/c/84795/12

Change-Id: I55c4a8713308d038002a6567471cd862bf89ec76
2014-04-14 11:32:16 -07:00
Russell Haering
8422118fa4 Kill the build_agent function
This used to actually do things, now it just wraps the constructor.
Lets kill it.

Change-Id: I320684f8f52d032a1755460eacc70f5aeee92d7a
2014-04-14 10:12:31 -07:00
Jim Rollenhagen
3c1d52cbb1 Use # instead of """ for copyright blocks
Reformats copyright messages to be comments rather than
docstring-style blocks.

Change-Id: I4d863f53b67bb49d03bda0952b9e6179b6d23c59
2014-04-10 07:14:06 -07:00
Jim Rollenhagen
9cfa63d2d0 Add kernel parameter support
Allow the agent to read arguments from the kernel command line.
Priority is: agent command line, kernel command line, defaults.

Change-Id: Idfd43a8b7fdf6c368cf55d45b32cb7bcfbb56212
2014-04-01 06:23:24 -07:00
Josh Gachnang
3bc4866a21 Adding DynamicLoopingCall around lookup
Currently, if a single lookup call to the Ironic API fails, the entire
agent errors out and restarts. This allows the agent to retry for a set
amount of time before throwing an uncaught exception forcing a restart.

Change-Id: I39752fb3f42ad3e4f15a49194f1554e1d3463cf8
Closes-Bug: 1297019
2014-03-31 14:54:14 -07:00
Josh Gachnang
5914e36b30 Replacing teeth/overlord with ipa/ironic 2014-03-19 16:19:52 -07:00
Josh Gachnang
b30d345c2e Renaming to IPA 2014-03-19 15:50:43 -07:00