speed up containers sequencial calls with cache
Change-Id: Ic96b210522cd397e9ef9e3b4eb51b63aee3ba3b4
This commit is contained in:
parent
8c42011634
commit
3fef57a712
@ -2,6 +2,7 @@ from __future__ import absolute_import
|
|||||||
|
|
||||||
import os
|
import os
|
||||||
import time
|
import time
|
||||||
|
import functools
|
||||||
|
|
||||||
from oslo_log import log
|
from oslo_log import log
|
||||||
import pandas
|
import pandas
|
||||||
@ -203,10 +204,15 @@ def assert_all_tripleo_containers_running():
|
|||||||
assert_ovn_containers_running()
|
assert_ovn_containers_running()
|
||||||
|
|
||||||
|
|
||||||
|
@functools.lru_cache()
|
||||||
|
def ovn_used_on_overcloud():
|
||||||
|
return list_containers_df()['container_name'].\
|
||||||
|
str.contains('ovn').any(axis=None)
|
||||||
|
|
||||||
|
|
||||||
def assert_ovn_containers_running():
|
def assert_ovn_containers_running():
|
||||||
# specific OVN verifications
|
# specific OVN verifications
|
||||||
if list_containers_df()['container_name'].\
|
if ovn_used_on_overcloud():
|
||||||
str.contains('ovn').any(axis=None):
|
|
||||||
# TODO: deployments with networker nodes are not supported
|
# TODO: deployments with networker nodes are not supported
|
||||||
ovn_controller_containers = ['ovn_controller',
|
ovn_controller_containers = ['ovn_controller',
|
||||||
'ovn-dbs-bundle-{}-'.
|
'ovn-dbs-bundle-{}-'.
|
||||||
@ -248,6 +254,7 @@ def comparable_container_keys(container, include_container_objects=False):
|
|||||||
container.attrs['State']['Status'])
|
container.attrs['State']['Status'])
|
||||||
|
|
||||||
|
|
||||||
|
@functools.lru_cache()
|
||||||
def list_containers_objects_df():
|
def list_containers_objects_df():
|
||||||
containers_list = list_containers()
|
containers_list = list_containers()
|
||||||
containers_objects_list_df = pandas.DataFrame(
|
containers_objects_list_df = pandas.DataFrame(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user