522 Commits

Author SHA1 Message Date
Zuul
1c51e81ab7 Merge "Fix OSError catch" 2017-10-17 01:19:30 +00:00
Julia Kreger
308cddc1bb Fix OSError catch
The _execute helper was catching OSError, except it
was expecting the same attributes as ProcessExecutionError,
which is incorrect.

Added a separate catch and unit test to ensure that we
at least properly catch and convert the error instead of
raising an error about an attribute that does not exist.

Change-Id: Id47715a5657478e4d9dd10ea7f360b1ededa27de
Closes-Bug: #1715466
2017-10-12 14:32:50 +00:00
John L. Villalovos
6d84d9642a Fix a mis-formatted log message
There was an error in thinking that we can pass a tuple to log a
message. Corrected this error.

Change-Id: I45a2512f2dc50d6cacc646321d26c2f1c5713137
2017-10-10 15:16:40 -07:00
Jenkins
0fb3329a18 Merge "Remove hard-coded path to grub binaries" 2017-09-26 09:16:09 +00:00
Jenkins
ad44a7922b Merge "Report /dev/disk/by-path on inspection" 2017-09-26 09:15:43 +00:00
Ilya Etingof
d0a53149f8 Report /dev/disk/by-path on inspection
When inspecting block devices on a node, discover and
report the /dev/disk/by-path/XXX name along with the
/dev/XXX block device name.

The second name does not change between Linux system
reboots and has greater chances to be the same across
similarly configured nodes.

Note: this patch depends on
https://review.openstack.org/#/c/500524/
library patch, but this dependency can't be expressed
with Depends-On clause. Therefore once this patch
requires a followup patch to enable one currently disabled
test in this patch.

Change-Id: I09874f19890500d352521f89573e2aaf50a29022
Closes-Bug: #1679726
2017-09-25 11:55:11 +02:00
Vasyl Saienko
db5272cfea Remove hard-coded path to grub binaries
Use PATH variable to find grub binaries.

Closes-Bug: 1717255

Change-Id: Ic6a2bafdc87e33c4e1c4534fa355f995c824b945
2017-09-25 09:30:58 +03:00
Dmitry Tantsur
f153a741e1 Clean up deprecated items in the inspection code
* Remove support for setting IPMI credentials (removed from inspector in Pike)
* Stop sending the ipmi_address field (bmc_address is used instead since Pike)

Change-Id: I1696041db62ba27e5d31e8481cb225a43d7e2a46
Closes-Bug: #1654318
2017-09-19 14:05:13 +02:00
Dmitry Tantsur
d6ff5116f4 Remove assumption that a valid IPMI channel cannot follow an invalid one
It seems to be incorrect at least for some iLO machines.
Also harden the code against invalid output from ipmitool.

Change-Id: I733785e9c7d86eadca963f0776910504bf91bcfe
Closes-Bug: #1714944
2017-09-11 18:43:24 +02:00
Jenkins
a487120187 Merge "BMC can be configured using different lan channel" 2017-08-10 09:39:55 +00:00
Mateusz Kowalski
7c28332e9a BMC can be configured using different lan channel
It may happen that BMC is configured to use non-zero channel.
In this case we should iterate across all of them as long as we
get a correct IP address (in this case different than "0.0.0.0"
which is a placeholder for not configured console).

Change-Id: I3c351af1882b24c8f56e4363249b19b5c3a4a446
Closes-Bug: #1702514
2017-08-09 15:35:57 +02:00
Ramamani Yeleswarapu
3ab779c897 Collect processor, memory and BIOS output of dmidecode - follow-up
Fixes nits, modifies unit tests.

This is a follow-up to commit c5544fb7a0d9d2a1481b3256c3587259368b599e.

Change-Id: Ibca82cc6e32311b1ff0be7137d8392f63e12639b
Closes-Bug: #1635057
2017-07-27 07:30:54 -07:00
Jenkins
aa8f68bbca Merge "Collect processor, memory and BIOS output of dmidecode" 2017-07-24 12:29:36 +00:00
Ramamani Yeleswarapu
c5544fb7a0 Collect processor, memory and BIOS output of dmidecode
Implements an optional collector 'collect_dmidecode_info' for
collecting detailed info of processor, memory and BIOS and
adds it to the inspection data.

Collects BIOS, processor, memory info and adds under the 'dmi' key.

Change-Id: Ida9b418ca579b15de70d17886631f3b21697987e
Closes-Bug: #1635057
2017-06-28 10:23:45 -07:00
ChangBo Guo(gcb)
30e0da15ea Remove usage of parameter enforce_type
Oslo.config deprecated parameter enforce_type and change its
default value to True in Ifa552de0a994e40388cbc9f7dbaa55700ca276b0.
Remove the usage of it to avoid DeprecationWarning: "Using the
'enforce_type' argument is deprecated in version '4.0' and will be
removed in version '5.0': The argument enforce_type has changed its
default value to True and then will be removed completely."

Change-Id: I0f0fb540c43edde64e489915c5199da40a0da9c1
Related--Bug: #1517839
2017-06-14 13:47:29 +08:00
Vu Cong Tuan
667ad45615 Remove pbr warnerrors in favor of sphinx check
This change removes the now unused "warnerrors" setting,
which is replaced by "warning-is-error" in sphinx
releases >= 1.5 [1].

[1] http://lists.openstack.org/pipermail/openstack-dev/
2017-March/113085.html

Change-Id: I9bf18ff72f36dfd3496b9672604e8bb98999b133
2017-06-11 18:18:28 +07:00
Ramamani Yeleswarapu
a42ef91591 Log 'Executable biosdevname not found' only once
Currently, get_bios_given_nic_name logs 'biosdevname not found' for
every NIC. This patch changes it to log only once when the executable
is not found.

Removes a redundant 'return' statement.

Change-Id: Ic42ec23876b6f7b28d8f6ac1bd37bdbfa20cf421
2017-06-02 10:59:25 -07:00
Dmitry Tantsur
40ddf861c7 Fix compatibility with Pint 0.5
This is the version we have in global-requirements, and it does not
contain module pint.errors. Fortunately, in all versions the required
error is exposed on the top level, so just use it.

See https://review.rdoproject.org/r/6741 for a build failure.

Change-Id: I1f194ccc48a3195fcbf8599c3a0b4fa21fde16d2
2017-05-22 17:05:53 +02:00
Jenkins
db76c899b5 Merge "NUMA-topology collector" 2017-05-22 13:13:18 +00:00
Jenkins
2deef86f32 Merge "Collect NIC name given by BIOS" 2017-05-22 11:35:41 +00:00
Jenkins
26accd2a8c Merge "Add missing description for params of 'start_iscsi_target'." 2017-05-20 16:20:25 +00:00
Luong Anh Tuan
efe739f039 Replace assertRaisesRegexp with assertRaisesRegex
This replaces the deprecated (in python 3.2) unittest.TestCase
method assertRaisesRegexp() with assertRaisesRegex()[1].
[1]https://review.openstack.org/#/c/466155/

Change-Id: Ife8504dbb58019a30bcc1495a78ab14c757efc98
Related-Bug: 1673768
2017-05-19 20:16:47 +07:00
Annie Lezil
fdcb0922a5 Collect NIC name given by BIOS
Adds an extra field ``biosdevname`` to network interface inventory
collected by ``default`` inspection collector (which collects the whole
inventory returned by hardware manager) of ironic-python-agent.

This feature requires biosdevname utility to collect the bios given NIC
names. The tooling module for tinyIPA is created for the same purpose.
For CoreOS IPA pxe images, biosdevname tooling module is limited,
because Docker repository is created and embedded into CoreOS pxe
images. The Docker repository uses debian to download the packages.
Debian does not have biosdevname package.

Adds an export variable TINYIPA_REQUIRE_BIOSDEVNAME. Set this
variable to ``true`` in your shell before building tinyIPA.

Closes-Bug: #1635351
Change-Id: Ia96af59e2a74868cac59e5a88cfbb3be60d85687
2017-05-18 14:44:11 -07:00
ericxiett
50f914d088 Add missing description for params of 'start_iscsi_target'.
Change-Id: I3bbd092d0738110ad36f85f1d333273f46648d2b
Closes-Bug: #1691303
2017-05-18 07:57:36 +08:00
Jaganathan Palanisamy
cc9e05da50 NUMA-topology collector
Implement the optional collector for fetching the NUMA topology
details.
Collects RAM, CPU Cores, thread siblings and NICS data for
each NUMA node and stored under "numa_topology" key.

Closes-bug: #1635253

Co-Authored-By: Jaganathan Palanisamy <jpalanis@redhat.com>

Change-Id: I5a546c009d95f39b7af4d89cf785be8acb8ebc67
Signed-off-by: karthik s <ksundara@redhat.com>
2017-05-16 08:07:58 -04:00
Jenkins
15878b7b18 Merge "Remove unused function _configdrive_location" 2017-05-16 10:31:01 +00:00
Jenkins
c2687c6223 Merge "Prevent tests' unmocked access to utils.execute()" 2017-05-15 04:25:45 +00:00
Julian Edwards
f57cbccf8b Prevent tests' unmocked access to utils.execute()
This change introduces a new base test class that mocks out
utils.execute and forces an exception if it gets called.
This has rooted out many tests that were doing this as a side effect of
calling other functions, doing things like modprobe and running iscsi
on the host's actual machine.

The tests are all now appropriately patched in places where this was
happening, and the new base class permanently prevents this from
accidentally happening again.

If you really want to call utils.execute() then you need to re-mock it
in your unit test.

Change-Id: Idf87d09a9c01a6bfe2767f8becabe65c02983518
2017-05-15 10:48:43 +10:00
vmud213
85869a134b Remove unused function _configdrive_location
This function is never used and can be removed safely.

Change-Id: Ied7b4984185ea170d33cb57010de89edeaaaeec5
Closes-Bug: #1690135
2017-05-11 12:23:38 +00:00
Javier Pena
32ed01448b Set valid inspection_dhcp_wait_timeout value in tests
inspection_dhcp_wait_timeout is defined as IntOpt, but its value was
set in tests to 0.01. This was ok until oslo.config started enforcing
types in [1], after that unit tests fail for test_timeout.

Fixing by setting the value to 1, and mocking time-related functions
to avoid a longer wait.

[1] https://review.openstack.org/328692

Change-Id: I732c4aa3d1760c3159d9672e3fae81f8bd72497c
2017-04-25 12:12:49 +02:00
Jenkins
4be702242e Merge "Add missing 'autospec' argument to mock.patch" 2017-03-20 13:59:18 +00:00
John L. Villalovos
1695cb18c2 Add missing 'autospec' argument to mock.patch
Add missing 'autospec' keyword argument to mock.patch and
mock.patch.object calls. Use 'autospec=True' except for a few cases
where it fails because the mocked function is a @classmethod and it
doesn't work. In that case explicity set it to 'autospec=False'

Change-Id: I620dce91abaa4440e1803aeefb3e93c0b65d1419
2017-03-19 10:04:19 -07:00
John L. Villalovos
e9344077fc flake8: Specify 'ironic_python_agent' as name of app
Specify 'ironic_python_agent' as the name of the application for the
flake8-import-order plugin. That way it knows that imports of
ironic_python_agent should come after external libraries.

Change-Id: Id39d558a51aeb97d96633afea28676634547d0d7
2017-03-16 07:09:07 -07:00
Jenkins
0ed8d7cd27 Merge "Fix logs encoding in py3" 2017-03-14 11:25:49 +00:00
zackchen
000eaa3554 Fix logs encoding in py3
Make sure that logs are encoded as text (not byte strings) in
python3 to allow theirs serialization in JSON.

Closes-Bug: #1668533

Change-Id: I3d0d87ca766146457d905f89c26331a415bd54f8
2017-03-14 10:25:09 +08:00
Galyna Zholtkevych
9c2d0cdd85 Correct failure message output when downloading
This fixes unreadable output on download image failure.
Adding new instance variable to exception `ImageDownloadError` class
to avoid redundant logs.

Change-Id: I51782abd572588adfc62745eeab9c559eb8346dd
Closes-Bug: #1657691
2017-03-10 19:16:07 +00:00
John L. Villalovos
949f4f509e Use flake8-import-order
Use the flake8 plugin flake8-import-order to check import ordering. It
can do it automatically and don't need reviewers to check it.

Change-Id: I946457e9079ce0b54c7fe0ad554d024a1c61dce0
2017-02-16 09:46:21 -08:00
Jenkins
fd7f10b993 Merge "Configure and use SSL-related requests options" 2017-02-07 09:57:49 +00:00
Ramamani Yeleswarapu
73f316d804 Remove switch_port_descr and switch_chassis_descr
Removes two reserved fields ``switch_port_descr`` and
``switch_chassis_descr`` that were deprecated in the Newton cycle.

Change-Id: Icd2251af63a69d60d1e72eddf651a168fdae94fa
2017-02-02 07:01:04 -08:00
Jenkins
b787b01f6c Merge "Remove compatibility with old bash-based introspection ramdisk" 2017-01-30 21:58:28 +00:00
John L. Villalovos
2334605789 Add a comment about the catch-all exception for psutil
If there is a problem with psutil failing we have a catch-all
exception. Explain reasoning for the catch-all exception.

Change-Id: Id2e22e4ff93d96c795f474e72a684dfe3db87a58
2017-01-27 13:37:34 -08:00
Jay Faulkner
b7ae4995a7 Remove support for older psutil versions
Global requirements was recently updated to force psutil=>3.0.1. This
patch removes support for older versions of psutil as well as changing
to opportunistically attempt to work if a version >5 is released but
doesn't change the interface we use.

Change-Id: I1f7fab33fd275fb8b5cd7704dc13375402756d06
Related-bug: #1659137
2017-01-26 14:28:51 -08:00
Mario Villaplana
e4919e04aa Support psutil 5.0.1
An upper-constraints update to psutil caused IPA to start using psutil
5.0.1. We had a hard-coded assumption that psutil would be major version
1 or 2. This allows us to use the updated psutil and attempts to simply
fail gracefully if an unrecognized psutil version is used.

Change-Id: Ibe072440159561b34a29b478d955876e5fb7f103
Closes-Bug: 1659137
2017-01-24 23:09:09 +00:00
Jenkins
2d21082cd5 Merge "Mock out get_wildcard_address" 2017-01-24 12:21:46 +00:00
Jenkins
465687940b Merge "Reboot and Poweroff fails with coreos IPA image" 2017-01-20 22:53:36 +00:00
Annie Lezil
20dc04e5e2 Reboot and Poweroff fails with coreos IPA image
The CoreOS IPA images do not support poweroff/reboot due to running in a
chroot. For this case, we fall back to forcing poweroff or reboot via
sysrq commands

Change-Id: I75d68b6308beba299d043e43a5fa1671b6ef3ada
Closes-Bug: #1628367
2017-01-20 12:55:12 -08:00
Derek Higgins
95956588c7 Mock out get_wildcard_address
In cases where unit tests are running in a env where IPv6 isn't enabled
it was returning the IPv4 wildcard address.

Change-Id: I0ebadafca70d9cddf761f2ef54726e0123af10f5
2017-01-20 12:17:01 +00:00
Jenkins
0a1c88d8f2 Merge "Limit memory usage when running qemu-img convert" 2017-01-20 00:26:41 +00:00
Jenkins
d691a726b3 Merge "Add IPv6 unit test for _get_route_source" 2017-01-19 22:34:21 +00:00
Jenkins
bbbea4601a Merge "iscsi: Listen for connections on both IPv4 and IPv6 ports" 2017-01-19 22:34:11 +00:00