Create networks only when network service is enabled

Currently tempestconf calls create_tempest_networks method
without checking neutron service is available or not which
leads to 'NoneType' object has no attribute
'create_tempest_networks'.

Making it conditional fixes the issue where we explicitly disables
the neutron service.

create_tempest_networks also contains the logic for creating
nova network and earlier it was called only when has_neutron
is false. nova network support is deprecated long time ago
and this change already pushes network creation part to
conditional then it will be never called.

Change-Id: I10f282e2a813060419e213dd25641078774a852d
Signed-off-by: Chandan Kumar (raukadah) <chkumar@redhat.com>
This commit is contained in:
Chandan Kumar (raukadah) 2020-01-13 13:02:21 +05:30
parent 2188ec07e1
commit 4410537ebe
1 changed files with 6 additions and 3 deletions

View File

@ -544,10 +544,13 @@ def config_tempest(**kwargs):
False))
image.create_tempest_images(conf)
# FIXME(chkumar246): Remove dead code of nova_network
# as it is deprecated long time ago.
has_neutron = services.is_service(**{"type": "network"})
network = services.get_service("network")
network.create_tempest_networks(has_neutron, conf,
kwargs.get('network_id'))
if has_neutron:
network = services.get_service("network")
network.create_tempest_networks(has_neutron, conf,
kwargs.get('network_id'))
services.post_configuration()
services.set_supported_api_versions()