Merge "Avoid concurrency issues when creating Cirros and Ubuntu images"
This commit is contained in:
commit
c845501b73
tobiko/openstack/stacks
@ -14,8 +14,10 @@
|
||||
from __future__ import absolute_import
|
||||
|
||||
import io
|
||||
import os
|
||||
import typing
|
||||
|
||||
from oslo_concurrency import lockutils
|
||||
from paramiko import sftp_file
|
||||
|
||||
from tobiko import config
|
||||
@ -30,6 +32,7 @@ import tobiko.tripleo
|
||||
from tobiko.openstack.stacks import _hot
|
||||
|
||||
CONF = config.CONF
|
||||
LOCK_DIR = os.path.expanduser(CONF.tobiko.common.lock_dir)
|
||||
|
||||
CIRROS_IMAGE_VERSION = '0.5.2'
|
||||
|
||||
@ -54,6 +57,11 @@ class CirrosImageFixture(glance.URLGlanceImageFixture):
|
||||
# when using recent Paramiko versions (>= 2.9.2)
|
||||
'pubkeys': ['rsa-sha2-256', 'rsa-sha2-512']}
|
||||
|
||||
@lockutils.synchronized(
|
||||
'cirros_image_setup_fixture', external=True, lock_path=LOCK_DIR)
|
||||
def setup_fixture(self):
|
||||
super(CirrosImageFixture, self).setup_fixture()
|
||||
|
||||
|
||||
class CirrosFlavorStackFixture(_nova.FlavorStackFixture):
|
||||
ram = 128
|
||||
|
@ -13,8 +13,11 @@
|
||||
# under the License.
|
||||
from __future__ import absolute_import
|
||||
|
||||
import os
|
||||
import typing
|
||||
|
||||
from oslo_concurrency import lockutils
|
||||
|
||||
import tobiko
|
||||
from tobiko import config
|
||||
from tobiko.openstack import glance
|
||||
@ -25,6 +28,7 @@ from tobiko.shell import sh
|
||||
|
||||
|
||||
CONF = config.CONF
|
||||
LOCK_DIR = os.path.expanduser(CONF.tobiko.common.lock_dir)
|
||||
|
||||
|
||||
class UbuntuMinimalImageFixture(glance.FileGlanceImageFixture):
|
||||
@ -38,6 +42,11 @@ class UbuntuMinimalImageFixture(glance.FileGlanceImageFixture):
|
||||
disabled_algorithms = CONF.tobiko.ubuntu.disabled_algorithms
|
||||
is_reachable_timeout = CONF.tobiko.nova.ubuntu_is_reachable_timeout
|
||||
|
||||
@lockutils.synchronized(
|
||||
'ubuntu_minimal_setup_fixture', external=True, lock_path=LOCK_DIR)
|
||||
def setup_fixture(self):
|
||||
super(UbuntuMinimalImageFixture, self).setup_fixture()
|
||||
|
||||
|
||||
IPERF3_SERVICE_FILE = """
|
||||
[Unit]
|
||||
|
Loading…
Reference in New Issue
Block a user