Commit Graph

22 Commits

Author SHA1 Message Date
M V P Nitesh 3e70d5be31 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: Ib3740617715c7097efeb5852338a669dc0bf8ff7
2017-04-04 17:29:58 +05:30
Felipe Monteiro 85b3a042dd Fixes filtering applications by name with glare.
This fix applies to Murano + Glare only.

The glare artifact_properties table does not contain a property
name 'name', but rather 'display_name'. Thus, filtering by 'name'
was not working. This change changes the kwargs filter dict to
use the key 'display_name' rather than 'name'.

Change-Id: I10d4d728fcd3e4bc0cc41cbddcad9ccd40b57f5e
Closes-Bug: #1653774
2017-01-04 01:52:04 +00:00
Omar Shykhkerimov bd4645d567 Fix 'owned' flag when Glare is used
This patch adds 'owner' filter for Glare if 'owned' parameter
is used for filtering artifacts.

Change-Id: Id855904f15b7d90096cc1466332dc4f20d22891e
Closes-bug: #1603505
2016-09-19 11:59:23 +00:00
Alexander Tivelkov 98adda6a46 Support for multi-class yamls in client
MuranoClient needs to analyse package classes (names and inheritance
chains) to properly add packages to Glare. This requires it to
properly resolve class names in the appropriate namespaces.

Since Mitaka Murano supports multi-class yamls, i.e. yaml files
containing multiple MuranoPL classes in a single yaml file using it
multi-document format. Optionally this allows to reuse a single
namespace definition for multiple classes defined in the same file.

Client was not aware of this feature, always loading classes as
single-document yamls. It was also always using the current-class
namespace definitions, thus likely to fail if the shared namespace
definition is in use.

This has been addressed.

Closes-bug: #1608440
Change-Id: Ibd08454f71e0266c76a2ac517b441df97311d8b9
2016-08-01 18:41:06 +00:00
Kirill Zaitsev cd182ba363 Use yaml.SafeLoader instead of yaml.Loader
Before this patch yaml.Loader was used by the client to create custom
yaql-enabled yaml loader. It is unsfae do to so, because yaml.Loader is
capable of creating custom python objects from specifically constructed
yaml files.
UI parsing functions also fell back to yaml.Loader if
the custom loader was not supplied.
After this patch all yaml load operations are performed with safe
loaders instead.

Change-Id: Id9bb6eabda35522271ec394f8758a974878cbb4b
Closes-Bug: #1586078
2016-06-23 18:26:23 +03:00
Kirill Zaitsev a0a48f0ace Store transitive inheritance information in glare
Before this patch only local inheritance information was stored in the
'inherits' field in glare. This means, that requesting all the
packages, that inherit from class X would only yield immediate
relatives, rather than all.
This patch adds transitive inheritance information to the same field.

Change-Id: I5096a2dd105dd70ff42b35eebbd850a9b66c9274
Closes-Bug: #1585419
2016-06-03 12:28:46 +00:00
Alexander Tivelkov 9134d9d2a4 GetPackageUI API is now called even if Glare is used
Since UI definitions are now always provided by Murano API (even when
the packages themselves are stored in Glare), the muranoclient should
now call the 'get_ui' method of the legacy controller class instead of
the glare one.

Change-Id: Ie8936891bff443cdf5f8b97cb93e63cd781c0696
Depends-on: Id9327e4015e1c0a1553c0b1a0151a94ee4da2928
Partial-bug: #1565805
2016-04-11 01:03:54 +00:00
Valerii Kovalchuk 2f969d1a06 Correct check for artifact package visibility
Is_public variable is a string, so`if is_public` is always true.
This patch changes it to check the string value.
Also 'is_public' variable is renamed to 'visibility' to avoid
considering it as a boolean value.

Change-Id: I2e96f1ca7ed722995099144b15fcbeac6284cfeb
Closes-bug: #1566199
2016-04-05 12:09:47 +03:00
Valerii Kovalchuk dfe9cfefe4 Improve dictionary representation of package from Glare
Several keys added to dictionary representation of package imported
from Glare to match packages from murano.
Thus, dashboard API works in a similar way, no matter what backend
is used.
It also allows dashboard to filter applications by category and by
some text in name, description or tags.

Change-Id: Ia08a0629e55b8fa318b787d87bb3a2f793cb2a2a
Closes-bug: #1561935
2016-03-25 18:19:15 +02:00
Alexander Tivelkov 386f894879 Fix package delete on update when using Glare
Since Glare is unable to filter artifacts by "owned' flag, it should
not be passed as one of list query params.
Such a call is made when cli shell attempts to delete the conflicting
package during the package import process.

Another issue was that durint the package conflict CLI was searching
for confilicting package by its name only, ignoring version, thus it
was unable to delete proper package.

Change-Id: Idc7c7f552576f0c242e90d30cfc1a3f65c581e6d
Closes-Bug: #1539031
2016-01-29 12:51:55 +03:00
Jenkins c50c85abb0 Merge "Fix module's import order" 2016-01-22 18:36:02 +00:00
Alexander Tivelkov 921cb9362e Fixed visibility parameter for create package glare call
When creating a murano-package artifact in Glare muranoclient was not
properly passing the visibility parameter. Instead, it was passing the
'is_public' parameter, which is not supported by Glare.

Appropriate conversion has been added to PackageManagerAdapter class

Change-Id: Ia3a038d2b16e27effd208f5e4877f1f06d8ad882
Closes-bug: #1537018
2016-01-22 13:59:32 +03:00
srushti 1ba5d55103 Fix module's import order
Made corrections in import order for built-in,third-party
and project specific modules as per openstack import
standards [1].

[1] http://docs.openstack.org/developer/hacking/#import-order-template

Change-Id: I1e086ab187aaf31868fcce76917070bb9a95e870
2016-01-21 22:10:58 -08:00
Ravi Shekhar Jethani 8c90b56312 Add python 3 support
Used six.iteritems, where relevant.
Used SimpleHTTPServer, ConfigParser from six.moves
Replaced iter.next() with next(iter)
Replaced dict.keys()[0] with list(dict.keys())[0]

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

https://github.com/haypo/sixer

Command:
python sixer.py -w all muranoclient/

Blueprint client-py34-support
Change-Id: I1cc978f13ac6ea2f0d33b1027362102c6c77ca6e
2016-01-19 04:30:22 -08:00
Jenkins 7dded14208 Merge "Fixed an incorrect call to the artifacts client" 2015-12-01 21:02:51 +00:00
Jenkins 9f9d7013f9 Merge "Glare client now properly filters by class name" 2015-12-01 18:44:50 +00:00
Jenkins 2ea33b60d0 Merge "Fixed a download method wrapper in glare adaptor" 2015-12-01 18:44:39 +00:00
Alexander Tivelkov 9ee3790662 Fixed an incorrect call to the artifacts client
The artifacts client was called incorrectly in the "toggle public"
call routine, leading to an exception when changing the visibility of
package if using Glare.
This has been fixed.

Change-Id: Ic3da93bde00d96909cae106c358bf4a7d64d19a8
Closes-Bug: #1501374
2015-12-01 16:59:02 +00:00
Alexander Tivelkov dce5e20f9c Fixed a download method wrapper in glare adaptor
A method which downloads the package in PackageManagerAdapter class
now returns the full contents of the file instead of the iterator over
this contents.

Although less memory-efficient this is needed to ensure the
compatibility with the legacy murano-api-based package downloader.

Change-Id: I24183f14e70fc6d5a53850d2ac00d5d52fdc5559
Closes-bug: #1521139
2015-12-01 16:58:58 +00:00
Alexander Tivelkov e5026fff1f 'to_dict' method added to PackageWrapper class
PackageWrapper objects, returned by the glare wrapper of the murano
client did not contain the 'to_dict' method which is needed for
carousel.

Appropriate method has been added. It does not need to return the full
dict representation of the object: just id, name and owner_id have to
be returned, as these are the only fields used by the carousel.

Change-Id: I2759ade3cfcbade27b459ba9b21b29e240f7696e
Closes-Bug: #1501405
2015-12-01 16:58:52 +00:00
Alexander Tivelkov 4f2336fa38 Glare client now properly filters by class name
Adaptor class which wraps the legacy filtering requests into the
Glare-compatible ones has got a conversion for class_name ->
class_definitions attribute.
This fixes a bug when the engine could not properly fetch the package
by class name when deploying an app.

Change-Id: I98846bfad5fc03558dfc2e46fb4dcbfdb40489e8
Closes-bug: #1503224
2015-12-01 16:58:49 +00:00
Alexander Tivelkov 54918f51a9 Added the support of Glance Artifact Repository
This patch adds a support of 'Murano Package' Glance artifact type to
the murano client. The ArtifactRepo class wraps the standard Glance's
V3 client and provides access to Glance Artifacts as to Murano
Packages.
Another class, called PackageManagerAdapter provides a temporary
facade which makes artifact-based packages compatible with the legacy
packages.

Depends-on: I11efa3758cea5eb459a101d62c93355f34bb42f9
Change-Id: I35d71bb7c03b23b01722e060c3ef770a24168ada
Implements-Blueprint: artifact-repository-support
2015-09-03 10:39:45 +00:00