Commit Graph

35 Commits

Author SHA1 Message Date
Takashi Kajinami 181d09d05f Replace deprecated import of ABCs from collections
ABCs in collections should be imported from collections.abc and direct
import from collections is deprecated since Python 3.3.

Change-Id: Ifb983fa478120a95760bf0cb78994210acdbe8e8
2021-08-02 08:27:12 +00:00
zhurong aa5f945088 Remove six murano/engine
Depends-On: https://review.opendev.org/#/c/720860/
Change-Id: Ib10d9e191ec93e55a0982d29de9a62a7b5d1894f
2020-04-18 01:08:08 -07:00
Ellen Batbouta 80b4e029bd Method, decrypt_data, uses internal Barbican endpoint
The yaql function, decrypt_data, in the file, yaql_functions.py,
sets the config option, barbican_endpoint_type, to internal.
This allows Murano to work when TLS is enabled.

Change-Id: Id9d82d7bbedcef87bdc9865ec55511d4e1f65507
Closes-Bug: #1775035
2018-06-04 14:18:12 -04:00
Paul Bourke 9248605e67 Add decryptData yaql function to murano engine
Adds a new yaql function 'decryptData' which pairs with 'encryptData' on
the dashboard side.

Requires a valid secret storage backend (e.g. Barbican) to be configured
via Castellan in murano.conf, e.g.

    [key_manager]
    auth_type = keystone_password
    auth_url = <auth_url>
    username = <username>
    password = <password>
    project_id = <project_id>
    user_domain_name = <user_domain_name>

Murano will still work fine without this config but the encrypt/decrypt
functions will be unavailable.

Partially-Implements blueprint: allow-encrypting-of-muranopl-properties
Depends-On: I1be3a1e11e3f4c2170062927ad359bf679eb25d9
Change-Id: I09416b6d35ed2dafa823eca98262a4e23081e6eb
2017-07-21 13:32:13 +01:00
LiuNanke 2506030cf1 Replace six iteration methods with standard ones
1.As mentioned in [1], we should avoid using six.iterXXX
  to achieve iterators. We can use dict.XXX instead, as it
  will return iterators in PY3 as well.
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: If90a56fad941e4bb55da1e9f14a8133983efc027
2016-12-01 16:07:09 +08: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
Jenkins 47b7a1d0fd Merge "Pass [rabbitmq]/ca_certs file to murano-spawned instance" 2016-05-04 22:46:29 +00:00
Konstantin Snihyr 21e877c22d Pass [rabbitmq]/ca_certs file to murano-spawned instance
Change-Id: I0d7a66b66d47c5996df8047225dcd9323d328412
Closes-Bug: #1568172
2016-05-04 18:41:53 +03:00
Victor Stinner f6e795efcf Fix base64 on Python 3 in yaql_functions.py
Don't add murano.tests.unit.dsl.test_engine_yaql_functions to
tox.ini. The test requires a new release of yaql to get the last
Python 3 fix (change Ia262ca3ff9ffaad618bde9c1157559e7320434ee).

Blueprint: murano-python-3-support
Change-Id: I8a42e9b31b13bd5075708c32130b1c2997971cb6
2016-04-19 09:55:02 +02:00
Stan Lagun dafd569775 Makes config() function be available to Core Library only
config() function returns information from murano.conf.
But since it contains sensitive information like passwords
it creates a security issue for Murano because any app can
get access to that information. However the function is
used by the core library to get RabbitMQ credentials.

This commit makes the function available to Core Library
only which currently identified by the name (io.murano)
but in the future will be identified by the package signature.

Change-Id: I3fe5c153f931decc59bc8bf9eb87c78d459a64fa
Closes-Bug: #1506807
2016-03-04 13:24:09 +03:00
Stan Lagun 46ea32f4e8 Py3 compatibility fixes
With this commit most of the Python 3 compatibility
issues in murano-engine are resolved.

If run on yaql with https://review.openstack.org/#/c/286110/
fix all of the unit tests except for one success.
The only failing test is base64 encoding/decoding test
which require rethink of resource management to get away
from string types for binary content

Change-Id: Iee87d27fe4f04118202de07f376d41fbf2c90f54
2016-03-03 13:02:45 +00:00
Stan Lagun 0979d150bc Removes unnecessary import
Change-Id: I60e1863c73c115769548ecb80fc74346ad27720e
2016-02-23 04:05:42 +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
Jenkins ed6bd4e526 Merge "Python3: Use six.moves for py2 compatibility" 2016-01-19 14:30:03 +00:00
Ravi Shekhar Jethani 651cc3ba49 Python3: Use six.moves for py2 compatibility
Use 'range', 'reduce', 'map', 'cStringIO' from six.moves
for python3 compatibility.

Blueprint murano-python-3-support

Change-Id: I823c44d51db72ddb30a14f5755d781eca0d91e50
2016-01-19 03:46:35 -08:00
Ravi Shekhar Jethani f963039bd7 Python3: Replace basestring by six.string_types
The builtin basestring abstract type was removed in python3,
use str instead, we need to use six.string_types to replace
the basestring for py3 compatibility.

This patch was generated by the following tool using 'basestring'
option.

https://github.com/haypo/sixer
Command:
python sixer.py -w basestring murano/

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: I26c236ce6dd2fffd6a4ca50e55ad62deb01bd9dd
2016-01-18 23:48:37 -08:00
Bo Wang af8a9f10b2 Python3:Replace iter.next() with next(iter)
function next() of iterator is not available in python3.
ref:http://www.diveintopython3.net/porting-code-to-python-3-with-2to3.html

Targets blueprint: murano-python-3-support

Change-Id: I8cb74520187ba532ad98b86b6ac15737a6cc9bee
2016-01-19 00:46:16 +08: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
Ravi Shekhar Jethani 782808db60 Replace unicode with six.text_type
The Unicode type is 'unicode' in Python 2 and 'str' on Python 3.
This patch replaces unicode with six.text_type to make Murano
more compatible with Python 3. Also it replaces the tuple
'(str, unicode)' with six.string_types for instance comparision.

Blueprint murano-python-3-support

Change-Id: I4db27afdb556ec30dd36d7d4e170055274edfa8b
2015-12-28 05:07:08 -08:00
enthurohini f49bdb6218 Drop types module usage
Since python 2.2, use of types module is not prefered way to
access the type hence it is replaced by using names of built-in
factory functions.

Change-Id: Ibdcc1ae75204f67076edab5edcffe94a9f1f1d8e
Implements: blueprint replace-types-module-with-new-style-classes
2015-11-02 18:39:24 +05:30
Stan Lagun aa0e112461 Introduce MuranoPL/1.1 and 1.2
1.1 is the same as 1.0 but packages with format other than
MuranoPL/1.0 (or just 1.0) will be rejected by Murano Kilo.
As a result it will be possible to specify that application
require yaql 1.0 which was introduce in Liberty.

MuranoPL/1.2 differs in that it has yaql legacy mode turned
off and several functions are now cannot be called as
MuranoObject methods. It is recommended to start development
of new applications using 1.2 format

Change-Id: Ie68cc0c37f198c10eeac79ed349f9d9d420e038f
Implements-Blueprint: muranopl-format-version-upgrade
2015-10-14 17:43:24 +03:00
Stan Lagun 16030aeec8 yaql context versioning
This commit reworks mechanism how context chain
is built at each point. The goal was to make
entire chain be dependent on format version
number. This would allow for example to use
yaql 1.0 legacy mode context for MuranoPL/1.0
and not to use it for 2.0.

Not the entire chain is built on demand up to the
root instead of attaching to existed parent context
as it was before. DSL host (engine) is no more
required to have custom MuranoDslExecutor implementation
but a new ContextManager interface that is used
to control contexts on each layer. Engine uses
this interface to register system classes and
engine level yaql functions. Also a ContextManager
is a foundation for method mocking because now
all MuranoPL methods are yaql functions stored
in context and with ContextManager it is possible
to inject/replace function in each scope (
global, package, class, object)

Partially implements: blueprint murano-versioning

Change-Id: I0a553e8044061fe780a83bc04d70b8f80580988f
2015-09-04 14:37:14 +00:00
Stan Lagun 425766a7f8 Migration to yaql 1.0
* Code migrated to yaql 1.0.0
* New MuranoPL object initialization
* Lots of refactoring

See referenced specs for more information

Implements: blueprint migrate-to-yaql-vnext
Implements: blueprint object-construction
Depends-on: I7f314634ab5f08a521e51082d5c84dffca4b0b5c
Closes-Bug: #1454264

Change-Id: I740a4f83c76d8b56a1da585a739d770ef823a524
2015-08-25 16:08:08 +03:00
Sergey Vilgelm 44f4a63642 Declare the CONF variable
In the several places the CONF variable is used from the murano.config.
This patch declares the local CONF variable and uses the oslo_config library.

Change-Id: I1f9a42f7f2cf7fef2cf0d63b185428dfddd9e78e
2015-07-14 00:16:27 +03:00
Jenkins 2d5388a690 Merge "Adds ability to join instances to existing Neutron networks" 2015-03-19 10:30:50 +00:00
Ekaterina Chernova 87a63bf24e Resolve H305 pep8 issue
H305  imports not grouped correctly

Change-Id: Ia990dd628da195097838a13d876ef987363d3f8e
2015-02-05 12:10:22 +03:00
Stan Lagun e531698e0c Adds ability to join instances to existing Neutron networks
Also refactores networking code to move networking code from
Instance so that different types of network can be represented by
single simple interface

Implements: blueprint join-existing-neutron-networks
Change-Id: I90afcea6b1c12d7f6f564d8524f5c0d30e1b4686
2015-02-04 03:02:19 +03:00
Stan Lagun 96603bced3 Adds aggregate function to MuranoPL (YAQL)
Aggregate is similar to python's reduce() built-in

Change-Id: If1e3ed20172c40344b771627ce20739348b80163
2014-11-21 18:18:50 +03:00
Stan Lagun dd7f6b3db9 $list.skip($start).take($count) throw YAQL exception
It was possible to have
 - $l: $list.skip($start)
 - Return: $l.take($count)

but not $list.skip($start).take($count)

Change-Id: I58709f9c994ad22497ff23662a1fc0c9c2d1e88d
Closes-Bug: #1365146
2014-09-24 16:47:25 +00:00
Georgy Okrokvertskhov 97d69cc38d Add two new functions to manipulate with lists
Add list.skip(count) and list.take(count) functions to collect only
a part of original list.

Change-Id: Ic730713f0baad64385e37b36e378615482c7a75d
Closes-bug: #1362892
2014-09-05 07:32:23 -07:00
Serg Melikyan 9130ad2c74 Fix race condition when two Instances are deployed
Murano uses Heat to allocate OpenStack resources by creating and
updating one Heat stack. All changes to stack are stored in shared
variable exposed via call to environment.stack.updateStack.

Allocation of resources needed by Instance class is done in several calls
to environment.stack.updateStack therefor in case of simultaneous deployment
of two instances of class Instance race condition is possible.

Instance class was rewritten to have only one call to stack.updateStack
that is going to eliminate possible race condition.

P.S. This change also introduce new function mergeWith that can merge
two dicts.

Change-Id: Ib3b0be04e7d0b6107466bd5837278a12f01cf766
Closes-Bug: #1364824
2014-09-04 15:26:48 +04:00
Stan Lagun 94c2157952 Unit tests for engine's YAQL functions
Also fixes several declaration errors in tested functions

Change-Id: If7a742c7f6d944d03e1a327e2ae2866b464472a4
2014-07-12 13:46:14 +00:00
Stan Lagun ad1800976b YAQL version updated to 0.2.3
YAQL 0.2.3 contains one small change that would allow to
forbid usage of uninitialized local variables

Also removed YAQL function binding that is available in
YAQL 0.2.3 out of the box

Change-Id: I96f455e50add8666c4e65eb421bea5af57055485
2014-07-04 15:06:03 +04:00
Stan Lagun 35979b1e02 Preliminary support for HOT packages
Adds support for packages consisting of single HOT template.
Most of HOT features are supported with exception of
environments, attachments and JSON parameter type.

Implements: blueprint hot-packages

Change-Id: I927af0e96f1613e8843ac47844e9c19fa00fdaa6
2014-05-30 12:27:01 +04:00
Ruslan Kamaldinov 86a4c4710d Rename muranoapi to murano
Partially-implements blueprint: rename-murano-api-to-murano

Change-Id: I2d7f52ef4073bce800cedc77f81f5d242c4d5d98
2014-05-27 15:14:44 +04:00