def _print_bento_info(bento, output_type): if output_type == 'yaml': _echo(pb_to_yaml(bento)) else: from google.protobuf.json_format import MessageToJson _echo(MessageToJson(bento))
def _print_deployment_info(deployment, output_type): if output_type == 'yaml': _echo(pb_to_yaml(deployment)) else: deployment_info = MessageToDict(deployment) if deployment_info['state']['infoJson']: deployment_info['state']['infoJson'] = json.loads( deployment_info['state']['infoJson']) _echo(json.dumps(deployment_info, indent=2, separators=(',', ': ')))
def _print_deployment_info(deployment, output_type): if output_type == 'yaml': _echo(pb_to_yaml(deployment)) else: from google.protobuf.json_format import MessageToDict deployment_info = MessageToDict(deployment) if deployment_info['state'] and deployment_info['state']['infoJson']: deployment_info['state']['infoJson'] = json.loads( deployment_info['state']['infoJson']) _echo(json.dumps(deployment_info, indent=2, separators=(',', ': ')))
def _print_deployment_info(deployment, output_type): if output_type == 'yaml': result = pb_to_yaml(deployment) else: result = MessageToJson(deployment) if deployment.state.info_json: result = json.loads(result) result['state']['infoJson'] = json.loads( deployment.state.info_json) _echo(json.dumps(result, indent=2, separators=(',', ': '))) return _echo(result)
def _print_bento_info(bento, output_type): if output_type == 'yaml': _echo(pb_to_yaml(bento)) else: _echo(MessageToJson(bento))
def display_deployment_info(deployment, output): if output == 'yaml': result = pb_to_yaml(deployment) else: result = MessageToJson(deployment) _echo(result)