Don't use oslo logging in the client

Else this causes DuplicateOptError because both mistralclient
and the project that imports mistralclient will have registered
the logging options.

Closes-bug: #1325478
Change-Id: Id64fc61964d2f638be45bcf783275cb4d214aa2f
This commit is contained in:
Angus Salkeld
2014-06-02 19:48:57 +10:00
parent df0ba35204
commit 069f19e0b2
7 changed files with 33 additions and 6 deletions

View File

@@ -16,7 +16,7 @@
import json
from mistralclient.openstack.common import log as logging
import logging
LOG = logging.getLogger(__name__)

View File

@@ -16,7 +16,7 @@
import requests
from mistralclient.openstack.common import log as logging
import logging
LOG = logging.getLogger(__name__)

View File

@@ -15,12 +15,12 @@
#
import json
import logging
from cliff.command import Command as BaseCommand
from cliff.lister import Lister as ListCommand
from cliff.show import ShowOne as ShowCommand
from mistralclient.openstack.common import log as logging
from mistralclient.api.executions import ExecutionManager
LOG = logging.getLogger(__name__)

View File

@@ -14,10 +14,11 @@
# under the License.
#
import logging
from cliff.lister import Lister as ListCommand
from cliff.show import ShowOne as ShowCommand
from mistralclient.openstack.common import log as logging
from mistralclient.api.tasks import TaskManager
LOG = logging.getLogger(__name__)

View File

@@ -15,12 +15,12 @@
#
import argparse
import logging
from cliff.command import Command as BaseCommand
from cliff.lister import Lister as ListCommand
from cliff.show import ShowOne as ShowCommand
from mistralclient.openstack.common import log as logging
from mistralclient.api.workbooks import WorkbookManager
LOG = logging.getLogger(__name__)

View File

@@ -18,10 +18,10 @@
Command-line interface to the Mistral APIs
"""
import logging
import sys
from mistralclient.openstack.common.cliutils import env
from mistralclient.openstack.common import log as logging
from mistralclient.api.client import Client

View File

@@ -0,0 +1,26 @@
# Copyright 2014 Rackspace Hosting
#
# 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
#
# 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.
from mistralclient.openstack.common import log as logging
from mistralclient.tests import base
LOG = logging.getLogger(__name__)
class TestSolumclient(base.BaseCommandTest):
def test_can_use_oslo_logging(self):
# Just showing that we can import and use logging
LOG.info('Nothing to see here.')