63 Commits

Author SHA1 Message Date
Lucas Alvares Gomes
c21409e98b Follow up patch for da9c3b0adc67efa916fc534d975823c0a45948a1
This patch is a follow up patch fixing some nits left by the review
da9c3b0adc67efa916fc534d975823c0a45948a1, this patch adds the
wwn_with_extension and wwn_vendor_extension root device hints to the
"serializable_fields" list attribute of the BlockDevice class and fixes
some tests.

Change-Id: I6039be535988319276f9ac355c80997d34328ce8
2015-11-18 09:56:09 +00:00
Lucas Alvares Gomes
da9c3b0adc Extend root device hints for different types of WWN
This patch is extending the root device hints to also look at
ID_WWN_WITH_EXTENSION and ID_WWN_VENDOR_EXTENSION from udev.

Prior to this patch the IPA ramdisk only cared about ID_WWN but in some
systems in some platforms with a RAID controller, this ID can be same
even if they are different disks (see bug 1516641).

Closes-Bug: #1516641
Change-Id: Ic3e9a1111dfcc99702190c173562a0dccf5f94c4
2015-11-16 14:58:24 +00:00
Jenkins
aa908205c6 Merge "Refactor list_all_block_devices & add block_type param" 2015-10-07 02:42:07 +00:00
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
John L. Villalovos
3af9ab36bf Refactor list_all_block_devices & add block_type param
Put the columns to retrieve from lsblk into a list so that future
modifications to columns will require fewer code changes.

Also add a 'block_type' parameter which defaults to 'disk'. To make the
function more flexible if callers wanted a different block type.

Update and add unit tests

Change-Id: If06460e13a5b56dc8d6efca9ff5b58ac6ba1f357
2015-09-24 15:31:13 -07:00
Dmitry Tantsur
b569e37d06 Expose serial, wwn and vendor on the BlockDevice object
Currently we only use these disk properties for root device hints.
However, they'll be really useful for inspector, especially for also
implementing root device hints.

Change-Id: I48aa6b6d2d198d16f2f8e387970f7230066cf8a2
2015-09-21 13:17:20 +02:00
Jenkins
a417baf25c Merge "Fix get_os_install_device()" 2015-09-06 13:35:12 +00:00
Jenkins
87223a0f94 Merge "Refactor list_block_devices to its own function" 2015-09-02 22:17:44 +00:00
Pavlo Shchelokovskyy
19575d026a Fix get_os_install_device()
Instead of silently failing, raise DeviceNotFound when no root device
hints were provided and all found block devices are smaller than 4GB.

Change-Id: Idd2e2c5905adf847f00ad15a84a817c3715225dd
Closes-Bug: #1490761
2015-09-02 17:13:07 +00:00
Josh Gachnang
cd6f15dffe Dispatch the call to erase_block_device
There is no way for two hardware managers to handle erasing two disks
in two different ways. dispatch_to_managers was designed specifically
for this case, and the default behavior will remain the same for the
GenericHardwareManager (erase_block_device will pick up each disk).

Also return the result of the dispatch calls, so they'll be logged by
Ironic and give more cleaning insight.

Change-Id: I19e9dc8539a0729fbb96cae92fe633e24608fc68
2015-08-28 18:08:56 +00:00
Josh Gachnang
c014549804 Refactor list_block_devices to its own function
This function is useful in any HardwareManager that interacts with
disks. Subclassing GenericHardwareManager is not ideal for any
hardware manager that interacts with only specific devices.

Change-Id: Ib20e68a8916590513c0a825e44407a110cfbb441
2015-08-28 10:03:40 -07:00
Dmitry Tantsur
17c7e05235 Extend hardware manager with data needed for inspector
* Added NetworkInterface.ip4_address
* Added HardwareManager.get_bmc_address()
* Added Memory.physical_mb

  This is total memory as reported by dmidecode, and yes,
  it's different from total, as it includes kernel reserved space.

* Added CPU.architecture

  As a side effect, get_cpus was switched to lscpu.
  Also fixes problem when get_cpus reported the current frequency
  instead of maximum one.

Change-Id: I4080d4d551eb0bb995a94ef9a300351910c09fb9
2015-08-21 16:25:04 +02:00
Josh Gachnang
fb2790774d Add base for IPA functional tests
Starts up an agent in a thread and then runs functional tests against
it.

Add the first functional test of the API: a simple test of the
commands API.

Co-Authored-By: Mario Villaplana <mario.villaplana@gmail.com>
Change-Id: If4ad611929d388a2a9454224646cb296bd0ba0ce
2015-08-18 16:19:47 +00:00