summaryrefslogtreecommitdiff
path: root/ironic/cmd/api.py
Commit message (Collapse)AuthorAgeFilesLines
* Separate WSGIService from RPCServiceRuby Loo2016-09-151-1/+2
| | | | | | | | | | | | | | | | | | | | | | This patch fixes a problem which prevented Ironic from honoring the interval values configuration for the periodic tasks. Since the interval values are passed to a decorator, the configuration options should be evaluated prior to importing the module which contains the periodic tasks. In our case this was not happening due to the chain of imports going from ironic.cmd.conductor -> ironic.common.service -> ironic.api.app -> ... -> ironic.conductor.manager. This caused the @periodic decorators to be evaluated before the configuration options were loaded. This patch breaks that chain of imports by separating the WSGIService and RPCService classes into two separate files. The conductor uses the RPCService, and since it is now in a separate file from WSGIService, it no longer pulls in ironic.api.app, ..., and ironic.conductor.manager. (ironic.api.app was being imported because WSGIService needed it.) Change-Id: Ie318e7bb2d2c2d971a796ab8960be33fccbd88f3 Closes-Bug: #1562258 Co-Authored-By: Lucas Alvares Gomes <lucasagomes@gmail.com>
* Remove cyclic import between rpcapi and objects.baseSam Betts2016-09-131-1/+3
| | | | | | | | | There was a cyclic import between conductor.rpcapi and objects.base, this was initally fixed by doing an import at runtime. This patch fixes the import cycle for good. Change-Id: I8ee8c47652de75430312f77ddee08adc7a237d2b Closes-Bug: #1623074
* Add SSL support to the Ironic APIAnton Arefiev2015-11-181-1/+1
| | | | | | | | | | | | | | | Add posibility to configure the API to service requests via HTTPS instead of HTTP using native ssl from oslo.service wsgi. New options was added: * enable_ssl_api - turn on ssl support; Options defined in oslo.service for configure certs: * ca_file - ca certificate file to use to verify connecting clients; * cert_file - certificate file to use when starting the server securely; * key_file - private key file to use when starting the server securely; Closes-bug: #1430213 Change-Id: Id4b84d83f9aa6c7f898b3b9b59158d5b1a00e159
* Use wsgi from oslo.service for Ironic APIAnton Arefiev2015-11-171-30/+4
| | | | | | | | | oslo.service provides a wsgi functionality for defining new long-running services using by OpenStack applications. It might usefull for working with SSL for example. Ironic has started migrate to oslo.service, this change continue this work, and consumes wsgi from it. Change-Id: Ic7865709cd87c45e6b7d49f15ce73354aa15401e Closes-Bug: #1484044
* Enable cmd/api & cmd/conductor to be launched directlyJohn L. Villalovos2015-10-161-0/+4
| | | | | | | | | This will be needed for functional testing, so we can execute them with: python -m ironic.cmd.api python -m ironic.cmd.conductor Change-Id: I2f201ee1f6517879fec6da4e6f40a6155763d979 Partial-Bug: #1491670
* Implement indirection_apiGrzegorz Grasza2015-09-241-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | During a rolling upgrade, ironic conductor and api services are running with different versions. When an object is received in an incompatible version, IncompatibleObjectVersion is raised. Implementation of the indirection API allows the object to be backported to a supported version by the conductor (conductor has to be the first service to be upgraded). This change enables backporting of objects from Mitaka. This lays the foundation to be able to do rolling upgrades from Liberty (or from this patch onwards) to Mitaka. There may still be other issues that will need fixing in Mitaka before we will be able to do a full rolling upgrade. Enabling the indirection_api causes all object methods decorated with the remotable or remotable_classmethod to do RPC from ironic-api to ironic-conductor service. To keep the current behavior, I'm removing all remotable decorators on object methods and thus not enabling object RPC calls in this patch. These calls caused random timeouts on the CI gates (probably due to a race in which Nova calls the ironic-api service before ironic-conductor is up). RPC calls made via the indirection_api should be enabled one-by-one, when the implications are fully understood. Change-Id: Ia381348da93f95d764c83f3ec2a2ed5a1db5ad6d Closes-Bug: 1493816 Depends-On: I81400305f166d62aa4612aab54602abb8178b64c
* Fix misspelling in commentJohn L. Villalovos2015-08-101-1/+1
| | | | | | Change 'Pase' to 'Parse' Change-Id: I35f2d13832c7250e8fe5b2920338b336f97b5c5d
* Log configuration values as DEBUG, not INFODmitry Tantsur2015-08-031-2/+2
| | | | | | | | According to the OpenStack logging standards, INFO logging should contain unit of works and should be targetted at operators: https://wiki.openstack.org/wiki/LoggingStandards#INFO Change-Id: Id584905e9b11136e674066d676c533d0c503fd61
* Enforce flake8 E123/6/7/8 in ironicSam Betts2015-06-041-3/+3
| | | | | | | | | | | | | | | | | This patch enforces the rules E123, E126, E127, and E128 in the ironic code base: E123 - closing bracket does not match indentation of opening bracket’s line E126 - continuation line over-indented for hanging indent E127 - continuation line over-indented for visual indent E128 - continuation line under-indented for visual indent This fixes any parts of the current code which fails these rules and removes these rules from the tox.ini flake8 ignore list. Change-Id: Ia96582b5e9abc088d6c1694afc93c59be4a4065c Closes-Bug: 1421522
* Use oslo_log libGhe Rivero2015-05-051-1/+1
| | | | | | Module 'log' from oslo-incubator was removed after release of oslo_log library. Change-Id: I4261083dae076cea66c42ad16eb82a5faaeb1a65
* Move oslo.config references to oslo_configJim Rollenhagen2015-02-021-1/+1
| | | | | | | The oslo team is recommending changing to non-namespaced references. Implements: blueprint drop-namespace-packages Change-Id: I45462d9d49552044ad990f22bd6e6c5b37cf0649
* Enable H305 PEP8 checkDavid Shrewsbury2014-10-131-1/+1
| | | | | | | | | | | | Fixes files with the PEP8 error: H305 imports not grouped correctly and enables the check in tox.ini. Import order is: stdlib, 3rd-party, project imports Change-Id: I81fc67bc9f79c514b6f4941a13e44c95badd34e2
* Translator functions cleanup part 4Vladyslav Drok2014-09-051-3/+3
| | | | | | | | | | | | | | | | | This part fixes ironic/api, ironic/cmd, ironic/tests folders. Some modules use _ function for log translation, even when the translated string is passed to e.g. LOG.warn function. This patch fixes it, using translator functions appropriate for corresponding log levels. Translator functions, imported from ironic.openstack.common.gettextutils are now imported from ironic.common.i18n. Translator functions are imported the same way across all modules. All places that are changed conform to http://docs.openstack.org/developer/oslo.i18n/guidelines.html Partial-bug: #1364813 Change-Id: I92e5f0d50c3b507080fb95e81274a241558ce526
* Remove gettextutils _ injectionVladyslav Drok2014-08-291-0/+1
| | | | | | | | | | Now that ironic supports oslo.i18n, using the install function to inject _ into the builtin has been deprecated. New i18n common module used instead. In one module _ was imported from gettextutils, now also changed to i18n import. Closes-bug: #1346406 Change-Id: I672a975d479991982c24031e834a26e2c2811890
* Remove extraneous vim configuration comments for ironicHe Yongli2014-02-261-2/+0
| | | | | | | | | | | | Remove vim setting: comment - # vim: tabstop=4 shiftwidth=4 softtabstop=4 at the top of source code files, except for files in openstack/common. Change-Id: Ie80f76f08e27b7f5f747227c4cca8d79ad98bec6 Partial-Bug: #1229324
* Remove shebang lines from codeMikhail Durnosvistov2014-02-211-1/+0
| | | | | | | | | Need remove shebang lines like: #!/usr/bin/env python from code Change-Id: Id11cfcb9836a4908b96012f7bf413bc077a04a33 Partial-Bug: #1281055
* Make ironic-api not single threadedDevananda van der Veen2014-02-121-1/+9
| | | | | | | | | | | | | | | The ironic-api service is an instance of wsgiref simple_server.WSGIServer. This derives from SocketServer.TCPServer, which requires that SocketServer.ThreadingMixIn be mixed in for it to become thread'able, however this was not being done when starting the WSGIServer. This patch creates a ThreadedSimpleServer class, which is just a mix of ThreadingMixIn and WSGIServer, so that the ironic-api process does not block on network IO. Change-Id: I9d686765edb4975519840a51d3beeb2be797a4fa Related-bug: #1279206
* Register API options under the 'api' groupLucas Alvares Gomes2013-11-141-2/+2
| | | | | | | | | | Register the API options under the 'api' group and change the name of the options to be less redundant. This patch also regenerates the sample config file. Change-Id: I55ec0b977275a394fef059a6318540bb5186ddc0 Closes-Bug: #1244742
* Use localisation where user visible strings are usedDirk Mueller2013-09-161-2/+3
| | | | Change-Id: I224e3faaf7d6fcf0e3db807646028633a532a78b
* Log configuration values on API startupMark McLoughlin2013-05-281-1/+6
| | | | | | | | | It's very helpful for every service to log its configuration values on startup, so you can e.g. check typos. Also, change the print statements in the API binary to info logs. Change-Id: I1b4181ddc7f36149cddb2c24f514d526c403b2e0
* Fix pep8 errors and make it pass Jenkins tests.Devananda van der Veen2013-05-161-7/+3
| | | | | | | | | | Fix all existing pep8 errors. Remove install_venv and friends, which were not needed. Add a few ignores for nova code that is yet to be cleaned up. Skip one failing test case, fixed by review 29394. Import contrib/redhat-eventlet.patch from Nova. Change-Id: I46b6ccaa272bd058757064672ce9221263ed7087
* Implement initial draft of a Pecan-based API.Devananda van der Veen2013-05-131-0/+54