Example::
import httplib
- import logging
import random
import StringIO
import time
from quantum.api import ports
from quantum.db import models
from quantum.extensions import multiport
+ from quantum.openstack.common import log as logging
import quantum.manager
from quantum import service
# vim: tabstop=4 shiftwidth=4 softtabstop=4
-# Copyright 2010 OpenStack, LLC
+# Copyright (c) 2010 OpenStack, LLC
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-import logging
import sys
import unittest
def run_tests(c=None):
- logger = logging.getLogger()
- hdlr = logging.StreamHandler()
- formatter = logging.Formatter('%(asctime)s %(levelname)s %(message)s')
- hdlr.setFormatter(formatter)
- logger.addHandler(hdlr)
- logger.setLevel(logging.DEBUG)
-
# NOTE(bgh): I'm not entirely sure why but nose gets confused here when
# calling run_tests from a plugin directory run_tests.py (instead of the
# main run_tests.py). It will call run_tests with no arguments and the
# vim: tabstop=4 shiftwidth=4 softtabstop=4
-#
+
# Copyright 2012, Nachi Ueno, NTT MCL, Inc.
# All Rights Reserved.
#
# License for the specific language governing permissions and limitations
# under the License.
-import logging
-
from cliff import lister
-
from quantumclient.common import utils
from quantumclient.quantum.v2_0.port import _format_fixed_ips
from quantumclient.quantum.v2_0 import QuantumCommand
+from quantum.openstack.common import log as logging
+
class ProbeCommand(QuantumCommand):
log = logging.getLogger(__name__ + '.ProbeCommand')
# vim: tabstop=4 shiftwidth=4 softtabstop=4
-#
+
# Copyright 2012, Nachi Ueno, NTT MCL, Inc.
# All Rights Reserved.
#
import datetime
import errno
-import logging
import os
import shlex
import socket
from quantum.agent.linux import utils
from quantum.openstack.common import cfg
from quantum.openstack.common import importutils
+from quantum.openstack.common import log as logging
from quantumclient.v2_0 import client
-LOG = logging.getLogger('test-agent')
+
+LOG = logging.getLogger(__name__)
DEVICE_OWNER_PROBE = 'network:probe'
# vim: tabstop=4 shiftwidth=4 softtabstop=4
-#
-# Copyright 2011 Cisco Systems, Inc. All rights reserved.
+
+# Copyright 2011 Cisco Systems, Inc.
+# All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
#
# @author: Ying Liu, Cisco Systems, Inc.
-import logging
-
from webob import exc
from quantum.api import api_common as common
from quantum import wsgi
-LOG = logging.getLogger('quantum.api.credentials')
-
-
class Credential(object):
"""extension class Credential"""
def __init__(self):
# vim: tabstop=4 shiftwidth=4 softtabstop=4
-#
-# Copyright 2011 Cisco Systems, Inc. All rights reserved.
+
+# Copyright 2011 Cisco Systems, Inc.
+# All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
#
# @author: Ying Liu, Cisco Systems, Inc.
-import logging
-
from webob import exc
from quantum.api import api_common as common
from quantum import wsgi
-LOG = logging.getLogger('quantum.api.multiports')
-
-
class Multiport(object):
"""extension class multiport"""
def __init__(self):
# vim: tabstop=4 shiftwidth=4 softtabstop=4
-#
-# Copyright 2011 Cisco Systems, Inc. All rights reserved.
+
+# Copyright 2011 Cisco Systems, Inc.
+# All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
#
# @author: Ying Liu, Cisco Systems, Inc.
-import logging
-
from webob import exc
from quantum.api import api_common as common
from quantum import wsgi
-LOG = logging.getLogger('quantum.api.qoss')
-
-
class Qos(object):
"""Qos extension file"""
def __init__(self):
# vim: tabstop=4 shiftwidth=4 softtabstop=4
-#
+
# Copyright 2012, Nachi Ueno, NTT MCL, Inc.
# All Rights Reserved.
#
# License for the specific language governing permissions and limitations
# under the License.
-import logging
-
from quantum.api.v2 import attributes
from quantum.common import exceptions as exc
from quantum.common.utils import find_config_file
from quantum.extensions.flavor import (FLAVOR_NETWORK, FLAVOR_ROUTER)
from quantum.openstack.common import cfg
from quantum.openstack.common import importutils
+from quantum.openstack.common import log as logging
from quantum.plugins.metaplugin.common import config
from quantum.plugins.metaplugin import meta_db_v2
from quantum.plugins.metaplugin.meta_models_v2 import (NetworkFlavor,
RouterFlavor)
from quantum import policy
-LOG = logging.getLogger("metaplugin")
+
+LOG = logging.getLogger(__name__)
# Metaplugin Exceptions
# vim: tabstop=4 shiftwidth=4 softtabstop=4
-#
+
# Copyright 2012, Nachi Ueno, NTT MCL, Inc.
# All Rights Reserved.
#
# License for the specific language governing permissions and limitations
# under the License.
-import logging
-
from quantum.db import api as db
from quantum.db import db_base_plugin_v2
from quantum.db import l3_db
from quantum.db import models_v2
from quantum.openstack.common import cfg
+from quantum.openstack.common import log as logging
from quantumclient.common import exceptions
from quantumclient.v2_0 import client
# vim: tabstop=4 shiftwidth=4 softtabstop=4
-# Copyright 2011 OpenStack LLC.
+# Copyright (c) 2011 OpenStack, LLC.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
-
-import logging
-logging.basicConfig()
-# Copyright 2012 OpenStack LLC
+# vim: tabstop=4 shiftwidth=4 softtabstop=4
+
+# Copyright (c) 2012 OpenStack, LLC
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# License for the specific language governing permissions and limitations
# under the License.
-
+import os
import unittest
+
import mock
+
from quantum.agent.linux import utils
-import os
-import logging
+import quantum.openstack.common import log as logging
-LOG = logging.getLogger('quantum.tests.database_stubs')
+LOG = logging.getLogger(__name__)
class RootwrapTestExec(unittest.TestCase):
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2011, Cisco Systems, Inc.
+# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
+#
# @author: Rohit Agarwalla, Cisco Systems, Inc.
-"""
-stubs.py provides interface methods for
-the database test cases
-"""
-import logging
+""" stubs.py provides interface methods for the database test cases """
from quantum.db import api as db
+from quantum.openstack.common import log as logging
-LOG = logging.getLogger('quantum.tests.database_stubs')
+LOG = logging.getLogger(__name__)
class QuantumDB(object):
# vim: tabstop=4 shiftwidth=4 softtabstop=4
-# Copyright 2012 OpenStack LLC.
+# Copyright (c) 2012 OpenStack, LLC.
# All Rights Reserved.
#
-# Licensed under the Apache License, Version 2.0 (the "License"); you may
-# not use this file except in compliance with the License. You may obtain
-# a copy of the License at
+# Licensed under the Apache License, Version 2.0 (the "License"); you may
+# not use this file except in compliance with the License. You may obtain
+# a copy of the License at
#
-# http://www.apache.org/licenses/LICENSE-2.0
+# http://www.apache.org/licenses/LICENSE-2.0
#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-# License for the spec
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations
+# under the License.
-import logging
import os
import unittest
from quantum.openstack.common import uuidutils
-LOG = logging.getLogger(__name__)
-
ROOTDIR = os.path.dirname(os.path.dirname(__file__))
ETCDIR = os.path.join(ROOTDIR, 'etc')
EXTDIR = os.path.join(ROOTDIR, 'unit/extensions')
+# vim: tabstop=4 shiftwidth=4 softtabstop=4
+
# Copyright (c) 2012 OpenStack, LLC.
+# All Rights Reserved.
#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
+# Licensed under the Apache License, Version 2.0 (the "License"); you may
+# not use this file except in compliance with the License. You may obtain
+# a copy of the License at
#
-# http://www.apache.org/licenses/LICENSE-2.0
+# http://www.apache.org/licenses/LICENSE-2.0
#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
-# implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations
+# under the License.
import contextlib
import copy
import datetime
-import logging
-import mock
import os
import random
+
+import mock
import unittest2
import webob.exc
from quantum.wsgi import Serializer, JSONDeserializer
-LOG = logging.getLogger(__name__)
-
DB_PLUGIN_KLASS = 'quantum.db.db_base_plugin_v2.QuantumDbPluginV2'
ROOTDIR = os.path.dirname(os.path.dirname(__file__))
ETCDIR = os.path.join(ROOTDIR, 'etc')
# vim: tabstop=4 shiftwidth=4 softtabstop=4
-# Copyright 2011 OpenStack LLC.
+
+# Copyright (c) 2011 OpenStack, LLC.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# License for the specific language governing permissions and limitations
# under the License.
-import logging
import os
import unittest
from quantum.common import exceptions
from quantum.db.db_base_plugin_v2 import QuantumDbPluginV2
from quantum.openstack.common import jsonutils
+from quantum.openstack.common import log as logging
from quantum.plugins.common import constants
from quantum.tests.unit import BaseTest
from quantum.tests.unit.extension_stubs import (
from quantum import wsgi
-LOG = logging.getLogger('quantum.tests.test_extensions')
+LOG = logging.getLogger(__name__)
ROOTDIR = os.path.dirname(os.path.dirname(__file__))
ETCDIR = os.path.join(ROOTDIR, 'etc')
# vim: tabstop=4 shiftwidth=4 softtabstop=4
-# Copyright 2012 Nicira Networks, Inc. All rights reserved.
+# Copyright 2012 Nicira Networks, Inc.
+# All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
import contextlib
import copy
import itertools
-import logging
import unittest2 as unittest
import mock
from quantum.extensions import l3
from quantum import manager
from quantum.openstack.common import cfg
+from quantum.openstack.common import log as logging
from quantum.openstack.common import uuidutils
from quantum.tests.unit import test_api_v2
from quantum.tests.unit import test_db_plugin
+# vim: tabstop=4 shiftwidth=4 softtabstop=4
+
# Copyright (c) 2012 OpenStack, LLC.
+# All Rights Reserved.
#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
+# Licensed under the Apache License, Version 2.0 (the "License"); you may
+# not use this file except in compliance with the License. You may obtain
+# a copy of the License at
#
-# http://www.apache.org/licenses/LICENSE-2.0
+# http://www.apache.org/licenses/LICENSE-2.0
#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
-# implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations
+# under the License.
-import logging
import types
import unittest2
from quantum.common.test_lib import test_config
from quantum.manager import QuantumManager
from quantum.openstack.common import cfg
+from quantum.openstack.common import log as logging
from quantum.plugins.common import constants
from quantum.plugins.services.dummy.dummy_plugin import QuantumDummyPlugin