translate failed in scaling policy while param involved in tosca
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Heat Translator |
New
|
Undecided
|
Unassigned | ||
TOSCA Parser |
Fix Released
|
Undecided
|
GUO Larry | ||
tacker |
New
|
Undecided
|
Unassigned |
Bug Description
Based on this tosca template: https:/
replace image name to parameter, such like:
tosca_definitio
description: >
Template for deploying servers based on policies.
imports:
- tacker_defs.yaml
- tacker_
topology_template:
inputs:
image_name:
type: string
description: Image Name
node_templates:
VDU1:
type: tosca.nodes.
properties:
image: { get_input: image_name }
flavor: m1.tiny
CP1:
type: tosca.nodes.
properties:
management: true
order: 0
requirements:
- virtualLink:
node: VL1
- virtualBinding:
node: VDU1
VDU2:
type: tosca.nodes.
properties:
image: { get_input: image_name }
flavor: m1.tiny
CP2:
type: tosca.nodes.
properties:
management: true
order: 0
requirements:
- virtualLink:
node: VL1
- virtualBinding:
node: VDU2
VL1:
type: tosca.nodes.nfv.VL
properties:
vendor: Tacker
policies:
- SP1:
type: tosca.policies.
targets: [VDU1, VDU2]
properties:
cooldown: 120
Run generate template command and it will fail:
# python heat_translator.py --template-
Traceback (most recent call last):
File "heat_translato
translator_
File "/root/
TranslatorS
File "/root/
self.
File "/root/
print(
File "/root/
self.
File "/root/
self.
File "/root/
return self._translate
File "/root/
self.
File "/root/
extra_res = copy.deepcopy(res)
File "/usr/lib64/
y = _reconstruct(x, rv, 1, memo)
File "/usr/lib64/
state = deepcopy(state, memo)
File "/usr/lib64/
y = copier(x, memo)
File "/usr/lib64/
y[deepcopy(key, memo)] = deepcopy(value, memo)
File "/usr/lib64/
y = _reconstruct(x, rv, 1, memo)
File "/usr/lib64/
state = deepcopy(state, memo)
File "/usr/lib64/
y = copier(x, memo)
File "/usr/lib64/
y[deepcopy(key, memo)] = deepcopy(value, memo)
File "/usr/lib64/
y = copier(x, memo)
File "/usr/lib64/
y.append(
File "/usr/lib64/
y = _reconstruct(x, rv, 1, memo)
File "/usr/lib64/
state = deepcopy(state, memo)
File "/usr/lib64/
y = copier(x, memo)
File "/usr/lib64/
y[deepcopy(key, memo)] = deepcopy(value, memo)
File "/usr/lib64/
y = copier(x, memo)
File "/usr/lib64/
y.append(
File "/usr/lib64/
y = _reconstruct(x, rv, 1, memo)
File "/usr/lib64/
state = deepcopy(state, memo)
File "/usr/lib64/
y = copier(x, memo)
File "/usr/lib64/
y[deepcopy(key, memo)] = deepcopy(value, memo)
File "/usr/lib64/
y = _reconstruct(x, rv, 1, memo)
File "/usr/lib64/
state = deepcopy(state, memo)
File "/usr/lib64/
y = copier(x, memo)
File "/usr/lib64/
y[deepcopy(key, memo)] = deepcopy(value, memo)
File "/usr/lib64/
y = _reconstruct(x, rv, 1, memo)
File "/usr/lib64/
state = deepcopy(state, memo)
File "/usr/lib64/
y = copier(x, memo)
File "/usr/lib64/
y[deepcopy(key, memo)] = deepcopy(value, memo)
File "/usr/lib64/
y = _reconstruct(x, rv, 1, memo)
File "/usr/lib64/
state = deepcopy(state, memo)
File "/usr/lib64/
y = copier(x, memo)
File "/usr/lib64/
y[deepcopy(key, memo)] = deepcopy(value, memo)
File "/usr/lib64/
y = copier(x, memo)
File "/usr/lib64/
y.append(
File "/usr/lib64/
y = _reconstruct(x, rv, 1, memo)
File "/usr/lib64/
state = deepcopy(state, memo)
File "/usr/lib64/
y = copier(x, memo)
File "/usr/lib64/
y[deepcopy(key, memo)] = deepcopy(value, memo)
File "/usr/lib64/
y = copier(x, memo)
File "/usr/lib64/
y.append(
File "/usr/lib64/
y = _reconstruct(x, rv, 1, memo)
File "/usr/lib64/
state = deepcopy(state, memo)
File "/usr/lib64/
y = copier(x, memo)
File "/usr/lib64/
y[deepcopy(key, memo)] = deepcopy(value, memo)
File "/usr/lib64/
y = _reconstruct(x, rv, 1, memo)
File "/usr/lib64/
state = deepcopy(state, memo)
File "/usr/lib64/
y = copier(x, memo)
File "/usr/lib64/
y[deepcopy(key, memo)] = deepcopy(value, memo)
File "/usr/lib64/
y = copier(x, memo)
File "/usr/lib64/
y.append(
File "/usr/lib64/
y = _reconstruct(x, rv, 1, memo)
File "/usr/lib64/
y = callable(*args)
File "/usr/lib64/
return cls.__new__(cls, *args)
TypeError: __new__() takes exactly 4 arguments (1 given)
It is the same error if this template used on Tacker.
summary: |
- translate failed in scaling policy while param involued in tosca + translate failed in scaling policy while param involved in tosca |
Changed in tosca-parser: | |
assignee: | nobody → GUO Larry (larrygu) |
status: | New → In Progress |
It caused by toscaparser/ elements/ constraints. py
class Constraint(object):
........
def __new__(cls, property_name, property_type, constraint):
__new__ must be called during deepcopy to create a new object.
one problem is that deepcopy and copy have no way of knowing which arguments to pass to __new__, therefore they only work with classes that don't require constructor arguments.