Beispiel #1
0
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))
Beispiel #2
0
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=(',', ': ')))
Beispiel #3
0
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=(',', ': ')))
Beispiel #4
0
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)
Beispiel #5
0
def _print_bento_info(bento, output_type):
    if output_type == 'yaml':
        _echo(pb_to_yaml(bento))
    else:
        _echo(MessageToJson(bento))
Beispiel #6
0
def display_deployment_info(deployment, output):
    if output == 'yaml':
        result = pb_to_yaml(deployment)
    else:
        result = MessageToJson(deployment)
    _echo(result)