[lxc-devel] [nova-lxd/master] Transition to nova.conf

zulcss on Github lxc-bot at linuxcontainers.org
Thu May 19 23:51:28 UTC 2016


A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 531 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20160519/9e8a01cc/attachment.bin>
-------------- next part --------------
From 17c7d55d75fde1d204958c086e45979ab648d8d7 Mon Sep 17 00:00:00 2001
From: Chuck Short <chuck.short at canonical.com>
Date: Thu, 19 May 2016 19:48:58 -0400
Subject: [PATCH] Transition to nova.conf

In the mitaka cycle, nova.conf has centralized all
the Nova configuration in one place. Transition
nova-lxd to do the same thing.

Signed-off-by: Chuck Short <chuck.short at canonical.com>
---
 nova/tests/unit/virt/lxd/test_driver_api.py | 3 ++-
 nova/virt/lxd/container_firewall.py         | 4 ++--
 nova/virt/lxd/container_snapshot.py         | 4 ++--
 nova/virt/lxd/driver.py                     | 1 +
 nova/virt/lxd/host.py                       | 4 ++--
 nova/virt/lxd/image.py                      | 4 ++--
 nova/virt/lxd/operations.py                 | 4 ++--
 nova/virt/lxd/utils.py                      | 4 ++--
 nova/virt/lxd/vif.py                        | 4 ++--
 9 files changed, 17 insertions(+), 15 deletions(-)

diff --git a/nova/tests/unit/virt/lxd/test_driver_api.py b/nova/tests/unit/virt/lxd/test_driver_api.py
index ff5fdd5..ea07616 100644
--- a/nova/tests/unit/virt/lxd/test_driver_api.py
+++ b/nova/tests/unit/virt/lxd/test_driver_api.py
@@ -21,9 +21,10 @@
 
 import ddt
 import mock
-from oslo_config import cfg
 import six
 
+from oslo_config import cfg
+
 from nova.compute import arch
 from nova.compute import hv_type
 from nova.compute import power_state
diff --git a/nova/virt/lxd/container_firewall.py b/nova/virt/lxd/container_firewall.py
index 9f3a11f..70e76c0 100644
--- a/nova/virt/lxd/container_firewall.py
+++ b/nova/virt/lxd/container_firewall.py
@@ -13,12 +13,12 @@
 #    License for the specific language governing permissions and limitations
 #    under the License.
 
+import nova.conf
 from nova.virt import firewall
 
-from oslo_config import cfg
 from oslo_log import log as logging
 
-CONF = cfg.CONF
+CONF = nova.conf.CONF
 LOG = logging.getLogger(__name__)
 
 
diff --git a/nova/virt/lxd/container_snapshot.py b/nova/virt/lxd/container_snapshot.py
index 376261f..3f750e0 100644
--- a/nova/virt/lxd/container_snapshot.py
+++ b/nova/virt/lxd/container_snapshot.py
@@ -14,6 +14,7 @@
 #    License for the specific language governing permissions and limitations
 #    under the License.from oslo_config import cfg
 
+import nova.conf
 from nova.compute import task_states
 from nova import exception
 from nova import i18n
@@ -21,7 +22,6 @@
 import os
 
 from oslo_concurrency import lockutils
-from oslo_config import cfg
 from oslo_log import log as logging
 from oslo_utils import excutils
 
@@ -30,7 +30,7 @@
 _ = i18n._
 _LE = i18n._LE
 
-CONF = cfg.CONF
+CONF = nova.conf.CONF
 LOG = logging.getLogger(__name__)
 
 IMAGE_API = image.API()
diff --git a/nova/virt/lxd/driver.py b/nova/virt/lxd/driver.py
index e56fc6c..c77560a 100644
--- a/nova/virt/lxd/driver.py
+++ b/nova/virt/lxd/driver.py
@@ -16,6 +16,7 @@
 
 from __future__ import absolute_import
 
+import nova.conf
 from nova import exception
 from nova import i18n
 from nova.virt import driver
diff --git a/nova/virt/lxd/host.py b/nova/virt/lxd/host.py
index 587539c..2aafbb9 100644
--- a/nova/virt/lxd/host.py
+++ b/nova/virt/lxd/host.py
@@ -18,6 +18,7 @@
 #    under the License.
 
 
+import nova.conf
 from nova.compute import arch
 from nova.compute import hv_type
 from nova.compute import utils as compute_utils
@@ -31,7 +32,6 @@
 from pylxd.deprecated import exceptions as lxd_exceptions
 import socket
 
-from oslo_config import cfg
 from oslo_log import log as logging
 from oslo_serialization import jsonutils
 from oslo_utils import units
@@ -39,7 +39,7 @@
 
 _ = i18n._
 _LW = i18n._LW
-CONF = cfg.CONF
+CONF = nova.conf.CONF
 LOG = logging.getLogger(__name__)
 
 
diff --git a/nova/virt/lxd/image.py b/nova/virt/lxd/image.py
index 90de759..dee13ac 100644
--- a/nova/virt/lxd/image.py
+++ b/nova/virt/lxd/image.py
@@ -16,6 +16,7 @@
 import hashlib
 import io
 import json
+import nova.conf
 from nova.compute import arch
 from nova import exception
 from nova import i18n
@@ -29,7 +30,6 @@
 
 from oslo_concurrency import lockutils
 from oslo_concurrency import processutils
-from oslo_config import cfg
 from oslo_log import log as logging
 from oslo_utils import excutils
 from oslo_utils import fileutils
@@ -40,7 +40,7 @@
 _ = i18n._
 _LE = i18n._LE
 
-CONF = cfg.CONF
+CONF = nova.conf.CONF
 LOG = logging.getLogger(__name__)
 IMAGE_API = image.API()
 
diff --git a/nova/virt/lxd/operations.py b/nova/virt/lxd/operations.py
index 84fb80c..43ec597 100644
--- a/nova/virt/lxd/operations.py
+++ b/nova/virt/lxd/operations.py
@@ -15,6 +15,7 @@
 #    under the License.
 
 
+import nova.conf
 from nova.api.metadata import base as instance_metadata
 from nova.virt import configdrive
 from nova.virt import hardware
@@ -22,7 +23,6 @@
 import pwd
 import shutil
 
-from oslo_config import cfg
 from oslo_log import log as logging
 from oslo_utils import excutils
 from oslo_utils import fileutils
@@ -45,7 +45,7 @@
 _LW = i18n._LW
 _LI = i18n._LI
 
-CONF = cfg.CONF
+CONF = nova.conf.CONF
 CONF.import_opt('vif_plugging_timeout', 'nova.virt.driver')
 CONF.import_opt('vif_plugging_is_fatal', 'nova.virt.driver')
 LOG = logging.getLogger(__name__)
diff --git a/nova/virt/lxd/utils.py b/nova/virt/lxd/utils.py
index 7ad822f..3de3f9a 100644
--- a/nova/virt/lxd/utils.py
+++ b/nova/virt/lxd/utils.py
@@ -15,9 +15,9 @@
 
 import os
 
-from oslo_config import cfg
+import nova.conf
 
-CONF = cfg.CONF
+CONF = nova.conf.CONF
 
 
 class LXDContainerDirectories(object):
diff --git a/nova/virt/lxd/vif.py b/nova/virt/lxd/vif.py
index deada73..5c8ad23 100644
--- a/nova/virt/lxd/vif.py
+++ b/nova/virt/lxd/vif.py
@@ -13,9 +13,9 @@
 #    under the License.
 
 from oslo_concurrency import processutils
-from oslo_config import cfg
 from oslo_log import log as logging
 
+import nova.conf
 from nova import exception
 from nova import i18n
 from nova.network import linux_net
@@ -25,7 +25,7 @@
 _ = i18n._
 _LE = i18n._LE
 
-CONF = cfg.CONF
+CONF = nova.conf.CONF
 
 LOG = logging.getLogger(__name__)
 


More information about the lxc-devel mailing list