summaryrefslogtreecommitdiff
path: root/ironic_python_agent
Commit message (Collapse)AuthorAgeFilesLines
* Merge "[LLDP] Skip NICs that say they are ready but are unreadable." into ↵Zuul2018-06-272-4/+56
|\ | | | | | | stable/pike
| * [LLDP] Skip NICs that say they are ready but are unreadable.Sam Betts2018-05-282-4/+56
| | | | | | | | | | | | | | | | | | | | | | | | | | | | While listening for LLDP packets, if one of the sockets marks itself as ready to read then our code will try to read data from that socket, but if something goes wrong while reading that data then it causes IPA to raise out of the loop skipping any other of the other NICs which might have worked. This patch adds code to catch and LOG any exception that is raised while we are trying to read data from one of the sockets so that we can proceed to process all the NICs. Change-Id: I8546097f5ae23755a5fdb448902007a2d823b7bf Closes-Bug: #1665025 (cherry picked from commit b536fbba616d958e58b110c8f86ea569f8834d7c)
* | Fix for fatal error when GPT was used and only MBR was cleanedOlivier Bourdon2018-06-041-1/+1
|/ | | | | | | | | | | | | | | | | | You can generate this error if after having provisioned a node using GPT partitioning, you clean its MBR using say dd if=/dev/zero bs=1024 count=1 of=/dev/sda and then cleanup all Ironic/Bifrost informations to get it reprovisioned. In this case sgdisk -Z returns an error and last_error field in Ironic contains: Error writing image to device: Writing image to device /dev/sda failed with exit code 2 Caution: invalid main GPT header, but valid backup; regenerating main header\nfrom backup!\n \nInvalid partition data!\ Change-Id: Ib617737fff5e40cb376edda0232e0726d9c71231 (cherry picked from commit 5fcf3f066ccdbcc081ae35ab25f1c18737b94778)
* Ignore IPv6 link local addressesDerek Higgins2017-11-212-1/+15
| | | | | | | | | | | | Prevent IPA from picking up the IPv6 link-local address as a callback_url in cases where it gets tried before other addressing methods havn't complete yet. In this scenario IPA sleeps for 10 seconds and then retries giving the nic a chance to configure its routable IP address. Change-Id: Ic53334c630180f0d77bb0231e548d2c44bfe55ca Closes-Bug: #1732692 (cherry picked from commit 214790d17e35edd48e1b18f3ceabba91859e3247)
* Fix waiting for target disk to appear2.2.2Lucas Alvares Gomes2017-10-177-101/+151
| | | | | | | | | | | | | | | | | | | | | | | | This patch is changing the _wait_for_disks() method behavior to wait to a specific disk if any device hints is specified. There are cases where the deployment might fail or succeed randomly depending on the order and time that the disks shows up. If no root device hints is specified, the method will just wait for any suitable disk to show up, like before. The _wait_for_disks call was made into a proper hardware manager method. It is now also called each time the cached node is updated, not only on start up. This is to ensure that we wait for the device, matching root device hints (which are part of the node). The loop was corrected to avoid redundant sleeps and warnings. Finally, this patch adds more logging around detecting the root device. Co-Authored-By: Dmitry Tantsur <dtantsur@redhat.com> Change-Id: I10ca70d6a390ed802505c0d10d440dfb52beb56c Closes-Bug: #1670916 (cherry picked from commit 3189c16a5e95ade468fa8bc37302eb9979f5a8c9)
* Remove hard-coded path to grub binariesVasyl Saienko2017-09-262-20/+22
| | | | | | | | | Use PATH variable to find grub binaries. Closes-Bug: 1717255 Change-Id: Ic6a2bafdc87e33c4e1c4534fa355f995c824b945 (cherry picked from commit db5272cfea9fa894675690d54b7d042cb3d01df3)
* Remove assumption that a valid IPMI channel cannot follow an invalid one2.2.1Dmitry Tantsur2017-09-122-7/+18
| | | | | | | | | 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 (cherry picked from commit d6ff5116f4a5586238d44a196ec89d844b151f9d)
* Merge "BMC can be configured using different lan channel"Jenkins2017-08-102-4/+55
|\
| * BMC can be configured using different lan channelMateusz Kowalski2017-08-092-4/+55
| | | | | | | | | | | | | | | | | | | | 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
* | Collect processor, memory and BIOS output of dmidecode - follow-upRamamani Yeleswarapu2017-07-272-24/+40
| | | | | | | | | | | | | | | | | | Fixes nits, modifies unit tests. This is a follow-up to commit c5544fb7a0d9d2a1481b3256c3587259368b599e. Change-Id: Ibca82cc6e32311b1ff0be7137d8392f63e12639b Closes-Bug: #1635057
* | Merge "Collect processor, memory and BIOS output of dmidecode"Jenkins2017-07-242-0/+815
|\ \ | |/ |/|
| * Collect processor, memory and BIOS output of dmidecodeRamamani Yeleswarapu2017-06-282-0/+815
| | | | | | | | | | | | | | | | | | | | | | 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
* | Remove usage of parameter enforce_typeChangBo Guo(gcb)2017-06-143-19/+12
| | | | | | | | | | | | | | | | | | | | | | | | 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
* | Remove pbr warnerrors in favor of sphinx checkVu Cong Tuan2017-06-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | 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
* | Log 'Executable biosdevname not found' only onceRamamani Yeleswarapu2017-06-021-2/+6
|/ | | | | | | | | | 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
* Fix compatibility with Pint 0.5Dmitry Tantsur2017-05-221-1/+1
| | | | | | | | | | 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
* Merge "NUMA-topology collector"Jenkins2017-05-223-0/+611
|\
| * NUMA-topology collectorJaganathan Palanisamy2017-05-163-0/+611
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | Merge "Collect NIC name given by BIOS"Jenkins2017-05-223-13/+149
|\ \
| * | Collect NIC name given by BIOSAnnie Lezil2017-05-183-13/+149
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | Merge "Add missing description for params of 'start_iscsi_target'."Jenkins2017-05-201-0/+3
|\ \
| * | Add missing description for params of 'start_iscsi_target'.ericxiett2017-05-181-0/+3
| |/ | | | | | | | | Change-Id: I3bbd092d0738110ad36f85f1d333273f46648d2b Closes-Bug: #1691303
* | Replace assertRaisesRegexp with assertRaisesRegexLuong Anh Tuan2017-05-191-2/+2
|/ | | | | | | | | 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
* Merge "Remove unused function _configdrive_location"Jenkins2017-05-162-16/+0
|\
| * Remove unused function _configdrive_locationvmud2132017-05-112-16/+0
| | | | | | | | | | | | | | This function is never used and can be removed safely. Change-Id: Ied7b4984185ea170d33cb57010de89edeaaaeec5 Closes-Bug: #1690135
* | Merge "Prevent tests' unmocked access to utils.execute()"Jenkins2017-05-1512-47/+113
|\ \ | |/ |/|
| * Prevent tests' unmocked access to utils.execute()Julian Edwards2017-05-1512-47/+113
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | Set valid inspection_dhcp_wait_timeout value in testsJavier Pena2017-04-251-4/+9
|/ | | | | | | | | | | | | 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
* Merge "Add missing 'autospec' argument to mock.patch"Jenkins2017-03-2014-250/+286
|\
| * Add missing 'autospec' argument to mock.patchJohn L. Villalovos2017-03-1914-250/+286
| | | | | | | | | | | | | | | | | | 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
* | flake8: Specify 'ironic_python_agent' as name of appJohn L. Villalovos2017-03-164-5/+5
|/ | | | | | | | 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
* Merge "Fix logs encoding in py3"Jenkins2017-03-142-1/+3
|\
| * Fix logs encoding in py3zackchen2017-03-142-1/+3
| | | | | | | | | | | | | | | | | | 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
* | Correct failure message output when downloadingGalyna Zholtkevych2017-03-103-7/+24
|/ | | | | | | | | 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
* Use flake8-import-orderJohn L. Villalovos2017-02-165-6/+6
| | | | | | | 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
* Merge "Configure and use SSL-related requests options"Jenkins2017-02-079-2/+90
|\
| * Configure and use SSL-related requests optionsPavlo Shchelokovskyy2017-01-139-2/+90
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds standard SSL options to IPA config and makes use of them when making HTTP requests. For now, a single set of certificates is used when needed. In the future configuration can be expanded to allow per-service certificates. Besides, the 'insecure' option (defaults to False) can be overridden through kernel command line parameter 'ipa-insecure'. This will allow running IPA in CI-like environments with self-signed SSL certificates. Change-Id: I259d9b3caa9ba1dc3d7382f375b8e086a5348d80 Closes-Bug: #1642515
* | Remove switch_port_descr and switch_chassis_descrRamamani Yeleswarapu2017-02-021-6/+1
| | | | | | | | | | | | | | Removes two reserved fields ``switch_port_descr`` and ``switch_chassis_descr`` that were deprecated in the Newton cycle. Change-Id: Icd2251af63a69d60d1e72eddf651a168fdae94fa
* | Merge "Remove compatibility with old bash-based introspection ramdisk"Jenkins2017-01-302-155/+5
|\ \
| * | Remove compatibility with old bash-based introspection ramdiskDmitry Tantsur2017-01-092-155/+5
| | | | | | | | | | | | | | | | | | | | | Inspector is using inventory directly, so we can remove the bits sending processed network and scheduling properties. Change-Id: I6c58bc3c5ea78fd2dbda82b38515f332ce2e8d4a
* | | Add a comment about the catch-all exception for psutilJohn L. Villalovos2017-01-271-0/+3
| | | | | | | | | | | | | | | | | | | | | If there is a problem with psutil failing we have a catch-all exception. Explain reasoning for the catch-all exception. Change-Id: Id2e22e4ff93d96c795f474e72a684dfe3db87a58
* | | Remove support for older psutil versionsJay Faulkner2017-01-262-20/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | Support psutil 5.0.1Mario Villaplana2017-01-242-4/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | Merge "Mock out get_wildcard_address"Jenkins2017-01-241-5/+13
|\ \ \
| * | | Mock out get_wildcard_addressDerek Higgins2017-01-201-5/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | | Merge "Reboot and Poweroff fails with coreos IPA image"Jenkins2017-01-202-4/+41
|\ \ \ \ | |/ / / |/| | |
| * | | Reboot and Poweroff fails with coreos IPA imageAnnie Lezil2017-01-202-4/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | | Merge "Limit memory usage when running qemu-img convert"Jenkins2017-01-201-0/+3
|\ \ \ \
| * | | | Limit memory usage when running qemu-img convertLucas Alvares Gomes2017-01-191-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch is limiting the memory address space to 1 GiB when invoking qemu-img convert. The qemu-img command can be exploited so we better play on the safe side (See: bug #1449062). Change-Id: I2088f74b32d1392310c569cfaa7fd368cb737421 Closes-Bug: #1657808
* | | | | Merge "Add IPv6 unit test for _get_route_source"Jenkins2017-01-191-1/+9
|\ \ \ \ \