Skip to content

Commit 11b977c

Browse files
committed
[UT] OVN fake resources factory method should return instance
The OVN fake resources factory method should return an instance of the requested object, not a "type" metaclass object. Closes-Bug: #2047049 Change-Id: I85c613dd628d7d2b67446d999b3e4d7b91eaf9fe (cherry picked from commit e45c403)
1 parent 15f07dc commit 11b977c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

neutron/tests/unit/fake_resources.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -767,7 +767,7 @@ def create_one_port(attrs=None):
767767

768768
# Overwrite default attributes.
769769
port_attrs.update(attrs)
770-
return type('Logical_Switch_Port', (object, ), port_attrs)
770+
return type('Logical_Switch_Port', (object, ), port_attrs)()
771771

772772
@staticmethod
773773
def from_neutron_port(port):
@@ -810,7 +810,7 @@ def create_one_router(attrs=None):
810810

811811
# Overwrite default attributes.
812812
router_attrs.update(attrs)
813-
return type('Logical_Router', (object, ), router_attrs)
813+
return type('Logical_Router', (object, ), router_attrs)()
814814

815815
@staticmethod
816816
def from_neutron_router(router):
@@ -910,4 +910,4 @@ def create(attrs=None, az_list=None, chassis_as_gw=False,
910910

911911
# Overwrite default attributes.
912912
chassis_attrs.update(attrs or {})
913-
return type('Chassis', (object, ), chassis_attrs)
913+
return type('Chassis', (object, ), chassis_attrs)()

0 commit comments

Comments
 (0)