Commit Graph

880 Commits

Author SHA1 Message Date
69b0b512c2 Updated from global requirements
Change-Id: I180828934b5c2b0ff51ab77a8203ff9c58895047
2015-06-09 19:58:37 +00:00
0a416af0c8 Merge "Make sure sysrq functions are enabled in reboot.sh" 2015-06-08 15:38:07 +00:00
601201d120 Update hacking and fix hacking violations
This does a few things:

* Update hacking to the version in global-requirements. Old hacking was
  installing a version of pbr that was breaking other packages.

* Fix all the hacking/pep8 rules that updating hacking raised.

* Do some general docstring cleanup, while already in there cleaning up
  a bunch of docstrings due to H405 violations.

Change-Id: I1fc1e59d4c3d7b14631f8b576e3f3854bc452188
Closes-Bug: #1461717
2015-06-03 16:58:57 -07:00
8faa3ae9d5 Make sure sysrq functions are enabled in reboot.sh
This commit echoes '1' to >/proc/sys/kernel/sysrq to
make sure that sysrq functions are enabled before
invoking them.

Change-Id: I88697efbc1bd0dec5ed4cbcd8d89b0b5d0734bdd
2015-06-02 12:41:06 +00:00
141191bcfa Rename gendocs tox environment
All other openstack projects use docs environment, use the same
name for ironic-python-agent as well.

Change-Id: I3315e111bd5994d2af2a7a2d0079a09e3d4e4d8b
2015-05-20 16:37:56 +02:00
8a94a8979c Merge "Use mkdtemp for mounting virtual media device" 2015-05-14 17:56:49 +00:00
5697bd40b1 Merge "Fix error in in-band disk erase using shred" 2015-05-12 09:35:12 +00:00
8cef029d0d Fix error in in-band disk erase using shred
in-band disk erase using shred fails with error "'module' object has no
attribute 'ProcessExecutionError'". This commit is to fix the issue.

Change-Id: Ia0c426074b2f0e9d534ed96a3e213933160edc61
Closes-Bug:#144799
2015-05-08 15:02:36 +05:30
daa28cd463 Updated from global requirements
Change-Id: I7b8985d21231c5bf6db7a5bc7e8d0c85e7ac5bda
2015-05-07 16:32:23 -07:00
7d1c852bee Use latest pip in Docker build
Turns out we're using whatever Ubuntu ships, which could go badly. :)

Change-Id: I2d41a9036f84f2ebcab96a5137642a4225d2b053
2015-05-07 16:32:07 -07:00
efba46a8a2 Fix inband disk erase using agent_ilo driver
In-band disk erase using shred fails for agent_ilo driver as it tries to
erase the virtual floppy device attached.This fix is to skip the virtual
media devices and continue with other disks.

Change-Id: I26745985382d440f7d4b3fbfffb14545067fcca6
Closes-Bug:#1450298
2015-05-07 09:51:11 +05:30
b735b3c9d1 Use mkdtemp for mounting virtual media device
When using virtual media, restarting ironic-python-agent
leads to errors like 'File exists'.  This is because
we use static directory (/vmedia_mnt) as mount path
and we don't remove it. It's better to use mkdtemp to create
a temporary directory for mounting virtual media
device.

Change-Id: Ibb4c3d3a2024cf51ef198bd396fb9e86ad72a320
2015-05-06 02:47:48 -07:00
1394771fcc Error doc builds on WARN or ERROR
This will ensure that any new commits to IPA won't pass a docs job if
they introduce improperly formatted doc strings. This will enable us to
ensure our generated documentation remains of a high quality.

I will be following this up with a change to project-config to have IPA
run the docs job on every change.

Change-Id: I90236225623298a7070db1ff22acb44dddb1c520
2015-04-06 19:03:17 +00:00
67a48c8cb1 Add PYTHONHASHSEED=0 to venv tox env
This is the environment used to generate docs in the check/gate, not
gendocs.

Change-Id: Ia026425f1a56d59c8d87a3ad44610c26fc286fad
2015-04-06 08:35:08 -07:00
e1ca8f4edf Merge "Docs on HardwareManager, building, and workflow" 2015-04-01 23:09:30 +00:00
ae369492c1 Docs on HardwareManager, building, and workflow
Documentation on IPA hardware managers, how to build an IPA ramdisk
and some ways Ironic interacts with the IPA API.

Change-Id: I94db188e1e1333e71437f551d1dfe00acdd7fc8a
Co-Authored-By: Josh Gachnang <josh@servercobra.com>
2015-04-01 14:02:20 -07:00
a1c87672ea Merge "Fix Sphinx Autodoc WARNING/ERROR in docs build" 2015-04-01 00:39:21 +00:00
499a212f92 Merge "Add sphinx build + basic documentation" 2015-04-01 00:32:18 +00:00
8bad5bbac3 Fix Sphinx Autodoc WARNING/ERROR in docs build
The docstrings here were all giving WARNINGs or ERRORs during the docs
build, and were generally making unappealing looking developer
documentation. I corrected the syntax and did what was neccessary to
make the build come out clean.

Change-Id: I74b00a7f125770b0468cff3bdf26d0d52cd054d7
(cherry picked from commit c0921cdff3)
2015-03-31 16:22:57 -07:00
be97525975 Add sphinx build + basic documentation
This adds and configures a sphinx doc builder. This is based on the code
in Ironic to build documentation.

The goal is for this to contain development documentation relevant to
hacking on the agent, including how to make custom HardwareManagers.

Change-Id: Ib6cecb9959f4ad5c71440fb37827b996582a9545
2015-03-31 16:22:12 -07:00
52831a0524 Merge "Update README file" 2015-03-26 19:53:54 +00:00
c2a1f5e3d4 Update README file
README file had very little information in it. This adds some basic
information and formating.

Change-Id: Ibde19ec7f89b474fd51dacdcd030aaa92d3364a2
2015-03-26 10:05:53 -07:00
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
98b92f960b Sync from oslo.incubator
Update imports from oslo.incubator and remove old modules no longer
used.

Change-Id: Ibb71a7287f46709bb76c3dac5ce4be7a2f4818a3
2015-03-24 08:41:32 +01:00
17067b938d Merge "Updated from global requirements" 2015-03-23 22:21:54 +00:00
ccda38a86e Do udevadm settle after running partx in image extn
This commit adds running 'udevadm settle' after
running partx so that the partition table is re-read
properly by lsblk which follows it.

Closes-bug: 1432918
Change-Id: I1c7dddd3ed8cab175e608e09ecc4ae7f289cfc31
2015-03-23 02:06:24 -07:00
81dd1be7c5 Updated from global requirements
Change-Id: I85b7f2aad5c230240120020fbdb9c4e5853dfc9c
2015-03-21 00:09:25 +00:00
173f86963a Merge "Add cleaning/zapping support to IPA" 2015-03-20 23:19:54 +00:00
79790171bc Call partprobe+partx before writing configdrive
partx -u $DEVICE doesn't work in some cases, but partprobe $DEVICE fails
in virtual environments (like devstack). For now, run both commands and
ignore partprobe failures.

Moving forward, this shell should be factored into python and share code
with the other partition-modifying code added this cycle.

Change-Id: I7e4c010e260be2a23dcc894bc0c1b30aea949084
Partial-bug: 1433812
2015-03-19 11:25:35 -07:00
a17c824288 Add fallback secure erase using shred
This prevents devices from failing cleaning if they don't support ATA
security erase. Instead, the device will be erased by overwriting using
GNU shred.

Change-Id: Ie4f88b97c8c34efe2397538662622abd0b963aea
2015-03-18 14:57:28 -07:00
5f4fa7f27e Add cleaning/zapping support to IPA
This will add support for in band cleaning operations to IPA and
replace the decom API that was unused.

Adds API support for get_clean_steps, which returns a list of
supported clean steps for the node, execute_clean_step, to execute
one of the steps returned by get_clean_steps.

Adds versioning and naming for hardware managers, so if a new hardware
manager version is deployed in the middle of cleaning/zapping, the
cleaning/zapping will be restarted to avoid incompatabilities.

blueprint implement-cleaning-states
blueprint inband-raid-configuration
blueprint implement-zaping-states
Depends-On: Ia2500ed5afb72058b4c5e8f41307169381cbce48
Change-Id: I750b80b9bf98b3ddc5643bb4c14a67d2052239af
2015-03-17 17:07:04 -07:00
ac4e9901d6 Add uefi support in image extension
This commit adds support for uefi systems in the image
extension so that grub can be installed onto efi system
partition for uefi machines.

Implements: blueprint local-boot-support-with-partition-images
Change-Id: I8fbb4b2ebdff991d41c7b618a4d654af26311a56
2015-03-17 18:21:22 +00:00
be44ac8d4d Merge "Use labels for virtual media dev in agent ramdisk" 2015-03-17 02:50:47 +00:00
4f2ad2104e Fix nit in test_get_agent_params_from_cache
Address a nit in previous review: test_get_agent_params_from_cache
should assert that _set_cached_params is never called.

Change-Id: I4724bd15ee923a9272aa872641430f3dfbef3fec
2015-03-16 11:00:24 -07:00
c7b3c73d65 Cache agent parameters for later invocations
When parameters are passed to agent through virtual
media, the device might be connected only for a short
while (dur to swift temp-url expiration, ironic removing
the floppy image, etc).  This change will enable agent
to cache the parameters and use it for any time later on.
After caching, the agent parameters need not be re-read
from /proc/cmdline or from the virtual media device.

Implements: blueprint ipa-as-default-ramdisk
Change-Id: Ia8c7020c91c987ec884c5640421f0583dbf1c3d9
2015-03-16 16:41:26 +00:00
1287b9ce4f Merge "Add dispatch to all managers" 2015-03-13 21:09:22 +00:00
d769b15b4e Merge "Add support for root device hints" 2015-03-13 14:02:56 +00:00
5a529ca489 Add support for root device hints
This patch add support for root device hints on IPA. Instead of picking
the first disk >= 4G, if the hints are specified IPA will look at it
to decide which device it should pick for the deployment. The initial
patch supports the following hints: Size, model, WWN, serial, vendor.

Implements: blueprint ipa-as-default-ramdisk
Implements: blueprint root-device-hints
Change-Id: I2b00b3fb3b61001033750dd8951f9353d6f2e361
2015-03-13 10:42:12 +00:00
3e6b57a8bc Add dispatch to all managers
This allows the agent to call a method on all hardware managers
that support the hardware and return a list of their responses. This
will be useful for implementing get_clean_steps() in cleaning.

Also fixes a leaky test in dispatch_to_managers. The function
wrapper was holding global state, which leaked into other tests
if a function was called again later, messing up the call count.

Implements blueprint implement-cleaning-states
Change-Id: I76bf8ec18df1dc16c4b9d942800b8a1efcde9e65
2015-03-12 15:16:02 -07:00
d0d319d65f Use labels for virtual media dev in agent ramdisk
This commit changes agent deploy ramdisk to find out
the virtual media device by using labels instead of
looking at the model of block device.  This helps in
finding out the device irrespective of the hardware.

Corresponding Ironic change is
If5b78d9af7048f2631d050ee5ce01ab7a67e2354.

Closes-Bug: 1429340
Change-Id: Ib6cc226dc4fb341d913f707737493c31a3f77152
2015-03-12 04:45:52 +00:00
1fc7136235 Merge "os.path.exists should be mocked in test case" 2015-03-11 21:57:07 +00:00
d1b30a14d2 os.path.exists should be mocked in test case
This commit mocks os.path.exists in the test case
test_start_iscsi_target_fail_wait_daemon in
extensions.iscsi.TestISCSIExtension.  If this isn't
mocked, the file can coincidentally exist on the
environment and can cause failure.

Change-Id: Ibaa8fcae51faaaefc2764411d02621f347d99c03
2015-03-11 17:16:46 +00:00
1e04c8fffb SyncCommandResult should store actual exception
This commit changes ExecuteCommandMixin to store the
actual exception in SyncCommandResult instead of just
the message in the exception. This is required in the
API side where the result.command_error is trasformed
to base.ExceptionType.

Closes-bug: 1430896
Change-Id: I222bfc11868e73c7da03c84723f1450e38aa1a2f
2015-03-11 16:44:12 +00:00
8173927dd3 Merge "Move _get_agent_params() to a common place" 2015-03-11 13:36:43 +00:00
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
26ecf880eb Updated from global requirements
Change-Id: Ib354c8a32c636a2e41c50bf2e2dfe5e6db52a0ca
2015-03-05 23:42:58 +00:00
e09cd11fe1 Merge "Add the image extension (for local boot)" 2015-03-05 19:51:42 +00:00
da567dae26 Merge "Image building support for fedora hosts" 2015-03-05 19:39:42 +00:00
9aa5e08da8 Merge "Fix incorrect IPA log message" 2015-03-04 17:39:00 +00:00
d23e0170de Add the image extension (for local boot)
Initially this extension supports installing a bootloader so the user
image can boot from the local disk.

Change-Id: Ia588aafc240b55119c02f1254addc0cf796f88c5
2015-03-04 16:34:17 +00:00