Browse code

Extract create_nova_conf() from init_nova()

Allows creating a new nova.conf without wiping the database,
say, during an upgrade.

Change-Id: I7703b54bc3a32485b3cdab8d6185f93a6675040d

Dean Troyer authored on 2012/10/09 08:12:14
Showing 2 changed files
... ...
@@ -12,6 +12,7 @@
12 12
 #
13 13
 # install_nova
14 14
 # configure_nova
15
+# create_nova_conf
15 16
 # init_nova
16 17
 # start_nova
17 18
 # stop_nova
... ...
@@ -274,8 +275,8 @@ EOF'
274 274
     fi
275 275
 }
276 276
 
277
-# init_nova() - Initialize databases, etc.
278
-function init_nova() {
277
+# create_nova_conf() - Create a new nova.conf file
278
+function create_nova_conf() {
279 279
     # Remove legacy ``nova.conf``
280 280
     rm -f $NOVA_DIR/bin/nova.conf
281 281
 
... ...
@@ -352,7 +353,10 @@ function init_nova() {
352 352
         # Attempt to convert flags to options
353 353
         add_nova_opt ${I//--}
354 354
     done
355
+}
355 356
 
357
+# init_nova() - Initialize databases, etc.
358
+function init_nova() {
356 359
     # Nova Database
357 360
     # -------------
358 361
 
... ...
@@ -1728,6 +1728,8 @@ fi
1728 1728
 
1729 1729
 if is_service_enabled nova; then
1730 1730
     echo_summary "Configuring Nova"
1731
+    # Rebuild the config file from scratch
1732
+    create_nova_conf
1731 1733
     init_nova
1732 1734
 fi
1733 1735