68 Commits

Author SHA1 Message Date
sbauza
052f17eb20 DB API and models for supporting Compute Hosts Reservations
As per our design doc for Hosts reservations [1], Climate needs to be
added three new models called ComputeHost, ComputeHostExtraCapabilities
and ComputeHostReservation

 * ComputeHost will store all info concerning hosts managed by Climate
   and will keep tracability on if they are free for a lease or not
 * ComputeHostExtraCapabilities will allow admin user to add extra info
   for each host to add to Climate like GPU or SSD which are not yet
   visible thru Nova-Compute
 * ComputeHostReservation will store all reservation details when
   creating a lease, needed by Manager when starting the leases

Implements bp:host-db-api

[1] : https://docs.google.com/drawings/d/1-_DOB65LsSGR4JUaPN525bWAg1yhvEv3KNcHfmuLvYw/edit

Change-Id: Ib8f289064a9621372908be1d44db92f3719b24e1
2013-12-09 15:01:40 +01:00
Jenkins
23595d493d Merge "Remove empty copyright headers" 2013-12-06 07:37:56 +00:00
sbauza
16b55ccd53 Remove empty copyright headers
As discussed, let's remove all headers for files containing no
code but the copyright headers.

Implements bp:remove-empty-copyrights

Change-Id: I276a346360e27df70093241676576995f8e298d8
2013-12-03 11:30:27 +01:00
sbauza
8624ca116f Add Host Reservation Admin API
Initial release of Host Reservation Admin API by adding new classes
to the current Lease API mapped to /os-hosts/ context.

The goal of this API is to be admin-only, defining CRUD methods for
adding a host to Compute, aiming to dedicate it for lease management.

As a result, the added host won't be available for booting VMs on it
unless Climate specifically picks it from a specific freepool to the
user' pcloud associated with the host reservation.

For testing, please patch RPC methods like this :
    call = lambda *args, **kwargs: True
    cast = lambda *args, **kwargs: True

TODO :
 - Add @policy.authorize() to climate.api.oshosts.service controllers
   once review 57200 (Policy mgmt) is merged

Implements bp:host-provisioning-api

Change-Id: I58d986fe8344b9578b2f15399ec19f7649cc3035
2013-12-03 10:48:00 +01:00
Jenkins
9f63fe76ae Merge "Unittest for manager service" 2013-12-03 08:15:00 +00:00
Jenkins
88816f42ca Merge "Remove config parsing call from test setup" 2013-11-29 12:50:48 +00:00
Jenkins
bf6ee1a614 Merge "Fix API exceptions handling for message and error code" 2013-11-29 12:49:16 +00:00
Dina Belova
03f2cb5037 Remove config parsing call from test setup
Change-Id: Ib30e45d87fc85052114e5727a200e2102c4face6
Fixes: bug #1256027
2013-11-28 20:02:20 +04:00
Jenkins
c5d97dc4be Merge "Add Cover directory to gitignore" 2013-11-28 15:57:33 +00:00
sbauza
6ef0b22f31 Add Cover directory to gitignore
Change-Id: I51013def22b22c3a2a666addeb0b26fb76c4de56
Fixes-Bug: #1255991
2013-11-28 15:24:43 +01:00
Jenkins
e352299f63 Merge "Hotfix for bug 1255928" 2013-11-28 14:00:30 +00:00
sbauza
6b2529ea45 Fix API exceptions handling for message and error code
API exceptions were not returning correct errorcode.
A bug will be opened for moving these exceptions into climate.api but
for this commit, the idea is just to quickly fix it.

Change-Id: I5563c93dac45e22dc3348f5e380521cf8537b440
2013-11-28 14:12:36 +01:00
Nikolaj Starodubtsev
06ae853bde Hotfix for bug 1255928
Change-Id: I987b598c19ca6d2070391ff4590b10ae94df1d9b
Fixes: bug #1255928
2013-11-28 15:08:49 +04:00
Yuriy Taraday
19e39676ad Remove extra excludes for flake8 checks
Change-Id: If95b676ed5f1ebd1e7b076fb354f24493f204ebb
2013-11-28 14:40:49 +04:00
Nikolaj Starodubtsev
ca33dc3484 Switch on coverage support for unit tests
After we merge this patch we can use 'tox -e cover' and see how is our
code is covered with tests. It's very good for proper code process.

Change-Id: Ia39145727b0dc55879cd807e2ef4fc2de331c9a4
Implements: blueprint coverage-for-testr
2013-11-28 13:06:00 +04:00
Nikolaj Starodubtsev
1ccd8d588d Unittest for manager service
fixes: bug #1251572

Change-Id: I9f543f3f8fd08d82e9523147e2797ea93f08f26f
2013-11-27 12:56:02 +04:00
Jenkins
0572493fc7 Merge "Refactor context module to make it more flexible" 2013-11-26 11:08:00 +00:00
Yuriy Taraday
ea0c144b13 Refactor context module to make it more flexible
- context data is stored in a dictionary now, so any key is allowed;
- list of allowed key for certain context is stored in special class
  variable;
- methods "current" and "elevated" of ClimateContext class are
  accessible from module level;
- moved to usage of threading.local instead of emulating one in code (as
  long as we use eventlet's monkey-patching, it's specific local() will
  be used).

Change-Id: I3c79c9cd0d16dfb5c61208f2aa71b5c59f3f40f3
2013-11-25 14:10:23 +04:00
Sergey Lukjanov
c718f6dafb Revert "Support building wheels (PEP-427)"
'universal=True' means app supports py2 and py3 which isn't supported by
climate at least due to the eventlet dependency, so, my bad, it should
be reverted atm. W/o 'universal=True' wheel bdist still could be built.

This reverts commit 415a66430b3c395c8f442d89f4d4ec6d48378276

Change-Id: I074b33f1a1df87c3f3cc58b5734b6f20e364de5b
2013-11-22 15:35:42 +00:00
Dina Belova
429b48fae0 Remove nova dependency
Nova filter should be removed to the separated repo.
That fixes Jenkins tests/gate jobs fails.

Fixes: bug #1254018
Change-Id: I725dd222204f159e9fe3b1ebd64292de62d62a1b
2013-11-22 17:16:23 +04:00
Jenkins
41c5ab8ebd Merge "Fix tox.ini to run tests in lockutils wrapper." 2013-11-21 11:33:22 +00:00
Jenkins
53e0a7fc7a Merge "Use setup.py develop for tox install." 2013-11-21 11:22:53 +00:00
Jenkins
609e99f5d1 Merge "Support building wheels (PEP-427)" 2013-11-20 18:26:55 +00:00
Jenkins
add4936756 Merge "Run tests using testrepository" 2013-11-20 12:49:31 +00:00
Nikolaj Starodubtsev
671eb6a515 Add unit tests to api functionality
Change-Id: Iae5d8a69d9fb0fa272aa0535f84c0ceeba6dd4d9
2013-11-20 11:40:14 +04:00
Nikolaj Starodubtsev
a2bdf75a10 Implemented bugfix for bug 1252989
I find bug after rebase my api unit tests to the latest master. We forgot
to add 'cfg.CONF.import('opt_name', 'climate.config')

Change-Id: I6c996c738bf3b2ae0b2c6d14beed424f99db4859
fixes: bug #1252989
2013-11-20 11:37:04 +04:00
Dina Belova
52420c1e2b Fix tox.ini to run tests in lockutils wrapper.
Without this line locks while parallel tests running won't be
working and there will be tests fails because of this.

Change-Id: I5d29441365fafd8005ac9a2088badca23bf7cb09
2013-11-19 18:01:21 +04:00
Julien Danjou
fe64cb2178 Run tests using testrepository
Change-Id: Ic0b4146d18fe7dba6f7c43c48ad6507147ef11eb
2013-11-19 13:41:02 +01:00
Jenkins
a24fb07d39 Merge "Update openstack/common/lockutils" 2013-11-19 12:06:40 +00:00
Jenkins
ae2ede96d7 Merge "Test module refactoring" 2013-11-19 09:56:43 +00:00
Sergey Lukjanov
415a66430b Support building wheels (PEP-427)
With that, "python setup.py bdist_wheel" could be used for building and uploading wheels to PyPI.

Change-Id: I64a0c379afd524185497526eae31ccf72cf97c61
2013-11-19 13:14:59 +04:00
Jenkins
bc7b2ffcf2 Merge "Ignore vim temporary files" 2013-11-19 08:56:53 +00:00
Nikita Konovalov
a9e564b13f Test module refactoring
Tests moved inside climate module

Change-Id: I619960bd9dc6293980171b510873ef32a5df3ad6
2013-11-19 11:38:32 +04:00
Jenkins
74a3dbdad3 Merge "Upgrade hacking to the latest version" 2013-11-18 11:21:55 +00:00
Jenkins
bf8efd8622 Merge "Sync with global requirements except hacking" 2013-11-18 11:21:39 +00:00
Michael Still
ac915532e4 Update openstack/common/lockutils
The following commits are in this update:

79e6bc6 fix lockutils.lock() to make it thread-safe
ace5120 Add main() to lockutils that creates temp dir for locks
537d8e2 Allow lockutils to get lock_path conf from envvar
d498c42 Fix to properly log when we release a semaphore

Change-Id: Ida26987e8841d79f3d4627d7f46ab08eb59234ec
2013-11-16 21:36:51 +11:00
Sergey Lukjanov
0041846fb8 Upgrade hacking to the latest version
Change-Id: I1c3b8e45d9e2618eb4ef9be23bb7746068354b32
2013-11-15 21:58:17 +04:00
Sergey Lukjanov
b1e9a1c62b Sync with global requirements except hacking
Change-Id: I786eb296d19315b563ad99dcad33307e89f60844
2013-11-15 14:57:41 +04:00
Swann Croiset
299d79c915 Ignore vim temporary files
Change-Id: Ic422e23c0c1590c683bafeb56ca30281d53efef4
2013-11-15 11:30:52 +01:00
Sergey Lukjanov
f32eea6b3f Add HACKING.rst with link to the style guidelines
Change-Id: Ib2fcc4c848df5ac6a975ecad2ace39dd35347d79
2013-11-15 14:27:36 +04: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
Michael Still
560ce68f9f Convert to a more modern form of openstack-common.conf
One module per line is the new hotness. I've also sorted the
modules alphabetically. There are no changes to your imports, but
this makes it easier for oslo maintainers to keep your imports up
to date.

Change-Id: I6e9ae5d8b953b81014bd60cc842af33c6af58b61
2013-11-14 20:31:29 +11:00
Nikolaj Starodubtsev
c89068117b Small fix for climate.api.utils
Add changes in climate.api.utils The bug occured because function excecution
wasn't stop after we log an error with abort_and_log func. Fix it with adding
return statement after abort_and_log.

Fixes LP bug #1246244

Change-Id: I7351758c10163c01ed55ffe6028dac63f9d70c69
2013-10-30 13:56:47 +04:00
Dina Belova
868ff3e62c Fix REST API service classes methods.
Change-Id: I97b618a6788e7b9381cc8dbdaa09253dbcebd395
2013-10-28 20:00:37 +04:00
Yuriy Taraday
dfeacfa37e Change api.service to use a class, fix validations in api
Change-Id: Ib5a957a82238b18548ff470ea9c2905b389d026e
2013-10-28 18:23:00 +04:00
Yuriy Taraday
dfbaa5a410 Remove context passing around, use climate.context instead
Since we have a global context storage we should use it everywhere. I
suggest we remove all this ctx args and never bring them back.
In case someone wants to run something with different context one can
always do:

    with my_other_context:
        run_method_without_ctx_in_args()

Change-Id: I976726f59cedd79f1d619f35f570c60e2c701c7d
2013-10-28 15:12:11 +04:00
Dina Belova
bcf2cc9395 Add docs for REST API 1.0
Change-Id: I836c60acbd169db8a92c36712db8c0afb6be2375
2013-10-27 18:56:44 +04:00
Dina Belova
7b6cd50ecd Implement REST API.
Change-Id: I7b63c692f153d766ddd3ab261bdc0c1715934c0b
2013-10-22 16:11:06 +04:00
Dina Belova
d8cd612d8e Add context module, rename context to ctx in method args
Change-Id: Ifefaae130cb3c1652e851356219c217c1dfd1509
2013-10-21 23:31:24 +04:00
Dina Belova
213e7bf0cc Rename climate.cmd.climate_* to climate.cmd.*
Also add __init__ to climate.cmd to let console_scripts work

Change-Id: I2f83738c7e73ef08b5f7e9a67ebf2c4d18409c6c
2013-10-21 21:03:37 +04:00