[openstack-nova] allow nova-manage to auto support the new cfg format

Pádraig Brady pbrady at fedoraproject.org
Mon Mar 5 14:52:57 UTC 2012


commit 0244ad46e64ba381572e80fae06ef2ae072816c9
Author: Pádraig Brady <P at draigBrady.com>
Date:   Mon Mar 5 14:51:19 2012 +0000

    allow nova-manage to auto support the new cfg format

 ...manage-to-auto-support-the-new-cfg-format.patch |   37 ++++++++++++++++++++
 openstack-nova.spec                                |    2 +
 2 files changed, 39 insertions(+), 0 deletions(-)
---
diff --git a/0004-allow-nova-manage-to-auto-support-the-new-cfg-format.patch b/0004-allow-nova-manage-to-auto-support-the-new-cfg-format.patch
new file mode 100644
index 0000000..5ac0cd1
--- /dev/null
+++ b/0004-allow-nova-manage-to-auto-support-the-new-cfg-format.patch
@@ -0,0 +1,37 @@
+From 2cfdc6c1dee8a9b58585cf0c2c19f0f0693b221c Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?P=C3=A1draig=20Brady?= <P at draigBrady.com>
+Date: Mon, 5 Mar 2012 14:48:21 +0000
+Subject: [PATCH] allow nova-manage to auto support the new cfg format
+
+This is a temprorary work around to support the
+new config file format transparently.
+---
+ bin/nova-manage |   15 +++++++++++++++
+ 1 files changed, 15 insertions(+), 0 deletions(-)
+
+diff --git a/bin/nova-manage b/bin/nova-manage
+index 4927614..a8eaec4 100755
+--- a/bin/nova-manage
++++ b/bin/nova-manage
+@@ -97,6 +97,21 @@ from nova.compute import vm_states
+ from nova.db import migration
+ from nova.volume import volume_types
+ 
++# PB: Temp hack to support new config file format
++def handle_new_cfg_format():
++    flagfile=utils.default_flagfile()
++    ff=file(flagfile)
++    ini = '[DEFAULT]' in ff.read(64)
++    ff.close()
++    if ini and not any('--config-file' in i for i in sys.argv):
++        for i in range(len(sys.argv)):
++            if '--flagfile' in sys.argv[i]:
++                del sys.argv[i]
++                break
++        sys.argv.insert(1,'--config-file='+flagfile)
++        print sys.argv
++handle_new_cfg_format()
++
+ FLAGS = flags.FLAGS
+ flags.DECLARE('flat_network_bridge', 'nova.network.manager')
+ flags.DECLARE('num_networks', 'nova.network.manager')
diff --git a/openstack-nova.spec b/openstack-nova.spec
index 02c6082..bd83466 100644
--- a/openstack-nova.spec
+++ b/openstack-nova.spec
@@ -37,6 +37,7 @@ Source23:         openstack-nova-db-setup
 Patch0001: 0001-Ensure-we-don-t-access-the-net-when-building-docs.patch
 Patch0002: 0002-Add-VIF-and-interface-drivers-for-the-Linux-Bridge-p.patch
 Patch0003: 0003-Adds-soft-reboot-support-to-libvirt.patch
+Patch0004: 0004-allow-nova-manage-to-auto-support-the-new-cfg-format.patch
 
 BuildArch:        noarch
 BuildRequires:    intltool
@@ -174,6 +175,7 @@ This package contains documentation files for nova.
 %patch0001 -p1
 %patch0002 -p1
 %patch0003 -p1
+%patch0004 -p1
 
 find . \( -name .gitignore -o -name .placeholder \) -delete
 


More information about the scm-commits mailing list