54 Commits

Author SHA1 Message Date
Dmitry Tantsur
34324112e0 Declare support for Python 3.5 in setup.cfg
This is required for the Python 3.5 goal to be finished for real.

Change-Id: I66a3a50575ce4547bf04e3835a5c92c85977201a
Related-Bug: #1673768
2018-01-31 12:46:06 +01:00
Zuul
c0c1dd813d Merge "Centralize config options" 2018-01-09 12:07:50 +00:00
John L. Villalovos
d7e1841680 Remove ironic_inspector/test/inspector_tempest_plugin/ directory
We now use the project openstack/ironic-tempest-plugin to store our
tempest plugin. All content from the
ironic_inspector/test/inspector_tempest_plugin/ directory has been
ported to that project.

We no longer want to have the plugin content stored here so we can
now delete it.

Change-Id: Ia8ea3a74d5aba1ea27eb6715c21667a30bac56b4
2018-01-05 12:52:54 -08:00
Pavlo Shchelokovskyy
71a2bef7d9 Centralize config options
Consolidate all config options under ``conf`` directory.

New config modules should give a better picture of the configuration
options provided by the inspector.

Change-Id: I501ed0787ff4e1d91462f936e1a54de2c7abb35c
Related-Bug: #1561100
Co-Authored-By: Anton Arefiev <aarefiev@mirantis.com>
2018-01-04 20:43:58 -08:00
dparalen
8ddfacdf34 Introducing a dnsmasq PXE filter driver
A PXE filter driver is introduced that works by configuring and controlling
the dnsmasq service.

Closes-Bug: 1693813
Related-Bug: 1665666
Change-Id: I63fe91ee4f9ac3021bcfd9a4a378af56af800fac
2017-11-22 15:08:23 +01:00
Zuul
f02eda0315 Merge "Refactoring the firewall" 2017-10-19 21:40:25 +00:00
dparalen
7b27585463 Refactoring the firewall
Adopting the PXE filter interface/driver concept

Related-Bug: 1665666
Change-Id: If83db978080b9c4e5d51ba50bbe8ed26e29abe83
2017-10-19 16:38:15 +02:00
Pavlo Shchelokovskyy
198ef70c2b Add request context and policy enforcement
this patch introduces an oslo.policy-based API access policy
enforcement engine to ironic-inspector.
As part of implementation, a proper oslo.context-based request
context is also generated and assigned to each request.

Short overview of changes:

- added custom RequestContext class

  - extends oslo.context to handle of "is_public_api" flag
    (False by default)

- added context to request in each API route

  - '/continue' api sets the "is_public_api" flag to True

- added documented definitions for API access policies and their
  defaults
- added enforcement of these policies on API requests
- added oslo.policy-specific entry points to setup.cfg
- added autogenerated policy sample file with defaults
- added documentation with autogenerated policies

Change-Id: Iff6f98fa9950d78608f0a7c325d132c11a1383b3
Closes-Bug: #1719812
2017-10-13 11:55:52 +00:00
Jenkins
1401439a6f Merge "Update URL home-page in documents according to document migration" 2017-07-25 18:34:54 +00:00
dparalen
cc7b98aa10 Introducing the contributor content
Moving the contributor "link" and API down the mandatory directory
structure.

Change-Id: I111cd55a06e40dc4db649728a5025354a85b3e1d
Partial-Bug: 1702142
2017-07-21 10:22:33 +02:00
Luong Anh Tuan
c23a79b81a Update URL home-page in documents according to document migration
Change-Id: Idd05534051891477343f94635d89e694c145d7f6
2017-07-14 02:53:26 +00:00
dparalen
e02bc755a6 PXE boot filtering drivers
Introduce a driver concept for PXE filtering

Change-Id: I73297771c4118f368b80a5f1021a0d5c3fc8b96e
Closes-Bug: 1665666
2017-06-28 12:25:37 +02:00
Vu Cong Tuan
75033eca66 Remove pbr warnerrors in favor of sphinx check
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: I05b19288a444d346cebe83a9aa0422d8655f6f0c
2017-06-09 17:24:48 +07:00
Anton Arefiev
50ed0bdbae Preparing for service splitting
Creates new WSGIService class which keeps base API sercice
initialization functionality and serve flask application. Also
it will configure application for wsgi container[1].

Also creates new `cmd` directory for storing console scripts.

[1] https://governance.openstack.org/tc/goals/pike/deploy-api-in-wsgi.html

Related-Bug: #1525218
Change-Id: Ia64228c47a79a3008d435e8323a964f2bc45dfa7
2017-05-26 11:59:35 +03:00
Bob Fournier
8834927d4c Add plugin to process basic management LLDP TLVs
This adds a plugin to process the raw LLDP TLVs stored in Swift for
the Basic Mgmt, 802.1, and 802.3 data sets and store the parsed data
back in Swift.  It implements the TLV processing as described in the
specification:
http://specs.openstack.org/openstack/ironic-inspector-specs/specs/lldp-reporting.html

Change-Id: I854826787ff045ffb2807970deaba8b77cbe277d
Closes-Bug: 1647515
Related-Bug: 1626253
2017-01-31 19:51:39 -05:00
Cady_Chen
b917c74908 Add author and author-email in setup.cfg
Change-Id: I220b7d3c37891eb68a9d105945d80a77736c106e
2016-12-14 10:37:10 +08:00
avnish
cc44415523 modify the home-page info with the developer documentation
Change-Id: Iff43acf4db1ec7b46bd35829d529192ecf443cb9
2016-09-20 13:11:14 +05:30
Szymon Borkowski
e686892739 Add PCI devices plugin to inspector
Adds a new plugin to distinguish PCI devices returned by Ironic
Python Agent. Recognized PCI devices are then registered in node
capabilities and later can be used by nova flavors.

Change-Id: I6565b8c4aa76de240a6c4d795635300ff2d0c30b
Partial-Bug: #1580893
2016-09-01 10:55:02 +02:00
Sam Betts
4af672b849 Add GenericLocalLinkConnectionHook processing hook
For Ironic multi-tenant networking support, we need to be able to
discover the nodes local connectivity. To do this IPA can try to pull
LLDP packets for every NIC.

This patch adds a processing hook to handle the data from these packets
in ironic-inspector so that we can populate the correct fields fields in
Ironic. The generic lldp hook only handles the mandatory fields port id
and chassis id, set on port_id and switch_id in local_link_connection.

Further LLDP fields should be handled by additional vendor specific LLDP
processing hooks, that populate the switch_info field in a non-generic
way.

Change-Id: I884eaaa9cc54cd08c21147da438b1dabc10d3a40
Related-Bug: #1526403
Depends-On: Ie655fd59b06de7b84fba3b438d5e4c2ecd8075c3
Depends-On: Idae9b1ede1797029da1bd521501b121957ca1f1a
2016-07-29 15:00:22 +01:00
Dmitry Tantsur
457c1277de Remove deprecated alias "root_device_hint" for "raid_device" hook
Deprecated in 3.1.0 (mid-Mitaka). Probably also completely unused.

Change-Id: Id1ea1e63e212a94dce61bd03c4217611cca3cd2e
2016-06-06 19:07:24 +02:00
Dmitry Tantsur
b2c2767147 Add a plugin for capabilities detection
Supports boot_mode and CPU flags.

Change-Id: Idee87a9fa0c89e51993735e69906f5688bfe23aa
Closes-Bug: #1571580
2016-06-06 13:18:09 +00:00
Anton Arefiev
50783c14f1 Tempest plugin initial commit
This patch contains tempest plugin interface which are generated by
tempest-plugin-cookiecutter[1].

Also empty test manager and basic test was added.

[1] https://github.com/openstack/tempest-plugin-cookiecutter

Change-Id: I333462987bb6cdd1933fbb3550f527364c74ba07
2016-04-08 11:48:21 +03:00
Jiri Tomasek
19fe16fd42 Added CORS support to Ironic Inspector
This adds the CORS support middleware to Ironic Inspector, allowing a deployer
to optionally configure rules under which a javascript client may
break the single-origin policy and access the API directly.

OpenStack CrossProject Spec:
   http://specs.openstack.org/openstack/openstack-specs/specs/cors-support.html
Oslo_Middleware Docs:
   http://docs.openstack.org/developer/oslo.middleware/cors.html
OpenStack Cloud Admin Guide:
   http://docs.openstack.org/admin-guide-cloud/cross_project_cors.html
DocImpact: Add link to CORS configuration in admin cloud guide.

Change-Id: I467d4e14b27f1d4808786d431aff66808c707a99
2016-03-14 15:29:09 +01:00
Jenkins
262972db94 Merge "Generate API documentation from Python modules" 2016-03-10 09:48:47 +00:00
Jenkins
9987d8841e Merge "Deprecate root_device_hint name for raid_device plugin" 2016-03-09 14:39:23 +00:00
Zhenguo Niu
bc1d71f086 Deprecate root_device_hint name for raid_device plugin
Change-Id: I4da2d156007ec320e3399d0bb2bb02d039b3724b
Closes-Bug: #1528830
2016-03-09 00:04:41 +08:00
Dmitry Tantsur
3975337875 Generate API documentation from Python modules
Also brings "contributing" section toctree depth to the same level as
everywhere.

Change-Id: I661a0c7045fe945bfa7bd99589751c4aad63a61c
2016-03-08 15:07:44 +01:00
Pavlo Shchelokovskyy
b804efeb02 Move ironic options to common/ironic
make it similar to how Swift options are handled

Change-Id: Ib155086f68970b6e74cb348778fcb4a6361c54ba
2016-03-07 13:56:55 +01:00
Jenkins
e03cbe8c8b Merge "Add enroll_node_not_found hook" 2016-03-01 14:09:20 +00:00
Anton Arefiev
5086d93b41 Add enroll_node_not_found hook
Add new node_not_found_hook - enroll_node_not_found hook,
which allows to enroll unknown nodes to Ironic automatically.

Change-Id: If1528688504e4be4b2369b985bc576544d96868d
Related-Bug: #1524753
2016-03-01 14:00:31 +02:00
Anton Arefiev
061d839a26 Add new condition: is-empty
Now, if operators want to check some attribute isn't specified,
they should use 'eq' condition with None, '', etc values:

    {'op': 'eq', 'field': 'inventory.bmc_addres', 'value': ''}

It would be useful to have condition plugin witch verify this case,
'is-empty' checks that field is empty string, list, dict or None value:

    {'op': 'is-empty', 'field': 'inventory.bmc_addres'}

Change-Id: I6596a067e769530092c3db34405e0f0917d2f052
2016-02-22 14:21:09 +02:00
Jenkins
5e84b68ce5 Merge "Add new conditions: matches and contains" 2016-02-02 13:36:15 +00:00
Andreas Jaeger
b28f1a75b7 Update translation setup
Follow new infra setup for translations, see spec
http://specs.openstack.org/openstack-infra/infra-specs/specs/translation_setup.html
for full details.

This basically renames
ironic-inspector/locale/ironic-inspector.pot to
ironic_inspector/locale/ironic_inspector.pot. For this we need to update
setup.cfg. Also fix some errors for translation setup in setup.cfg

Update also domain name in i18n.py.

The project has no translations currently, let's remove the outdated
pot file, the updated scripts work without them. So, we can just
delete the file and once there are translations, an updated pot file
together with translations can be imported automatically.

Change-Id: I1f9e3777a68d09406eeee836d03f15cbfe568470
2016-01-29 09:34:46 +01:00
Dmitry Tantsur
d6ff54faf7 Add new conditions: matches and contains
Both check a value against a regular expression. The former requires
full match, while the latter requires matching anywhere in the string
representaion of value.

Change-Id: Ia59d17d6f8383aed97696d678fc1e7e329242692
2016-01-26 17:01:41 +01:00
Dmitry Tantsur
99732e5297 Numerous improvements in the documentation
* Flatten the directory structure (we don't have that many doc files)
* Dropped HTTP-API from the root so that we don't maintain 2 copies
* Fixed links all over the place
* Leave one copy of README text in the root and include it in docs
* Update 'tox -epep8' to also check docs

Change-Id: Ic14cb73668544be27c6b96b384f93b239e49acfd
2015-12-02 18:07:22 +01:00
Serge Kovaleff
292e8c9cfd Generate Sphinx docs
Change-Id: I540b28d6173b30baf6ee2e6e14d8ba5ffb67b660
Closes-Bug: #1514803
2015-11-27 11:56:36 +02:00
Sam Betts
aa3b8ba777 Add alembic migrations for the inspector database
This patch adds a new command ironic-inspector-dbsync which can be used
to sync the ironic inspector database using alembic migrations. It adds
a migration to match the current required db schema.

Change-Id: I21188b3f5003c8ab43d82903473e2a6ef7f755a0
Closes-Bug: #1495620
2015-09-23 14:44:46 +01:00
Yuiko Takada
52ef561c9f Use rootwrap to execute iptables instead of requiring root
This patch set adds support for rootwrap in order to execute iptables.

Co-Authored-By: Dmitry Tantsur <dtantsur@redhat.com>
Change-Id: I7c424c17222f119730b8c5ac0daafd9906282e4d
Closes-bug: #1495844
2015-09-23 13:27:15 +02:00
Dmitry Tantsur
6c686e81ce Add missing plugins for introspection rules
Conditions:
* in-net: checks if address is in a network

Actions:
* set-capability: sets a capability
* extend-attribute: append value to a list attibute

Helper method NodeInfo.replace_field is added to simplify writing
similar action plugins.

Implements: blueprint rules
Change-Id: I7e47b3500624df1f2cb15445d05e1c9bca6dc9ae
2015-09-18 17:42:42 +02:00
Dmitry Tantsur
13b11c8052 Smart root disk selection including support for root device hints
Creates a new plugin root_disk_selection which uses root device hints
and IPA inventory to calculate a root disk.

Update scheduler plugin to support 'root_disk' field in introspection
data. This field is populated by both root_disk_selection plugin
and IPA itself. The latter value is now used when root device hints
are not provided.

New option disk_partitioning_spacing regulates whether to substract
1 GiB from local_gb. Previously it was unconditionally done by
the ramdisk.

Change-Id: I8d60e3483ab5d7d181e231fe413fcd16192e0e97
Depends-On: Ie19b82ff2a914873ff4b2395b02643e086b934b1
Implements: blueprint root-device-hints
2015-09-16 19:22:32 +02:00
Dmitry Tantsur
eb9b3da67a Add introspection rules support
This patch introduces a simple JSON-based DSL to run on introspected
data. Conditions and actions are provided via new plugin entry points.

This patch is missing PUT operation on a rule, this can be added later.

Also not all planned conditions and actions are added in this patch,
will also follow up.

Implements: blueprint rules
Change-Id: If4d17b5f1462d03879cb4c2ff4e5cb3ea364b697
2015-09-14 14:56:09 +02:00
Jenkins
ca553ff7a5 Merge "Rename plugin root_device_hint -> raid_device" 2015-08-28 08:04:57 +00:00
Dmitry Tantsur
7343cad09f Rename plugin root_device_hint -> raid_device
We'll soon have root_device_hints plugin, so it will become confusing.
Also added a test that we can use it under new name.

Change-Id: I049e049002cb25afc5aadb9a7a9e5d026a6810fd
2015-08-26 15:59:57 +02:00
Dmitry Tantsur
2ab0770b1e Clean up README
* Add standard tas recognized by release-tools
* Stop mentioning Tuskar UI, as it's being refactored now

Change-Id: I18fc8f184376b0d643c53eb2928f5bb32662fb76
2015-08-25 18:44:32 +02:00
Dmitry Tantsur
459bb6c976 Switch to pbr postversioning
It's a bit annoying to bump version every time.

Change-Id: Ia8e04f53a819df34b7bf784a67fcf5ca3b3e51e8
2015-07-10 15:18:59 +02:00
Yuiko Takada
436ffd2c6c Fix usage of mock due for the latest 1.1.0 mock
unit tests jobs have suffered falled from the latest mock 1.1.0.
http://lists.openstack.org/pipermail/openstack-dev/2015-July/069156.html

This patch set fixes this.

Change-Id: Idcc52ec641b02173680dce2246d2cc3810949353
Closes-Bug: #1473381
2015-07-10 07:58:58 -04:00
Dmitry Tantsur
a18cd6c8d1 Bump version to 2.1.0
Change-Id: I3d176ee203c27bcad200daf27a1b1aef1a79e7be
2015-07-09 16:54:04 +02:00
Dmitry Tantsur
931685d008 Move Python ramdisk code out of tree
New home will be IPA, patch is already being worked on:
https://review.openstack.org/#/c/194116/

Anyway, we have to get rid of the ramdisk code before release.

Change-Id: I1b71a466059e70fd249712eaaf325efd459addcf
Closes-Bug: #1464708
2015-06-29 12:22:41 +02:00
Jenkins
dcbe621e37 Merge "Move client out of tree" 2015-06-23 10:36:33 +00:00
Andreas Jaeger
6a8b99a5e1 Setup Translations
The infra scripts for interacting with our translation server
(transifex) need pot files in the projects to work correctly.

These pot files have been generated using the same method as the infra
scripts.

Note that the infra scripts expect locale files in directory $REPO/locale/, thus
setup.cfg was changed and the existing pot file moved around so that the
infra scripts find everything.

Any future updates of these files will be proposed by the OpenStack
Proposal Bot - including import of translated files once the translation team has
translated files in a sufficient way.

Change-Id: I4f9260c2cfc1605fc2957529f3874750a0cfb0e6
2015-06-22 14:05:19 +02:00