Currently is_admin flag is always False. As a result
some of the admin operations are not working.
For example, quotas-list is not listing all the
user quotas.
This change sets the flag correctly based on the
roles assigned to the user and policies defined
in policy.json.
Change-Id: I01534ccf1cf1e635282db497e0e026bea19c3bd2
Closes-Bug: #1660843
This commit addresses multiple potential vulnerabilities in
Magnum. It makes the following changes:
* Permissions for /etc/sysconfig/heat-params inside Magnum
created instances are tightened to 0600 (used to be 0755).
* Certificate retrieval is modified to work without the need
for a Keystone trust.
* The cluster's Keystone trust id is only passed into
instances for clusters where that is actually needed. This
prevents the trustee user from consuming the trust in cases
where it is not needed.
* The configuration setting trust/cluster_user_trust (False by
default) is introduced. It needs to be explicitely enabled
by the cloud operator to allow clusters that need the
trust_id to be passed into instances to work. Without this
setting, attempts to create such clusters will fail.
Please note, that none of these changes apply to existing
clusters. They will have to be deleted and rebuilt to benefit
from these changes.
Change-Id: I643d408cde0d6e30812cf6429fb7118184793400
Replaces tempfile.mkdtemp by fixtures.TempDir in order to explicit that
unittest temporary directories will be deleted (cleanup is hidden in NestedTempfile).
Change-Id: I7056333decd9a36f3ff1f69997e049dbc3d8afe5
Magnum needs to emit notifications for resource tracking, monitoring,
metering and auditing purposes so ceilometer can capture the events
and generate samples.
This commit leverage oslo.notify to send notifications when bay
resource operations are executed.
Change-Id: I4b07539822a75c069d9da8932dc0ff10a02e0058
Partially-Implements: blueprint magnum-notifications
This patch will copy logs from nova servers to local environment
on test failures.
Don't delete bays until teardown so log gathering will work.
Give functional test types a common base.
Added timeout to docker ps; else, the command would time out,
failing to run the rest of the tests.
Closes-Bug: 1542390
Change-Id: I016ed8fe311bede407f57b7982126c4b77749bec
Co-Authored-By: Corey O'Brien <coreypobrien@gmail.com>
cfg.CONF is a global object, so we need not pass it to init
a ConfFixture.
We should import opts before use them in case that the opts
have not been registered.
Change-Id: I1a97df4d522325d9423b1c89cc9958de26704faa
Closes-Bug: #1492084
Infra team has indicated that tearDown methods should be replaced
with addCleanup in unit tests. The reason is that all addCleanup
methods will be executed even if one of them fails, while a failure
in tearDown method can leave the rest of the tearDown un-executed,
which can leave stale state laying around.
Moreover, tearDown methods won't run if an exception raises in setUp
method, while addCleanup will run in such case.
So, we should replace tearDown with addCleanup methods.
Change-Id: I3d16954ef7e2fd229f779d193f24ac01d1d2f641
Closes-Bug: #1476976
Testing app has be and should be loaded in the FunctionalTest class.
So we should remove the duplicate app loading in the TestCase class.
The config.py file is not used if we remove the duplicate app
loading.So let's remove it.
If we remove the duplicate app loading, TestContainerController
should be modified. The base class of it should be FunctionalTest.
By the way, rename path_get to get_path.
Change-Id: I93d69d9392ecb8ae0303efe14574a6ebe9a82b3c
Closes-Bug: #1478194
Automated change to replace dict.iteritems() which is no longer present
in python 3 with dict.items(). The later can be very marginally slower
in python 2, however the alternative to this would be to use
six.iteritems(dict) which has a greater cognitive overhead and reduces
readability with little or no performance gain.
Refer to this mailing list thread for more on this issue
http://markmail.org/message/tx7776ewlutxitjx
Code under magnum/common/pythonk8sclient has been ignored as this is
autogenerated code expected to be pull out of Magnum.
Partially-Implements: blueprint magnum-python3
Change-Id: Ib7cd192b2be3776985963bdf7fa14e96a464d0ae
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
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
In oslo.versionedobjects, objects are registered inside a separate
ObjectRegistry class. Each object is registered with a decorator
(with less magic). Also remove unused check_object_version method.
Related to blueprint versioned-objects
Change-Id: I0f9fd3fdaa754480ccd9e18b6c15501900aa46ee
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
The updated API include the following:
1) get_bay_by_uuid
2) get_baymodel_by_uuid
3) get_node_by_uuid
4) get_container_by_uuid
Implements part of bp multi-tenant
Change-Id: I6cff457e585b4dd11f485eb63e477b8de0e96bea
The new patching only ensures that auth_token_info is properly
set up by default. A real RequestContext is returned, and it is
passed through to_dict and from_dict to ensure there are no
assumptions made that will not work through RPC.
If necessary, tests can still return a mock context by setting
a return_value or side_effect on self.mock_make_ctxt.
Change-Id: I6369e0bd89d83a5ea3ddde2b35423233fee18327
When test_objects run, it will load some dummy objects such as Foo
etc, the problem is that Foo did not have '_type' field, so the
unit test will be failed.
This patch was resetting objects for all test cases in test_objects.
Closes-Bug: #1413144
Implements part of bp increase-test-coverage
Change-Id: I84067db21cb087c2694145a5a733d867422b73a5
This client will be used by novaclient and heatclient to create a bay.
The original sources are come from Ironic.
Change-Id: Ib075148afb0ddf503e71b333cef85523561a2732
This creates and deletes bay objects in the database.
This new model is great because we can do things like:
https://github.com/openstack/nova/blob/master/nova/cmd/compute.py#L67
And completely override the database with an RPC mechanism instead.
This way objects are created in the ReST endpoint but stored in the
database via the backend and conductor.
I was attempting to write this code, but found it is already on its
way to being merged into oslo-incubator here:
https://review.openstack.org/#/c/127532/
Change-Id: Iff995d28a78f41874cc6ad62baf7420960a530da
These were the commits from github repo(s)
84d943e Initial commit
3d15bd1 Created the pecan project for containers for API
b49297b Added rest functionality to the v2 apis
227e1dd Added rest functionality to the v2 apis
39500ae Added the base API call like POST, GET, PUT & DELETE.
e404e94 adding wsme support to pecan
f90f540 Added wsme support to the magnum apis
c879329 added changes to api
24ebc32 Fixed the bugs in the container apis
01725ef Rename dir from containers to magnum
1a1375a Add requirements and test-requirements
f957e2e Add ASL2.0 license
8f4c0ee Move tests to the proper location
48dd100 Move setup files to proper directory
86cc435 Fix the setup so the installation is sanitary
b766d59 Make the installation and tox testing work
c477236 This is a new project - start with v1 for api
cf20cac Remove pep8 errors
d23b325 Merge with code generated using OpenStack cookie-cutter
b6b9f34 Ability to run pecan serve from command line
Had to update requirements.txt to get jobs working
Change-Id: I068389412d023c258bda40dfbdff5a40f2e7d175
Co-Authored-By: Digambar Patil <digambarpat@gmail.com>
Co-Authored-By: Steven Dake <sdake@redhat.com>