Skip to content

Issue in data type of row  #109

@ashish-gupta-2

Description

@ashish-gupta-2

sample.yaml

tosca_definitions_version: tosca_simple_yaml_1_3

metadata:
  template_name: Inputs and Outputs Example
  template_author: Puccini
topology_template:

  inputs:
    cores:
      type: integer
      default: 4
      constraints:
      - less_than: 8

  node_templates:
    server:
      type: tosca:Compute
      capabilities:
        host:
          properties:
            num_cpus: { get_input: cores }
      attributes:
        public_address: "10.11.111.121"
  outputs:
    url:
      type: string
      value: { concat: [ 'http://', { get_attribute: [ server, public_address ] }, ':8080' ] }

function-call.go

  if data, ok := map_["row"]; ok {
		      if functionCall.Row, ok = asInt(data); !ok {
			      return nil, fmt.Errorf("malformed function call, \"row\" not an integer: %T", data)
		      }
	      }

	if data, ok := map_["column"]; ok {
		if functionCall.Column, ok = asInt(data); !ok {
			return nil, fmt.Errorf("malformed function call, \"column\" not an integer: %T", data)
		}
	}

we are using below js script for coerce in our js file

const traversal = require('tosca.lib.traversal');
traversal.coerce();

It is taking row number as float64 rather than integer due to which below issue is coming :

GoError: malformed function call, "row" not an integer: float64 at internal:tosca.lib.traversal:158:9(58)

the same thing is working fine while using CLI command :

puccini-tosca compile -c <filename>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions