2826 Commits

Author SHA1 Message Date
Jay Faulkner
9825cb7d7d Bump hacking to 0.11.0 in test-requirements
Hacking's latest release is 0.11.0. Most other ironic projects are using
this release.

These updates are done project-by-project to avoid introducing
unexpected new hacking rules to projects. This version bump already
applies cleanly to ironic-lib with no code style changes.

Change-Id: I6e47390299bf8f073b8c8413f0cd4e1365f938bb
2016-10-19 04:19:49 -07:00
John L. Villalovos
337ae96819 Add missing autospec=True to mocks
Some mocks have snuck in without having autospec=True. Add that to
them.

Change-Id: I79f8d68c78446f384e1b455b2835ef34602fd591
2016-10-20 08:23:53 -07:00
Jenkins
e282b96be8 Merge "Add more tests for work_on_disk" 2016-10-20 13:55:20 +00:00
Jenkins
e478fab4dd Merge "Add debug logging while waiting for udevadm" 2.3.0 2016-10-19 19:56:26 +00:00
Jenkins
839a84df59 Merge "Wait for a config drive device to be available" 2016-10-19 18:05:31 +00:00
Vladyslav Drok
82cb68adb0 Add debug logging while waiting for udevadm
Does what it says.

Change-Id: Ibfda7585fd071abfc505a4e5ab6698a8bfd958b7
2016-10-19 20:53:27 +03:00
Vladyslav Drok
939c026950 Wait for a config drive device to be available
A failure may occur if the dd to config drive partition happens
before it actually becomes available. This change adds a udevadm
settle call that ensures that config drive device is present in
/dev folder.

Closes-Bug: #1633063
Change-Id: I5526f791371e7a6f4cdad151bb163707504e76cf
2016-10-19 16:37:45 +03:00
Mario Villaplana
40e2765690 Add more tests for work_on_disk
ironic has some test cases that check the internals of what ironic-lib
does. This adds some test cases to ironic-lib's work_on_disk method to
ensure coverage will stay up to par when those tests are purged from
ironic proper.

Change-Id: If9499982156e349056cffd87d62d1da172494204
Related-Bug: 1552843
2016-10-18 17:58:44 +00:00
Jenkins
36a2260a47 Merge "Use 'code-block' for pieces of code" 2016-10-18 15:14:26 +00:00
Jenkins
5b9239dbbe Merge "Fix typo in error message" 2016-10-16 15:52:47 +00:00
Nam Nguyen Hoai
19cdf5b8da Fix typo in error message
This patch set replaces type "retrive" to "retrieve"

Change-Id: Ic33ace74302f33ce9ea0c3d1762c9a95add5641b
2016-10-14 04:51:37 +00:00
Ruby Loo
5f0a6c6079 followup to disk_utils.count_mbr_partitions()
This addresses a couple of issues with disk_utils.count_mbr_partitions()
and is a followup to I7042cd12775b0d715c15f466db2d4c5dc9e1a60a.

This fixes a typo as well as adds the device to the error string.

Change-Id: I010b8a8ebb34bf776ea22dc5fed13fe868b0d794
Related-Bug: #1629926
2016-10-06 11:38:47 -04:00
Yushiro FURUKAWA
813c727b19 Use 'code-block' for pieces of code
'code-block' improves the visibility for the pieces of code.

Change-Id: I163e3ad625f3d86b75fdf208aae526b694884dc1
2016-10-06 15:35:57 +09:00
Jenkins
93c925b68c Merge "Correctly count the number of primary partitions" 2016-10-05 18:32:26 +00:00
Lucas Alvares Gomes
17d1b06c13 Correctly count the number of primary partitions
This patch is adding a new method called count_msdos_partitions()
responsible for counting the number of primary and logical partitions
in a MBR partition table.

Prior to this patch, the code checking if there were more than 4 primary
partitions present in the partiton table was using the list_partitions()
method which do not distinguish between the types*. So, even if the disk
had 2 primary and 5 logical partitions the check would fail thinking
that 7 primary partitions were present (which is impossible btw).

This patch make use of "partprobe" to count the partitions, which is
already required in ironic-lib.

* Not distinguishing types is a pro on the list_partitions() method
because primary and logical does not apply for others disk labels such
as GPT.

This patch also fix a small typo in a non-related string :-)

Change-Id: I7042cd12775b0d715c15f466db2d4c5dc9e1a60a
Closes-Bug: #1629926
2016-10-05 14:41:38 -03:00
Jenkins
a95a5fcb7f Merge "Add prefix "$" for command examples" 2016-10-05 02:17:04 +00:00
Jenkins
001aa86630 Merge "Remove tests and common.i18n from autodoc" 2016-10-05 00:08:30 +00:00
Jenkins
f2ebcc08d4 Merge "Changed the home-page of ironic-lib" 2016-10-04 15:20:01 +00:00
Sharat Sharma
b63f20198e Changed the home-page of ironic-lib
Change-Id: I0562823fba4c5460b00666f023531da150897443
2016-10-03 12:43:46 +00:00
Dmitry Tantsur
f23ce3c91e Remove tests and common.i18n from autodoc
Change-Id: I52d579ea25ce36dc1cda0ffaeb8d0602e2b17f07
2016-10-03 14:42:04 +02:00
OpenStack Proposal Bot
e1cad868df Updated from global requirements
Change-Id: Iae3d5af83d5a7a62204bd64f782f52f2597504be
2016-09-30 10:17:35 +00:00
Yushiro FURUKAWA
d2d2c82b28 Add prefix "$" for command examples
Change-Id: I46d7a61d7fbde90e5a4081e1ed5c355d978345e8
2016-09-28 22:19:51 +09:00
Jenkins
056ccaf19b Merge "Remove unneeded disk_utils.mkfs() function" 2.2.0 2016-09-27 00:19:12 +00:00
Jenkins
25957833fb Merge "Add py35 to tox environments" 2016-09-23 08:56:14 +00:00
John L. Villalovos
c10121bc26 Remove unneeded disk_utils.mkfs() function
There is no need for the disk_utils.mkfs() function. Remove it and
update code to not use it.

Change-Id: I5609a8b80d23af23823ef0f0d7143efb209ef324
2016-09-22 17:49:47 -07:00
Jenkins
d134c54378 Merge "Fix check for GPT partioned device" 2016-09-22 21:52:56 +00:00
OpenStack Proposal Bot
448627ac2a Updated from global requirements
Change-Id: I720aee8e3de408f74bf18f577235867bac146791
2016-09-22 20:13:37 +00:00
John L. Villalovos
4fc0078f95 Add py35 to tox environments
Since we're running python 3.5 tests now, we should also be
running thme when running all tests with just `tox`.

Change-Id: Ic5d1c64d4cfccbc517f753bfe48aec13a16736e8
2016-09-22 10:48:02 -07:00
John L. Villalovos
ddef39b502 Fix check for GPT partioned device
The check for determining if a device was GPT partioned was incorrect.

This was due to the fact that the blkid output for a GPT partioned
device would have been: ('gpt\n', '') and the test was checking for
'gpt' in the output.

Change-Id: Ifdae7c5bfe01d100b1a94e83a4475ac2523483dc
Closes-Bug: #1626671
2016-09-22 10:42:08 -07:00
Dmitry Tantsur
33af42c965 Fix creating config drive for whole disk images
The execute utility returns (out, err), not just out.

Change-Id: I322ddae8026493eed2d1ac3c8d446e870b09e711
Closes-Bug: #1626544
2016-09-22 15:51:22 +02:00
Cao Xuan Hoang
36109e58f2 TrivialFix: Remove cfg import unused
This patch removes cfg import unused in
ironic_lib/tests/test_metrics.py

Change-Id: Ia5287621ce697fa26e8f0b64538442c0f83cba62
2016-09-06 14:27:54 +07:00
Lucas Alvares Gomes
96c287d34e Add match_root_device_hints() to the utils.py module
This patch is adding a function called match_root_device_hints() to the
utils.py module. This function tries to find a device that matches all the
given root device hints.

Closes-Bug: #1561137
Change-Id: Ia3ad098d6334ba22387c0f6d17b4bd518b178ca9
2016-09-01 17:28:17 +01:00
Jenkins
a8c75bd204 Merge "Sync tools/tox_install.sh" 2016-09-01 07:57:12 +00:00
Jenkins
d4ed5a9d96 Merge "Extend parse_root_device_hints to support operators" 2016-08-30 18:06:59 +00:00
Andreas Jaeger
57a164da15 Sync tools/tox_install.sh
Sync tools/tox_install.sh with python-openstackclient. This brings in
the following improvements:

* Do not leave temporary directory around, instead delete temporary
  directory directly after usage (change
  I939eae82dba3287fd4e4086128ebf4609a0e0770).
* Do not set ZUUL_BRANCH explicitely and remove unused if condition
  (change I0077c986a17d6bb92791474e03d1e77776e9382f).

Change-Id: I455222311fb1e9e029cb586c8cc6a06debaaa225
2016-08-30 20:02:49 +02:00
Lucas Alvares Gomes
dccd7b1789 Extend parse_root_device_hints to support operators
This patch is extending the parse_root_device_hints() method to make it
work with the oslo.utils operators.

Partial-Bug: #1561137
Change-Id: I9ab7357e396b89e1fe0c326d9bdfaca71916910e
2016-08-30 10:19:16 +01:00
Luong Anh Tuan
8429c01ce9 Using assertIsNone() is preferred over assertEqual()
Following OpenStack Style Guidelines:
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: Id34fb0851d698ed9c1c77cbb230f32aa21678c4e
2016-08-30 05:38:57 +00:00
Jenkins
52b2d2fa51 Merge "Correct reraising of exception" 2.1.0 2016-08-24 15:37:28 +00:00
Jenkins
52a3cf32d1 Merge "Add developer documentation on metrics" 2016-08-24 12:15:11 +00:00
yuyafei
bb90b10b8b Correct reraising of exception
When an exception was caught and rethrown, it should call 'raise'
without any arguments because it shows the place where an exception
occured initially instead of place where the exception re-raised.

Change-Id: I112eeea489470bca34b588bd862500d615c84e67
2016-08-24 12:37:59 +01:00
Jay Faulkner
7aff4e1689 Add developer documentation on metrics
Adds developer documentation to ironic-lib index page about how to emit
metrics and what each metric type is useful for.

Change-Id: I3e835717aa141f0e0fa0f026b910b9a9ed60665e
Partial-bug: #1611559
2016-08-19 08:49:33 -07:00
Jenkins
5ca6f2c9a2 Merge "Use constraints for all the things" 2016-08-19 14:16:59 +00:00
Jim Rollenhagen
65fbc0d664 Use constraints for all the things
This configures tox to use upper-constraints for everything.

Change-Id: I77f8d86e8791c3853534c95f52c88594c428ba8d
2016-08-19 08:14:55 -04:00
Jenkins
c724cbf368 Merge "Enforce doc8, make it pass, + fix inaccuracies" 2016-08-18 21:44:14 +00:00
Jenkins
6870101ba7 Merge "Add framework for doc building in ironic-lib" 2016-08-18 21:23:07 +00:00
Jay Faulkner
84f8c3095a Enforce doc8, make it pass, + fix inaccuracies
This patch fixes all sphinx warnings generated by malformed docstrings.

Additionally, it contains formatting and accuracy fixes for the metrics
docstrings, to ensure blockquotes are properly rendered, and to indicate
the get_metrics_logger() method is actually in metrics_utils.

Finally, this adds doc8 to the pep8 job, ensuring we don't reintroduce
some of these errors. As a note, there are items that can cause warnings
in doc builds that aren't enforced by doc8, and can't be enforced until
a doc build job is added to project-config.

Change-Id: I622812bfe8af576ab215c098dd211c6faf697a0c
Partial-bug: #1614272
Partial-bug: #1611559
2016-08-18 16:47:22 +00:00
Jay Faulkner
4f58317ce0 Add framework for doc building in ironic-lib
This adds a doc build for ironic-lib. Currently the only documentation
is that generated from docstrings.

Change-Id: I6ee00ad863bc7ce72958db4e8d5b6871a5b96eb0
Partial-bug: #1614272
2016-08-18 09:14:52 -07:00
OpenStack Proposal Bot
f4da9e9a11 Updated from global requirements
Change-Id: I51dfa6c163439a77c1caae88335af68b948ea008
2016-08-04 02:35:41 +00:00
OpenStack Proposal Bot
64451bc38b Updated from global requirements
Change-Id: Ia137a2710d01e9597e8ccd7ec76e3dda75425313
2016-07-29 02:28:57 +00:00
Shivanand Tendulker
7e926fd3fb Support configdrive in iscsi deploy for whole disk images
This will work for UEFI only or BIOS only images. It will not
work for hybrid images; which are capable of boot from BIOS
and UEFI boot mode.

Partial-Bug: #1493328
Change-Id: I4c517f63d620b5a9de31ecb2d7c209776d5ded48
2016-07-28 04:44:56 -07:00