Commit Graph

15 Commits

Author SHA1 Message Date
zhurong 4ee97f7b7a Bump to hacking 1.1.0
Change-Id: I4019f41d9ddd843872855e6e80c0667ee2df758a
2019-07-04 11:51:47 +00:00
Sam Pilla 3efd12c1c6 Add `nosec` for Bandit issue 506 in resource_manager.py
Running `tox -e bandit` will raise a `B506: Use of unsafe yaml load`
issue. Because yaml.safe_load is a wrapper for yaml.load(SafeLoader),
this is a non-issue raised by the tests. This patch adds a `nosec` to
ignore the issue and comments to explain why it is okay as is.

Change-Id: I4bb3b1635000a8bf77015f35f0be36df2c4f731f
2017-04-17 13:32:16 +00:00
Valerii Kovalchuk ce8e2ec37a Prevent logging of result of resources.string() method call
The result of resources.string() method is the content of the file
saved to string. Logging of binary file content causes
UnicodeDecode error. Moreover, logging of any file content can be
security issue. Finally, it is just not practical to fill the logs
with tons of text from the big files.

Change-Id: I87077b002f2a8888c22b4dfba1f7b9f0508fec69
Closes-bug: #1561522
2016-09-14 17:44:56 +00:00
Valerii Kovalchuk 9d0c88a47b Convert script line endings for the target OS
This patch adds 'binary' parameter to ResourceManager 'string'
method. It allows to open text files in 'rU' mode which recognizes
all types of newlines, and binary files in 'rb' mode to prevent
their corruption.

Change-Id: I505070df187dfd910e68c555319e3ef92ce2c826
Closes-bug: #1496376
2016-06-29 22:17:25 +03:00
Stan Lagun 7c200d66f1 Use more generic "type" name instead of "murano_class"
Because the're going to be many different types of classes
(like meta-classes) it is reasonable to distinguish murano_class
from a "type", that can refer to any type of class (type)

Change-Id: I05993eb7a37627aaeacbc6c828250791e145d706
2016-02-26 17:25:25 +03:00
Stan Lagun 4f9ab7a321 Refactoring of smart-types defined in DSL
* MuranoType and MuranoObjectParameterType smart types
  were merged into a single smart type because their functionality overlap
  to a large degree. New smart type is called MuranoObjectParameter
* Other smart types were renamed to have the same name pattern:
   ThisParameterType -> ThisParameter,
   InterfacesParameterType -> InterfacesParameter
* For MuranoObjectInterface instead of saying obj.data().propertyName
   the syntax now is obj.properties.propertyName

Change-Id: I3c925d1ba1a4ac0864987377a3e90c6f166823a7
2016-02-25 02:06:38 +03:00
Stan Lagun 8fb4eb7ac2 Allow static methods to detect calls on object
Static methods can be called both on on class instance
and on the type object. With this refactoring it is now
possible in Python static/class methods to distinguish
which way it was called and in case of instance call
get the instance.

This commit also reworks ResourceManager to use new
functionality. Now all ResourceManager methods
are static so no class instance is necessary. If resources
belonging to some other type are required it is possible
to provide the type object explicitly to each method.
However it is still possible to create ResourceManager
instance and call statics as a normal methods. In this
case they will recognize it and will operate that were
captured at class construction. Thus it is still possible
to create ResourceManager at one place and pass it to
another class in another package so that it will access
resources of the package where the instance was created
rather than that where it used.

Change-Id: Ib47be86a99eb7903f7d3f7e1c5f2570df819c2d8
2016-02-24 21:51:02 +00: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 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
Ekaterina Chernova 87a63bf24e Resolve H305 pep8 issue
H305  imports not grouped correctly

Change-Id: Ia990dd628da195097838a13d876ef987363d3f8e
2015-02-05 12:10:22 +03:00
Ruslan Kamaldinov 18694ec63d Use oslo.serialization
Change-Id: I028409bb4fe05d4d2949f7f028298cd4704345b4
2014-12-11 02:15:39 +03:00
Serg Melikyan 034059f4b2 Fixed issue with loading yaml files
When ResourceManager was used for loading Heat templates with
unquoted dates like 2013-05-23 in yaml files it was causing
problems.

Change-Id: Ie8218000c0f6e551ad28b69ff76cf1c78aa03da9
Closes-bug: #1359967
2014-08-22 15:40:32 +04:00
Stan Lagun 504a8a6039 Make sys:Resources class use resources belonging to its owner
io.murano.system.Resources class tried to access resource files
belonging to the instance's class rather than the class that owns
sys:Resources instance. So when derived class is located in different
package than its base class inherited methods become using resources
of derived class package.

Closes bug: #1328176

Change-Id: I85719c612ad0d62c82f83f9e584278fba0825688
2014-06-11 17:57:53 +00: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