1147 Commits

Author SHA1 Message Date
Luong Anh Tuan
ddb78ec4b3 Remove unused requirements
oslo.serialization are not imported. Thus, remove them from requirements.txt

Change-Id: I59185786c812c504d043f9c1ae72952a4c2fab35
2016-08-30 16:55:34 +07:00
Jenkins
d60aa8ef65 Merge "Enforce upper-constraints when building ramdisks" 2016-08-29 20:49:23 +00:00
Jenkins
aa4c889a06 Merge "Using assertIsNone() is preferred over assertEqual()" 2016-08-29 18:43:18 +00:00
Gábor Antal
4facf2c385 Changed an assert to more specific assert method
Following OpenStack Style Guidelines [1], I changed:
assertFalse(sth in sth) to assertNotIn(sth, sth).

After this change, a more specific message is shown on error.

[1]: http://docs.openstack.org/developer/hacking/#unit-tests-and-assertraises

Change-Id: I5d47d775dcff194693d97db6b797b7b027cbab56
2016-08-29 15:40:44 +02:00
Luong Anh Tuan
814b60def3 Using assertIsNone() is preferred over assertEqual()
Following OpenStack Style Guidelines[1]:
http://docs.openstack.org/developer/hacking/#unit-tests-and-assertraises

[H203] Unit test assertions tend to give better messages for more specific assertions.
As a result, assertIsNone(...) is preferred over assertEqual(None, ...)

Change-Id: I53c6d6d3e53d9fac38c50faf065c131d3aa55224
2016-08-29 05:22:33 +00:00
Mathieu Mitchell
a0ca6ce157 Enforce upper-constraints when building ramdisks
Currently, building ramdisks installs ironic-python-agent without any
upper-constraints. This causes the package to be installed with newer,
untested dependencies.

This commits introduces a tool to generate a local upper-constraints
file based on predefined strategies (below). Additionally, the fallback
to the openstack/requirements uses the URL defined in tox.ini instead of
redefining it. This prevents having to keep track of two separate
variables when releasing.

upper-constraints lookup strategies (in order):

  * UPPER_CONSTRAINTS_FILE points to a local file
  * UPPER_CONSTRAINTS_FILE points to a URL
  * /opt/stack/new/requirements/upper-constraints.txt
  * upper-constraints.txt from openstack/requirements git repository

Partial-bug: #1616554
Change-Id: Ib5c0c57cafdb6ffd7456e61f3b1bb5fa57520e5a
2016-08-26 09:06:24 -04:00
Julia Kreger
95f31be108 Re-use API client for Heartbeat operations
Re-initialization of the API client causes the identification
of an older ironic API to be forgotten.

As such, we need to re-use the API client from the initial lookup
for the heartbeat.

Tested with current master branch and stable/mitaka ipa
in noauth mode, and was able to deploy without any issues.

Closes-Bug: #1616461
Change-Id: I3ae1e2ce83f614b5b936a3cbb1b9587c6c55a89a
2016-08-26 12:53:30 +00:00
OpenStack Proposal Bot
e3c7f7c7cc Updated from global requirements
Change-Id: I04f49177cf66aec7d4cbe484a77c4a51ce9b0fcc
2016-08-26 05:08:26 +00:00
Jenkins
21c2a79816 Merge "Update hacking test-requirement" 2016-08-25 23:31:58 +00:00
OpenStack Proposal Bot
4e7077f140 Updated from global requirements
Change-Id: I071cab31fd63826a3da1c971903c9cf0c83e851f
2016-08-23 22:17:14 +00:00
John L. Villalovos
a12f21aee7 Update hacking test-requirement
Update the hacking test-requirement to match openstack/requirements
global-requirements.txt

The hacking requirement is not updated by the proposal bot.

Change-Id: I6cfbaf55abad0c33cbcbe8063d873db717f5252e
2016-08-23 13:20:08 -07:00
Jenkins
007654a9b6 Merge "Build socket list right before select call" 2016-08-19 20:51:25 +00:00
Jim Rollenhagen
8de195a3d5 Use upper-constraints for all tox targets
The issue has been resolved by infra [0], so we can use upper
constraints for all targets.

[0]
http://lists.openstack.org/pipermail/openstack-dev/2016-August/101474.html

Change-Id: If075c2752fa77547e23e3dda4688386185f79dca
2016-08-19 08:50:20 -04:00
Jenkins
705eed8d09 Merge "Use CoreOS 1068.9.0" 2016-08-17 22:37:42 +00:00
Robert Li
9e4b769055 Build socket list right before select call
This will make sure the socket list and the interface list are
always in sync, and the select call is on the right list of
sockets.

Co-Authored-By: Dmitry Tantsur <dtantsur@redhat.com>
Closes-Bug: #1533892
Change-Id: Id6710f4648203b7d476a2a16ea647224baca1bb9
2016-08-17 16:35:07 +02:00
Jenkins
d34bc0559c Merge "Minor updates to metrics documentation" 2016-08-15 23:55:01 +00:00
Mathieu Mitchell
3b64950247 Use CoreOS 1068.9.0
The differences between 1010.6.0 and 1068.9.0 are published by the
CoreOS team [1] and are noted below.

1068.9.0
========

Security Updates:

* libcurl 7.50.1 for CVE-2016-5419, CVE-2016-5420, CVE-2016-5421,
  CVE-2016-4802, CVE-2016-3739

1068.8.0
========

Security Updates:

* libpcre 8.38-r1 for CVE-2014-8964, CVE-2014-8964, CVE-2015-5073,
  CVE-2015-5073, CVE-2015-5073, CVE-2015-8380, CVE-2015-8381,
  CVE-2015-8383, CVE-2015-8384, CVE-2015-8385, CVE-2015-8386,
  CVE-2015-8387, CVE-2015-8388, CVE-2015-8389, CVE-2015-8390,
  CVE-2015-8391, CVE-2015-8392, CVE-2015-8393, CVE-2015-8394,
  CVE-2015-8395, CVE-2016-1283, CVE-2016-1283

Bug Fixes:

* Properly escape systemd specifiers (#1459)

1068.6.0
========

Bug Fixes:

* Fix parsing of the user database which caused systemd-sysusers to crash (#1394)
* Fix handling of certain unicode characters in bash (#1411)
* Fix issue when starting transient services (#1430)
* Include work-around for empty SSH host keys (#106)

Changes:

* Removed Kubernetes kubelet
  * The Stable channel has never contained a version which included the
    kubelet. If an instance was booted from the Beta or Alpha channels
    and then moved to the Stable channel, it will lose the kubelet when
    it updates to this release.
* Set group for /dev/kvm

Updates:

* coreos-metadata v0.4.1
* bash 4.3_p46

[1] https://coreos.com/releases/

Change-Id: I00c2114aeea9d4c1b8e38f5786158f248875970d
2016-08-12 12:12:46 -04:00
Lucas Alvares Gomes
09d5d0c377 Fallback to the old /lookup endpoint on 401
Prior to this patch the ironic-python-agent service would only fallback
to use the old endpoints for /lookup and /heartbeat on a 404 error but,
since Ironic will check auth (if enabled) before it routes the requests
a 401 (Unauthorized) was returned.

Closes-Bug: #1612696
Change-Id: Idba5fed587e77aaa683d2c2b2126a520214712ce
2016-08-12 16:41:51 +01:00
Ruby Loo
ad7926365e Minor updates to metrics documentation
This is a follow up to Ic08d4ff78b6fb614b474b956a32eac352a14262a.
It enhances an example, fixes a spelling error, and modifies some
sentences for better readability.

Change-Id: Icfc89edd426ddee6a93be40c5b2f56d9d78fbd0c
2016-08-11 23:09:12 -04:00
Jim Rollenhagen
5f146d465d Make code blocks real code blocks in metrics docs
Makes them an RST block quote and 4 space indents instead of 2.

Change-Id: If2b727ac431e70d714f3df0c622c5516901f3393
2016-08-11 07:24:06 -04:00
Jenkins
dfaf92b611 Merge "Add metrics support to IPA" 2016-08-09 16:15:29 +00:00
Jenkins
c1b1d7e670 Merge "Add erase_devices_metadata cleaning step" 2016-08-09 11:06:01 +00:00
Jenkins
87b2b82478 Merge "Use new agent API if available" 2016-08-07 02:44:48 +00:00
Dmitry Tantsur
09265ba4b5 Use new agent API if available
Falls back to vendor passthru on receiving 404.

Also fixes logging around lookup: log traceback on unexpected
exceptions, log successful lookup and replace % with ,

Change-Id: I7160c99ca63585fc333482fa578fdf5e0962b2b6
Depends-On: I9080c07b03103cd7a323e2fc01be821733b07eea
Partial-Bug: #1570841
2016-08-05 12:02:41 +02:00
OpenStack Proposal Bot
277d97ba2b Updated from global requirements
Change-Id: I501fc9df20913558850bbca4e9662922ebc88448
2016-08-04 02:35:43 +00:00
Josh Gachnang
fd874652e3 Add metrics support to IPA
This utilizes the new metrics support in ironic-lib to allow the agent to
report timing metrics for agent API methods as configured in ironic-lib.

Additionally, this adds developer docs on how to use metrics in IPA,
including some caveats specific to ironic-lib.metrics use in IPA.

Co-Authored-By: Jay Faulkner <jay@jvf.cc>
Co-Authored-By: Alex Weeks <alex.weeks@gmail.com>
Change-Id: Ic08d4ff78b6fb614b474b956a32eac352a14262a
Partial-bug: #1526219
2016-08-03 11:24:54 -07:00
OpenStack Proposal Bot
d46f850eb6 Updated from global requirements
Change-Id: Iaa4beed60e7a4cde492f5cc4e498883168a09499
2016-08-01 18:41:46 +00:00
Lucas Alvares Gomes
d528728090 Add erase_devices_metadata cleaning step
This patch is adding a new cleaning step called "erase_devices_metadata"
to the GenericHardwareManager. This step is responsible for erasing the
metadata of the disks present in the node (partition tables, signatures,
filesystem identifiers etc...).

It's important to note that the "erase_devices" cleaning step will also
remove all these metadatas (because it will zero/shred the whole disk)
but, it takes a lot of time to run and for some usages of Ironic only
cleaning the device metadata and leaving the data from previous tenants
on the disk after the machine is recycled is fine. That's the use case
for systems using Ironic just to install the same base image onto many
nodes which will run another cloud on top afterwards (TripleO).

The new cleaning step has a default priority of 99, so it should run
before the "erase_devices" cleaning step so that we can guarantee that
the metadata was removed even in case of a failure when cleaning the
disks.

The version of the GenericHardwareManager was bumped to "1.1" with the
addition of this new clean step.

This patch make use of the "destroy_disk_metadata" method from ironic-lib
to get rid of the metadata.

Closes-Bug: #1603411
Change-Id: I3d7b39d5ee3e03ce63185e4168b1ac954a896c93
2016-07-28 11:14:11 +01:00
Ruby Loo
81ca8a8744 Use ironic_lib's execute()
Use ironic_lib's execute() instead of copying that code.

Change-Id: If40c2da5423d0f90cc6661f8cdf2bec9567e1f7d
Partial-Bug: #1587199
2016-07-27 16:28:43 -04:00
Jenkins
913c2a1ea5 Merge "Fix resolv.conf in tinyipa image build" 2016-07-27 01:53:10 +00:00
Jenkins
e414a38efd Merge "Remove discover from test-requirements" 2016-07-26 23:17:11 +00:00
Jim Rollenhagen
7ab53e34b0 Fix races in advertise_address unit tests
This was testing that _check_for_iscsi was called, which is part of
evaluate_hardware_support for the in-tree hardware manager.
evaluate_hardware_support is called at hardware manager instantiation,
which can happen when dispatch_to_managers is called. The hardware
manager instances are cached, so calling dispatch_to_managers won't
always invoke _check_for_iscsi. As such, these tests were intermittently
failing.

Mock _check_for_iscsi at the class level for these tests (since it's
unrelated), and don't check that it was called.

Change-Id: Iefca50c4c231c5eafd199bf8da6649bc3008a8fa
2016-07-26 10:22:41 -04:00
Pavlo Shchelokovskyy
db4099daef Fix resolv.conf in tinyipa image build
Currently image build for tinyipa overrides resolv.conf with the one
from build host instead of backing it up.

Change-Id: I18598fe5327d0ff74cac2596161b9201d47d2c5b
2016-07-25 20:37:41 +03:00
Jenkins
e9dd5d3db0 Merge "Follow-up text changes for 327807" 2016-07-21 17:38:47 +00:00
Ruby Loo
95c586a3c5 Remove discover from test-requirements
'discover' is test discovery for unittest and is only needed for
< python 2.7 (it was introduced in py 2.7), so it is no longer
needed.

Change-Id: I14dc79fe929854af6d51152815bc22e66d2273dc
2016-07-21 11:28:36 -04:00
Jenkins
5d012b43bd Merge "Handle diskless hardware connected to remote iscsi" 2016-07-21 14:39:36 +00:00
Julia Kreger
f50a14dd1b Follow-up text changes for 327807
Address some comments on the original review, mainly changing
the release note to be more specific.

Change-Id: I0af397fab174e4a7b426fdc69e50dffce5578577
2016-07-21 09:54:51 -04:00
Jenkins
ad60806f93 Merge "Small refactor in the root device loop matching logic" 2016-07-19 10:10:28 +00:00
Jenkins
04c880f6f2 Merge "Fix doc warnings" 2016-07-18 13:58:51 +00:00
Jim Rollenhagen
62743fec6a Update to work with latest stevedore
stevedore no longer raises a KeyError when there's an entrypoint
missing. Instead we must supply a callback that handles that error.
Update inspection code to work with this.

Also bumps stevedore minimum to 1.16 ahead of the global-requirements
bot.

Closes-Bug: #1603542
Change-Id: I12af23f2525ac90e577bdd10bbfbbd9788e9551c
Depends-On: I8aa1ee52ff7de50488acb86e8920da89ddb05771
2016-07-17 14:38:00 -04:00
Jim Rollenhagen
2e10d7b32c Fix doc warnings
Per Doug's email[0], 'warnerrors' in setup.cfg hasn't actually been
working for some time now, and we've piled up a few warnings. Fix these
before a pbr release to unbreak it gets pushed out and breaks our doc
builds.

[0] http://lists.openstack.org/pipermail/openstack-dev/2016-June/097849.html

Change-Id: I6576a56234918febb21e7e4860544eb952123c09
2016-07-14 14:37:02 -04:00
OpenStack Proposal Bot
72fc068c33 Updated from global requirements
Change-Id: I8cf4eb470ec1d63f45c747b22d2b973ff5c2a2a2
2016-07-13 23:51:27 +00:00
Jenkins
5f4c0a7f85 Merge "Extend root device hints to support "rotational"" 2016-07-13 17:24:03 +00:00
Lucas Alvares Gomes
5f09bd03e1 Small refactor in the root device loop matching logic
When matching the root device hints passed to Ironic and the devices
present in the disk, the logic to the "size" attribute was different was
outside the main loop. This patch refactors that uses the same loop for
matching the size attribute, improving a little the readability.

This patch also makes sure that we convert the value of "size" to
integer before attempting to match it.

Change-Id: I619153232b9b58696369185ad5be90ccfd38a4ed
2016-07-12 10:15:48 +01:00
Yossi Ovadia
90424fad0a Handle diskless hardware connected to remote iscsi
It is required to issue iscsistart -b on those hardware in order for
/dev/sda /dev/sdb etc to be exposed to the OS.

On this type of hw, without the fix
introspection fails with -  missing: ['local_gb']' err.

Change-Id: If6667b123e9b890d97c03612596fb78ee2b0ae85
Closes-Bug: 1590606
2016-07-11 09:42:20 -07:00
Lucas Alvares Gomes
080e413b9c Extend root device hints to support "rotational"
This patch is extending the root device hints to also consider if a disk
is a rotational device or not. This hint makes it easier to separate
SSDs and HDDs when selecting the device to deploy the image onto.

Partial-Bug: #1599517
Change-Id: I270fe57df825929bdef7911b3a6757cf7163a5f1
2016-07-11 14:30:35 +01:00
OpenStack Proposal Bot
211756e42a Updated from global requirements
Change-Id: I5dedb635e13e058e36165dd20c2320f719f865f5
2016-07-09 19:21:00 +00:00
Jenkins
185780822f Merge "Bump CoreOS to 1010.6.0 (last current stable)" 2016-07-08 22:02:33 +00:00
Jay Faulkner
5df024e716 Bump CoreOS to 1010.6.0 (last current stable)
This approach was used instead of fetching the latest version number at
build time because that meant a CoreOS update could break our gates at
any given time.

A new CoreOS make target, 'pin_latest', was made available. This target
bumps the "pinned" version to the latest. An eventual proposal bot will
call this target to ensure we stay up to date. This also offers the
possibility for downstream operators that want to build the latest
version to call this target before building. This leads to the same
result as fetching directly in the python build script, but with more
flexibility.

This is a second attempt to merge this change, as before it caused
frequent CI failures/timeouts. The expectation is that with CoreOS only
gating on IPA, this would be lower impact and easier to mitigate.

Change-Id: I78cb2efff2293b1591b30b7e39df9fc2af98d0b2
Closes-bug: 1581673
Co-Authored-By: Arun S A G <sagarun@gmail.com>
Co-Authored-By: Jim Rollenhagen <jim@jimrollenhagen.com>
2016-07-08 10:25:28 -04:00
Lucas Alvares Gomes
f26f902603 Replace the ps options when collecting logs
This patch is replacing the "-ax" options of the ps command when
collecting the logs to "au". The "-x" option is not supported by the
BusyBox in the TinyIPA ramdisk.

Closes-Bug: #1599839
Change-Id: Id0c86db6aa16c63550890e1cd488994025f5dd68
2016-07-07 14:19:42 +01:00