Fix VIP IPv6 subnet discovery order

Code was assuming the subnet existed already and only after creating one
if not. On environments where the subnet does not exist, it raises an
IndexError exception as there are no elements in priv_ipv6_subnet. This
patch fixes the order of the code to first create the subnet if ones
does not exist yet.

Story: 2006280
Task: 35982

Change-Id: I9fa9d7e16f32f516592bf155045d4f4e6a15ed6c
diff --git a/octavia_tempest_plugin/tests/test_base.py b/octavia_tempest_plugin/tests/test_base.py
index e85fb0a..ddc953d 100644
--- a/octavia_tempest_plugin/tests/test_base.py
+++ b/octavia_tempest_plugin/tests/test_base.py
@@ -309,10 +309,10 @@
                 name='ipv6-private-subnet')['subnets']
 
             cls.lb_member_vip_ipv6_subnet_stateful = False
-            if (priv_ipv6_subnet[0]['ipv6_address_mode'] ==
-                    'dhcpv6-stateful'):
-                cls.lb_member_vip_ipv6_subnet_stateful = True
             if len(priv_ipv6_subnet) == 1:
+                if (priv_ipv6_subnet[0]['ipv6_address_mode'] ==
+                        'dhcpv6-stateful'):
+                    cls.lb_member_vip_ipv6_subnet_stateful = True
                 cls.lb_member_vip_ipv6_subnet = priv_ipv6_subnet[0]
                 cls.lb_member_vip_ipv6_net = {
                     'id': priv_ipv6_subnet[0]['network_id']}
@@ -331,6 +331,7 @@
                     cls._logging_delete_subnet,
                     cls.lb_mem_subnet_client.show_subnet,
                     cls.lb_member_vip_ipv6_subnet['id'])
+
             LOG.info('lb_member_vip_ipv6_subnet: {}'.format(
                 cls.lb_member_vip_ipv6_subnet))