@@ -872,6 +872,22 @@ def _update_nics_config(server_config, client_config, allow_multiple=False):
872872 # valid only when one network created for the current tenant, the server
873873 # will attach automatically to that network
874874 if not (nics_from_node or nics_from_rels ):
875+ compute_api_version = client_config .get ('compute_api_version' )
876+ compute_microversion = client_config .get (
877+ 'compute_default_microversion' )
878+ if compute_api_version :
879+ compute_api_version = float (compute_api_version )
880+ if compute_microversion :
881+ compute_microversion = float (compute_microversion )
882+ if any ([compute_api_version >= 2.37 , compute_microversion >= 2.37 ]):
883+ ctx .logger .warn (
884+ 'No network was provided and no ports are connected '
885+ 'at server creation time. This is only supported for compute '
886+ 'API versions 2.37 and above. '
887+ 'Additionally, the network key should be set to \' none\' or '
888+ '\' auto\' . The plugin default is \' none\' .' )
889+ server_config ['networks' ] = 'none'
890+ ctx .instance .runtime_properties ['networks' ] = 'none'
875891 return
876892 # Try to merge them
877893 elif nics_from_node and nics_from_rels and not allow_multiple :
@@ -1486,6 +1502,8 @@ def _validate_external_volume_connection(openstack_resource):
14861502
14871503
14881504def _validate_security_groups_on_ports (server_networks , client_config ):
1505+ if not isinstance (server_networks , list ):
1506+ return
14891507 for net in server_networks :
14901508 if net .get ('port' ):
14911509 port = OpenstackPort (client_config = client_config ,
0 commit comments