Fix release sync after nailrun db restore

Change-Id: I79cd4ecfec4ce2da981067106401d315ee295534
Closes-bug: 1541429
This commit is contained in:
Sergey Abramov 2016-02-03 18:12:31 +03:00
parent c32580dc7f
commit d0acfbed00
3 changed files with 13 additions and 3 deletions

View File

@ -28,9 +28,10 @@ ARCHIVATORS = [
cobbler.CobblerArchivator,
fuel_keys.FuelKeysArchivator,
fuel_uuid.FuelUUIDArchivator,
postgres.KeystoneArchivator,
postgres.NailgunArchivator,
puppet.PuppetArchivator,
postgres.KeystoneArchivator,
# Nailgun restore should be after puppet restore
postgres.NailgunArchivator,
ssh.SshArchivator,
version.VersionArchivator,
nailgun_plugins.NailgunPluginsArchivator,

View File

@ -102,6 +102,13 @@ class NailgunArchivator(PostgresArchivator):
release.update(fixture['fields'])
self.__post_data_to_nailgun(
"/api/v1/releases/", release, context.password)
subprocess.call([
"fuel",
"release",
"--sync-deployment-tasks",
"--dir",
"/etc/puppet/",
])
class KeystoneArchivator(PostgresArchivator):

View File

@ -393,7 +393,7 @@ def test_post_restore_nailgun(mocker):
{"fields": {}},
{"fields": {"k": 3}},
])
mock_subprocess_call = mocker.patch("octane.util.subprocess.call")
mocker.patch("octane.util.docker.run_in_container",
return_value=(data, None))
token = "123"
@ -418,3 +418,5 @@ def test_post_restore_nailgun(mocker):
],
any_order=True
)
mock_subprocess_call.assert_called_once_with([
"fuel", "release", "--sync-deployment-tasks", "--dir", "/etc/puppet/"])