Commit Graph

28 Commits

Author SHA1 Message Date
Hiroaki Kobayashi 99cb6b5199 Register and document policy in code
This patch moves default policy definitions from file-based maintenance
to registering them in code following OpenStack standard[1].

[1] https://governance.openstack.org/tc/goals/queens/policy-in-code.html

Change-Id: I47afa929ebfa30e17c2dbeac31108ecbab67f067
Implements: blueprint policy-in-code
2018-06-11 17:36:13 +09:00
Ken'ichi Ohmichi 12d0b95cff Remove unused reference from config-generator
When operating `tox -e genconfig`, the tox did output the following
warning message:

  WARNING:stevedore.named:Could not load oslo.utils

because the oslo module doesn't have any config options.
This patch removes this invalid reference from config-generator.

Change-Id: I523c915c14cf00916224d5ce69f7c659e397dc7d
2017-05-17 03:56:57 +00:00
Masahito Muroi 68d769bf71 Migrate climate namespace to blazar
Although the Climate project was renamed to Blazar in 2014, the code has
still been using the climate namespace.

This patch moves all code to the blazar directory and allows users and
operators to use the 'blazar' command namespace. The 'climate' namespace
remains O release to allow users of Blazar time to move their own
code to the blazar namespace, but will be removed in P release
development cycle.

Change-Id: Icbe6fab1051aae4ac819982a1fa4f323cb0bf2d0
Partial-Bug: #1662734
2017-03-02 09:36:14 +00:00
Hiroaki Kobayashi f90a113644 Use oslo.utils
This patch replaces old oslo-incubator code with the oslo.utils module.

Change-Id: Ia6f5c766232d19ea32f6bb5228d52b8882960fbd
Closes-Bug: #1661516
2017-02-10 13:18:42 +00:00
Pierre Riteau c44f601525 Use oslo.db
This commit replaces the openstack.common.db module with oslo.db.

Note that database migration tests in climate/tests/db/migration have
not yet been changed to use test fixtures and helpers from oslo.db.

Change-Id: I706f7a1028617c8e35b989ff11ecdecd62dcd1a3
2017-02-10 12:12:56 +00:00
Hiroaki Kobayashi 7a6bf157cb Use oslo.policy
All OpenStack projects should use the oslo.policy[1] module for policy
enforcements. This patch converts the Blazar code base from its
oslo-incubator policy module to oslo.policy.

[1] http://docs.openstack.org/developer/oslo.policy/usage.html

Change-Id: I3bdeaa87d17a2bb3fea345c3356b88add86b9e96
Closes-Bug: #1658920
2017-02-07 20:26:57 +09:00
Hiroaki Kobayashi 65c7de0aba Use oslo-config-generator
This commit replaces the old configuration file generator from the
openstack.common.config module by oslo-config-generator [1]. It also
deletes files under tools/config which are now unused. New files are
added for the generator:

  - climate/opts.py is for collecting climate options
  - etc/climate/climate-config-generator.conf contains generator configs
  - etc/climate/README-climate.conf.txt describes how to generate a
    sample configuration file

In addition, a testenv:genconfig section is added to tox.ini and
settings for the oslo.config.opts entry point are added in setup.cfg.

[1] http://docs.openstack.org/developer/oslo.config/generator.html

Change-Id: Ifd352dee176310fd667d1523a85afd3ddf9ab5da
Closes-Bug: #1658908
2017-02-07 08:53:12 +00:00
Masahito Muroi 3c7dbd3237 Use oslo.log
All OpenStack projects should use the oslo.log module for logging. This
patch converts the Blazar code base from its oslo-incubator logging
module to oslo.log.

Change-Id: I2434bb8e864a77a3c3b1ec278767e5526e0a8952
2017-02-02 13:46:42 +09:00
Tony Breeds 3c6632716e Switch from openstack.common to olso_concurrency
The aim is to remove the last user of posix-ipc so it can be removed
from global-requirements.txt.

This commit also re-generates the sample config to reflect the config
group change for 'disable_process_locking' and 'lock_path'.

Change-Id: I777424370dc02c3164803a63331a1befb8531de5
2016-12-09 08:08:05 +11:00
Pierre Riteau c5e9132a07 Use oslo.serialization
This allows to remove the wsgi and sslutils code originating from
oslo-incubator. sslutils is causing ubuntu-xenial gate jobs to fail
because it refers to ssl.PROTOCOL_SSLv3, which was disabled in OpenSSL
on Debian and Ubuntu due to the POODLE attack.

Also update climate.conf sample file to pick up library changes in this
commit and previous ones. This required patching the generator code to
support cfg.PortOpt and cfg.Opt, but ultimately will be replaced to use
the new generator in oslo.config.

Change-Id: I54fcc1cf6c86bbadf6e922f7339d2bde18182e3a
2016-11-11 11:47:18 +00:00
Andreas Jaeger e84096852f Update requirements, fix testsuite
Manually update from global requirements.
Remove obsolete docutils pin.
Regenerate climate config file.
Fix testsuite for testtools change.
Workaround PYTHONHASHSEED setting in tox, disable for now so that tests
always pass.

Change-Id: I8c4a458371b28c91c5b848094e56038a16d6afc3
2014-08-26 08:09:54 +02:00
Pablo Andres Fuente c9b7307cf3 Added use of trusts to Physical Host plugin
Now the physical host plugin uses trusts to communicate with Nova.

Added a decorator in order to create a trust in certain API calls.
Added the trust_id to the ComputeHost model. Added a DB migration for
this change and a unit test for it.
Added the MissingTrustId exception, which is raised when no trust_id is
provided to some methods of the RPC API.
Removed all the configuration keys related to the admin Climate user.
Modified NovaClientWrapper in order to use the information stored in
context.

Change-Id: I0b83a933c0d72871654f3c6252be5d5e2c4cfd54
Closes-Bug: #1285585
2014-06-18 10:12:39 -03:00
Jenkins a952cc3f63 Merge "Add extensions for API v2 controllers" 2014-05-30 16:50:24 +00:00
Sylvain Bauza 17fbc15eaf Fix tests gates broken due to keystoneclient upgrade to 0.9.0
Keystoneclient MW cache and FakeMemcache were not having same args.
Fixed FakeMemcache so now the call is working.

Change-Id: Id555922646b926183315dc4a016cddd85d65e923
Closes-Bug: #1324903
2014-05-30 14:52:52 +02:00
Sylvain Bauza 23e327f79c Add extensions for API v2 controllers
Controllers (and API endpoints) should be able to be selected using
configuration flags, as we do for plugins

TODO:
 - Extra Hooks to be configured using stevedore

Implements blueprint: pecan-wsme
Implements blueprint: api-extensions

Change-Id: I12f1bc1accbc870aacb0d1e08c9e0d08223c4b18
2014-05-30 11:19:19 +02:00
Cristian A Sanchez 1d1ad49da0 Sends notifications at lease events
Climate now uses oslo.notify to send notifications when
CRUD lease operations are executed and when relevant lease
events happen (start_lease, before_end_lease, end_lease).
This implementation also adds one new event type called
before_end_lease to be sent when a lease is close to be ended.
Moreover, a new oslo.notify wrapper class was also added.

Change-Id: I861540e5ec5d1309ded2de56b2135bae5b59dad9
Implements: blueprint notifications
2014-04-21 12:11:13 -03:00
Cristian A Sanchez 6b26ecaf75 Change references of tenant to project
Refernces from tenant to project were made in several
places, including DB, HTTP Headers, configuration items,
json in responses and devstack integration. Additionally,
a migration script using Alembic was included.

Implements: blueprint tenant-to-project-ref
Change-Id: I4b21182f555ccd412a4ca4e0ce753f07edcd07f8
2014-04-17 11:16:09 -03:00
Sylvain Bauza eb0c81f95a Port to Pecan/WSME for API v2
Routing either V1 or V2 using a Facade. By default, V1 is enabled
but can be deactivated by a confflag.

Pecan controller for Lease created using WSME i/o validation

Implements blueprint: pecan-wsme

Change-Id: I9047abece78632daa13fdebfea9fb8aaa3c60981
2014-03-31 13:45:48 +02:00
Cristian A Sanchez 01f64a0ede Update Keystone sample config file
pep8 in Jenkins fails becase it's building with Keystone
client 0.7.0, but the sample config file was generated with
0.6.0. The failure is caused by changes in some descriptions
of configuration items.

Closes-Bug: #1297977
Change-Id: Iad39d1b77274ddf40b55f167bc76d5d24b5c9cd8
2014-03-26 15:11:14 -03:00
Sylvain Bauza e141b08a1e Change API v1 path to explicit module
In order to prepare API v2, we need to isolate API v1 code into a
separate module called climate.api.v1

Implements blueprint: pecan-wsme

Change-Id: I9e968370ba9ac8d21f5c099f1b09587d9f6b821e
2014-03-12 17:40:05 +01:00
Cristian A Sanchez 69b0497ab9 Update openstack.common with latest oslo-incubator
openstack.common was updated with the latest oslo-incubator changes.
rpc and notif were manually removed. DB layer was modified to adapt
to the changes done in Oslo. '# noqa' was also removed from imports.

Also after new release of oslo.messaging appeared, we also needed
to update openstack.common to make Climate work with oslo.

Change-Id: I1b5ce64f8d4906d1fcfea9379d115b7bb2ec3f7b
Closes-Bug: #1237896
Closes-Bug: #1284749
Partial-bug: #1253497
Co-Authored-By: Pablo Fernando Cargnelutti <pablo.fernando.cargnelutti@intel.com>
Co-Authored-By: Dina Belova <dbelova@mirantis.com>
2014-03-06 16:30:42 -03:00
Sylvain Bauza c219fb6903 Clean-up config files for API and Manager
Moves some config files for better clarity, and adds the possibility to
define climate-api.conf and climate-manager.conf

Change-Id: I8b628d051a563bec9f644710e44b6d87a1f7de88
Closes-Bug: #1284716
2014-02-27 11:58:41 +01:00
Swann Croiset e9d03ee1ea Reworking configuration options
Use config tools from Oslo-incubator :

* generate a consistant config file sample:
  etc/climate/climate.conf.sample

* Add a new check in tox env 'pep8' to check out-dated config file sample.

Move specifics options for admin credential in group config 'physical:host'

Factorize by declaring config options in each plugins with available values and
centralizing RESOURCE_TYPE value in plugin's module (one dir per plugin)

Use socket.gethostname() in place of socket.getfqdn() to have
predictable default value for 'host' config in climate.config,
since it's ugly forced in openstack.common.config.generator#L232

Fixes: bug #1271875

Change-Id: Ie54fc98b58b49400360c4fd2ce7d8bb3b75915e2
2014-02-24 18:04:22 +01:00
Nikolaj Starodubtsev 0177cd8841 Implement basic plugin for VM management
This commit implements basic VM management plugin for Climate.
As decided we use nova shelved instances to support our reservation
model. The only one thing we do for "on_start" lease action -
'unshelve' instance. As decided we support configurable opts for
"on_end" lease action, by default it set to snapshot and delete VM.

Implements bp:basic-vm-plugin

Change-Id: Ia34e16c636d1fa8d200873334f55b9868866f97f
2014-01-29 21:59:32 +04:00
Sylvain Bauza 16d5f67ba7 Fix service user creating objects
Service user used by Climate should not create objects such as
host aggregates. Consequently, until we migrate the code by using
trusts, we need to use a dedicated user for operations

Change-Id: I35878e178dea7eb10a52ad2419e191d8d683b35c
Closes-bug: #1270765
2014-01-20 14:46:04 +00:00
Sylvain Bauza 66dc137068 Add Physical Host Config to climate.conf.example
There was a miss in the example climate.conf where only the
virtual instance plugin was loaded. Added it.

Implements blueprint host-manager

Change-Id: I535b93a6cbd4dd4b89c7794fdfe4e38dd3259f49
2014-01-17 14:16:04 +01:00
sbauza 8443312186 Policy management for Climate
Implements policies in Climate with unittests based on Oslo.
Tight integration with Context as it will populate to Context
if user is admin or not based on policy.json

In order to make that work, please add policy.json to /etc/climate

Decorator @policy.authorize allows enforcing policy checks on
controllers.

Implements bp:climate-policy

Change-Id: I94e8fa142e5c5d830b0bea9278e5a47f9904db4c
2014-01-07 12:31:39 +01:00
Dina Belova f50a50b3fe Implement Manager service.
Implement RPC service to work with plugins and DB.
Base plugin class added.

Implements: blueprint lease-manager
Change-Id: Icbed7fabef6c0673c62f67017e5e9cd8d257b5ee
2013-11-14 17:50:11 +01:00