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
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
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
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
* 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
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
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
* 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
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
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
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