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
In this commit [0] has monkey patching should be as
early as possible, but didn't monkey patch murano api,
this will cause the RecursionError
[0]: I76fed9e80a7f848a0f6b37c25dd035844c75a6ee
Change-Id: Idf8ab02b15459d4dc786389c583afb752c599cb6
Closes-Bug: #1886784
Currently getting the following error:
TypeError: You cannot set Response.body to a text object (use Response.text)
Closes-Bug: #1882156
Change-Id: Iba918ec671dabb2d0df72e071c6279176c63b312
When cloning environment template with the same name, the
current exception description is "Environment with specified name
already exists", "Environment" in the exception description
should be "Env template".
Co-Authored-By: zhurong <aaronzhu1121@gmail.com>
Change-Id: Iaf5868c173963eb737e27c2a3221f6b6a23fac84
From the following code, session can't be opened when environment
status is DEPLOYING or DELETING status.
if env_status in (states.EnvironmentStatus.DEPLOYING,
states.EnvironmentStatus.DELETING):
Change-Id: I4f20b51f87a77cfbf2d76e9961d8bfaa6380aac8
The following codes have been excuted in function '_validate_exists',
and the result has been returned. therefore it is not necessary to
excute the following code again.
get_env_template = env_temps.EnvTemplateServices.get_env_template
env_template = get_env_template(env_template_id)
Change-Id: I2aeb835b1cda1b30f4fffbbd293beb42efc78588
Add notifications about environment events that are required for
tracking. These are AMQP notifications and oslo.messaging library
is used for sending them.
The follow event types are provided:
- environment.deploy.end
This event is issued on successful finish of environment deployment,
provides general information about environment and also deployment
start and finish times
- environment.delete.end
This event is issued on environment delete (and abandon as well)
- environment.exists
This is a period event, it's issued for every existing environment
that has successful deployments
There are 2 new configuration options controlling these notifications:
- stats.env_audit_period
Controls how often to send environment.exists notification, by
it's once per hour (60 minutes)
- env_audit_enabled
Allows to completely disable environment-related notifications. By
default notifications are enabled.
Change-Id: I8dee2456b7ccab7c0c167aa21abb9710959ebb30
Various components defines different options for the client sessions.
Standardize them with the help of keystonauth1 lib.
Change-Id: I2f791caaf230a58b8426d1c1d6e1eb4316a85a28
The API catalog endpoint `show_categories` was deprecated back
in Liberty cycle. It should be removed.
This commit removes the deprecated endpoint `show_categories`,
removes it from the API router, and removes references to it
in Tempest tests -- which now test `list_categories` instead.
Change-Id: If1bea7448c0d4aa5fdf37c8400323589d73fdb21
Murano used to have a custom, always-enabled ssl middleware, to parse
X-Forwarded-Proto header, to let murano work correctly behind an SSL
proxy. There is now an oslo middleware, that does the
same thing, but more thoroughly.
This commit replaces custom implementation with oslo one.
Co-Authored-By: Kirill Zaitsev <k.zaitsev@me.com>
Change-Id: I5444542b878434fb656e19b12d0f6e71df1ab95f
The ``update`` method in the environments API is only responsible
for renaming the environment.
However, the entire request body is passed to the ``update``
DB method if the name of the environment meets the initial checks
(enough characters and not empty string).
While this is not a problem if the request body is generated
through the CLI client or the dashboard, it is a problem using
something like curl, in which other attributes in the environment
could be added to the request body, causing the environments API
to violate its contract: an endpoint that is supposed to rename
an environment should only ever rename the environment.
Change-Id: If6314f704c22ff4d61411b1808d6d73bfb7ac562
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
Adds new endpoint /deployments to Murano, to enable
Murano Dashboard to get all deployments for all environments.
This is needed in order to improve log browsing for
deployments, which calls for creating a new view in which
all deployments across all environments can be viewed.
Also made deployment unit tests more robust.
Partially-implements: blueprint improve-deployment-log-browsing
Change-Id: I1b6a313af1a0c4aa57bd4e6f51da92b396b35165
From the following sentence,the environment status has DEPLOYING or
DELETING status,but the environment status of log information only
include deploying status.
if env_status in (states.EnvironmentStatus.DEPLOYING,
states.EnvironmentStatus.DELETING):
Change-Id: Id48e69dec671ef31b87ec803667e69f9b906b17f
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
Before this patch debug output was excessive.
Now print the line log if wsgi.url_scheme differ and
Change-Id: I925a7dd0844dfa76696b75e9f818d1bb47b34928
Closes-Bug: #1605806
'/environments/<env_id>/model/<path>' endpoint added.
GET request responds with the subsection of <env_id>'s object
model located in its <path>.
PATCH request applies json-patch from request body to <end_id>'s
model. It does not contain <path> in the URL.
Change-Id: I672d43464ed7d5722cc574f1a10700b070664f34
Implements: bp environment-edit
Modified a "List Environments" API call to add an ability to filter
environments by an owner project (tenant).
The request now supports extra query parameter - tenant. If this
parameter is passed the list of returned environments is filtered to
return only the environments owned by the tenant with this id.
This operation requires a 'list_environments_all_tenants' policy to be
enabled for a caller user (by default it means that the user has to
have an "admin" role).
Implements-blueprint: list-environments-of-a-given-project
ApiImpact
Change-Id: I90b0dd672d5a431f63e52753d7f517fd3d0ec6eb
It was impossible to delete the last component from the env via
CLI, because it was prohibited to make put request with empty body.
APIImpact
Change-Id: I462072ad7c90eec1790b74cae958809aa316c25c
Closes-bug: #1511645
Python3.4 throwing TypeError and in this patch it
is fixed
Co-Authored-By: David Purcell <david.purcell@att.com>
Change-Id: I5cbc54142ba2fd1885879c2e401ba84095becc1a
Closes-Bug: #1625219
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
Generation of json-schema from MuranoPL class or method
and engine RPC call for it were added
Implements: blueprint muranopl-forms
Change-Id: I43ccd2d9d94f9f89db1855932280539f69f2f8d8
If auth_type is set in the keystone_authtoken section,
then one can use the the keystoneauth1 library to load the
authentication plugin. This makes muranoclient fully workable,
with Keystone v3 in case domain name is not 'Default'.
Related-Bug: 1580611
Change-Id: I0d71032fb5296752ee25482b75993072884731e7
Static public methods can be called synchronously through the
API call without creating environment, object instances and
database records. It is proposed to make RPC call as the single
request-responce for now.
However async API and RPC calls may also be implemented later
exploiting the same pattern as for calling instance methods.
New call can be done through client method (see
Ib6a60f8e33c5d3593a55db9f758e94e27f0a4445)
Tempest and unit tests are added.
APIImpact
Implements: blueprint static-actions
Change-Id: I17ab2eba0fd6c42309667f42d0644d21940ab02d
This patch makes possible to filter operator values 'id', 'category' and 'tag'
by provided comma-separated values whithin 'in' operator.
F.E. with filter '/a/b?id=in:buzz,bar' 'id' must be among
'buzz' and 'bar' values.
Related-bug: #1559066
Change-Id: Ibd93233392552699f9fc02e7f1d92542de2597f1
SUPPORTED_PARAMS, LIST_PARAMS and ORDER_VALUES are used only to check
whether some value is inside of them.
This patchset makes them sets instead of tuples.
Change-Id: I0abfc555d1a481b20dc971c3a801fdf7e88aed2f
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
* Replace len(MultiDict.keys()) with len(MultiDict). On Python 3,
MultiDict.keys() now returns a generator which has no length.
* Replace json with jsonutils to fix Unicode vs bytes issues.
* Use a bytes strings for the HTTP body, not Unicode strings.
* Replace LOG.exception() with LOG.error() when the argument is a
string, not an exception object.
* Only declare PackageException.__str__() on Python 2. The default
implementation of __str__() is fine on Python 3. Moreover, the
'message' attribute has been removed from Exception on Python 3.
* tox.ini: run the following API v1 unit tests on Python 3.4
- test_actions
- test_catalog
- test_env_templates
- test_environments
- test_sessions
Blueprint: murano-python-3-support
Change-Id: I4c8bedef019495477ae668769595ac4abc1ac0f4
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