Browse Source

Merge "Insert physnet1 in ml2_flat_allocations"

changes/61/358461/22
Jenkins 2 years ago
parent
commit
8a4278e3b9
1 changed files with 8 additions and 1 deletions
  1. 8
    1
      octane/util/db.py

+ 8
- 1
octane/util/db.py View File

@@ -107,10 +107,17 @@ def fix_neutron_migrations(node):
107 107
         "UPDATE ml2_network_segments " \
108 108
         "SET network_type='flat',physical_network='physnet1' " \
109 109
         "WHERE network_id IN (SELECT network_id FROM externalnetworks);"
110
-
110
+    insert_physnet1 = \
111
+        "INSERT INTO ml2_flat_allocations " \
112
+        "SELECT b.* FROM (SELECT 'physnet1') AS b " \
113
+        "WHERE NOT EXISTS (" \
114
+        "SELECT 1 FROM ml2_flat_allocations " \
115
+        "WHERE physical_network = 'physnet1'" \
116
+        ");"
111 117
     cmd = ['sudo', '-iu', 'root', 'mysql', 'neutron']
112 118
     with ssh.popen(cmd, node=node, stdin=ssh.PIPE) as proc:
113 119
         proc.stdin.write(add_networksecuritybindings_sql)
120
+        proc.stdin.write(insert_physnet1)
114 121
         proc.stdin.write(update_network_segments_sql)
115 122
 
116 123
 

Loading…
Cancel
Save