Fix inconsistencies in clients
This commit is contained in:
parent
9cf2b89e41
commit
ba1c720285
@ -189,7 +189,7 @@ class DGroup(object):
|
|||||||
('type', 'depends_on'),
|
('type', 'depends_on'),
|
||||||
('state', 'success'),
|
('state', 'success'),
|
||||||
('parent_action', RoleData.name + '{{index}}.run'),
|
('parent_action', RoleData.name + '{{index}}.run'),
|
||||||
('child_action', t.name + '{{index}}.run')])
|
('depend_action', t.name + '{{index}}.run')])
|
||||||
|
|
||||||
for dep in set(inner):
|
for dep in set(inner):
|
||||||
if dep in self.filtered:
|
if dep in self.filtered:
|
||||||
@ -199,7 +199,7 @@ class DGroup(object):
|
|||||||
('type', 'depends_on'),
|
('type', 'depends_on'),
|
||||||
('state', 'success'),
|
('state', 'success'),
|
||||||
('parent_action', dep + '{{index}}.run'),
|
('parent_action', dep + '{{index}}.run'),
|
||||||
('child_action', t.name + '{{index}}.run')])
|
('depend_action', t.name + '{{index}}.run')])
|
||||||
for dep in set(outer):
|
for dep in set(outer):
|
||||||
if dep in self.filtered:
|
if dep in self.filtered:
|
||||||
continue
|
continue
|
||||||
@ -316,6 +316,9 @@ def g2vr(groups, c):
|
|||||||
inner_preds = []
|
inner_preds = []
|
||||||
outer_preds = []
|
outer_preds = []
|
||||||
for p in dg.predecessors(t):
|
for p in dg.predecessors(t):
|
||||||
|
if dg.node[p]['t'].type != 'puppet':
|
||||||
|
continue
|
||||||
|
|
||||||
if p in dsub:
|
if p in dsub:
|
||||||
inner_preds.append(p)
|
inner_preds.append(p)
|
||||||
else:
|
else:
|
||||||
|
@ -20,10 +20,13 @@ class NailgunSource(object):
|
|||||||
def roles(self, roles):
|
def roles(self, roles):
|
||||||
return []
|
return []
|
||||||
|
|
||||||
|
def master(self):
|
||||||
|
return 'master', ''
|
||||||
|
|
||||||
class DumbSource(object):
|
class DumbSource(object):
|
||||||
|
|
||||||
def nodes(self, uids):
|
def nodes(self, uids):
|
||||||
ip_mask = '10.0.0.%'
|
ip_mask = '10.0.0.%s'
|
||||||
return [(uid, ip_mask % uid, 1) for uid in uids]
|
return [(uid, ip_mask % uid, 1) for uid in uids]
|
||||||
|
|
||||||
def roles(self, uid):
|
def roles(self, uid):
|
||||||
@ -34,37 +37,36 @@ class DumbSource(object):
|
|||||||
|
|
||||||
source = DumbSource()
|
source = DumbSource()
|
||||||
|
|
||||||
@click.command()
|
@main.command()
|
||||||
@click.parameter('uids', nargs=-1)
|
@click.argument('uids', nargs=-1)
|
||||||
def nodes(uids):
|
def nodes(uids):
|
||||||
master = source.master()
|
master = source.master()
|
||||||
vr.create('master', 'f2s/vrs/fuel_node',
|
vr.create('master', 'f2s/vrs/fuel_node.yaml',
|
||||||
{'index': master[0], 'ip': master[1]})
|
{'index': master[0], 'ip': master[1]})
|
||||||
for uid, ip, env in source.nodes(uids):
|
for uid, ip, env in source.nodes(uids):
|
||||||
vr.create('fuel_node', 'f2s/vrs/fuel_node',
|
vr.create('fuel_node', 'f2s/vrs/fuel_node.yaml',
|
||||||
{'index': uid, 'ip': ip})
|
{'index': uid, 'ip': ip})
|
||||||
|
|
||||||
@click.command()
|
@main.command()
|
||||||
@click.parameter('uids', nargs=-1)
|
@click.argument('uids', nargs=-1)
|
||||||
def basic(uids):
|
def basic(uids):
|
||||||
master_index = source.master()[0]
|
master_index = source.master()[0]
|
||||||
other = nodes_data[1:]
|
|
||||||
|
|
||||||
vr.create('genkeys', 'f2s/vrs/genkeys', {
|
vr.create('genkeys', 'f2s/vrs/genkeys.yaml', {
|
||||||
'node': 'node'+master_index,
|
'node': 'node'+master_index,
|
||||||
'index': master_index})
|
'index': master_index})
|
||||||
for uid, ip, env in source.nodes(uids):
|
for uid, ip, env in source.nodes(uids):
|
||||||
vr.create('prep', 'f2s/vrs/prep',
|
vr.create('prep', 'f2s/vrs/prep.yaml',
|
||||||
{'index': uid, 'env': env, 'node': 'node'+uid})
|
{'index': uid, 'env': env, 'node': 'node'+uid})
|
||||||
|
|
||||||
|
|
||||||
@click.command()
|
@main.command()
|
||||||
@click.parameter('uids', nargs=-1)
|
@click.argument('uids', nargs=-1)
|
||||||
def roles(uids):
|
def roles(uids):
|
||||||
|
|
||||||
for uid, ip, env in source.nodes(uids):
|
for uid, ip, env in source.nodes(uids):
|
||||||
role = source.roles(uid)
|
role = source.roles(uid)
|
||||||
vr.create(role, 'f2s/vrs/'+role,
|
vr.create(role, 'f2s/vrs/'+role +'.yml',
|
||||||
{'index': uid, 'env': env, 'node': 'node'+uid})
|
{'index': uid, 'env': env, 'node': 'node'+uid})
|
||||||
|
|
||||||
|
|
||||||
|
@ -37,8 +37,8 @@ events:
|
|||||||
- type: depends_on
|
- type: depends_on
|
||||||
state: success
|
state: success
|
||||||
parent_action: sources{{index}}.run
|
parent_action: sources{{index}}.run
|
||||||
child_action: role_data{{index}}.run
|
depend_action: role_data{{index}}.run
|
||||||
- type: depends_on
|
- type: depends_on
|
||||||
state: success
|
state: success
|
||||||
parent_action: managed_apt_{{index}}.run
|
parent_action: managed_apt_{{index}}.run
|
||||||
child_action: role_data{{index}}.run
|
depend_action: role_data{{index}}.run
|
||||||
|
@ -53,7 +53,7 @@ class InputsFieldWrp(IndexFieldWrp):
|
|||||||
# XXX: it could be worth to precalculate it
|
# XXX: it could be worth to precalculate it
|
||||||
if ':' in name:
|
if ':' in name:
|
||||||
name = name.split(":", 1)[0]
|
name = name.split(":", 1)[0]
|
||||||
schema = resource.meta_inputs[name]['schema']
|
schema = resource.meta_inputs[name].get('schema', None)
|
||||||
if isinstance(schema, self._simple_types):
|
if isinstance(schema, self._simple_types):
|
||||||
return InputTypes.simple
|
return InputTypes.simple
|
||||||
if isinstance(schema, list):
|
if isinstance(schema, list):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user