Allow to use manageonly releases for preupgrades

The Liberty releases are marked as manageonly but they have to be
applied for compute nodes.

Change-Id: I81c3b87522b6c6463a54be2ca6fca8d91847eb4d
Related-Bug: #1624041
This commit is contained in:
Ilya Kharin 2016-09-15 20:16:42 +03:00
parent 5e6953bc93
commit 3311ac84af
2 changed files with 6 additions and 4 deletions

View File

@ -25,9 +25,10 @@ LOG = logging.getLogger(__name__)
def check_sanity(nodes, release):
if release.data['state'] != 'available':
if release.data['state'] not in ('available', 'manageonly'):
raise Exception(
"Release with id {0} is not available.".format(release.id)
"Release with id {0} is not available (at least manageonly)."
.format(release.id)
)
env_id = nodes[0].env.id

View File

@ -81,6 +81,7 @@ def test_preupgrade_compute(mocker, release_id, node_ids, env_id, version):
@pytest.mark.parametrize("release_id,node_ids,env_ids,roles,state,err", [
(1, [1, 2], [1, 1], ["compute", "compute"], "available", None),
(1, [1, 2], [1, 1], ["compute", "compute"], "manageonly", None),
(1, [1, 3], [1, 1], ["compute", "compute"], "unavailable", Exception),
(1, [1, 2], [1, 2], ["compute", "compute"], "available", Exception),
(1, [1, 2], [1, 1], ["compute", "controller"], "available", Exception),
@ -102,8 +103,8 @@ def test_check_sanity(release_id, node_ids, env_ids, roles, state, err):
with pytest.raises(err) as exc_info:
preupgrade_compute.check_sanity(node_list, release)
if state != "available":
assert "Release with id {0} is not available.".format(release_id)\
in exc_info.value.args[0]
assert "Release with id {0} is not available (at least " \
"manageonly).".format(release_id) in exc_info.value.args[0]
elif env_ids[0] != env_ids[1]:
assert "Nodes have different clusters." in exc_info.value.args[0]
else: