Reuse parse_dict_input in parse_list
This commit is contained in:
parent
95a65a625e
commit
b894c1d855
@ -15,7 +15,7 @@
|
||||
- shell: celery multi stopwait 2 -A solar.orchestration.runner
|
||||
chdir={{ celery_dir }}
|
||||
tags: [stop]
|
||||
- shell: celery multi start 2 -A solar.orchestration.runner -P -c:2 1000 gevent -c:1 1 -Q:1 scheduler,system_log -Q:2 celery,{{ hostname.stdout }}
|
||||
- shell: celery multi start 2 -A solar.orchestration.runner -P gevent -c:2 1000 -c:1 1 -Q:1 scheduler,system_log -Q:2 celery,{{ hostname.stdout }}
|
||||
chdir={{ celery_dir }}
|
||||
tags: [master]
|
||||
|
||||
|
@ -267,7 +267,7 @@ def parse_list_input(r_input, args):
|
||||
assignments = {}
|
||||
for arg in args:
|
||||
if isinstance(arg, dict):
|
||||
n_connections, n_assign = parse_dicts_as_collection(
|
||||
n_connections, n_assign = parse_dict_input(
|
||||
r_input, arg)
|
||||
connections.extend(n_connections)
|
||||
if n_assign:
|
||||
@ -309,19 +309,6 @@ def is_connection(arg):
|
||||
return False
|
||||
|
||||
|
||||
def parse_dicts_as_collection(child_input, arg):
|
||||
connections = []
|
||||
assignments = {}
|
||||
for key, value in arg.items():
|
||||
if is_connection(value):
|
||||
connections.append(
|
||||
parse_connection(
|
||||
'{}:{}'.format(child_input, key), value))
|
||||
else:
|
||||
assignments[key] = value
|
||||
return connections, assignments
|
||||
|
||||
|
||||
def parse_connection(child_input, element):
|
||||
parent, parent_input = element.split('::', 1)
|
||||
try:
|
||||
|
Loading…
x
Reference in New Issue
Block a user