summaryrefslogtreecommitdiff
path: root/ironic_python_agent
Commit message (Collapse)AuthorAgeFilesLines
* Merge "When ouputting to /dev/null should open in write mode"3.2.0Zuul2018-02-071-1/+1
|\
| * When ouputting to /dev/null should open in write modeJohn L. Villalovos2018-02-061-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | Even though it was working opening the file in 'read' mode, it really should be opened in 'write' mode, since we are redirecting the output to the file. Interestingly it does fail in 'read' mode if the command is: echo something But passes in 'write' mode. Change-Id: Ic67091881e0be377e527b78d270ab48962881ae0
* | Merge "Replace use of functools.wraps() with six.wraps()"Zuul2018-02-061-2/+2
|\ \ | |/
| * Replace use of functools.wraps() with six.wraps()John L. Villalovos2018-02-011-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In Python 2.7, functools.wraps() does not provide the '__wrapped__' attribute. This attribute is used by oslo_utils.reflection.get_signature() when getting the signature of a function. If a function is decorated without the '__wrapped__' attribute then the signature will be of the decorator rather than the underlying function. From the six documentation for six.wraps(): This is exactly the functools.wraps() decorator, but it sets the __wrapped__ attribute on what it decorates as functools.wraps() does on Python versions after 3.2. Change-Id: Ic0f7a6be9bc3e474a0229b264d1bfe6c8f7e6d85
* | Merge "Use lshw in place of dmidecode for the default hardware manager"Zuul2018-02-012-92/+169
|\ \ | |/ |/|
| * Use lshw in place of dmidecode for the default hardware managerMike Turek2018-01-302-92/+169
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently the generic hardware manager uses dmidecode to get the total physical memory and system details. This patch switches the generic hardware manager to use lshw, as it is capable of reading more than DMI [0]. This enables systems that do not support DMI to use the generic hardware manager, such as IBM Power systems. [0] https://github.com/lyonel/lshw/blob/master/README.md Closes-Bug: #1715790 Change-Id: Ie370331df6bb5ef131c5cb60f458877e2a7ad71a Depends-On: Idaf05b8efce28cd0cbf339cf693db4f55a693d9b
* | Follow-up patch for rescue extension for CoreOSShivanand Tendulker2018-01-302-2/+2
| | | | | | | | | | | | | | | | This patch addresses few minor comments in commit a659306272542dd38420cb118cc7b04b1e8cf377 Change-Id: Id5b48e3cc96c8807c471c947da3e233cebdf687e Related-Bug: #1526449
* | Execute error in _detect_cna_cardyuan liang2018-01-262-14/+21
| | | | | | | | | | | | A list type parameter pass to utils.execute will raise OSError. Change-Id: Ic5dd30f7e819e433d05bf9cc888902abe7a82def
* | Merge "Remove /ironic-python-agent/api/app.wsgi"Zuul2017-12-191-0/+0
|\ \ | |/ |/|
| * Remove /ironic-python-agent/api/app.wsgiVu Cong Tuan2017-12-141-0/+0
| | | | | | | | | | | | | | /ironic-python-agent/api/app.wsgi is an empty file. As suggestion from John L. Villalovos, we probably should delete it. Change-Id: I695aca42b76dfad1b74418c05a48c5cba3b7d71e
* | Merge "Do not try unmounting the EFI partition if it was not mounted"Zuul2017-12-152-1/+33
|\ \
| * | Do not try unmounting the EFI partition if it was not mountedDmitry Tantsur2017-12-142-1/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | If mounting the root partition fails for some reason, we try to unmount the EFI partition, which is not mounted at this point. This results in a new exception hiding the real failure. This change fixes it. Change-Id: I0ec636a361eda71b4149e4a7ba1538a9bbf6ec34 Closes-Bug: #1732932
* | | Merge "Report /dev/disk/by-path on inspection followup"Zuul2017-12-142-18/+15
|\ \ \ | |_|/ |/| |
| * | Report /dev/disk/by-path on inspection followupIlya Etingof2017-12-142-18/+15
| | | | | | | | | | | | | | | | | | | | | | | | This is the followup patch for commit d0a53149f82a3587515a4371f0f4cad8570dc715) fixing issues with the unit tests not addressed initially. Change-Id: I7889bf908bcb64b79bf303c6ae356fd3f4e94a83
* | | Merge "Include IPA Version during heartbeat"Zuul2017-12-132-9/+119
|\ \ \
| * | | Include IPA Version during heartbeatSam Betts2017-12-072-9/+119
| | |/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | In order for Ironic to know what parameters can be sent to IPA commands, Ironic needs to know which version of IPA it is talking to. This patch adds a new node heartbeat parameter agent_version which will carry the IPA version information to Ironic. Change-Id: I27e3311accf3a113a48a73df372ed46ff50c7e22 Partial-Bug: #1602265 Depends-On: I400adba5d908b657751a83971811e8586f46c673
* | | Merge "Catch OSError thrown when hexdump is missing"Zuul2017-12-122-3/+26
|\ \ \
| * | | Catch OSError thrown when hexdump is missingJulia Kreger2017-12-112-3/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change c5bf7b088f1ec776b788a81f2775e1b2577720e8 introduced a new requirement via a pre-existing ironic-lib method being called that utilizes hexdump. Hexdump is not always present and since we did not explicitly call it out as a new requirement, we should at least somewhat gracefully handle the exception. Change-Id: Id0223ef1417f6e419770ceb56b2a3b80c6118a85 Closes-Bug: #1732470
* | | | Merge "Rescue extension for CoreOS with DHCP tenant networks"Zuul2017-12-114-81/+293
|\ \ \ \
| * | | | Rescue extension for CoreOS with DHCP tenant networksMario Villaplana2017-11-064-81/+293
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds support for rescue mode with DHCP tenant networks in CoreOS. Applying network config from a configdrive is not yet supported but will be in a future patch. Co-Authored-By: Jay Faulkner <jay@jvf.cc> Co-Authored-By: Taku Izumi <izumi.taku@jp.fujitsu.com> Co-Authored-By: Annie Lezil <annie.lezil@gmail.com> Co-Authored-By: Aparna <aparnavtce@gmail.com> Co-Authored-By: Shivanand Tendulker <stendulker@gmail.com> Change-Id: I7898ff22800dedba73d7fbfb3801378867abe183 Partial-Bug: 1526449
* | | | | Merge "Update version of flake8-import-order package"Zuul2017-12-112-3/+1
|\ \ \ \ \
| * | | | | Update version of flake8-import-order packageJohn L. Villalovos2017-12-082-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use latest version of flake8-import-order package, like we do in openstack/ironic Fix two issues detected by new version. Change-Id: Idb8f0fd79c3d6b34611288f77948d042cd837806
* | | | | | Merge "Fix issue with double mocking of utils.execute functions"Zuul2017-12-082-21/+110
|\ \ \ \ \ \ | |/ / / / / |/| | | | |
| * | | | | Fix issue with double mocking of utils.execute functionsJohn L. Villalovos2017-12-012-21/+110
| | |_|/ / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | An issue was discovered if we mock an already mock-ed function. This was happening in our execute() detection code. Change it to not use a mock and instead a function. Add unit tests to show it works as intended. Change-Id: Ia116b355e7adb3cbfb8ae34f4d59bf527f2889bb
* | | | | [LLDP] Skip NICs that say they are ready but are unreadable.Sam Betts2017-11-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
* | | | 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
* | | Merge "Fix off-by-one error in warning"Zuul2017-11-132-12/+24
|\ \ \
| * | | Fix off-by-one error in warningRuby Loo2017-11-092-12/+24
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | This fixes an off-by-one error in a warning message. This is a follow-up to 3189c16a5e95ade468fa8bc37302eb9979f5a8c9. Change-Id: I89b56974c1b919f4c03498873d3ce9860d5644c5 Related-Bug: #1670916
* | | Use oslo_config.fixture in unit testsVasyl Saienko2017-11-091-0/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It provides cleaner per-tests config objects, with more options to configure the fixture. Also, allow overriding config fixture in particular test cases if needed. Change-Id: I2e9945b6168d97d7ee861924ac2f4ca5cd03dde2
* | | Fix a mis-formatted log messageJohn L. Villalovos2017-10-271-3/+3
|/ / | | | | | | | | | | The log message was missing the type specifier. Change-Id: Ia5ee5e79bc75c11541cbc328385b046d1e798ddd
* | Merge "Fix to return 'root_uuid' as part of command status"Zuul2017-10-252-14/+32
|\ \
| * | Fix to return 'root_uuid' as part of command statusShivanand Tendulker2017-10-242-14/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | IPA does not return 'root_uuid' as part of command status when provisioning of whole disk image is done using 'agent' deploy interface from ironic. This commit fixes the issue. Also updated Dockerfile to include package 'bsdmainutils' related to 'hexdump' binary. Change-Id: I89597fe4a704686fe31c064c3443fd8404a300e5 Partial-Bug: #1713916
* | | Merge "Improve the catching of calls to 'execute' related functions"Zuul2017-10-242-13/+30
|\ \ \
| * | | Improve the catching of calls to 'execute' related functionsJohn L. Villalovos2017-10-232-13/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Improve the catching of calls to 'execute' related functions in unit tests. Before we only caught calls to utils.execute(). Now we catch calls to: ironic_lib.utils.execute() processutils.execute() subprocess.call() subprocess.check_call() subprocess.check_output() utils.execute() Change-Id: If4720ebed00f15c2a19cb8badbe4dc3c808eeece
* | | | Merge "Have unit tests all derive from our base unit test class"3.0.0Zuul2017-10-2310-26/+26
|\ \ \ \ | |/ / /
| * | | Have unit tests all derive from our base unit test classJohn L. Villalovos2017-10-1810-26/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Have our unit tests derive from the base unit test class in ironic_python_agent/tests/unit/base: IronicAgentTest This is so if we add additional global common features to our base test class, all of our tests will get those common features. Change-Id: I5188112f06dcfda4f5b0fd41fa9b9dd270cde8d7
* | | | Unit test has incorrect mock orderRuby Loo2017-10-181-1/+1
|/ / / | | | | | | | | | | | | | | | | | | | | | Minor change to a unit test; the names of the mock arguments to the unit test method are not consistent with the actual ordering of the mock decorators. This fixes it. Change-Id: Id9e0dd1614703760b2fe143b2029f9bf6067420a
* | | Merge "Fix waiting for target disk to appear"Zuul2017-10-177-101/+151
|\ \ \
| * | | Fix waiting for target disk to appearLucas Alvares Gomes2017-10-167-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
* | | Merge "Fix OSError catch"Zuul2017-10-172-1/+14
|\ \ \
| * | | Fix OSError catchJulia Kreger2017-10-122-1/+14
| | |/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | Fix a mis-formatted log messageJohn L. Villalovos2017-10-101-3/+2
| |/ |/| | | | | | | | | | | There was an error in thinking that we can pass a tuple to log a message. Corrected this error. Change-Id: I45a2512f2dc50d6cacc646321d26c2f1c5713137
* | Merge "Remove hard-coded path to grub binaries"Jenkins2017-09-262-20/+22
|\ \
| * | Remove hard-coded path to grub binariesVasyl Saienko2017-09-252-20/+22
| | | | | | | | | | | | | | | | | | | | | | | | Use PATH variable to find grub binaries. Closes-Bug: 1717255 Change-Id: Ic6a2bafdc87e33c4e1c4534fa355f995c824b945
* | | Merge "Report /dev/disk/by-path on inspection"Jenkins2017-09-262-21/+97
|\ \ \
| * | | Report /dev/disk/by-path on inspectionIlya Etingof2017-09-252-21/+97
| | |/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | Clean up deprecated items in the inspection codeDmitry Tantsur2017-09-192-103/+10
| |/ |/| | | | | | | | | | | | | * 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
* | Remove assumption that a valid IPMI channel cannot follow an invalid oneDmitry Tantsur2017-09-112-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
* 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