@@ -17,7 +17,6 @@ class OSRelease:
1717@dataclass
1818class OpenStackRelease :
1919 version : str
20- previous_version : str
2120 os_releases : t .List [OSRelease ]
2221
2322
@@ -34,11 +33,12 @@ class Scenario:
3433UBUNTU_NOBLE = OSRelease ("ubuntu" , "noble" , "ubuntu" )
3534# NOTE(upgrade): Add supported releases here.
3635OPENSTACK_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 ]),
4039]
4140NEUTRON_PLUGINS = ["ovs" , "ovn" ]
41+ VERSION_HIERARCHY = ["zed" , "2023.1" , "2024.1" , "2025.1" ]
4242
4343
4444def main () -> None :
@@ -52,13 +52,17 @@ def random_scenario() -> Scenario:
5252 openstack_release = random .choice (OPENSTACK_RELEASES )
5353 os_release = random .choice (openstack_release .os_releases )
5454 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"
5656 return Scenario (openstack_release , os_release , neutron_plugin , upgrade )
5757
5858
5959def generate_inputs (scenario : Scenario ) -> t .Dict [str , str ]:
6060 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+ )
6266 inputs = {
6367 "os_distribution" : scenario .os_release .distribution ,
6468 "os_release" : scenario .os_release .release ,
0 commit comments