diff options
author | Sam Morrison <sorrison@gmail.com> | 2020-10-01 09:06:53 +1000 |
---|---|---|
committer | Lingxian Kong <anlin.kong@gmail.com> | 2020-10-01 08:36:40 +0000 |
commit | a5a5c5e060c37c4d0ec5fff125253ca02c1f1817 (patch) | |
tree | e28586e9d0cd66ffa003229b62ad4548eaf16bc6 | |
parent | 7e4927086d7db9c6ea6130f94209b00ef8ca0ebd (diff) | |
download | trove-a5a5c5e060c37c4d0ec5fff125253ca02c1f1817.tar.gz |
Handle case where no networks are selected at create
Currently trove will error when no networks are selected
and no management network is configured. This change will
pass in None as the nics to nova server create which will
let nova choose the network.
Change-Id: Ica4f888bf1bc7b771cdfcb0af5c104b2aa6410fe
Story: 2008213
Task: 40999
-rwxr-xr-x | trove/taskmanager/models.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/trove/taskmanager/models.py b/trove/taskmanager/models.py index 9e3253f3..5c0d28f5 100755 --- a/trove/taskmanager/models.py +++ b/trove/taskmanager/models.py @@ -511,6 +511,9 @@ class FreshInstanceTasks(FreshInstance, NotifyMixin, ConfigurationMixin): self.id) networks.append({"port-id": port_id}) + if not CONF.management_networks and not networks: + return None + # Create port in the user defined network, associate floating IP if # needed if len(networks) > 1 or not CONF.management_networks: |