move to use oslo.i18/utils/serialization

nova is switching to use oslo.i18n, oslo.utils, oslo.serialization with
change
d0e0ade702
nova.openstack.common removed some modules that has been replaced by the
ones from oslo.i18n, oslo.utils, oslo.serialization.

Closes-Bug: #1384039
Change-Id: I9fae9b61599a50b54fc40552b2c90fceb75d8522
This commit is contained in:
terryyao 2014-10-23 00:07:25 +08:00
parent d2d4e304be
commit 7b84b07f0b
16 changed files with 39 additions and 44 deletions

View File

@ -1,5 +1,5 @@
#!/usr/bin/env python
# Copyright 2013 IBM Corp.
# Copyright 2013, 2014 IBM Corp.
"""Starter script for the PowerVC cinder-volume Service."""
@ -18,11 +18,11 @@ POSSIBLE_TOPDIR = os.path.normpath(os.path.join(
if os.path.exists(os.path.join(POSSIBLE_TOPDIR, 'powervc', '__init__.py')):
sys.path.insert(0, POSSIBLE_TOPDIR)
from cinder.openstack.common import gettextutils
from oslo import i18n
# TODO RYKAL
# This should go in the base __init__ folder I think
gettextutils.install('cinder')
i18n.install('cinder')
# NOTE: Import powervc driver common config at the very beginning to parse
# AMQP.

View File

@ -1,4 +1,4 @@
# Copyright 2013 IBM Corp.
# Copyright 2013, 2014 IBM Corp.
# mock module
import mock
import sys
@ -7,8 +7,8 @@ import unittest
sys.modules['powervc.common.client'] = mock.MagicMock()
# import _
from cinder.openstack.common import gettextutils
gettextutils.install('cinder')
from oslo import i18n
i18n.install('cinder')
from powervc.common import config
from cinder import exception
from cinder import db

View File

@ -1,6 +1,6 @@
# Copyright 2013 IBM Corp.
from cinder.openstack.common import gettextutils
gettextutils.install('cinder')
# Copyright 2013, 2014 IBM Corp.
from oslo import i18n
i18n.install('cinder')
import unittest
import mox
from powervc.volume.manager.manager import PowerVCCinderManager

View File

@ -5,7 +5,7 @@ import re
import urlparse
import powervc.common.client.delegate as delegate
from glanceclient.openstack.common import importutils
from oslo.utils import importutils
from powervc.common.constants import SERVICE_TYPES as SERVICE_TYPES
from powervc.common import netutils
from powervc.common.client.extensions.glance import Extended_V2_Client

View File

@ -1,4 +1,4 @@
# Copyright 2013 IBM Corp.
# Copyright 2013, 2014 IBM Corp.
import logging
import exception
import os
@ -7,7 +7,7 @@ import threading
import time
from eventlet.semaphore import Semaphore
from glanceclient.openstack.common import importutils
from oslo.utils import importutils
from powervc.common import config
from powervc.common import constants
from powervc.common.exception import StorageConnectivityGroupNotFound

View File

@ -1,12 +1,12 @@
# Copyright 2013 IBM Corp.
# Copyright 2013, 2014 IBM Corp.
import unittest
import mox
from mock import MagicMock
import glanceclient.v1.images as imagesV1
import glanceclient.v1.image_members as membersV1
from glanceclient.openstack.common import gettextutils
gettextutils.install('common-glance-client-ut')
from oslo import i18n
i18n.install('common-glance-client-ut')
import powervc.common.utils as common_utils

View File

@ -1,5 +1,5 @@
#!/usr/bin/env python
# Copyright 2013 IBM Corp.
# Copyright 2013, 2014 IBM Corp.
"""Starter script for the PowerVC Driver ImageManager Service."""
@ -24,8 +24,8 @@ if os.path.exists(os.path.join(POSSIBLE_TOPDIR, 'powervc', '__init__.py')):
# TODO RYKAL
# This should go in the base __init__ folder I think
from nova.openstack.common import gettextutils
gettextutils.install('glance')
from oslo import i18n
i18n.install('glance')
# NOTE: Import powervc driver common config at the very beginning to parse
# AMQP.
@ -35,7 +35,7 @@ from powervc.glance.common import config as glance_config
from nova.openstack.common import log
from nova.openstack.common import service
from nova.openstack.common import importutils
from oslo.utils import importutils
CONF = glance_config.CONF

View File

@ -1,4 +1,4 @@
# Copyright 2013 IBM Corp.
# Copyright 2013, 2014 IBM Corp.
"""
PowerVC Driver ImageManager service
@ -16,8 +16,8 @@ from powervc.common import config
from nova.openstack.common import service
from nova.openstack.common import log as logging
from nova.openstack.common import timeutils
from nova.openstack.common import jsonutils
from oslo.utils import timeutils
from oslo.serialization import jsonutils
from glanceclient.v1 import images as v1images
from glanceclient.exc import CommunicationError
from glanceclient.exc import HTTPNotFound

View File

@ -1,5 +1,5 @@
#!/usr/bin/env python
# Copyright 2013 IBM Corp.
# Copyright 2013, 2014 IBM Corp.
import os
import sys
@ -31,8 +31,8 @@ if os.path.exists(os.path.join(POSSIBLE_TOPDIR, 'powervc', '__init__.py')):
# TODO RYKAL
# This should go in the base __init__ folder I think
from neutron.openstack.common import gettextutils
gettextutils.install('neutron')
from oslo import i18n
i18n.install('neutron')
# NOTE: Import powervc driver common config at the very beginning to parse
# AMQP.

View File

@ -13,11 +13,7 @@ POSSIBLE_TOPDIR = os.path.normpath(os.path.join(
if os.path.exists(os.path.join(POSSIBLE_TOPDIR, 'powervc', '__init__.py')):
sys.path.insert(0, POSSIBLE_TOPDIR)
from nova.openstack.common import gettextutils
# TODO RYKAL
# This should go in the base __init__ folder I think
gettextutils.install('nova')
from nova import i18n
from powervc.nova.cmd.compute import main

View File

@ -1,4 +1,4 @@
# Copyright 2013 IBM Corp.
# Copyright 2013, 2014 IBM Corp.
"""
Doing PowerVC initialize work, including image, instance sync.
@ -25,12 +25,12 @@ from nova.image import glance
from nova.compute import flavors
from nova.compute import task_states
from nova.compute import vm_states
from nova.openstack.common import importutils
from oslo.utils import importutils
from nova.openstack.common import log as logging
from nova.openstack.common import timeutils
from oslo.utils import timeutils
from nova.openstack.common import loopingcall
from nova.openstack.common.loopingcall import LoopingCallDone
from nova.openstack.common import jsonutils
from oslo.serialization import jsonutils
from nova import objects
from nova.objects import instance as instance_obj
from nova.objects import base as obj_base

View File

@ -1,4 +1,4 @@
# Copyright 2013 IBM Corp.
# Copyright 2013, 2014 IBM Corp.
import nova
from novaclient.exceptions import NotFound
from novaclient.exceptions import BadRequest
@ -6,9 +6,9 @@ from nova import exception
from nova.compute import task_states
from nova.image import glance
from nova.virt import driver
from nova.openstack.common import jsonutils
from oslo.serialization import jsonutils
from nova.openstack.common import log as logging
from nova.openstack.common import excutils
from oslo.utils import excutils
from powervc.nova.driver.virt.powervc import service
from powervc.nova.driver.compute import constants
from powervc.nova.common import exception as pvc_exception

View File

@ -1,4 +1,4 @@
# Copyright 2013 IBM Corp.
# Copyright 2013, 2014 IBM Corp.
import httplib
from novaclient import exceptions
@ -17,7 +17,7 @@ from powervc.common import utils
from powervc import utils as powervc_utils
from powervc.common.gettextutils import _
from nova.exception import Invalid
from nova.openstack.common import excutils
from oslo.utils import excutils
from powervc.nova.driver.compute import task_states
from nova.compute import flavors
from novaclient.v1_1 import servers

View File

@ -4,7 +4,7 @@ from webob import exc
from nova.api.openstack import extensions
from nova.api.openstack import wsgi
from nova import compute
from nova.openstack.common.gettextutils import _
from nova.i18n import _
from powervc.common import constants as common_constants
from powervc.common import config

View File

@ -1,9 +1,8 @@
# Copyright 2013 IBM Corp.
# Copyright 2013, 2014 IBM Corp.
import unittest
import mox
from nova.openstack.common import gettextutils
gettextutils.install('nova')
from nova.i18n import _
from nova.compute import flavors

View File

@ -7,7 +7,7 @@ import os
from nova import exception
os.environ['EVENTLET_NO_GREENDNS'] = 'yes'
from nova import test
from nova.openstack.common import jsonutils
from oslo.serialization import jsonutils
from nova.compute import task_states
from nova.image import glance
from nova import db