Switch to oslo_log in murano-dashboard
Change-Id: If454f698c8711f734d3220e82fc14331bd0d0661 Partial-bug: 1463093
This commit is contained in:
parent
9d3f2588ad
commit
1e8513c556
|
@ -13,7 +13,6 @@
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
import contextlib
|
import contextlib
|
||||||
import logging
|
|
||||||
|
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
from django.contrib.messages import api as msg_api
|
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 django.utils.translation import ugettext_lazy as _
|
||||||
from horizon import exceptions
|
from horizon import exceptions
|
||||||
from openstack_dashboard.api import base
|
from openstack_dashboard.api import base
|
||||||
|
from oslo_log import log as logging
|
||||||
|
|
||||||
import muranoclient.client as client
|
import muranoclient.client as client
|
||||||
from muranoclient.common import exceptions as exc
|
from muranoclient.common import exceptions as exc
|
||||||
|
|
|
@ -13,9 +13,9 @@
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
from horizon import tabs
|
from horizon import tabs
|
||||||
import logging
|
|
||||||
|
|
||||||
from django.utils.translation import ugettext_lazy as _
|
from django.utils.translation import ugettext_lazy as _
|
||||||
|
from oslo_log import log as logging
|
||||||
|
|
||||||
from muranodashboard.dynamic_ui import services
|
from muranodashboard.dynamic_ui import services
|
||||||
|
|
||||||
|
|
|
@ -16,7 +16,6 @@ import collections
|
||||||
import copy
|
import copy
|
||||||
import functools
|
import functools
|
||||||
import json
|
import json
|
||||||
import logging
|
|
||||||
import re
|
import re
|
||||||
|
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
|
@ -36,6 +35,7 @@ from horizon import exceptions
|
||||||
from horizon.forms import views
|
from horizon.forms import views
|
||||||
from horizon import messages
|
from horizon import messages
|
||||||
from horizon import tabs
|
from horizon import tabs
|
||||||
|
from oslo_log import log as logging
|
||||||
|
|
||||||
from muranoclient.common import exceptions as exc
|
from muranoclient.common import exceptions as exc
|
||||||
from muranodashboard import api
|
from muranodashboard import api
|
||||||
|
|
|
@ -12,12 +12,11 @@
|
||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
import logging
|
|
||||||
|
|
||||||
from django import forms
|
from django import forms
|
||||||
from django.utils.translation import ugettext_lazy as _
|
from django.utils.translation import ugettext_lazy as _
|
||||||
from horizon import forms as horizon_forms
|
from horizon import forms as horizon_forms
|
||||||
from horizon import messages
|
from horizon import messages
|
||||||
|
from oslo_log import log as logging
|
||||||
|
|
||||||
from muranodashboard import api
|
from muranodashboard import api
|
||||||
|
|
||||||
|
|
|
@ -12,12 +12,11 @@
|
||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
import logging
|
|
||||||
|
|
||||||
from django.utils.translation import ugettext_lazy as _
|
from django.utils.translation import ugettext_lazy as _
|
||||||
from horizon import exceptions
|
from horizon import exceptions
|
||||||
from horizon import tables
|
from horizon import tables
|
||||||
from muranoclient.common import exceptions as exc
|
from muranoclient.common import exceptions as exc
|
||||||
|
from oslo_log import log as logging
|
||||||
|
|
||||||
from muranodashboard import api
|
from muranodashboard import api
|
||||||
|
|
||||||
|
|
|
@ -17,9 +17,10 @@ try:
|
||||||
except ImportError:
|
except ImportError:
|
||||||
import pickle
|
import pickle
|
||||||
import functools
|
import functools
|
||||||
import logging
|
|
||||||
import os
|
import os
|
||||||
|
|
||||||
|
from oslo_log import log as logging
|
||||||
|
|
||||||
from muranodashboard.environments import consts
|
from muranodashboard.environments import consts
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -13,13 +13,13 @@
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
|
|
||||||
import logging
|
|
||||||
import re
|
import re
|
||||||
import uuid
|
import uuid
|
||||||
|
|
||||||
from django.utils.translation import ugettext_lazy as _
|
from django.utils.translation import ugettext_lazy as _
|
||||||
from horizon import exceptions
|
from horizon import exceptions
|
||||||
from openstack_dashboard.api import neutron
|
from openstack_dashboard.api import neutron
|
||||||
|
from oslo_log import log as logging
|
||||||
|
|
||||||
from muranodashboard.environments import api as env_api
|
from muranodashboard.environments import api as env_api
|
||||||
|
|
||||||
|
|
|
@ -15,7 +15,6 @@
|
||||||
import ast
|
import ast
|
||||||
import copy
|
import copy
|
||||||
import json
|
import json
|
||||||
import logging
|
|
||||||
import netaddr
|
import netaddr
|
||||||
import re
|
import re
|
||||||
|
|
||||||
|
@ -31,6 +30,7 @@ from horizon import forms as hz_forms
|
||||||
from horizon import messages
|
from horizon import messages
|
||||||
from openstack_dashboard.api import glance
|
from openstack_dashboard.api import glance
|
||||||
from openstack_dashboard.api import nova
|
from openstack_dashboard.api import nova
|
||||||
|
from oslo_log import log as logging
|
||||||
import yaql
|
import yaql
|
||||||
|
|
||||||
from muranoclient.common import exceptions as muranoclient_exc
|
from muranoclient.common import exceptions as muranoclient_exc
|
||||||
|
|
|
@ -14,11 +14,11 @@
|
||||||
|
|
||||||
from collections import defaultdict
|
from collections import defaultdict
|
||||||
import copy
|
import copy
|
||||||
import logging
|
|
||||||
import types
|
import types
|
||||||
|
|
||||||
from django import forms
|
from django import forms
|
||||||
from django.utils.translation import ugettext_lazy as _
|
from django.utils.translation import ugettext_lazy as _
|
||||||
|
from oslo_log import log as logging
|
||||||
import yaql
|
import yaql
|
||||||
|
|
||||||
import muranodashboard.dynamic_ui.fields as fields
|
import muranodashboard.dynamic_ui.fields as fields
|
||||||
|
|
|
@ -12,7 +12,6 @@
|
||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
import logging
|
|
||||||
import os
|
import os
|
||||||
import re
|
import re
|
||||||
import semantic_version
|
import semantic_version
|
||||||
|
@ -20,6 +19,7 @@ import yaql
|
||||||
|
|
||||||
from django.utils.encoding import force_text
|
from django.utils.encoding import force_text
|
||||||
from django.utils.translation import ugettext_lazy as _
|
from django.utils.translation import ugettext_lazy as _
|
||||||
|
from oslo_log import log as logging
|
||||||
import six
|
import six
|
||||||
|
|
||||||
from muranodashboard.api import packages as pkg_api
|
from muranodashboard.api import packages as pkg_api
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
import logging
|
from oslo_log import log as logging
|
||||||
|
|
||||||
from muranoclient.common import exceptions as exc
|
from muranoclient.common import exceptions as exc
|
||||||
from muranodashboard import api
|
from muranodashboard import api
|
||||||
|
|
|
@ -12,7 +12,6 @@
|
||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
import ast
|
import ast
|
||||||
import logging
|
|
||||||
|
|
||||||
from django.core import validators
|
from django.core import validators
|
||||||
from django import forms
|
from django import forms
|
||||||
|
@ -20,6 +19,7 @@ from django.utils.translation import ugettext_lazy as _
|
||||||
from horizon import exceptions
|
from horizon import exceptions
|
||||||
from horizon import forms as horizon_forms
|
from horizon import forms as horizon_forms
|
||||||
from horizon import messages
|
from horizon import messages
|
||||||
|
from oslo_log import log as logging
|
||||||
|
|
||||||
from muranoclient.common import exceptions as exc
|
from muranoclient.common import exceptions as exc
|
||||||
from muranodashboard.common import net
|
from muranodashboard.common import net
|
||||||
|
|
|
@ -13,7 +13,6 @@
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
import json
|
import json
|
||||||
import logging
|
|
||||||
|
|
||||||
from django.core.urlresolvers import reverse
|
from django.core.urlresolvers import reverse
|
||||||
from django import http as django_http
|
from django import http as django_http
|
||||||
|
@ -25,6 +24,7 @@ from horizon import exceptions
|
||||||
from horizon import forms
|
from horizon import forms
|
||||||
from horizon import messages
|
from horizon import messages
|
||||||
from horizon import tables
|
from horizon import tables
|
||||||
|
from oslo_log import log as logging
|
||||||
|
|
||||||
from muranodashboard import api as api_utils
|
from muranodashboard import api as api_utils
|
||||||
from muranodashboard.api import packages as pkg_api
|
from muranodashboard.api import packages as pkg_api
|
||||||
|
|
|
@ -13,7 +13,6 @@
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
import json
|
import json
|
||||||
import logging
|
|
||||||
|
|
||||||
from django.core.urlresolvers import reverse
|
from django.core.urlresolvers import reverse
|
||||||
from django.utils.datastructures import SortedDict
|
from django.utils.datastructures import SortedDict
|
||||||
|
@ -22,6 +21,7 @@ from horizon import exceptions
|
||||||
from horizon import tabs
|
from horizon import tabs
|
||||||
from openstack_dashboard.api import heat as heat_api
|
from openstack_dashboard.api import heat as heat_api
|
||||||
from openstack_dashboard.api import nova as nova_api
|
from openstack_dashboard.api import nova as nova_api
|
||||||
|
from oslo_log import log as logging
|
||||||
|
|
||||||
|
|
||||||
from muranoclient.common import exceptions as exc
|
from muranoclient.common import exceptions as exc
|
||||||
|
|
|
@ -14,7 +14,6 @@
|
||||||
|
|
||||||
import base64
|
import base64
|
||||||
import json
|
import json
|
||||||
import logging
|
|
||||||
|
|
||||||
from django.core.urlresolvers import reverse
|
from django.core.urlresolvers import reverse
|
||||||
from django.core.urlresolvers import reverse_lazy
|
from django.core.urlresolvers import reverse_lazy
|
||||||
|
@ -26,6 +25,7 @@ from horizon.forms import views
|
||||||
from horizon import tables
|
from horizon import tables
|
||||||
from horizon import tabs
|
from horizon import tabs
|
||||||
from horizon.utils import memoized
|
from horizon.utils import memoized
|
||||||
|
from oslo_log import log as logging
|
||||||
|
|
||||||
from muranoclient.common import exceptions as exc
|
from muranoclient.common import exceptions as exc
|
||||||
from muranodashboard import api as api_utils
|
from muranodashboard import api as api_utils
|
||||||
|
|
|
@ -13,7 +13,6 @@
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
import json
|
import json
|
||||||
import logging
|
|
||||||
|
|
||||||
from django import forms
|
from django import forms
|
||||||
from django.utils.translation import ugettext_lazy as _
|
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 forms as horizon_forms
|
||||||
from horizon import messages
|
from horizon import messages
|
||||||
from openstack_dashboard.api import glance
|
from openstack_dashboard.api import glance
|
||||||
|
from oslo_log import log as logging
|
||||||
|
|
||||||
LOG = logging.getLogger(__name__)
|
LOG = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
|
@ -12,11 +12,11 @@
|
||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
import logging
|
|
||||||
import traceback
|
import traceback
|
||||||
|
|
||||||
from horizon import exceptions
|
from horizon import exceptions
|
||||||
from horizon import middleware
|
from horizon import middleware
|
||||||
|
from oslo_log import log as logging
|
||||||
|
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
|
@ -12,9 +12,8 @@
|
||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
import logging
|
|
||||||
|
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
|
from oslo_log import log as logging
|
||||||
|
|
||||||
LOG = logging.getLogger(__name__)
|
LOG = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
|
@ -13,7 +13,6 @@
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
import json
|
import json
|
||||||
import logging
|
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
from django.core.urlresolvers import reverse
|
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 exceptions
|
||||||
from horizon import forms as horizon_forms
|
from horizon import forms as horizon_forms
|
||||||
from horizon import messages
|
from horizon import messages
|
||||||
|
from oslo_log import log as logging
|
||||||
|
|
||||||
from muranoclient.common import exceptions as exc
|
from muranoclient.common import exceptions as exc
|
||||||
from muranodashboard import api
|
from muranodashboard import api
|
||||||
|
|
|
@ -13,7 +13,6 @@
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
from collections import defaultdict
|
from collections import defaultdict
|
||||||
import logging
|
|
||||||
|
|
||||||
from django.core.urlresolvers import reverse
|
from django.core.urlresolvers import reverse
|
||||||
from django import http
|
from django import http
|
||||||
|
@ -22,6 +21,7 @@ from django.utils.translation import ugettext_lazy as _
|
||||||
from django.utils.translation import ungettext_lazy
|
from django.utils.translation import ungettext_lazy
|
||||||
from horizon import exceptions
|
from horizon import exceptions
|
||||||
from horizon import tables
|
from horizon import tables
|
||||||
|
from oslo_log import log as logging
|
||||||
|
|
||||||
from muranoclient.common import exceptions as exc
|
from muranoclient.common import exceptions as exc
|
||||||
from muranodashboard import api
|
from muranodashboard import api
|
||||||
|
|
|
@ -13,7 +13,6 @@
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
import json
|
import json
|
||||||
import logging
|
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
from django.contrib.formtools.wizard import views as wizard_views
|
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 exceptions as exc
|
||||||
from muranoclient.common import utils as muranoclient_utils
|
from muranoclient.common import utils as muranoclient_utils
|
||||||
from openstack_dashboard.api import glance
|
from openstack_dashboard.api import glance
|
||||||
|
from oslo_log import log as logging
|
||||||
|
|
||||||
from muranodashboard import api
|
from muranodashboard import api
|
||||||
from muranodashboard.api import packages as pkg_api
|
from muranodashboard.api import packages as pkg_api
|
||||||
|
|
|
@ -21,6 +21,8 @@ import urlparse
|
||||||
from glanceclient import client as gclient
|
from glanceclient import client as gclient
|
||||||
from keystoneclient.v2_0 import client as ksclient
|
from keystoneclient.v2_0 import client as ksclient
|
||||||
from muranoclient import client as mclient
|
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.common import exceptions as exc
|
||||||
from selenium import webdriver
|
from selenium import webdriver
|
||||||
from selenium.webdriver.common.action_chains import ActionChains
|
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 consts
|
||||||
from muranodashboard.tests.functional import utils
|
from muranodashboard.tests.functional import utils
|
||||||
|
|
||||||
log = logging.getLogger(__name__)
|
logger = log.getLogger(__name__).logger
|
||||||
log.setLevel(logging.DEBUG)
|
logger.level = logging.DEBUG
|
||||||
log.addHandler(logging.StreamHandler())
|
logger.addHandler(handlers.ColorHandler())
|
||||||
|
|
||||||
if sys.version_info >= (2, 7):
|
if sys.version_info >= (2, 7):
|
||||||
class BaseDeps(testtools.TestCase):
|
class BaseDeps(testtools.TestCase):
|
||||||
|
@ -103,7 +105,7 @@ class UITestCase(BaseDeps):
|
||||||
|
|
||||||
"""
|
"""
|
||||||
name = self._testMethodName
|
name = self._testMethodName
|
||||||
log.exception('{0} failed'.format(name))
|
logger.error('{0} failed'.format(name))
|
||||||
screenshot_dir = './screenshots'
|
screenshot_dir = './screenshots'
|
||||||
if not os.path.exists(screenshot_dir):
|
if not os.path.exists(screenshot_dir):
|
||||||
os.makedirs(screenshot_dir)
|
os.makedirs(screenshot_dir)
|
||||||
|
@ -229,7 +231,7 @@ class UITestCase(BaseDeps):
|
||||||
|
|
||||||
def wait_for_alert_message(self):
|
def wait_for_alert_message(self):
|
||||||
locator = (by.By.CSS_SELECTOR, 'div.alert-success')
|
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(
|
ui.WebDriverWait(self.driver, 2).until(
|
||||||
EC.presence_of_element_located(locator))
|
EC.presence_of_element_located(locator))
|
||||||
|
|
||||||
|
@ -292,7 +294,7 @@ class ImageTestCase(PackageBase):
|
||||||
is_public=True,
|
is_public=True,
|
||||||
properties=property)
|
properties=property)
|
||||||
except Exception as e:
|
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
|
raise e
|
||||||
return image
|
return image
|
||||||
|
|
||||||
|
@ -325,8 +327,8 @@ class FieldsTestCase(PackageBase):
|
||||||
self.driver.find_element_by_xpath(
|
self.driver.find_element_by_xpath(
|
||||||
consts.ErrorMessage.format(error_message))
|
consts.ErrorMessage.format(error_message))
|
||||||
except (exc.NoSuchElementException, exc.ElementNotVisibleException):
|
except (exc.NoSuchElementException, exc.ElementNotVisibleException):
|
||||||
log.info("Message {0} is not"
|
logger.info("Message {0} is not"
|
||||||
" present on the page".format(error_message))
|
" present on the page".format(error_message))
|
||||||
|
|
||||||
self.driver.implicitly_wait(30)
|
self.driver.implicitly_wait(30)
|
||||||
|
|
||||||
|
|
|
@ -3,9 +3,11 @@ import os
|
||||||
import yaml
|
import yaml
|
||||||
import zipfile
|
import zipfile
|
||||||
|
|
||||||
|
from oslo_log import log
|
||||||
|
|
||||||
from muranodashboard.tests.functional import consts
|
from muranodashboard.tests.functional import consts
|
||||||
|
|
||||||
log = logging.getLogger(__name__)
|
log = log.getLogger(__name__).logger
|
||||||
log.setLevel(logging.DEBUG)
|
log.setLevel(logging.DEBUG)
|
||||||
log.addHandler(logging.StreamHandler())
|
log.addHandler(logging.StreamHandler())
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue