Commit Graph

151 Commits

Author SHA1 Message Date
Thomas Goirand 46b34c05b0 Fix compatibility with oslo.db 12.1.0
oslo.db 12.1.0 has changed the default value for the 'autocommit'
parameter of 'LegacyEngineFacade' from 'True' to 'False'. This is a
necessary step to ensure compatibility with SQLAlchemy 2.0. However, we
are currently relying on the autocommit behavior and need changes to
explicitly manage sessions. Until that happens, we need to override the
default.

Note that this patch was written using this one as example:
https://review.opendev.org/c/openstack/magnum/+/858374

Also include Zuul gate fix. Fix as described in [1][2]

[1] https://lists.opendev.org/pipermail/service-announce/2022-September/000044.html
[2] https://lists.zuul-ci.org/pipermail/zuul-discuss/2022-May/001801.html

Change-Id: I963e741078514b1cca6ed0e510cefaeccdd3499a
2022-10-12 13:11:52 +11:00
Jeremy Stanley 398b2d86d5 Tenant to project migration for RequestContext
As of the oslo.context 4.0.0 release, RequestContext objects no
longer have a tenant attribute, instead expecting callers to use
project_id for that purpose. Update all context.tenant references to
context.project_id in order to facilitate this transition.

Change-Id: I2830ccf840bf4d1d8a516287adee51c46d2a5583
2022-03-29 12:43:00 +00:00
zhurong 272a9e40fd Remove six murano/db
Change-Id: Ibc5a314beab903d4cd8d0bd693d8c9c134858c69
2020-04-17 20:05:40 -07:00
zhurong b40e458c5f Remove the deadcode
Change-Id: I8170d9c91f04e92a8374a403550bc05486733092
2019-08-15 19:32:01 +08:00
zhurong 4ee97f7b7a Bump to hacking 1.1.0
Change-Id: I4019f41d9ddd843872855e6e80c0667ee2df758a
2019-07-04 11:51:47 +00:00
zhurong 20af772ee7 Fix pep8 E402
Change-Id: Ie8eda174a6da50a222e4070a18a421eff28b6119
2019-01-09 13:23:29 +08:00
M V P Nitesh 580677eedc Replace six.iteritems() with .items()
1.As mentioned in [1], we should avoid using six.iteritems to achieve
iterators. We can use dict.items instead, as it will return iterators
in PY3 as well. And dict.items/keys will more readable.
2.In py2, the performance about list should be negligible, see the
link [2].
[1] https://wiki.openstack.org/wiki/Python3
[2] http://lists.openstack.org/pipermail/openstack-dev/2015-June/066391.html

Change-Id: I45fa65427318e1c35bb521de46e81ea12ca7b770
2017-05-03 09:17:18 +00:00
shihanzhang 06746baa32 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: I24ca32d9e92cdd2b3a91916337839d116e335084
2017-04-03 12:11:20 +08:00
Duan Jiong 264b971da6 Fix some reST field lists in docstrings
Probably the most common format for documenting arguments is reST field
lists [1]. This change updates some docstrings to comply with the field
lists syntax.

[1] http://sphinx-doc.org/domains.html#info-field-lists

Change-Id: I75a16629617c4e96ec2983108642025319d3deca
2017-03-23 13:50:58 +08:00
Jenkins aab84fbb2f Merge "Fix syntax errors of the comments" 2016-11-30 15:35:41 +00:00
Jenkins 1f58ddab56 Merge "Fix a typo" 2016-11-29 13:14:09 +00:00
chenaidong1 686e85476c Fix syntax errors of the comments
Change-Id: Id6eadb991b2d0ad7a8416b1137767b251d4a23d7
2016-11-25 03:29:06 +00:00
Alexander Tivelkov 81eebd12ad Ability to retrieve current/owner user/project
Added an ability to retrieve information about the current user,
current project, environment owner (both user and project)
from keystone. Appropriate information (including
extra fields but excluding internal system data) is fetched from
Keystone using the same service credentials that are used to validate
tokens, create trusts etc.

- io.murano.User and io.murano.Project classes were added.
- Both classes have 2 static methods to get current and environment
   owner object of appropriate class
- Object model now contains project_id/user_id of the user who
   created the environment
- Deployment task contains project_id (renamed from tenant_id)
   and user_id of the user who initiated the deployment

Change-Id: Ic7e24c1d2b669ed315851047bcdb27e075cfc56b
2016-11-24 02:07:34 -08:00
chenaidong1 bf4d27c1da Fix a typo
Change-Id: I789147df313bad9f28b78c774a0d5d1c493524bd
2016-11-21 12:00:05 +08:00
Huangsm 82bd5858e3 Order the packages for parameter search
Previously, list packages with parameter 'search',
search content in any attributes, but packages are unordered
With this change, packages are  ordered.
Such as: list package with 'search=mysql'
the packages whose name like 'mysql' are ahead of others
whose afn like 'mysql',and so on

Change-Id: Iecc3038ac40e731788975cff0cdf7d42e7f97112
Closes-Bug:#1467487
2016-11-04 17:55:40 -04:00
zhurong 111ec40bde Fix statservice save db error
Previously the statservice saved db with the error, because
requests_per_tenant was a dictionary. JSON.dumps() fixes it.

Change-Id: Iee92d9fa1ebbec3e28fc37b8252b3e3d88a8d995
Closes-Bug: #1632619
2016-10-12 10:09:07 +00:00
Jenkins 948219cc8c Merge "Fixes Statistics class create referencing invalid attributes for models.ApiStats." 2016-10-11 14:52:42 +00:00
Jenkins 3562357f6b Merge "Fix TypeError being thrown by delete_environment_from_space in cf_connections." 2016-10-07 17:05:09 +00:00
Alexander Tivelkov fc876ee278 Initialize environments with empty metadata
Since environment edits are implemented with jsonpatch which is unable
to replace non-existing dictionary keys it is better to initialize
environments with already existing 'metadata' block, so it may be
modified without ned to care about its existence.

Targets-blueprint: metadata-assignment-and-propagation

Change-Id: I04922b5933de388a16bc1f3b59008aad426a9aff
2016-10-06 12:49:08 +00:00
Felipe Monteiro 8a437b8823 Fixes Statistics class create referencing invalid attributes for
models.ApiStats.

Currently, stats.Statistics.create() erroneously sets 2 incorrect
attributes for an instance of models.ApiStats. These attributes
are:
    1) `stats.request_per_tenant`
    2) `stats.request_per_second`

These attributes have been changed to:
    1) `stats.requests_per_tenant` (plural)
    2) `stats.requests_per_second` (plural)

This change aligns with the currently correct attribute reference:
    - `stats.errors_per_second`

These changes also align with the correct attribute definitions
in models.ApiStats which are: `requests_per_tenant` (plural)
and `requests_per_second` (plural), respectively.

Change-Id: I7c8a0ff2580ee4d5e8f5336425ed1af040a97e8a
Closes-Bug: #1630782
2016-10-05 18:15:52 -04:00
Felipe Monteiro 9ff3f49f23 Fix TypeError being thrown by delete_environment_from_space
in cf_connections.

An unexpected keyword, 'synchronized', is passed to the
function delete from delete_environment_from_space.
This fix removes 'synchronized' arg from the call to
delete.

Change-Id: I065dc1a81dc0c23cc9a264399a99255e8272b07d
Closes-Bug: #1630747
2016-10-05 16:36:09 -04:00
Jenkins 4020e0bea4 Merge "Fix typo and make docstring more clear" 2016-10-04 16:31:56 +00:00
Duong Ha-Quang 8d09fd5820 Fix typo and make docstring more clear
Rewrite docstrings in murano/common/wsgi.py to make it
more clear. Fix typo in other files.

TrivialFix

Change-Id: Iaa6bde5f3b0356b6ac9e67f39ebf0f7feff4ee45
2016-10-04 15:29:16 +07:00
Samantha Blanco a9eea57ca6 Fixes CFServiceInstance.to_dict calls wrong class
CFServiceInstance uses wrong class to call superclass

Change-Id: I95ff892c7d5b815b7e4acff6c5644d2442879ec8
Closes-Bug: #1628290
2016-09-29 15:46:35 -04:00
Stan Lagun 61625103a3 Increase description column length in task table
Previously we changed description column in environment
table from TEXT to LONGTEXT but forgot to do the same
for similar column in the task task table

Change-Id: I3a2bd0204a9fac2d583d8742ca72868bd20c49b4
Closes-Bug: #1616997
2016-08-30 18:08:14 +00:00
Jenkins c5628ee56e Merge "TrivialFix: Remove cfg import unused" 2016-08-29 12:53:28 +00:00
Cao Xuan Hoang 688dcd0f88 TrivialFix: Remove cfg import unused
This patch removes cfg import unused in
murano/api/middleware/version_negotiation.py
murano/api/versions.py
murano/db/catalog/api.py
murano/engine/system/test_fixture.py
murano/policy/model_policy_enforcer.py
murano/tests/unit/cmd/test_api_workers.py
murano/tests/unit/cmd/test_engine_workers.py

Change-Id: I0f12f15e4def84550ef5bde0840006211cac7809
2016-08-29 09:35:14 +07:00
Andy Botting bc4c548f9e Allow network driver selection override
Expose a new [networking]/driver option to allow overriding the
network driver.

Our use case is that we have multiple external networks and
floating IP pools in our cells environment, which Murano does not
yet allow you to select. This option allows us to move back to
Nova networking where we have code to handle this automatically.

Change-Id: Ic4e806dc72283fce6348ab1e2966ba3a618f91dc
Closes-Bug: #1617096
2016-08-26 09:49:45 +10:00
Nguyen Hung Phuong 79a6914961 Clean imports in code
In some part in the code we import objects.
In the Openstack style guidelines they recommend to import only modules.

http://docs.openstack.org/developer/hacking/#imports

Change-Id: I80c70abd2f6973e1285eb7af2871d40d0a276712
2016-08-23 15:17:27 +00:00
zhurong 3d8d5a0b0e Use devstack for service broker use separate paste and db
1.Add the devstack support for new cfapi
2.service broker use separate paste file
3.service broker use separate db

Closes-Bug: #1500777
Closes-Bug: #1500827
Change-Id: I2842828fe14878e6ff5ac194473f2ffa619370df
partial-implement: bp separate-service-broker-from-murano
2016-07-25 10:05:58 +00:00
Jenkins df761a16f3 Merge "Fix application template update" 2016-06-28 08:58:04 +00:00
visitor 806fd1c75f Including a description field for environment and environment templates
Current environment and environment template information miss a description
 field to describe its functionality. Fixing this request implies to provide
 an extra field in both environment and environment template for that
 information, for instance called text, since description includes the object json.

Change-Id: Ic7dc5f420f453a3f4fa2769860b4a603ab14eaad
Closes-Bug: #1588276
2016-06-23 08:15:13 +02:00
visitor 6e35fb4b57 Fix application template update
Updating an application/service in a environment template
does not work and return 404 error.  This patchs solves that
bug.

Change-Id: I03f51c45512c4282ef99ddc1ed9ba55460827a94
Closes-Bug: #1587833
2016-06-21 09:42:28 +02:00
Jenkins 65e2ec60c2 Merge "Fixing application template deletion" 2016-06-08 22:41:59 +00:00
visitor 1adc59cef3 Fixing application template deletion
Deleting an application/service in a environment template
does not work and murano got blocked. This patch solves that
bug.

Closes-Bug: #1587809
Change-Id: I871e3b0eca82c14354b9c7ff2abce90da7cb21b0
2016-06-08 08:18:55 +02:00
zhurong deb487d8c0 Generate separate db for murano service broker
1) Create separate config use the separate config.py
to use: tox -egencfconfig

2) Create separate db for murano service broker
to use: tox -e venv murano-cfapi-db-manage \
	--config-file etc/murano/murano-cfapi.conf upgrade

Change-Id: Ifd3551ace000e496d99725f46dbead62f7ef64b0
partial-implement: bp separate-service-broker-from-murano
2016-05-31 21:25:33 -04:00
Jenkins 3a31b844ab Merge "Add models and migration for new service broker db" 2016-05-20 15:18:35 +00:00
Jenkins 5a5a92f9cf Merge "Increase status report messages time resolution" 2016-05-19 11:07:17 +00:00
zhurong 80d92d8111 Add models and migration for new service broker db
Create all stuff which is needed for cf db migration: models, migration
This will be used to generate a new service broker db.
This is the first step in separation service broker db from
murano db.

partial-implement: bp separate-service-broker-from-murano
Change-Id: I2a71c0e864fb806c73287293eac04746ef6b2cae
2016-05-18 22:04:57 -04:00
Stan Lagun 89a4c4cb5a Increase status report messages time resolution
We use DATETIME SQL type for created/updated columns
everywhere through the database. In SQL standard
DATETIME defaults to DATETIME(6) which is 6 digit
fraction second part. However MySQL defaults it
to DATETIME(0) for backward compatibility. In result
status messages timestamps get rounded to the
second boundary and if there are several status
messages were generated within a second
after table sort they might be shown in a different
order.

This commit adds MySQL migration that increases
resolution for the status table and adds subseconds
to the generated status repor timestamps.

Change-Id: Ice8c2d82c6a320c7f73c27f4c60c87bef55b8d95
Related-Bug: #1462270
2016-05-18 18:30:49 -07:00
OpenStack Proposal Bot bc8943c8cc Modified docstrings to comply with pep8 H405 style check
Closes-Bug: #1563270

Change-Id: I987d846f1a86ecee1fcfb0f99877563a10481478
2016-05-10 20:18:23 +00:00
Alexander Tivelkov 12636e2e12 Increased the size of TEXT columns to store large object models
Object model is stored in database in the columns of type TEXT. In
MySQL database this type of column is limited by default and cannot
hold data structures which are large enough.

This patch adds an extra migration which alters appropriate columns in
database when the mysql is used. The column type is explicitly set to
LONGTEXT.

Change-Id: Ic04fb99469edc087cc12d4c78a983484ae49a6c1
Closes-bug: #1567863
2016-04-12 16:52:09 +03:00
wangzhh 17622c8f33 Modified the wrong note
Change-Id: I686b3bc3d64b3df8e3f46a7dd0219a9374631c6d
2016-03-14 17:05:06 +08:00
Stan Lagun fc76b3b1b4 Major refactoring of how OS clients are created and managed
* Single universal ClientManager class was dropped in favor of
   of individual in-context methods to create OS clients without
   ClientManager restrictions.
* Environment class was renamed to ExecutionSession to avoid
   common confusion with io.murano.Environment
* execution_session_local module was introduced to simplify
   keep of per-execution session (per-deployment) data. This
   is similar to thread-locals with the difference that there can
   be many threads in single session.
* All OS-clients related code was migrated to keystone client
   sessions and API v3 (except for GLARE and Mistral that doesn't
   support sessions). This increases performance and solves
   authentication problems that could be caused by token expiration
   even with trusts enabled.
* [DEFAULT]/home_region setting was introduced instead of
   [murano]/region_for_services to configure what region
   should be used by the clients by default (where Murano API
   resides). All client factories respect this setting.

Change-Id: If02c7e5d7d39574d0621e0e8dc27d1f501a31984
2016-02-20 17:59:11 +03:00
venkatamahesh 92b1fc2b37 Use uppercase 'S' in OpenStack
Change-Id: I9cf21e65045f07a2b0ca3e6cdd6afcf54bbfc589
2016-02-04 15:34:53 +05:30
Nikolay Starodubtsev 8865876b1c Update _get_tags function to prevent race condition
Add `session.begin(nested=True` inside get tags to prevent duplicate
tags creation if murano executes in amount of threads.

Change-Id: I10968e2f2f758a5904943d273a9302a5cfb1a8c9
Closes-Bug: #1498097
2016-02-01 14:55:35 +03:00
Ravi Shekhar Jethani 7ea4442e9c Fix import order of modules
Make corrections in import order for six, yaml, eventlet and
greenlet as per OpenStack import standards [1].

[1] http://docs.openstack.org/developer/hacking/#import-order-template

Change-Id: I26feb4adb81e8b07a7a36ac7f0a6235536a8c119
2016-01-24 23:34:03 -08:00
Jesus Perez 9941585945 Fix migrations to maintain compatibility with sqlite
The current command used for alter a column (drop or alter) missing
the compatibility with sqllite. Solution, pass by using batch alembic.
Read http://alembic.readthedocs.org/en/latest/batch.html for more info.

Change-Id: I32c5cecaad111f2bde559de74ecefa339739b994
2016-01-20 08:33:45 +01:00
Ravi Shekhar Jethani 859888d62a Python3: Replace dict.iteritems with six.iteritems
This also adds a check to murano/hacking/checks.py that
should catch this error in the future.

Blueprint murano-python-3-support
Change-Id: Ib8b2b91a40577d18739f0c1bf2c37b7cf4060560
2016-01-15 03:15:23 -08:00
Aaron-DH a757b8f842 Modify filter by 'Name' in Package Definition
Search with name only matches package name and
search with keyword can matches names, tags ..etc

Change-Id: Ia86befcf0a126f4e532c847df44170a898b38824
Closes-Bug: #1500865
2016-01-09 17:23:43 +08:00