Commit Graph

22 Commits

Author SHA1 Message Date
Michal Nasiadka 68c8acba39 Remove execution bit on unnecessary files
Change-Id: Ia41b843fdf20154750b129a8ab5dd42f5c3989fb
2024-02-19 00:30:21 +00:00
coldmoment ba8ad5e37f Add a hacking rule for string interpolation at logging
String interpolation should be delayed to be handled
by the logging code, rather than being done at the point
of the logging call.
See the oslo i18n guideline
* https://docs.openstack.org/oslo.i18n/latest/user/guidelines.html#adding-variables-to-log-messages
and
* https://github.com/openstack-dev/hacking/blob/master/hacking/checks/other.py#L39

Change-Id: I8a4f5f896865aebbff88ee894f0081e58cfce9ef
2017-07-15 14:49:45 +08:00
yuanpeng 71d25456d2 Remove log translations
Log messages are no longer being translated. This removes all use of
the _LE, _LI, and _LW translation markers to simplify logging and to
avoid confusion with new contributions.

See:
http://lists.openstack.org/pipermail/openstack-i18n/2016-November/002574.html
http://lists.openstack.org/pipermail/openstack-dev/2017-March/113365.html

Change-Id: If1f4bd2f6be967368f52fb367c5a428d3eb58a9d
Closes-Bug:#1674551
2017-03-30 17:05:10 +08:00
Jenkins 085058bfb2 Merge "Support magnum-api multiple process workers" 2017-02-15 08:37:27 +00:00
Tovin Seven 32d088b2c1 Integrate OSProfiler in Magnum
* Add osprofiler wsgi middleware. This middleware is used for 2 things:
  1) It checks that person who wants to trace is trusted and knows
     secret HMAC key.
  2) It starts tracing in case of proper trace headers
     and adds first wsgi trace point, with info about HTTP request

* Add initialization of osprofiler at start of service
  Currently that includes oslo.messaging notifer instance creation
  to send Ceilometer backend notifications.

* Traces HTTP/RPC/DB API calls

Demo: https://hieulq.github.io/cluster-create-false-new-html.html

Co-Authored-By: Hieu LE <hieulq@vn.fujitsu.com>
Implements: blueprint osprofiler-support-in-magnum
Change-Id: I7d68995aab81d365433950aada078ef1fcd5469b
2017-01-24 07:43:31 +07:00
wangbo b462a3b8cd Support magnum-api multiple process workers
Multiple process workers support for magnum-api.
Adds new option 'workers' to group [api] of magnum.conf.

Change-Id: I0e8327ada6926602d577d1f36d384dd49426c7ee
Implements: blueprint magnum-multiple-process-workers
2017-01-09 20:25:55 +08:00
Hieu LE cfe5b4ed5c Centralize config option: api section
Centralize config option of API section.
Replace oslo_conf cfg to magnum.conf.

Change-Id: I0589014ab8eb70f0f6551bb23808d3b9edc580c1
Implements: blueprint centralize-config-magnum
2016-09-22 00:59:34 +00:00
Hieu LE 70c803bfc1 Use werkzeug to run Magnum API with SSL
wsgiref.simple_server is mono threaded process that can not
support SSL context. This patch aim to replace wsgiref.simple_server
with werkzeug for running development API server supporting SSL.

Change-Id: Ib4360d77030e4cce8abf5ea543d87b7982e0e285
Closes-Bug: #1614596
2016-08-24 03:57:30 +00:00
Eric Brown 6253f70a43 Remove bandit.yaml in favor of defaults
* Remove bandit.yaml so bandit just uses internal defaults. Results
  in much less maintenance.
* Raise the severity level of the scan to just medium and high
* Added nosec to line that makes use of file:// scheme. That support
  should probably be droppped at a later time.
* Removed a misleading log message noting what address it was
  serving on. Bandit also flagged this as a potential security issue
  serving on 0.0.0.0.

Change-Id: I3e08e462255f7b4ba8405d69f5843ed3c001d055
2016-03-09 11:20:28 -08:00
Aaron-DH db378a0ee5 Load wsgi app(api) with paste.deploy
This change replaces the hard coded WSGI app creation with a pipeline
of WSGI apps declared in a configuration file.
Paste Deploy was used to create the pipeline since it is used by many other
OpenStack projects and it is an active project
with new contributors and supports Python 3. Dependency on Paste is
localized so switching to another library would not be hard if OpenStack moves
to another package in the future.

Change-Id: I9a45f974c2c8c67a01748583639e6a6248003b85
Closes-Bug:#1551134
2016-03-08 09:25:44 +08:00
ting.wang b9aa042293 Replace string format arguments with function parameters
There are files containing string format arguments inside logging
messages. Using logging function parameters should be preferred.

Change-Id: Id558f66de13146f6ae76a7a69f49721b6c3d6257
Closes-Bug: #1321274
2016-02-20 23:39:33 +08:00
Xi Yang 7e799929bb Replace logging with oslo_log
Use oslo_log for all logging options

Co-Authored-By: Corey O'Brien <coreypobrien@gmail.com>
Change-Id: Iaed3a18c868a532f0ce2455e2f4d3c6b06adc88e
2016-01-30 00:28:27 +00:00
Grzegorz Grasza 2ed6b128d4 Indirection API implementation
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.

Related to blueprint versioned-objects-indirection-api

Change-Id: I99fe686b4b4e497be6b5d35a1d2e41833865799a
2015-09-01 16:38:36 +02:00
Wanghua 6e22b25b11 Add guru meditation report for magnum
Oslo_reports enables OpenStack projects to dump Guru Meditation
Reports with useful debugging information to files or stderr.
So we introduce it into magnum.

Change-Id: Ibf78d87559f9646cc314cd064d7da4f94edc1ff7
Implements: blueprint guru-meditation-report
2015-07-23 22:33:10 +08:00
Wanghua af35cb173d Code refactor for prepare_service
Put the common codes used by api and conductor into a function.

Closes-Bug: 1472961
Change-Id: I3f7d431d9a91d9979d940d794db5bc383a077826
2015-07-09 09:09:34 +00:00
Jenkins 7bcb700a97 Merge "Fix continuation line under/over indented problems" 2015-05-31 21:10:25 +00:00
Accela Zhao 7344fcf2a7 Fix continuation line under/over indented problems
When you are writing a multiple method invocation (or other similar
syntax)

```
obj.method(argument1,
           argument2,
           ...)
```

If you put argument1 in the first line, the following lines should have
the same hanging distance to argument1.

If you put argument1 in the second line, the hanging distance should
always be four.

```
obj.method(
    argument1,
    argument2,
    ...
)
```

Otherwise PEP8 would complain for continuation line under/over indented
problems. See below for more details

https://www.python.org/dev/peps/pep-0008/#indentation

This patch fixes all the continuation line indentation problems and
enables related checks in tox.ini.

Closes-bug: #1459514
Change-Id: I80995c2ae71b817ad78a87ab7c567f0d36112710
2015-05-30 00:16:37 +08:00
Lan Qi song 17218a8011 Use oslo.log instead of oslo.incubator log module
oslo.log has graduated from oslo-incubator, magnum need use oslo.log
instead of oslo.incubator log module.

NOTE: openstack.common.log registers its options at import time, but
oslo.log needs to call register_options() explicitly.

Change-Id: I671bb020b628bd972813daf5936040b7f1c6bf7a
Closes-Bug: #1459736
2015-05-29 18:28:23 +08:00
Davanum Srinivas bf42ec94ef Setup for translation
To start translation, we need to initially import the
translation file - and place it at the proper place so that
the usual CI scripts can handle it.

The proper place is for all python projects
$PROJECT/locale/$PROJECT.pot - see setup.cfg.

Note that we were using _i18n.py from openstack/common
which is likely to go away, so created our own i18n.py
module per best practices:
http://docs.openstack.org/developer/oslo.i18n/usage.html#creating-an-integration-module

Further imports will be done by the OpenStack Proposal bot.

implements blueprint magnum-i18n-support
Change-Id: Ib34bfbe1ae47e077e92a4262642842c845d1a5d6
2015-05-24 03:13:55 +00:00
Madhuri Kumari e05e967775 Support i18n log format for error in magnum.
This patch supports i18n log format for error
level logs in magnum.

Change-Id: I58a3bda63139ef0ef6535601e74100a66016a23f
Partial-Bug: #1424499
2015-02-27 02:05:01 +00:00
Davanum Srinivas 17c5711c55 Remove imports from oslo namespaces
Oslo team is recommending everyone to use the direct imports and
not use the Oslo namespaces. So switch all our code to use oslo_*
instead of "from oslo." or "import oslo" or "from oslo"

NOTE: some of the tests still have mocks referring to oslo.utils
@mock.patch('oslo.utils.timeutils.utcnow')
as the tests break otherwise. We should do this later.

Closes-bug: #1419385
Change-Id: I8e3fbeb833cddc3f55674a0e781ffe69d5033ad4
2015-02-08 02:59:30 +00:00
Steven Dake 14707dd546 Create a ReST API entrypoint
This creates a server entrypoint for running the Pecan+WSME
infrastructure.

Change-Id: I58bdeea7971f0f562e3d7a5542740283cb910a7b
2014-11-18 14:01:20 -07:00