@@ -17,7 +17,6 @@ class OSRelease:
17
17
@dataclass
18
18
class OpenStackRelease :
19
19
version : str
20
- previous_version : str
21
20
os_releases : t .List [OSRelease ]
22
21
23
22
@@ -34,11 +33,12 @@ class Scenario:
34
33
UBUNTU_NOBLE = OSRelease ("ubuntu" , "noble" , "ubuntu" )
35
34
# NOTE(upgrade): Add supported releases here.
36
35
OPENSTACK_RELEASES = [
37
- OpenStackRelease ("2023.1" , "zed" , [ROCKY_9 , UBUNTU_JAMMY ]),
38
- OpenStackRelease ("2024.1" , "2023.1" , [ROCKY_9 , UBUNTU_JAMMY ]),
39
- OpenStackRelease ("2025.1" , "2024.1" , [ROCKY_9 , UBUNTU_NOBLE ]),
36
+ OpenStackRelease ("2023.1" , [ROCKY_9 , UBUNTU_JAMMY ]),
37
+ OpenStackRelease ("2024.1" , [ROCKY_9 , UBUNTU_JAMMY ]),
38
+ OpenStackRelease ("2025.1" , [ROCKY_9 , UBUNTU_NOBLE ]),
40
39
]
41
40
NEUTRON_PLUGINS = ["ovs" , "ovn" ]
41
+ VERSION_HIERARCHY = ["zed" , "2023.1" , "2024.1" , "2025.1" ]
42
42
43
43
44
44
def main () -> None :
@@ -52,13 +52,17 @@ def random_scenario() -> Scenario:
52
52
openstack_release = random .choice (OPENSTACK_RELEASES )
53
53
os_release = random .choice (openstack_release .os_releases )
54
54
neutron_plugin = random .choice (NEUTRON_PLUGINS )
55
- upgrade = ' major' if random .random () > 0.6 else ' none'
55
+ upgrade = " major" if random .random () > 0.6 else " none"
56
56
return Scenario (openstack_release , os_release , neutron_plugin , upgrade )
57
57
58
58
59
59
def generate_inputs (scenario : Scenario ) -> t .Dict [str , str ]:
60
60
branch = get_branch (scenario .openstack_release .version )
61
- previous_branch = get_branch (scenario .openstack_release .previous_version )
61
+ previous_branch = get_branch (
62
+ VERSION_HIERARCHY [
63
+ VERSION_HIERARCHY .index (scenario .openstack_release .version ) - 1
64
+ ]
65
+ )
62
66
inputs = {
63
67
"os_distribution" : scenario .os_release .distribution ,
64
68
"os_release" : scenario .os_release .release ,
0 commit comments