Browse Source

Merge "Switch to use process executor"

tags/13.0.0^0
Zuul 2 weeks ago
parent
commit
02b23c9f22
4 changed files with 12 additions and 5 deletions
  1. +1
    -1
      lower-constraints.txt
  2. +1
    -1
      requirements.txt
  3. +7
    -2
      tripleoclient/tests/v1/test_container_image.py
  4. +3
    -1
      tripleoclient/v1/container_image.py

+ 1
- 1
lower-constraints.txt View File

@@ -148,7 +148,7 @@ testscenarios===0.4
testtools==2.2.0
tooz==1.58.0
traceback2==1.4.0
tripleo-common==10.7.0
tripleo-common==11.3.1
ujson==1.35
unittest2==1.1.0
vine==1.1.4

+ 1
- 1
requirements.txt View File

@@ -16,6 +16,6 @@ simplejson>=3.5.1 # MIT
six>=1.10.0 # MIT
osc-lib>=1.8.0 # Apache-2.0
websocket-client>=0.44.0 # LGPLv2+
tripleo-common!=11.3.0,>=10.7.0 # Apache-2.0
tripleo-common>=11.3.1 # Apache-2.0
cryptography>=2.1 # BSD/Apache-2.0
futures>=3.0.0;python_version=='2.7' or python_version=='2.6' # BSD

+ 7
- 2
tripleoclient/tests/v1/test_container_image.py View File

@@ -782,10 +782,14 @@ class TestTripleoImagePrepare(TestPluginV1):
with open(self.roles_data_file, 'w') as f:
f.write(self.roles_yaml)

@mock.patch('tripleo_common.utils.locks.processlock.'
'ProcessLock')
@mock.patch('tripleo_common.image.kolla_builder.'
'container_images_prepare_multi')
def test_tripleo_container_image_prepare(self, prepare_multi):
def test_tripleo_container_image_prepare(self, prepare_multi, mock_lock):

mock_lockobj = mock.MagicMock()
mock_lock.return_value = mock_lockobj
env_file = os.path.join(self.temp_dir, 'containers_env.yaml')

arglist = [
@@ -813,7 +817,8 @@ class TestTripleoImagePrepare(TestPluginV1):
self.default_env,
yaml.safe_load(self.roles_yaml),
dry_run=False,
cleanup='full')
cleanup='full',
lock=mock_lockobj)

with open(env_file) as f:
result = yaml.safe_load(f)

+ 3
- 1
tripleoclient/v1/container_image.py View File

@@ -32,6 +32,7 @@ import yaml
from tripleo_common.image.builder import buildah
from tripleo_common.image import image_uploader
from tripleo_common.image import kolla_builder
from tripleo_common.utils.locks import processlock

from tripleoclient import command
from tripleoclient import constants
@@ -952,9 +953,10 @@ class TripleOImagePrepare(command.Command):
parsed_args.environment_directories
)

lock = processlock.ProcessLock()
params = kolla_builder.container_images_prepare_multi(
env, roles_data, dry_run=parsed_args.dry_run,
cleanup=parsed_args.cleanup)
cleanup=parsed_args.cleanup, lock=lock)
env_data = build_env_file(params, self.app.command_options)
if parsed_args.output_env_file:
if os.path.exists(parsed_args.output_env_file):

Loading…
Cancel
Save