Commit Graph

29 Commits

Author SHA1 Message Date
zhurong a9e530fdd8 Remove six murano/policy
Change-Id: Iafee5f81a3c3e7930232f17c2d3c0f30764e3b47
2020-04-17 18:48:08 -07:00
Andreas Jaeger d1dae85ac7 Update hacking for Python3
The repo is Python 3 now, so update hacking to version 3.0 which
supports Python 3.

Fix problems found.

Update local hacking checks for new flake8.

Change-Id: Ibe28b6b6bf3927e80816f0c5f1cb972fb6e2374b
2020-03-30 11:59:26 +02:00
zhurong 95f9da9cd8 Fix pep8 F821 error
Change-Id: Idef9c90b57b67fae2e896de00cc8f647c238cae8
2019-01-09 08:37:25 +00: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
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
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
Stan Lagun 50a7aa4e0b Fixes congress integration
Fixes several bugs that were introduced during
recent dsl refactoring

Change-Id: Ida55ff4102e20a059e5f43311ea351264afbb5b4
Closes-Bug: #1613337
2016-08-18 23:57:16 +00: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
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
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
Bo Wang c4b3340847 Fix using map() for python2,3 compatibility
In python3, map() returns an iterator that caused error:
AttributeError: 'map' object has no attribute 'insert'

Targets blueprint: murano-python-3-support
Change-Id: Id0b1e545bf2ce11c0e4fd29faa5d19bad29c2173
2016-01-20 19:31:13 +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
zhu.rong 8d2a8933ce Fix the run_test unchecked pep8 W503 and E402 errors
Now thw flake8 did not check W503 and E402 errors,
1.E402 module level import not at top of file
2.W503 line break before binary operator
This patch fix it

Change-Id: Ieae4f2f23d2aa0fd1e19ef770c2f1ce6aef30f79
2015-09-26 13:43:55 +08:00
Filip Blaha 3cef984de9 Environment modify actions introduced
Base class for modify actions.
Entry points based action registration.
Action manager loads and execute actions.
Out-of-the-box actions implementation.

Partially implements: blueprint policy-based-env-modification

Change-Id: Ib148c5f2b7efb1186d77f5461ef9324cca1287c2
2015-09-09 12:47:45 +02:00
Stan Lagun 068831ccd8 Package versioning
With this change MuranoPackage becomes first-class DSL citizen.
Packages have version, runtime_version (that is specified
in Format attribute of the manifest file) and a list of classes.
Previously engine used to have package loader which had most
of "load" functionality and class loader that mostly acted as an
adapter from package loader to interface that DSL used to
get classes. Now class loader is gone and is replaced with
package loader at the DSL level. Package loader is responsible
for loading packages by either package or class name (as it was
before) plus semantic_version spec (for example ">=1.2,<2.0").
Package loader can now keep track of several versions of the same
package.

Also packages now have requirements with version specs.
All class names that are encountered in application code are
looked up within requirements only. As a consequence
packages that use other packages without referencing
them explicitly will become broken. An exception from this rule
is core library which is referenced automatically.

Partially implements: blueprint murano-versioning

Change-Id: I8789ba45b6210e71bf4977a766f82b66d2a2d270
2015-09-03 12:06:42 +00:00
Stan Lagun 75afcd238b Fixes Congress model validation
Change-Id: I8293996b936503b10f67ce428c0a17dc059e6481
2015-08-27 16:21:51 +02:00
Nikolay Starodubtsev de5ed2115a Switch to oslo_log
To follow latest community practices we need to use oslo_log in
murano instead of handcrafted libs.
Unsupported log level 'audit' was changed to 'info'.

Change-Id: I40c0f3790e34bf80d0b63554e86b3cbc019eefca
2015-07-15 11:20:45 +03:00
Filip Blaha eea9b5a631 Policy enforcement - add cleaning action rules
Simulation purges data populated by murano driver in congress.
Test creates rules as its prerequisites.

Change-Id: Ia002b60ad5ba0d831e73b69f660a38c4f5e35f20
Closes-Bug: #1439595
2015-04-14 13:33:27 +02:00
Filip Blaha 9a26eb0f38 Policy enforcement 'services' relationship
Following changes were made in congress mapping of murano objects:
Relationship "services" is created for environment and its applications.
Property tenant_id on environment is no longer needed.
Ownerships respect embedded objects within the tree.

Change-Id: I846d4d2be9ebf2fd7d5b75ea8e36eed87e56a633
Closes-Bug: #1439591
2015-04-07 13:28:13 +02:00
Filip Blaha 2a80451151 Computes transitive relationships in murano model
Since rule recursion is not supported by Congress now,
we have to deal with relationships traversal in different way.
There will be murano:connected(source_id, target_id) table
in congress murano policy which contains directly and
indirectly connected objects in environment.

Closes-Bug: #1434530

Change-Id: If2bab9d91a8dea5b08b231ce95f15af3ccd7f85f
2015-03-24 12:00:48 +01:00
Radek Pospisil ea03c1f55c Ignoring properties with None value in Murano->Congress mapping
Change-Id: I90624cb58eca1104ede8446cef0c80342153a6aa
2015-02-27 16:49:23 +01:00
Radek Pospisil 48bb646ebd Fixes environment owner in congress mapping
Owner of an environment is a tenant in murano-congress mapping.

Change-Id: I5b58e3474aebf44c69a2db6a7f65ce42378ed46b
Closes-Bug: #1423934
2015-02-27 10:34:47 +01:00
Ekaterina Chernova 5feedfb8ba Update from global requirements
Change-Id: I955c2945de793ee7f3ce4eb9688e43ec63a6b8e2
2015-02-25 16:09:22 +03:00
Radek Pospisil 45f61bf5b0 Changed status constant PENDING -> pending
Change-Id: I95340d8deaa3c250891cdd76a75884ecbac61fab
2015-02-25 11:23:44 +01:00
Kirill Zaitsev 4e036191ff Use oslo.i18n for translation
Remove gettextutils in favor of oslo.i18n suite for
internationalization purposes. Wrap murano.common.i18n around
oslo.i18n. Mark all logs messages of levels higher than
DEBUG for translation with _/_LI/_LW/_LE/_LC to conform with
oslo.i18n guidelines.

Change-Id: I09a2e2fc802e404f5c59fa4edd2a2124ad24101a
Implements: blueprint organize-translation
2015-02-19 18:51:22 +03:00
Ekaterina Chernova 9a26a3f4c3 Resolve and enable H307 pep8 rule
* H307  like imports should be grouped together

Change-Id: I9fa443c9b7380e4c589793caf35c80ba6afbe9f0
2015-02-05 12:10:22 +03:00
Ekaterina Chernova 8a15466301 Enable and resolve some PEP8 issues
* E128 continuation line under-indented for visual indent
* H501 don't use locals() for formatting strings. to also check
* H402 first line of docstring should end with punctuation
* E122 continuation line missing indentation or outdented
* E713 test for membership should be 'not in'

Change-Id: I4a30350778a4452075e468400effcbc4155d24d8
2015-02-05 12:10:18 +03:00
ondrej.vojta a933d6e3b8 Initial implementation of policy enforcement point
Adds ModelPolicyEnforcer that calls congress client (added by commit 2ea56d5b).
Enforcer called only when config property set to true (default false).
Integration test will follow in the next commit (https://review.openstack.org/#/c/147515).

Partially Implements blueprint policy-enforcement-point

Change-Id: Ie53b985ba759c3297e2fe2228bd48fce220ea32f
2015-01-26 16:11:57 +01:00