From 21b8bf800f4dcd8c0c07949f9d418c8cca430042 Mon Sep 17 00:00:00 2001 From: Jedrzej Nowak Date: Mon, 4 Jan 2016 13:20:09 +0100 Subject: [PATCH] composer.create returns CreatedResources object This object has smart __getitem__ method it also has like method that simplifies filtering Change-Id: If5aa13e1ab3d2ecbfc3c6d5797868f64db315a8f Closes-bug: #1530808 --- examples/riak/riaks.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/riak/riaks.py b/examples/riak/riaks.py index 40e890f..7187a30 100755 --- a/examples/riak/riaks.py +++ b/examples/riak/riaks.py @@ -33,9 +33,9 @@ def setup_riak(): ModelMeta.remove_all() resources = cr.create('nodes', 'templates/nodes', {'count': 3}) nodes = [x for x in resources if x.name.startswith('node')] - hosts_services = [x for x in resources if x.name.startswith('hosts_file')] + nodes = resources.like('node') + hosts_services = resources.like('hosts_file') node1, node2, node3 = nodes - hosts_services = [x for x in resources if x.name.startswith('hosts_file')] riak_services = [] ips = '10.0.0.%d'