Łukasz Oleś 25dc2685f5 Refactor VirtualResources
- rename VirtualResource to Composer
- rename event parameter depend_action to child_action
- rename values parameter to input

Closes-bug: #1526780

Change-Id: Ib974e14ff4bda44c2d7d991f62aa4a06dea160ea
2015-12-29 16:50:46 +01:00

40 lines
814 B
Python

import click
import sys
import time
from solar.core import signals
from solar.core.resource import composer as cr
from solar.dblayer.model import ModelMeta
def run():
ModelMeta.remove_all()
resources = cr.create('nodes', 'templates/nodes', {'count': 2})
node1, node2 = [x for x in resources if x.name.startswith('node')]
hosts1, hosts2 = [x for x in resources
if x.name.startswith('hosts_file')]
node1.connect(hosts1, {
'name': 'hosts:name',
'ip': 'hosts:ip',
})
node2.connect(hosts1, {
'name': 'hosts:name',
'ip': 'hosts:ip',
})
node1.connect(hosts2, {
'name': 'hosts:name',
'ip': 'hosts:ip',
})
node2.connect(hosts2, {
'name': 'hosts:name',
'ip': 'hosts:ip',
})
run()