Skip to content
This repository has been archived by the owner on Feb 22, 2020. It is now read-only.

Commit

Permalink
Merge pull request #348 from colethienes/master
Browse files Browse the repository at this point in the history
fix(flow): improve the error logging
  • Loading branch information
mergify[bot] authored Oct 23, 2019
2 parents 69ea3fd + a7610e5 commit 388d1ba
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions gnes/flow/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,7 @@ def _get_client(self, bytes_gen: Iterator[bytes] = None, **kwargs):
from ..cli.parser import set_client_cli_parser
from ..client.cli import CLIClient

args, p_args, unk_args = self._get_parsed_args(self, set_client_cli_parser, kwargs)
_, p_args, _ = self._get_parsed_args(self, CLIClient.__name__, set_client_cli_parser, kwargs)
p_args.grpc_port = self._service_nodes[self._frontend]['parsed_args'].grpc_port
p_args.grpc_host = self._service_nodes[self._frontend]['parsed_args'].grpc_host
c = CLIClient(p_args, start_at_init=False)
Expand Down Expand Up @@ -534,7 +534,7 @@ def set(self, name: str, recv_from: Union[str, Tuple[str], List[str], 'Service']
if not clear_old_attr:
node['kwargs'].update(kwargs)
kwargs = node['kwargs']
args, p_args, unk_args = op_flow._get_parsed_args(op_flow, service_map[service]['parser'], kwargs)
args, p_args, unk_args = op_flow._get_parsed_args(op_flow, name, service_map[service]['parser'], kwargs)
node.update({
'args': args,
'parsed_args': p_args,
Expand Down Expand Up @@ -635,7 +635,7 @@ def add(self, service: Union['Service', str],
recv_from = op_flow._parse_service_endpoints(op_flow, name, recv_from, connect_to_last_service=True)
send_to = op_flow._parse_service_endpoints(op_flow, name, send_to, connect_to_last_service=False)

args, p_args, unk_args = op_flow._get_parsed_args(op_flow, service_map[service]['parser'], kwargs)
args, p_args, unk_args = op_flow._get_parsed_args(op_flow, name, service_map[service]['parser'], kwargs)

op_flow._service_nodes[name] = {
'service': service,
Expand Down Expand Up @@ -686,7 +686,7 @@ def _parse_service_endpoints(op_flow, cur_service_name, service_endpoint, connec
return set(service_endpoint)

@staticmethod
def _get_parsed_args(op_flow, service_arg_parser, kwargs):
def _get_parsed_args(op_flow, name, service_arg_parser, kwargs):
kwargs.update(op_flow._common_kwargs)
args = []
for k, v in kwargs.items():
Expand All @@ -709,7 +709,7 @@ def _get_parsed_args(op_flow, service_arg_parser, kwargs):
op_flow.logger.warning('not sure what these arguments are: %s' % unknown_args)
except SystemExit:
raise ValueError('bad arguments for service "%s", '
'you may want to double check your args "%s"' % (service_arg_parser, args))
'you may want to double check your args "%s"' % (name, args))
return args, p_args, unknown_args

def _build_graph(self, copy_flow: bool) -> 'Flow':
Expand Down

0 comments on commit 388d1ba

Please sign in to comment.