Switch to oslo_log in murano-dashboard

Change-Id: If454f698c8711f734d3220e82fc14331bd0d0661
Partial-bug: 1463093
This commit is contained in:
Nikolay Starodubtsev 2015-07-21 14:23:36 +03:00 committed by Kirill Zaitsev
parent 9d3f2588ad
commit 1e8513c556
23 changed files with 35 additions and 33 deletions

View File

@ -13,7 +13,6 @@
# under the License.
import contextlib
import logging
from django.conf import settings
from django.contrib.messages import api as msg_api
@ -21,6 +20,7 @@ from django.utils.encoding import force_unicode
from django.utils.translation import ugettext_lazy as _
from horizon import exceptions
from openstack_dashboard.api import base
from oslo_log import log as logging
import muranoclient.client as client
from muranoclient.common import exceptions as exc

View File

@ -13,9 +13,9 @@
# under the License.
from horizon import tabs
import logging
from django.utils.translation import ugettext_lazy as _
from oslo_log import log as logging
from muranodashboard.dynamic_ui import services

View File

@ -16,7 +16,6 @@ import collections
import copy
import functools
import json
import logging
import re
from django.conf import settings
@ -36,6 +35,7 @@ from horizon import exceptions
from horizon.forms import views
from horizon import messages
from horizon import tabs
from oslo_log import log as logging
from muranoclient.common import exceptions as exc
from muranodashboard import api

View File

@ -12,12 +12,11 @@
# License for the specific language governing permissions and limitations
# under the License.
import logging
from django import forms
from django.utils.translation import ugettext_lazy as _
from horizon import forms as horizon_forms
from horizon import messages
from oslo_log import log as logging
from muranodashboard import api

View File

@ -12,12 +12,11 @@
# License for the specific language governing permissions and limitations
# under the License.
import logging
from django.utils.translation import ugettext_lazy as _
from horizon import exceptions
from horizon import tables
from muranoclient.common import exceptions as exc
from oslo_log import log as logging
from muranodashboard import api

View File

@ -17,9 +17,10 @@ try:
except ImportError:
import pickle
import functools
import logging
import os
from oslo_log import log as logging
from muranodashboard.environments import consts

View File

@ -13,13 +13,13 @@
# under the License.
import logging
import re
import uuid
from django.utils.translation import ugettext_lazy as _
from horizon import exceptions
from openstack_dashboard.api import neutron
from oslo_log import log as logging
from muranodashboard.environments import api as env_api

View File

@ -15,7 +15,6 @@
import ast
import copy
import json
import logging
import netaddr
import re
@ -31,6 +30,7 @@ from horizon import forms as hz_forms
from horizon import messages
from openstack_dashboard.api import glance
from openstack_dashboard.api import nova
from oslo_log import log as logging
import yaql
from muranoclient.common import exceptions as muranoclient_exc

View File

@ -14,11 +14,11 @@
from collections import defaultdict
import copy
import logging
import types
from django import forms
from django.utils.translation import ugettext_lazy as _
from oslo_log import log as logging
import yaql
import muranodashboard.dynamic_ui.fields as fields

View File

@ -12,7 +12,6 @@
# License for the specific language governing permissions and limitations
# under the License.
import logging
import os
import re
import semantic_version
@ -20,6 +19,7 @@ import yaql
from django.utils.encoding import force_text
from django.utils.translation import ugettext_lazy as _
from oslo_log import log as logging
import six
from muranodashboard.api import packages as pkg_api

View File

@ -12,7 +12,7 @@
# License for the specific language governing permissions and limitations
# under the License.
import logging
from oslo_log import log as logging
from muranoclient.common import exceptions as exc
from muranodashboard import api

View File

@ -12,7 +12,6 @@
# License for the specific language governing permissions and limitations
# under the License.
import ast
import logging
from django.core import validators
from django import forms
@ -20,6 +19,7 @@ from django.utils.translation import ugettext_lazy as _
from horizon import exceptions
from horizon import forms as horizon_forms
from horizon import messages
from oslo_log import log as logging
from muranoclient.common import exceptions as exc
from muranodashboard.common import net

View File

@ -13,7 +13,6 @@
# under the License.
import json
import logging
from django.core.urlresolvers import reverse
from django import http as django_http
@ -25,6 +24,7 @@ from horizon import exceptions
from horizon import forms
from horizon import messages
from horizon import tables
from oslo_log import log as logging
from muranodashboard import api as api_utils
from muranodashboard.api import packages as pkg_api

View File

@ -13,7 +13,6 @@
# under the License.
import json
import logging
from django.core.urlresolvers import reverse
from django.utils.datastructures import SortedDict
@ -22,6 +21,7 @@ from horizon import exceptions
from horizon import tabs
from openstack_dashboard.api import heat as heat_api
from openstack_dashboard.api import nova as nova_api
from oslo_log import log as logging
from muranoclient.common import exceptions as exc

View File

@ -14,7 +14,6 @@
import base64
import json
import logging
from django.core.urlresolvers import reverse
from django.core.urlresolvers import reverse_lazy
@ -26,6 +25,7 @@ from horizon.forms import views
from horizon import tables
from horizon import tabs
from horizon.utils import memoized
from oslo_log import log as logging
from muranoclient.common import exceptions as exc
from muranodashboard import api as api_utils

View File

@ -13,7 +13,6 @@
# under the License.
import json
import logging
from django import forms
from django.utils.translation import ugettext_lazy as _
@ -21,6 +20,7 @@ from horizon import exceptions
from horizon import forms as horizon_forms
from horizon import messages
from openstack_dashboard.api import glance
from oslo_log import log as logging
LOG = logging.getLogger(__name__)

View File

@ -12,11 +12,11 @@
# License for the specific language governing permissions and limitations
# under the License.
import logging
import traceback
from horizon import exceptions
from horizon import middleware
from oslo_log import log as logging
logger = logging.getLogger(__name__)

View File

@ -12,9 +12,8 @@
# License for the specific language governing permissions and limitations
# under the License.
import logging
from django.conf import settings
from oslo_log import log as logging
LOG = logging.getLogger(__name__)

View File

@ -13,7 +13,6 @@
# under the License.
import json
import logging
import sys
from django.core.urlresolvers import reverse
@ -22,6 +21,7 @@ from django.utils.translation import ugettext_lazy as _
from horizon import exceptions
from horizon import forms as horizon_forms
from horizon import messages
from oslo_log import log as logging
from muranoclient.common import exceptions as exc
from muranodashboard import api

View File

@ -13,7 +13,6 @@
# under the License.
from collections import defaultdict
import logging
from django.core.urlresolvers import reverse
from django import http
@ -22,6 +21,7 @@ from django.utils.translation import ugettext_lazy as _
from django.utils.translation import ungettext_lazy
from horizon import exceptions
from horizon import tables
from oslo_log import log as logging
from muranoclient.common import exceptions as exc
from muranodashboard import api

View File

@ -13,7 +13,6 @@
# under the License.
import json
import logging
import sys
from django.contrib.formtools.wizard import views as wizard_views
@ -30,6 +29,7 @@ from horizon.utils import functions as utils
from muranoclient.common import exceptions as exc
from muranoclient.common import utils as muranoclient_utils
from openstack_dashboard.api import glance
from oslo_log import log as logging
from muranodashboard import api
from muranodashboard.api import packages as pkg_api

View File

@ -21,6 +21,8 @@ import urlparse
from glanceclient import client as gclient
from keystoneclient.v2_0 import client as ksclient
from muranoclient import client as mclient
from oslo_log import handlers
from oslo_log import log
from selenium.common import exceptions as exc
from selenium import webdriver
from selenium.webdriver.common.action_chains import ActionChains
@ -32,9 +34,9 @@ import config.config as cfg
from muranodashboard.tests.functional import consts
from muranodashboard.tests.functional import utils
log = logging.getLogger(__name__)
log.setLevel(logging.DEBUG)
log.addHandler(logging.StreamHandler())
logger = log.getLogger(__name__).logger
logger.level = logging.DEBUG
logger.addHandler(handlers.ColorHandler())
if sys.version_info >= (2, 7):
class BaseDeps(testtools.TestCase):
@ -103,7 +105,7 @@ class UITestCase(BaseDeps):
"""
name = self._testMethodName
log.exception('{0} failed'.format(name))
logger.error('{0} failed'.format(name))
screenshot_dir = './screenshots'
if not os.path.exists(screenshot_dir):
os.makedirs(screenshot_dir)
@ -229,7 +231,7 @@ class UITestCase(BaseDeps):
def wait_for_alert_message(self):
locator = (by.By.CSS_SELECTOR, 'div.alert-success')
log.debug("Waiting for a success message")
logger.debug("Waiting for a success message")
ui.WebDriverWait(self.driver, 2).until(
EC.presence_of_element_located(locator))
@ -292,7 +294,7 @@ class ImageTestCase(PackageBase):
is_public=True,
properties=property)
except Exception as e:
log.exception("Unable to create or update image in Glance")
logger.error("Unable to create or update image in Glance")
raise e
return image
@ -325,8 +327,8 @@ class FieldsTestCase(PackageBase):
self.driver.find_element_by_xpath(
consts.ErrorMessage.format(error_message))
except (exc.NoSuchElementException, exc.ElementNotVisibleException):
log.info("Message {0} is not"
" present on the page".format(error_message))
logger.info("Message {0} is not"
" present on the page".format(error_message))
self.driver.implicitly_wait(30)

View File

@ -3,9 +3,11 @@ import os
import yaml
import zipfile
from oslo_log import log
from muranodashboard.tests.functional import consts
log = logging.getLogger(__name__)
log = log.getLogger(__name__).logger
log.setLevel(logging.DEBUG)
log.addHandler(logging.StreamHandler())