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