2826 Commits

Author SHA1 Message Date
Lucas Alvares Gomes
7aac631fbc Add parse_root_device_hints to utils.py
This patch is adding a function called parse_root_device_hints to the
utils.py module. This function is responsible for parsing the root
device hints dictionary from the node's properties attribute.

Both Ironic and Ironic Python Agent project have similar functions so
adding it to ironic-lib would make it easier to share code between both
projects and fix bugs in only one place.

Change-Id: Ida6d20d1fdb40e50fe33ffec1c953286d4cbc2b7
Partial-Bug: #1605631
2016-07-26 09:52:26 +01:00
OpenStack Proposal Bot
64dc8b64c7 Updated from global requirements
Change-Id: Ia132b8b022f07ffdddf5d8bc0073457dc8c8b795
2016-07-09 19:20:58 +00:00
Jenkins
6fec307e52 Merge "Include wipefs --force option" 2.0.0 2016-07-06 17:01:45 +00:00
Zhenguo Niu
9b5cb2062d Include wipefs --force option
Wipefs sometimes failed with errors like 'Device or resource busy',
include --force option to fix the problems.

Change-Id: Iad864d7ae9ab67286853f3c533a9c385ffe2cb05
Closes-Bug: #1590304
Closes-Bug: #1580169
2016-07-06 03:52:25 +00:00
Jenkins
49c58cfc2a Merge "Updated from global requirements" 2016-07-05 17:49:14 +00:00
Jenkins
5cf517d41e Merge "Add support for metrics" 2016-07-05 10:15:43 +00:00
OpenStack Proposal Bot
9fea53313d Updated from global requirements
Change-Id: I4eb0340a3d4beec5b2325986183ff8bec132fafe
2016-07-04 11:36:45 +00:00
Jenkins
a351856469 Merge "Use autospec in mocked objects" 2016-07-02 00:14:02 +00:00
Jenkins
9946bb615c Merge "Add keyword arg 'log_stdout' to utils.execute()" 2016-06-30 18:16:09 +00:00
Ruby Loo
433f3d98e8 Add keyword arg 'log_stdout' to utils.execute()
This adds the keyword argument 'log_stdout' (Boolean) to utils.execute().
If set to True, it will log the stdout returned by executing the
command. By default, it is True.

This argument is used in ipa's (ironic-python-agent) copy of execute(),
and is being added here in preparation for changing ipa to use this
library's execute().

The docstrings associated with utils.execute() were updated to reflect
the copy in ipa.

Change-Id: I44148c6e9150c7afd3de7b0b59bedb4983d9a6a7
Partial-Bug: 1587199
2016-06-29 17:09:29 -04:00
Ruby Loo
3858f6005e Remove releasenotes/*
Reno is not being used to handle release notes for ironic-lib.
A release note was accidentally added; this removes it to
avoid confusion.

Reno is meant to be used for deploy-facing information, not
for libraries meant for developers:
https://specs.openstack.org/openstack/oslo-specs/specs/policy/release-note-management.html#proposed-policy

Change-Id: I843981bf7cc1a26351bb99466c4b83aa6a3f35a9
2016-06-29 17:06:56 -04:00
Ruby Loo
e61a45b644 Use autospec in mocked objects
Some of the mocked objects in the unit tests do not have
autospec=True specified. This patch adds them, so that the
tests are consistent.

autospec=True is useful because it creates mock objects
that have the same attributes and methods as the objects
they are replacing.

Change-Id: I49b3a2dd7694666f6f62d3557ccee19a582d5868
2016-06-28 15:57:14 -04:00
Aline Bousquet
fb46000e24 Add support for metrics
This patch adds metrics to ironic-lib, so that it can be used by both
Ironic and IPA. It implements a generic MetricLogger including timers,
counters, and gauges with their respective decorators and context
managers. Two default MetricLogger are included: NoopMetricLogger and
StatsdMetricLogger.

Change-Id: I8a62414e6c03acb6f3457f1b8f81c03a9d3a8576
Co-Authored-By: Josh Gachnang <josh@pcsforeducation.com>
Co-Authored-By: Jim Rollenhagen <jim@jimrollenhagen.com>
Co-Authored-By: Alex Weeks <alex.weeks@gmail.com>
Partial-Bug: #1526219
2016-06-28 13:38:01 +01:00
Zhenguo Niu
122891b43c Ignore .idea folder
Should ignore .idea folder for JetBrains PyCharm users

Change-Id: If953a5d84c8f6402ad4e6263b737d1e45c7e19d2
2016-06-13 17:47:11 +08:00
Jenkins
3d7fef015c Merge "Remove deprecated disk util configs" 2016-06-10 00:20:09 +00:00
OpenStack Proposal Bot
aeaa70b247 Updated from global requirements
Change-Id: I46331306d867b7032fbe9f66b2f35fa4ab99c0bd
2016-06-03 18:13:21 +00:00
OpenStack Proposal Bot
f7a6100027 Updated from global requirements
Change-Id: I43c376fa55a4fcccfc4a3ea7fba9f13cd0b08e5b
2016-06-01 13:48:44 +00:00
OpenStack Proposal Bot
cd25d69987 Updated from global requirements
Change-Id: I86570efe458ab49d192551e793509e14ad7b2b1a
2016-05-30 00:13:26 +00:00
Jenkins
28dd421ad2 Merge "Updated from global requirements" 2016-05-24 22:28:12 +00:00
Jenkins
8fd4c5751c Merge "Clarify which projects are meant to use the ironic-lib" 2016-05-24 19:32:07 +00:00
Ruby Loo
2ca50bc7ee Remove deprecated disk util configs
This removes support for the deprecated configuration
options in the [deploy] group: efi_system_partition_size,
dd_block_size, iscsi_verify_attempts. They are available
in the [disk_util] group.

The three configuration options in [disk_util] had originally
been in ironic code (the [deploy] group) and was moved in
Feb 2015 to this library. Ironic started using this library
in (early) Mitaka development cycle.

Change-Id: Ie8ee2aab69ef2f0d711b276f3538c832c3369f29
2016-05-24 11:42:18 -04:00
OpenStack Proposal Bot
1d2f962762 Updated from global requirements
Change-Id: I33c0a47e3942806b2886680158876f8b74b4a94b
2016-05-23 20:44:06 +00:00
Jenkins
6958db206d Merge "Add support for BIOS local boot for GPT label" 2016-05-23 15:13:08 +00:00
vmud213
c6d4f0f463 Add support for BIOS local boot for GPT label
Ironic doesn't support local booting of images in BIOS boot mode
when the disk_label is GPT. The current changes creates BIOS Boot
partition when the disk_label is chosen as gpt. The partition size
is a configurable parameter.

Change-Id: Iade60da0316b8f1c0bf8ce4c79931c1105d19cec
Closes-bug: #1563291
2016-05-23 06:14:49 +00:00
Lucas Alvares Gomes
28b1941377 Clarify which projects are meant to use the ironic-lib
This patch is updating the README file to clarify that only projects
under the Ironic governance should be consuming this library.

Change-Id: Ie1430c955e44311bbe5d60503ee146ce1601612e
2016-05-20 16:02:58 +01:00
Yushiro FURUKAWA
c693f1e9bb Fix coverage option and execution
--coverage-package-name option was no longer supported by 'testr'[1].
This commit replaces from 'testr' to 'test' as coverage option.

[1] https://review.openstack.org/#/c/217847/

Change-Id: I0e3e5e837ee2f7275c489502700e91c15c7d44aa
2016-04-14 03:11:02 +00:00
OpenStack Proposal Bot
9eaad70080 Updated from global requirements
Change-Id: Iff7830aadbc5b803c0230afa5bdc104afa809f87
1.3.0
2016-04-07 17:08:49 +00:00
Jenkins
adedae3915 Merge "Explore config options to oslo-config-generator" 2016-04-06 15:05:08 +00:00
Lin Tan
733a40bc5c Explore config options to oslo-config-generator
Add entry points to explore config options.
This could be used for oslo-config-generator.

Partial-Bug: #1564195
Change-Id: Ibf844b903340f834cca5cc4539ddd9cecbeda90a
2016-03-31 02:29:06 +00:00
Dmitry Tantsur
20720a8c0b Clean up test-requirements
Remove unused: discover, oslosphinx, sphinx, pylint, simplejson, mox3.

Add actually used mock.

Change-Id: I8c839a99b25e7ec4def4f1eb7d1aaff45c3f0381
2016-03-29 19:30:58 +02:00
Jenkins
6dc190d478 Merge "Move eventlet to test-requirements. Remove greenlet." 2016-03-25 00:23:08 +00:00
Jenkins
ba48de7a82 Merge "use wipefs to erase FS meta information" 2016-03-21 23:16:26 +00:00
Gonéri Le Bouder
042aa9ab5a use wipefs to erase FS meta information
destroy_disk_metadata should destroy a bit more data than expected if we
want to be sure grub won't conflict with remaining bits of filesystem.
grub probes the hard drive to find remaining partition or filesystem. If
it find something, it will refuse to install itself on the disk.

By using wipefs instead of dd, we not only erase the MBR and partition
table but also all trace of filesystem, raid or partition-table signatures
(magic strings). This without extra Python code.

wipefs is part of util-linux which is available on all the Linux
distribution.

References:
https://review.openstack.org/#/c/284347/
https://bugzilla.redhat.com/show_bug.cgi?id=1310883
Partial-Bug: 1550604

Change-Id: I39637e22c344703ad48fc271f6f866aa018bbdd1
2016-03-10 13:03:27 -05:00
Jenkins
251db7ea9d Merge "Tests to not depend on psmisc to be installed" 2016-03-07 22:45:50 +00:00
OpenStack Proposal Bot
313f55971e Updated from global requirements
Change-Id: Ifa07185e27791ba327d5bad00feae4c146859f1b
2016-03-03 16:24:58 +00:00
Jenkins
3bdfe793f4 Merge "Fixes naming for the partitions in baremetal." 1.1.0 2016-03-03 16:13:48 +00:00
John L. Villalovos
3c4af656b1 Move eventlet to test-requirements. Remove greenlet.
The eventlet library is used in testing. Move it to
test-requirements.txt.

The greenlet library is not directly used. Remove it from
requirements.txt.

Make it more explicit which tests need the eventlet mock.

Change-Id: I117ec6a2ee4bb1a52e6de088cd1ddd5b0cce5efe
2016-03-02 15:53:03 -08:00
Nisha Agarwal
f8bb790f00 Fixes naming for the partitions in baremetal.
This fix differentiates between the partition names for
the baremetal and the iSCSI device names used by conductor.
This is required for supporting partition images for
ironic-python-agent and ironic agent drivers. The
ironic-python-agent should be able to
name the device partitions as /dev/sda1, /dev/sda2, etc.

Change-Id: I22bc29a39bf5c35f3eecb6d4e51cebd6aee0ce19
Partial-bug: 1526289
2016-03-02 12:55:13 -08:00
Jenkins
0d662256bd Merge "Add support for choosing the disk label" 2016-03-01 17:28:01 +00:00
Lucas Alvares Gomes
c0d87c89df Tests to not depend on psmisc to be installed
This patch is mocking the methods that uses "fuser" after writing the
partition table, since this is a unittest and the partition table is
written to a temporary file we don't need fuser to be checking whether
other process are accessing that file descriptor or not.

Closes-Bug: #1550438
Change-Id: I2a12d4fc2e7df4eb24a977ee6b1ff5b3ad479755
2016-02-26 17:52:19 +00:00
Lucas Alvares Gomes
c19984ba37 Add support for choosing the disk label
This patch is adding support for choosing the disk label that will be
used when partitoning the disk.

Theoretically [0] GPT is compatible with old BIOS (it maintains a
"protected MBR") allowing partitions > 2TB for BIOS when used. And EFI
can boot from MBR, so no big deal.

If the disk label parameter is not specified, Ironic will take the
decision on which disk label it should used based on the boot mode (uefi
or bios), the approach taken by the patch is quite simple: If the boot
mode is UEFI we use GPT, otherwise we use MBR.

[0] http://www.rodsbooks.com/gdisk/bios.html

Partial-Bug: #1548788
Change-Id: I307315b1b32c9bf0babd7e42d4e9bc2030884980
2016-02-25 11:42:43 +00:00
OpenStack Proposal Bot
cfd7a91fa2 Updated from global requirements
Change-Id: I1fbd452c68d04671a58366ef2ea8d06064ee730f
2016-02-24 08:32:27 +00:00
OpenStack Proposal Bot
8f54601fe6 Updated from global requirements
Change-Id: I29225af1f96f38355539ab4d68854ae113efce26
2016-02-20 21:55:43 +00:00
OpenStack Proposal Bot
68936625ee Updated from global requirements
Change-Id: If3292f7a2facb7d81dd7d47ee1abf2b92e718595
1.0.0
2016-02-10 21:53:54 +00:00
OpenStack Proposal Bot
1d6b6286d2 Updated from global requirements
Change-Id: I8d6a627aafb31ccbac16450f591bc6f059c2774f
2016-01-26 23:23:49 +00:00
OpenStack Proposal Bot
ceabbdf7a0 Updated from global requirements
Change-Id: I07fbce0c851eb5a235e21911c3f049d9a8ad35b2
2016-01-16 03:27:06 +00:00
Ruby Loo
5c7a8471a3 Remove unused packages from requirements
These packages aren't used and are remove from requirements:
argparse, Jinja2, oslo.middleware, oslo.serialization, PrettyTable,
psutl, and pycrypto.

Change-Id: Ibbe1e1c6c6934f6d13ba6c844837f2b2f66960da
2016-01-14 16:15:23 +00:00
OpenStack Proposal Bot
987aed5b54 Updated from global requirements
Change-Id: I6b3d78750987f00d3684067114f4c2821a18d330
2016-01-06 23:15:01 +00:00
Jenkins
345e5423fe Merge "Add tests for qemu_img_info() & convert_image()" 2016-01-05 14:12:02 +00:00
Jenkins
8b220d91c6 Merge "Sync test_utils from ironic" 2016-01-05 14:11:07 +00:00