Fixes hacking rules
This patchset helps reducing the ignored pep8 errors. Fixed some ignored hacking rules, as listed follows: - E111 indentation is not a multiple of four - E122 continuation line missing indentation or outdented - E123 closing bracket does not match indentation of opening bracket's line - E128 continuation line under-indented for visual indent - E251 unexpected spaces around keyword / parameter equals - E265 block comment should start with '# ' - E713 test for membership should be 'not in' - H105 Don't use author tags - H306 imports not in alphabetical order Change-Id: Iadf2af4f6ec90420153ad63b5a41650392ef2cbd
This commit is contained in:
parent
0f3d242548
commit
843bb0cd53
@ -19,8 +19,8 @@
|
||||
When the guest is moved out of the application, this will no longer
|
||||
be needed in the project."""
|
||||
|
||||
import sys
|
||||
import os
|
||||
import sys
|
||||
|
||||
possible_topdir = os.path.normpath(os.path.join(os.path.abspath(sys.argv[0]),
|
||||
os.pardir,
|
||||
|
@ -15,11 +15,12 @@
|
||||
# under the License.
|
||||
#
|
||||
|
||||
import run_tests
|
||||
import argparse
|
||||
import os
|
||||
import sys
|
||||
|
||||
import run_tests
|
||||
|
||||
|
||||
def import_tests():
|
||||
from trove.tests.examples import snippets
|
||||
|
79
run_tests.py
79
run_tests.py
@ -19,22 +19,23 @@
|
||||
import functools
|
||||
import gettext
|
||||
import os
|
||||
import urllib
|
||||
import sys
|
||||
import traceback
|
||||
|
||||
from trove.common import cfg
|
||||
from trove.common import utils
|
||||
from trove.common.rpc import service as rpc_service
|
||||
from trove.common.rpc import version as rpc_version
|
||||
from trove.openstack.common import log as logging
|
||||
from trove.tests.config import CONFIG
|
||||
from trove import rpc
|
||||
from wsgi_intercept.httplib2_intercept import install as wsgi_install
|
||||
import proboscis
|
||||
import wsgi_intercept
|
||||
import urllib
|
||||
|
||||
import eventlet
|
||||
import proboscis
|
||||
import wsgi_intercept
|
||||
from wsgi_intercept.httplib2_intercept import install as wsgi_install
|
||||
|
||||
from trove.common import cfg
|
||||
from trove.common.rpc import service as rpc_service
|
||||
from trove.common.rpc import version as rpc_version
|
||||
from trove.common import utils
|
||||
from trove.openstack.common import log as logging
|
||||
from trove import rpc
|
||||
from trove.tests.config import CONFIG
|
||||
|
||||
eventlet.monkey_patch(thread=False)
|
||||
|
||||
CONF = cfg.CONF
|
||||
@ -77,13 +78,12 @@ def initialize_trove(config_file):
|
||||
|
||||
def datastore_init():
|
||||
# Adds the datastore for mysql (needed to make most calls work).
|
||||
from trove.datastore import models
|
||||
from trove.configuration.models import DatastoreConfigurationParameters
|
||||
from trove.datastore import models
|
||||
|
||||
models.DBDatastore.create(id=CONFIG.dbaas_datastore_id,
|
||||
name=CONFIG.dbaas_datastore,
|
||||
default_version_id=
|
||||
CONFIG.dbaas_datastore_version_id)
|
||||
models.DBDatastore.create(
|
||||
id=CONFIG.dbaas_datastore_id, name=CONFIG.dbaas_datastore,
|
||||
default_version_id=CONFIG.dbaas_datastore_version_id)
|
||||
|
||||
models.DBDatastore.create(id=utils.generate_uuid(),
|
||||
name=CONFIG.dbaas_datastore_name_no_versions,
|
||||
@ -91,22 +91,18 @@ def datastore_init():
|
||||
|
||||
main_dsv = models.DBDatastoreVersion.create(
|
||||
id=CONFIG.dbaas_datastore_version_id,
|
||||
datastore_id=
|
||||
CONFIG.dbaas_datastore_id,
|
||||
datastore_id=CONFIG.dbaas_datastore_id,
|
||||
name=CONFIG.dbaas_datastore_version,
|
||||
manager="mysql",
|
||||
image_id=
|
||||
'c00000c0-00c0-0c00-00c0-000c000000cc',
|
||||
image_id='c00000c0-00c0-0c00-00c0-000c000000cc',
|
||||
packages='test packages',
|
||||
active=1)
|
||||
models.DBDatastoreVersion.create(id="d00000d0-00d0-0d00-00d0-000d000000dd",
|
||||
datastore_id=
|
||||
CONFIG.dbaas_datastore_id,
|
||||
name='mysql_inactive_version',
|
||||
manager="mysql",
|
||||
image_id=
|
||||
'c00000c0-00c0-0c00-00c0-000c000000cc',
|
||||
packages=None, active=0)
|
||||
models.DBDatastoreVersion.create(
|
||||
id="d00000d0-00d0-0d00-00d0-000d000000dd",
|
||||
datastore_id=CONFIG.dbaas_datastore_id,
|
||||
name='mysql_inactive_version', manager="mysql",
|
||||
image_id='c00000c0-00c0-0c00-00c0-000c000000cc',
|
||||
packages=None, active=0)
|
||||
|
||||
def add_parm(name, data_type, max_size, min_size=0, restart_required=0):
|
||||
DatastoreConfigurationParameters.create(
|
||||
@ -148,7 +144,6 @@ def initialize_fakes(app):
|
||||
path_info = env.get('PATH_INFO')
|
||||
if path_info:
|
||||
env['PATH_INFO'] = urllib.unquote(path_info)
|
||||
#print("%s %s" % (args, kwargs))
|
||||
return app.__call__(env, start_response)
|
||||
|
||||
return call_back
|
||||
@ -200,30 +195,30 @@ def run_tests(repl):
|
||||
def import_tests():
|
||||
# F401 unused imports needed for tox tests
|
||||
from trove.tests.api import backups # noqa
|
||||
from trove.tests.api import header # noqa
|
||||
from trove.tests.api import limits # noqa
|
||||
from trove.tests.api import configurations # noqa
|
||||
from trove.tests.api import databases # noqa
|
||||
from trove.tests.api import datastores # noqa
|
||||
from trove.tests.api import flavors # noqa
|
||||
from trove.tests.api import versions # noqa
|
||||
from trove.tests.api import header # noqa
|
||||
from trove.tests.api import instances as rd_instances # noqa
|
||||
from trove.tests.api import instances_actions as rd_actions # noqa
|
||||
from trove.tests.api import instances_delete # noqa
|
||||
from trove.tests.api import instances_mysql_down # noqa
|
||||
from trove.tests.api import instances_resize # noqa
|
||||
from trove.tests.api import configurations # noqa
|
||||
from trove.tests.api import databases # noqa
|
||||
from trove.tests.api import datastores # noqa
|
||||
from trove.tests.api import replication # noqa
|
||||
from trove.tests.api import root # noqa
|
||||
from trove.tests.api import root_on_create # noqa
|
||||
from trove.tests.api import users # noqa
|
||||
from trove.tests.api import user_access # noqa
|
||||
from trove.tests.api import limits # noqa
|
||||
from trove.tests.api.mgmt import accounts # noqa
|
||||
from trove.tests.api.mgmt import admin_required # noqa
|
||||
from trove.tests.api.mgmt import hosts # noqa
|
||||
from trove.tests.api.mgmt import instances as mgmt_instances # noqa
|
||||
from trove.tests.api.mgmt import instances_actions as mgmt_actions # noqa
|
||||
from trove.tests.api.mgmt import storage # noqa
|
||||
from trove.tests.api.mgmt import malformed_json # noqa
|
||||
from trove.tests.api.mgmt import storage # noqa
|
||||
from trove.tests.api import replication # noqa
|
||||
from trove.tests.api import root # noqa
|
||||
from trove.tests.api import root_on_create # noqa
|
||||
from trove.tests.api import user_access # noqa
|
||||
from trove.tests.api import users # noqa
|
||||
from trove.tests.api import versions # noqa
|
||||
from trove.tests.db import migrations # noqa
|
||||
|
||||
|
||||
|
4
tox.ini
4
tox.ini
@ -41,9 +41,9 @@ commands = {posargs}
|
||||
|
||||
[flake8]
|
||||
show-source = True
|
||||
# H301 and H306 are ignored on purpose.
|
||||
# H301 is ignored on purpose.
|
||||
# The rest of the ignores are TODOs.
|
||||
ignore = E111,E122,E123,E128,E251,E265,E713,F821,H105,H237,H238,H301,H305,H306,H307,H402,H404,H405,H407,H501,H904
|
||||
ignore = F821,H237,H238,H301,H305,H307,H402,H404,H405,H407,H501,H904
|
||||
builtins = _
|
||||
exclude=.venv,.tox,dist,doc,openstack,*egg,rsdns,tools,etc,build,*.po,*.pot
|
||||
filename=*.py,trove-*
|
||||
|
@ -19,7 +19,6 @@
|
||||
.. automodule:: trove
|
||||
:platform: Unix
|
||||
:synopsis: Platform-As-A-Service Database Cloud
|
||||
.. moduleauthor:: Michael Basnight <mbasnight@gmail.com>
|
||||
"""
|
||||
|
||||
__all__ = ['__version__']
|
||||
|
@ -1,16 +1,16 @@
|
||||
#Copyright [2013] Hewlett-Packard Development Company, L.P.
|
||||
# Copyright [2013] Hewlett-Packard Development Company, L.P.
|
||||
|
||||
#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.
|
||||
|
||||
"""Model classes that form the core of snapshots functionality."""
|
||||
|
||||
@ -20,14 +20,14 @@ from swiftclient.client import ClientException
|
||||
from trove.backup.state import BackupState
|
||||
from trove.common import cfg
|
||||
from trove.common import exception
|
||||
from trove.db.models import DatabaseModelBase
|
||||
from trove.datastore import models as datastore_models
|
||||
from trove.openstack.common import log as logging
|
||||
from trove.taskmanager import api
|
||||
from trove.common.i18n import _
|
||||
from trove.common.remote import create_swift_client
|
||||
from trove.common import utils
|
||||
from trove.datastore import models as datastore_models
|
||||
from trove.db.models import DatabaseModelBase
|
||||
from trove.openstack.common import log as logging
|
||||
from trove.quota.quota import run_with_quotas
|
||||
from trove.common.i18n import _
|
||||
from trove.taskmanager import api
|
||||
|
||||
|
||||
CONF = cfg.CONF
|
||||
|
@ -13,14 +13,14 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from trove.backup import views
|
||||
from trove.backup.models import Backup
|
||||
from trove.backup import views
|
||||
from trove.common import apischema
|
||||
from trove.common import cfg
|
||||
from trove.common.i18n import _
|
||||
from trove.common import pagination
|
||||
from trove.common import wsgi
|
||||
from trove.openstack.common import log as logging
|
||||
from trove.common.i18n import _
|
||||
|
||||
CONF = cfg.CONF
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
@ -17,12 +17,12 @@ from trove.cluster.tasks import ClusterTask
|
||||
from trove.cluster.tasks import ClusterTasks
|
||||
from trove.common import cfg
|
||||
from trove.common import exception
|
||||
from trove.common.i18n import _
|
||||
from trove.common.strategies.cluster import strategy
|
||||
from trove.datastore import models as datastore_models
|
||||
from trove.db import models as dbmodels
|
||||
from trove.instance import models as inst_models
|
||||
from trove.openstack.common import log as logging
|
||||
from trove.common.i18n import _
|
||||
from trove.taskmanager import api as task_api
|
||||
|
||||
|
||||
|
@ -17,16 +17,16 @@ from oslo_config.cfg import NoSuchOptError
|
||||
|
||||
from trove.cluster import models
|
||||
from trove.cluster import views
|
||||
from trove.common import apischema
|
||||
from trove.common import cfg
|
||||
from trove.common import exception
|
||||
from trove.common.i18n import _
|
||||
from trove.common import pagination
|
||||
from trove.common import apischema
|
||||
from trove.common.strategies.cluster import strategy
|
||||
from trove.common import utils
|
||||
from trove.common import wsgi
|
||||
from trove.common.strategies.cluster import strategy
|
||||
from trove.datastore import models as datastore_models
|
||||
from trove.openstack.common import log as logging
|
||||
from trove.common.i18n import _
|
||||
|
||||
|
||||
CONF = cfg.CONF
|
||||
|
@ -12,8 +12,9 @@
|
||||
# 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 oslo_config import cfg as openstack_cfg
|
||||
from oslo_concurrency import processutils
|
||||
from oslo_config import cfg as openstack_cfg
|
||||
|
||||
from trove.cmd.common import with_initialize
|
||||
|
||||
|
||||
|
@ -25,9 +25,9 @@ from trove.common import cfg
|
||||
from trove.common import exception
|
||||
from trove.common import utils
|
||||
from trove.configuration import models as config_models
|
||||
from trove.datastore import models as datastore_models
|
||||
from trove.db import get_db_api
|
||||
from trove.openstack.common import log as logging
|
||||
from trove.datastore import models as datastore_models
|
||||
|
||||
|
||||
CONF = cfg.CONF
|
||||
|
@ -14,16 +14,16 @@
|
||||
|
||||
import routes
|
||||
|
||||
from trove.common import wsgi
|
||||
from trove.backup.service import BackupController
|
||||
from trove.cluster.service import ClusterController
|
||||
from trove.common import wsgi
|
||||
from trove.configuration.service import ConfigurationsController
|
||||
from trove.configuration.service import ParametersController
|
||||
from trove.datastore.service import DatastoreController
|
||||
from trove.flavor.service import FlavorController
|
||||
from trove.instance.service import InstanceController
|
||||
from trove.limits.service import LimitsController
|
||||
from trove.backup.service import BackupController
|
||||
from trove.versions import VersionsController
|
||||
from trove.datastore.service import DatastoreController
|
||||
|
||||
|
||||
class API(wsgi.Router):
|
||||
|
@ -14,14 +14,14 @@
|
||||
# under the License.
|
||||
|
||||
import re
|
||||
|
||||
from oslo_utils import strutils
|
||||
import webob.exc
|
||||
import wsgi
|
||||
|
||||
from oslo_utils import strutils
|
||||
|
||||
from trove.common import exception
|
||||
from trove.openstack.common import log as logging
|
||||
from trove.common.i18n import _
|
||||
from trove.openstack.common import log as logging
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
||||
|
@ -98,9 +98,7 @@ def wrap_exception(f):
|
||||
return f(*args, **kw)
|
||||
except Exception as e:
|
||||
if not isinstance(e, Error):
|
||||
#exc_type, exc_value, exc_traceback = sys.exc_info()
|
||||
logging.exception(_('Uncaught exception'))
|
||||
#logging.error(traceback.extract_stack(exc_traceback))
|
||||
raise Error(str(e))
|
||||
raise
|
||||
_wrap.func_name = f.func_name
|
||||
|
@ -30,7 +30,6 @@ import eventlet.wsgi
|
||||
from oslo_config import cfg
|
||||
import routes
|
||||
import routes.middleware
|
||||
#import six
|
||||
import webob.dec
|
||||
import webob.exc
|
||||
from xml.dom import minidom
|
||||
@ -481,7 +480,7 @@ class XMLDictSerializer(DictSerializer):
|
||||
self._add_xmlns(node, has_atom)
|
||||
return node.toprettyxml(indent=' ', encoding='UTF-8')
|
||||
|
||||
#NOTE (ameade): the has_atom should be removed after all of the
|
||||
# NOTE (ameade): the has_atom should be removed after all of the
|
||||
# xml serializers and view builders have been updated to the current
|
||||
# spec that required all responses include the xmlns:atom, the has_atom
|
||||
# flag is to prevent current tests from breaking
|
||||
@ -501,7 +500,7 @@ class XMLDictSerializer(DictSerializer):
|
||||
if xmlns:
|
||||
result.setAttribute('xmlns', xmlns)
|
||||
|
||||
#TODO(bcwaldon): accomplish this without a type-check
|
||||
# TODO(bcwaldon): accomplish this without a type-check
|
||||
if type(data) is list:
|
||||
collections = metadata.get('list_collections', {})
|
||||
if nodename in collections:
|
||||
@ -520,7 +519,7 @@ class XMLDictSerializer(DictSerializer):
|
||||
for item in data:
|
||||
node = self._to_xml_node(doc, metadata, singular, item)
|
||||
result.appendChild(node)
|
||||
#TODO(bcwaldon): accomplish this without a type-check
|
||||
# TODO(bcwaldon): accomplish this without a type-check
|
||||
elif type(data) is dict:
|
||||
collections = metadata.get('dict_collections', {})
|
||||
if nodename in collections:
|
||||
|
@ -19,9 +19,9 @@ import re
|
||||
|
||||
from oslo_concurrency import processutils
|
||||
|
||||
from trove.openstack.common import log as logging
|
||||
from trove.common import base_exception as openstack_exception
|
||||
from trove.common.i18n import _
|
||||
from trove.openstack.common import log as logging
|
||||
|
||||
|
||||
ClientConnectionError = openstack_exception.ClientConnectionError
|
||||
|
@ -14,20 +14,20 @@
|
||||
# under the License.
|
||||
|
||||
import abc
|
||||
|
||||
from lxml import etree
|
||||
import routes
|
||||
import six
|
||||
import stevedore
|
||||
import webob.dec
|
||||
import webob.exc
|
||||
|
||||
from trove.common import base_wsgi
|
||||
|
||||
from lxml import etree
|
||||
from trove.openstack.common import log as logging
|
||||
from trove.common import base_exception as exception
|
||||
from trove.common import base_wsgi
|
||||
from trove.common import cfg
|
||||
from trove.common.i18n import _
|
||||
from trove.common import wsgi
|
||||
from trove.common.i18n import _ # noqa
|
||||
from trove.openstack.common import log as logging
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
CONF = cfg.CONF
|
||||
|
@ -23,16 +23,16 @@ import httplib
|
||||
import math
|
||||
import re
|
||||
import time
|
||||
|
||||
from oslo_serialization import jsonutils
|
||||
from oslo_utils import importutils
|
||||
import webob.dec
|
||||
import webob.exc
|
||||
|
||||
from oslo_utils import importutils
|
||||
from oslo_serialization import jsonutils
|
||||
|
||||
from trove.common import cfg
|
||||
from trove.common import wsgi
|
||||
from trove.common import base_wsgi
|
||||
from trove.common import cfg
|
||||
from trove.common.i18n import _
|
||||
from trove.common import wsgi
|
||||
|
||||
|
||||
CONF = cfg.CONF
|
||||
|
@ -16,8 +16,9 @@
|
||||
"""Model classes that form the core of instances functionality."""
|
||||
|
||||
from oslo_utils.importutils import import_class
|
||||
from trove.common import remote
|
||||
|
||||
from trove.common import cfg
|
||||
from trove.common import remote
|
||||
|
||||
CONF = cfg.CONF
|
||||
|
||||
|
@ -13,13 +13,13 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
import urllib
|
||||
import six.moves.urllib.parse as urlparse
|
||||
|
||||
try:
|
||||
from collections import OrderedDict
|
||||
except ImportError:
|
||||
from ordereddict import OrderedDict
|
||||
import urllib
|
||||
|
||||
import six.moves.urllib.parse as urlparse
|
||||
|
||||
|
||||
def url_quote(s):
|
||||
|
@ -20,6 +20,7 @@ from trove.cluster.tasks import ClusterTasks
|
||||
from trove.cluster.views import ClusterView
|
||||
from trove.common import cfg
|
||||
from trove.common import exception
|
||||
from trove.common.i18n import _
|
||||
from trove.common import remote
|
||||
from trove.common.strategies.cluster import base
|
||||
from trove.common import utils
|
||||
@ -27,7 +28,6 @@ from trove.common import wsgi
|
||||
from trove.datastore import models as datastore_models
|
||||
from trove.extensions.mgmt.clusters.views import MgmtClusterView
|
||||
from trove.instance import models as inst_models
|
||||
from trove.common.i18n import _
|
||||
from trove.openstack.common import log as logging
|
||||
from trove.quota.quota import check_quotas
|
||||
from trove.taskmanager import api as task_api
|
||||
|
@ -34,10 +34,10 @@ class MongoDbGuestAgentAPI(guest_api.API):
|
||||
|
||||
def add_shard(self, replica_set_name, replica_set_member):
|
||||
LOG.debug("Adding shard with replSet %(replica_set_name)s and member "
|
||||
"%(replica_set_member)s for instance %(id)s" % {
|
||||
'replica_set_name': replica_set_name,
|
||||
'replica_set_member': replica_set_member,
|
||||
'id': self.id})
|
||||
"%(replica_set_member)s for instance "
|
||||
"%(id)s" % {'replica_set_name': replica_set_name,
|
||||
'replica_set_member': replica_set_member,
|
||||
'id': self.id})
|
||||
return self._call("add_shard", guest_api.AGENT_HIGH_TIMEOUT,
|
||||
self.version_cap,
|
||||
replica_set_name=replica_set_name,
|
||||
|
@ -16,10 +16,10 @@
|
||||
from eventlet.timeout import Timeout
|
||||
|
||||
from trove.common import cfg
|
||||
from trove.common.i18n import _
|
||||
from trove.common.strategies.cluster import base
|
||||
from trove.instance.models import DBInstance
|
||||
from trove.instance.models import Instance
|
||||
from trove.common.i18n import _
|
||||
from trove.openstack.common import log as logging
|
||||
from trove.taskmanager import api as task_api
|
||||
import trove.taskmanager.models as task_models
|
||||
|
@ -1,15 +1,15 @@
|
||||
#Copyright [2015] Hewlett-Packard Development Company, L.P.
|
||||
#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
|
||||
# Copyright [2015] Hewlett-Packard Development Company, L.P.
|
||||
# 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.
|
||||
|
||||
from novaclient import exceptions as nova_exceptions
|
||||
|
||||
|
@ -1,15 +1,15 @@
|
||||
#Copyright [2015] Hewlett-Packard Development Company, L.P.
|
||||
#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
|
||||
# Copyright [2015] Hewlett-Packard Development Company, L.P.
|
||||
# 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.
|
||||
|
||||
from trove.common import cfg
|
||||
from trove.common.strategies.cluster import base
|
||||
|
@ -1,23 +1,23 @@
|
||||
#Copyright [2015] Hewlett-Packard Development Company, L.P.
|
||||
#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
|
||||
# Copyright [2015] Hewlett-Packard Development Company, L.P.
|
||||
# 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.
|
||||
|
||||
from eventlet.timeout import Timeout
|
||||
|
||||
from trove.common import cfg
|
||||
from trove.common.i18n import _
|
||||
from trove.common.strategies.cluster import base
|
||||
from trove.instance.models import DBInstance
|
||||
from trove.instance.models import Instance
|
||||
from trove.common.i18n import _
|
||||
from trove.openstack.common import log as logging
|
||||
from trove.taskmanager import api as task_api
|
||||
import trove.taskmanager.models as task_models
|
||||
|
@ -20,9 +20,9 @@ from oslo_config import cfg as oslo_config
|
||||
from trove.common import cfg
|
||||
from trove.common import configurations
|
||||
from trove.common import exception
|
||||
from trove.common.i18n import _
|
||||
from trove.common import utils
|
||||
from trove.openstack.common import log as logging
|
||||
from trove.common.i18n import _
|
||||
|
||||
CONF = cfg.CONF
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
@ -16,20 +16,19 @@
|
||||
|
||||
import datetime
|
||||
import inspect
|
||||
import jinja2
|
||||
import time
|
||||
import six.moves.urllib.parse as urlparse
|
||||
import uuid
|
||||
import os
|
||||
import shutil
|
||||
import time
|
||||
import uuid
|
||||
|
||||
from eventlet.timeout import Timeout
|
||||
from passlib import utils as passlib_utils
|
||||
|
||||
from oslo_utils import importutils
|
||||
from oslo_utils import timeutils
|
||||
from oslo_utils import strutils
|
||||
import jinja2
|
||||
from oslo_concurrency import processutils
|
||||
from oslo_utils import importutils
|
||||
from oslo_utils import strutils
|
||||
from oslo_utils import timeutils
|
||||
from passlib import utils as passlib_utils
|
||||
import six.moves.urllib.parse as urlparse
|
||||
|
||||
from trove.common import cfg
|
||||
from trove.common import exception
|
||||
|
@ -14,29 +14,29 @@
|
||||
# under the License.
|
||||
"""Wsgi helper utilities for trove"""
|
||||
|
||||
import eventlet.wsgi
|
||||
import math
|
||||
import jsonschema
|
||||
import paste.urlmap
|
||||
import re
|
||||
import time
|
||||
import traceback
|
||||
import uuid
|
||||
|
||||
import eventlet.wsgi
|
||||
import jsonschema
|
||||
from oslo_serialization import jsonutils
|
||||
import paste.urlmap
|
||||
import webob
|
||||
import webob.dec
|
||||
import webob.exc
|
||||
|
||||
from trove.common import base_wsgi
|
||||
from trove.common import cfg
|
||||
from trove.common import context as rd_context
|
||||
from trove.common import exception
|
||||
from trove.common import utils
|
||||
from trove.common.i18n import _
|
||||
from oslo_serialization import jsonutils
|
||||
|
||||
from trove.common import utils
|
||||
from trove.openstack.common import log as logging
|
||||
from trove.openstack.common import pastedeploy
|
||||
from trove.openstack.common import service
|
||||
from trove.common import base_wsgi
|
||||
from trove.openstack.common import log as logging
|
||||
from trove.common import cfg
|
||||
|
||||
CONTEXT_KEY = 'trove.context'
|
||||
Router = base_wsgi.Router
|
||||
|
@ -13,10 +13,11 @@
|
||||
# under the License.
|
||||
|
||||
import oslo_messaging as messaging
|
||||
from trove import rpc
|
||||
|
||||
from trove.common import cfg
|
||||
from trove.common.rpc import version as rpc_version
|
||||
from trove.openstack.common import log as logging
|
||||
from trove import rpc
|
||||
|
||||
|
||||
CONF = cfg.CONF
|
||||
|
@ -17,6 +17,7 @@ import oslo_messaging as messaging
|
||||
from trove.backup import models as bkup_models
|
||||
from trove.common import cfg
|
||||
from trove.common import exception
|
||||
from trove.common.i18n import _
|
||||
from trove.common.instance import ServiceStatus
|
||||
from trove.common.rpc import version as rpc_version
|
||||
from trove.conductor.models import LastSeen
|
||||
@ -24,7 +25,6 @@ from trove.extensions.mysql import models as mysql_models
|
||||
from trove.instance import models as t_models
|
||||
from trove.openstack.common import log as logging
|
||||
from trove.openstack.common import periodic_task
|
||||
from trove.common.i18n import _
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
CONF = cfg.CONF
|
||||
|
@ -1,16 +1,16 @@
|
||||
#Copyright 2014 OpenStack Foundation
|
||||
# Copyright 2014 OpenStack Foundation
|
||||
|
||||
#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.
|
||||
|
||||
from trove.db import get_db_api
|
||||
from trove.openstack.common import log as logging
|
||||
|
@ -13,18 +13,18 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
import json
|
||||
from datetime import datetime
|
||||
import json
|
||||
|
||||
from trove.common import cfg
|
||||
from trove.common import exception
|
||||
from trove.common import utils
|
||||
from trove.common.exception import ModelNotFoundError
|
||||
from trove.common.i18n import _
|
||||
from trove.common import utils
|
||||
from trove.datastore import models as dstore_models
|
||||
from trove.db import get_db_api
|
||||
from trove.db import models as dbmodels
|
||||
from trove.openstack.common import log as logging
|
||||
from trove.common.i18n import _
|
||||
from trove.taskmanager import api as task_api
|
||||
|
||||
|
||||
|
@ -14,18 +14,19 @@
|
||||
# under the License.
|
||||
|
||||
from datetime import datetime
|
||||
|
||||
import trove.common.apischema as apischema
|
||||
from trove.common import cfg
|
||||
from trove.common import exception
|
||||
from trove.common.i18n import _
|
||||
from trove.common import pagination
|
||||
from trove.common import wsgi
|
||||
from trove.configuration import models
|
||||
from trove.configuration import views
|
||||
from trove.configuration.models import DBConfigurationParameter
|
||||
from trove.configuration import views
|
||||
from trove.datastore import models as ds_models
|
||||
from trove.openstack.common import log as logging
|
||||
from trove.common.i18n import _
|
||||
from trove.instance import models as instances_models
|
||||
import trove.common.apischema as apischema
|
||||
from trove.openstack.common import log as logging
|
||||
|
||||
|
||||
CONF = cfg.CONF
|
||||
|
@ -19,8 +19,8 @@
|
||||
from trove.common import cfg
|
||||
from trove.common import exception
|
||||
from trove.common import utils
|
||||
from trove.db import models as dbmodels
|
||||
from trove.db import get_db_api
|
||||
from trove.db import models as dbmodels
|
||||
from trove.openstack.common import log as logging
|
||||
|
||||
|
||||
@ -412,8 +412,8 @@ class DatastoreVersion(object):
|
||||
self._datastore_name = Datastore.load(self.datastore_id).name
|
||||
return self._datastore_name
|
||||
|
||||
#TODO(tim.simpson): This would be less confusing if it was called "version"
|
||||
# and datastore_name was called "name".
|
||||
# TODO(tim.simpson): This would be less confusing if it was called
|
||||
# "version" and datastore_name was called "name".
|
||||
@property
|
||||
def name(self):
|
||||
return self.db_info.name
|
||||
@ -475,15 +475,15 @@ def get_datastore_version(type=None, version=None, return_inactive=False):
|
||||
datastore = Datastore.load(datastore)
|
||||
version = version or datastore.default_version_id
|
||||
if not version:
|
||||
raise exception.DatastoreDefaultVersionNotFound(datastore=
|
||||
datastore.name)
|
||||
raise exception.DatastoreDefaultVersionNotFound(
|
||||
datastore=datastore.name)
|
||||
datastore_version = DatastoreVersion.load(datastore, version)
|
||||
if datastore_version.datastore_id != datastore.id:
|
||||
raise exception.DatastoreNoVersion(datastore=datastore.name,
|
||||
version=datastore_version.name)
|
||||
if not datastore_version.active and not return_inactive:
|
||||
raise exception.DatastoreVersionInactive(version=
|
||||
datastore_version.name)
|
||||
raise exception.DatastoreVersionInactive(
|
||||
version=datastore_version.name)
|
||||
return (datastore, datastore_version)
|
||||
|
||||
|
||||
|
@ -27,7 +27,7 @@ class DatastoreController(wsgi.Controller):
|
||||
datastore_versions = (models.DatastoreVersions.load(datastore.id))
|
||||
return wsgi.Result(views.
|
||||
DatastoreView(datastore, datastore_versions,
|
||||
req).data(), 200)
|
||||
req).data(), 200)
|
||||
|
||||
def index(self, req, tenant_id):
|
||||
context = req.environ[wsgi.CONTEXT_KEY]
|
||||
@ -38,7 +38,7 @@ class DatastoreController(wsgi.Controller):
|
||||
datastores_versions = models.DatastoreVersions.load_all(only_active)
|
||||
return wsgi.Result(views.
|
||||
DatastoresView(datastores, datastores_versions,
|
||||
req).data(), 200)
|
||||
req).data(), 200)
|
||||
|
||||
def version_show(self, req, tenant_id, datastore, id):
|
||||
datastore = models.Datastore.load(datastore)
|
||||
|
@ -16,8 +16,8 @@
|
||||
# under the License.
|
||||
#
|
||||
|
||||
from trove.common import wsgi
|
||||
from trove.common.views import create_links
|
||||
from trove.common import wsgi
|
||||
|
||||
|
||||
class DatastoreView(object):
|
||||
|
@ -15,8 +15,8 @@
|
||||
|
||||
import optparse
|
||||
|
||||
from trove.common import utils
|
||||
from trove.common import cfg
|
||||
from trove.common import utils
|
||||
|
||||
CONF = cfg.CONF
|
||||
|
||||
|
@ -12,14 +12,14 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from trove.db import get_db_api
|
||||
from trove.db import db_query
|
||||
from trove.common import exception
|
||||
from trove.common.i18n import _
|
||||
from trove.common import models
|
||||
from trove.common import pagination
|
||||
from trove.common import utils
|
||||
from trove.db import db_query
|
||||
from trove.db import get_db_api
|
||||
from trove.openstack.common import log as logging
|
||||
from trove.common.i18n import _
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
||||
|
@ -14,9 +14,9 @@
|
||||
# under the License.
|
||||
|
||||
from sqlalchemy import MetaData
|
||||
from sqlalchemy import Table
|
||||
from sqlalchemy import orm
|
||||
from sqlalchemy.orm import exc as orm_exc
|
||||
from sqlalchemy import Table
|
||||
|
||||
|
||||
def map(engine, models):
|
||||
|
@ -15,9 +15,10 @@
|
||||
|
||||
"""Various conveniences used for migration scripts."""
|
||||
|
||||
from trove.openstack.common import log as logging
|
||||
import sqlalchemy.types
|
||||
|
||||
from trove.openstack.common import log as logging
|
||||
|
||||
|
||||
logger = logging.getLogger('trove.db.sqlalchemy.migrate_repo.schema')
|
||||
|
||||
|
@ -16,10 +16,10 @@
|
||||
from sqlalchemy.schema import Column
|
||||
from sqlalchemy.schema import MetaData
|
||||
|
||||
from trove.db.sqlalchemy.migrate_repo.schema import Table
|
||||
from trove.db.sqlalchemy.migrate_repo.schema import create_tables
|
||||
from trove.db.sqlalchemy.migrate_repo.schema import drop_tables
|
||||
from trove.db.sqlalchemy.migrate_repo.schema import String
|
||||
from trove.db.sqlalchemy.migrate_repo.schema import Table
|
||||
|
||||
|
||||
meta = MetaData()
|
||||
|
@ -1,16 +1,16 @@
|
||||
#Copyright [2013] Hewlett-Packard Development Company, L.P.
|
||||
# Copyright [2013] Hewlett-Packard Development Company, L.P.
|
||||
|
||||
#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.
|
||||
|
||||
from sqlalchemy.schema import Column
|
||||
from sqlalchemy.schema import MetaData
|
||||
|
@ -1,27 +1,27 @@
|
||||
#Copyright [2013] Hewlett-Packard Development Company, L.P.
|
||||
# Copyright [2013] Hewlett-Packard Development Company, L.P.
|
||||
|
||||
#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.
|
||||
|
||||
from sqlalchemy.schema import Column
|
||||
from sqlalchemy.schema import MetaData
|
||||
|
||||
from trove.db.sqlalchemy.migrate_repo.schema import Boolean
|
||||
from trove.db.sqlalchemy.migrate_repo.schema import create_tables
|
||||
from trove.db.sqlalchemy.migrate_repo.schema import DateTime
|
||||
from trove.db.sqlalchemy.migrate_repo.schema import drop_tables
|
||||
from trove.db.sqlalchemy.migrate_repo.schema import Float
|
||||
from trove.db.sqlalchemy.migrate_repo.schema import String
|
||||
from trove.db.sqlalchemy.migrate_repo.schema import Table
|
||||
from trove.db.sqlalchemy.migrate_repo.schema import Boolean
|
||||
|
||||
meta = MetaData()
|
||||
|
||||
|
@ -17,12 +17,12 @@ from sqlalchemy import ForeignKey
|
||||
from sqlalchemy.schema import Column
|
||||
from sqlalchemy.schema import MetaData
|
||||
|
||||
from trove.db.sqlalchemy.migrate_repo.schema import create_tables
|
||||
from trove.db.sqlalchemy.migrate_repo.schema import drop_tables
|
||||
from trove.db.sqlalchemy.migrate_repo.schema import Boolean
|
||||
from trove.db.sqlalchemy.migrate_repo.schema import create_tables
|
||||
from trove.db.sqlalchemy.migrate_repo.schema import DateTime
|
||||
from trove.db.sqlalchemy.migrate_repo.schema import drop_tables
|
||||
from trove.db.sqlalchemy.migrate_repo.schema import Integer
|
||||
from trove.db.sqlalchemy.migrate_repo.schema import String
|
||||
from trove.db.sqlalchemy.migrate_repo.schema import DateTime
|
||||
from trove.db.sqlalchemy.migrate_repo.schema import Table
|
||||
|
||||
|
||||
|
@ -31,7 +31,7 @@ def upgrade(migrate_engine):
|
||||
'TYPE INTEGER USING flavor_id::integer')
|
||||
else:
|
||||
instances = Table('instances', meta, autoload=True)
|
||||
#modify column
|
||||
# modify column
|
||||
instances.c.flavor_id.alter(type=Integer())
|
||||
|
||||
|
||||
|
@ -61,7 +61,7 @@ def upgrade(migrate_engine):
|
||||
instances.drop_column('service_type')
|
||||
# Table 'service_images' is deprecated since this version.
|
||||
# Leave it for few releases.
|
||||
#drop_tables([service_images])
|
||||
# drop_tables([service_images])
|
||||
|
||||
|
||||
def downgrade(migrate_engine):
|
||||
|
@ -21,7 +21,7 @@ def upgrade(migrate_engine):
|
||||
meta = MetaData()
|
||||
meta.bind = migrate_engine
|
||||
datastore_versions = Table('datastore_versions', meta, autoload=True)
|
||||
#modify column
|
||||
# modify column
|
||||
datastore_versions.c.name.alter(unique=False)
|
||||
|
||||
|
||||
|
@ -13,10 +13,11 @@
|
||||
# under the License.
|
||||
|
||||
from sqlalchemy.schema import MetaData
|
||||
from sqlalchemy.sql.expression import select
|
||||
from sqlalchemy.sql.expression import insert
|
||||
from sqlalchemy.sql.expression import update
|
||||
from sqlalchemy.sql.expression import delete
|
||||
from sqlalchemy.sql.expression import insert
|
||||
from sqlalchemy.sql.expression import select
|
||||
from sqlalchemy.sql.expression import update
|
||||
|
||||
from trove.common import cfg
|
||||
from trove.db.sqlalchemy.migrate_repo.schema import Table
|
||||
|
||||
|
@ -17,10 +17,10 @@ from sqlalchemy import ForeignKey
|
||||
from sqlalchemy.schema import Column
|
||||
from sqlalchemy.schema import MetaData
|
||||
|
||||
from trove.db.sqlalchemy.migrate_repo.schema import create_tables
|
||||
from trove.db.sqlalchemy.migrate_repo.schema import drop_tables
|
||||
from trove.db.sqlalchemy.migrate_repo.schema import DateTime
|
||||
from trove.db.sqlalchemy.migrate_repo.schema import Boolean
|
||||
from trove.db.sqlalchemy.migrate_repo.schema import create_tables
|
||||
from trove.db.sqlalchemy.migrate_repo.schema import DateTime
|
||||
from trove.db.sqlalchemy.migrate_repo.schema import drop_tables
|
||||
from trove.db.sqlalchemy.migrate_repo.schema import String
|
||||
from trove.db.sqlalchemy.migrate_repo.schema import Table
|
||||
from trove.db.sqlalchemy import utils as db_utils
|
||||
|
@ -15,11 +15,11 @@
|
||||
from sqlalchemy.schema import Column
|
||||
from sqlalchemy.schema import MetaData
|
||||
|
||||
from trove.db.sqlalchemy.migrate_repo.schema import create_tables
|
||||
from trove.db.sqlalchemy.migrate_repo.schema import drop_tables
|
||||
from trove.db.sqlalchemy.migrate_repo.schema import Float
|
||||
from trove.db.sqlalchemy.migrate_repo.schema import String
|
||||
from trove.db.sqlalchemy.migrate_repo.schema import Table
|
||||
from trove.db.sqlalchemy.migrate_repo.schema import create_tables
|
||||
from trove.db.sqlalchemy.migrate_repo.schema import drop_tables
|
||||
|
||||
meta = MetaData()
|
||||
|
||||
|
@ -13,11 +13,11 @@
|
||||
# under the License.
|
||||
|
||||
from sqlalchemy.exc import OperationalError
|
||||
from sqlalchemy.schema import MetaData
|
||||
from sqlalchemy.schema import Index
|
||||
from trove.openstack.common import log as logging
|
||||
from sqlalchemy.schema import MetaData
|
||||
|
||||
from trove.db.sqlalchemy.migrate_repo.schema import Table
|
||||
from trove.openstack.common import log as logging
|
||||
|
||||
logger = logging.getLogger('trove.db.sqlalchemy.migrate_repo.schema')
|
||||
|
||||
|
@ -13,11 +13,11 @@
|
||||
# under the License.
|
||||
|
||||
from sqlalchemy.exc import OperationalError
|
||||
from sqlalchemy.schema import MetaData
|
||||
from sqlalchemy.schema import Index
|
||||
from trove.openstack.common import log as logging
|
||||
from sqlalchemy.schema import MetaData
|
||||
|
||||
from trove.db.sqlalchemy.migrate_repo.schema import Table
|
||||
from trove.openstack.common import log as logging
|
||||
|
||||
logger = logging.getLogger('trove.db.sqlalchemy.migrate_repo.schema')
|
||||
|
||||
|
@ -13,11 +13,11 @@
|
||||
# under the License.
|
||||
|
||||
from sqlalchemy.exc import OperationalError
|
||||
from sqlalchemy.schema import MetaData
|
||||
from sqlalchemy.schema import Index
|
||||
from trove.openstack.common import log as logging
|
||||
from sqlalchemy.schema import MetaData
|
||||
|
||||
from trove.db.sqlalchemy.migrate_repo.schema import Table
|
||||
from trove.openstack.common import log as logging
|
||||
|
||||
logger = logging.getLogger('trove.db.sqlalchemy.migrate_repo.schema')
|
||||
|
||||
|
@ -17,11 +17,11 @@ from sqlalchemy.schema import Column
|
||||
from sqlalchemy.schema import MetaData
|
||||
from sqlalchemy.schema import UniqueConstraint
|
||||
|
||||
from trove.db.sqlalchemy.migrate_repo.schema import Boolean
|
||||
from trove.db.sqlalchemy.migrate_repo.schema import create_tables
|
||||
from trove.db.sqlalchemy.migrate_repo.schema import drop_tables
|
||||
from trove.db.sqlalchemy.migrate_repo.schema import String
|
||||
from trove.db.sqlalchemy.migrate_repo.schema import Table
|
||||
from trove.db.sqlalchemy.migrate_repo.schema import Boolean
|
||||
|
||||
|
||||
meta = MetaData()
|
||||
|
@ -13,8 +13,8 @@
|
||||
# under the License.
|
||||
|
||||
from sqlalchemy.schema import Column
|
||||
from sqlalchemy.schema import MetaData
|
||||
from sqlalchemy.schema import ForeignKey
|
||||
from sqlalchemy.schema import MetaData
|
||||
|
||||
from trove.db.sqlalchemy.migrate_repo.schema import String
|
||||
from trove.db.sqlalchemy.migrate_repo.schema import Table
|
||||
|
@ -15,8 +15,8 @@
|
||||
from sqlalchemy.schema import Column
|
||||
from sqlalchemy.schema import MetaData
|
||||
|
||||
from trove.db.sqlalchemy.migrate_repo.schema import Table
|
||||
from trove.db.sqlalchemy.migrate_repo.schema import DateTime
|
||||
from trove.db.sqlalchemy.migrate_repo.schema import Table
|
||||
|
||||
|
||||
def upgrade(migrate_engine):
|
||||
|
@ -20,8 +20,8 @@ from sqlalchemy.schema import MetaData
|
||||
|
||||
from trove.db.sqlalchemy.migrate_repo.schema import Boolean
|
||||
from trove.db.sqlalchemy.migrate_repo.schema import create_tables
|
||||
from trove.db.sqlalchemy.migrate_repo.schema import drop_tables
|
||||
from trove.db.sqlalchemy.migrate_repo.schema import DateTime
|
||||
from trove.db.sqlalchemy.migrate_repo.schema import drop_tables
|
||||
from trove.db.sqlalchemy.migrate_repo.schema import Integer
|
||||
from trove.db.sqlalchemy.migrate_repo.schema import String
|
||||
from trove.db.sqlalchemy.migrate_repo.schema import Table
|
||||
|
@ -18,10 +18,10 @@ from sqlalchemy.schema import Column
|
||||
from sqlalchemy.schema import MetaData
|
||||
from sqlalchemy.schema import UniqueConstraint
|
||||
|
||||
from trove.db.sqlalchemy.migrate_repo.schema import create_tables
|
||||
from trove.db.sqlalchemy.migrate_repo.schema import drop_tables
|
||||
from trove.db.sqlalchemy.migrate_repo.schema import DateTime
|
||||
from trove.db.sqlalchemy.migrate_repo.schema import Boolean
|
||||
from trove.db.sqlalchemy.migrate_repo.schema import create_tables
|
||||
from trove.db.sqlalchemy.migrate_repo.schema import DateTime
|
||||
from trove.db.sqlalchemy.migrate_repo.schema import drop_tables
|
||||
from trove.db.sqlalchemy.migrate_repo.schema import String
|
||||
from trove.db.sqlalchemy.migrate_repo.schema import Table
|
||||
|
||||
|
@ -13,7 +13,6 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from trove.openstack.common import log as logging
|
||||
import os
|
||||
|
||||
from migrate.versioning import api as versioning_api
|
||||
@ -25,6 +24,7 @@ except ImportError:
|
||||
from migrate import exceptions as versioning_exceptions
|
||||
|
||||
from trove.common import exception
|
||||
from trove.openstack.common import log as logging
|
||||
|
||||
|
||||
logger = logging.getLogger('trove.db.sqlalchemy.migration')
|
||||
|
@ -14,6 +14,7 @@
|
||||
# under the License.
|
||||
|
||||
import contextlib
|
||||
|
||||
import osprofiler.sqlalchemy
|
||||
import sqlalchemy
|
||||
from sqlalchemy import create_engine
|
||||
@ -21,9 +22,9 @@ from sqlalchemy import MetaData
|
||||
from sqlalchemy.orm import sessionmaker
|
||||
|
||||
from trove.common import cfg
|
||||
from trove.openstack.common import log as logging
|
||||
from trove.common.i18n import _
|
||||
from trove.db.sqlalchemy import mappers
|
||||
from trove.openstack.common import log as logging
|
||||
|
||||
_ENGINE = None
|
||||
_MAKER = None
|
||||
@ -41,17 +42,17 @@ def configure_db(options, models_mapper=None):
|
||||
if models_mapper:
|
||||
models_mapper.map(_ENGINE)
|
||||
else:
|
||||
from trove.instance import models as base_models
|
||||
from trove.backup import models as backup_models
|
||||
from trove.cluster import models as cluster_models
|
||||
from trove.conductor import models as conductor_models
|
||||
from trove.configuration import models as configurations_models
|
||||
from trove.datastore import models as datastores_models
|
||||
from trove.dns import models as dns_models
|
||||
from trove.extensions.mysql import models as mysql_models
|
||||
from trove.guestagent import models as agent_models
|
||||
from trove.quota import models as quota_models
|
||||
from trove.backup import models as backup_models
|
||||
from trove.extensions.security_group import models as secgrp_models
|
||||
from trove.configuration import models as configurations_models
|
||||
from trove.conductor import models as conductor_models
|
||||
from trove.cluster import models as cluster_models
|
||||
from trove.guestagent import models as agent_models
|
||||
from trove.instance import models as base_models
|
||||
from trove.quota import models as quota_models
|
||||
|
||||
model_modules = [
|
||||
base_models,
|
||||
|
@ -17,14 +17,16 @@
|
||||
Dns Driver that uses Designate DNSaaS.
|
||||
"""
|
||||
|
||||
import base64
|
||||
import hashlib
|
||||
|
||||
from designateclient.v1 import Client
|
||||
from designateclient.v1.records import Record
|
||||
|
||||
from trove.common import cfg
|
||||
from trove.common import exception
|
||||
from trove.dns import driver
|
||||
from trove.openstack.common import log as logging
|
||||
from designateclient.v1 import Client
|
||||
from designateclient.v1.records import Record
|
||||
import base64
|
||||
import hashlib
|
||||
|
||||
|
||||
CONF = cfg.CONF
|
||||
@ -142,7 +144,7 @@ class DesignateInstanceEntryFactory(driver.DnsInstanceEntryFactory):
|
||||
# Constructing the hostname by hashing the instance ID.
|
||||
name = base64.b32encode(hashlib.md5(instance_id).digest())[:11].lower()
|
||||
hostname = ("%s.%s" % (name, zone.name))
|
||||
#Removing the leading dot if present
|
||||
# Removing the leading dot if present
|
||||
if hostname.endswith('.'):
|
||||
hostname = hostname[:-1]
|
||||
|
||||
|
@ -45,13 +45,13 @@ class DnsDriver(object):
|
||||
pass
|
||||
|
||||
def modify_content(self, name, content, dns_zone):
|
||||
#TODO(tim.simpson) I've found no use for this in RS impl of DNS w/
|
||||
# instances. Check to see its really needed.
|
||||
# TODO(tim.simpson) I've found no use for this in RS impl of DNS w/
|
||||
# instances. Check to see its really needed.
|
||||
pass
|
||||
|
||||
def rename_entry(self, content, name, dns_zone):
|
||||
#TODO(tim.simpson) I've found no use for this in RS impl of DNS w/
|
||||
# instances. Check to see its really needed.
|
||||
# TODO(tim.simpson) I've found no use for this in RS impl of DNS w/
|
||||
# instances. Check to see its really needed.
|
||||
pass
|
||||
|
||||
|
||||
|
@ -16,10 +16,10 @@
|
||||
"""
|
||||
Dns manager.
|
||||
"""
|
||||
from trove.openstack.common import log as logging
|
||||
|
||||
from trove.common import utils
|
||||
from trove.common import cfg
|
||||
from trove.common import utils
|
||||
from trove.openstack.common import log as logging
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
||||
|
@ -18,11 +18,11 @@ Model classes that map instance Ip to dns record.
|
||||
"""
|
||||
|
||||
|
||||
from trove.db import get_db_api
|
||||
from trove.common import exception
|
||||
from trove.common.models import ModelBase
|
||||
from trove.openstack.common import log as logging
|
||||
from trove.common.i18n import _
|
||||
from trove.common.models import ModelBase
|
||||
from trove.db import get_db_api
|
||||
from trove.openstack.common import log as logging
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
||||
|
@ -13,8 +13,8 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from trove.openstack.common import log as logging
|
||||
from trove.instance.models import DBInstance
|
||||
from trove.openstack.common import log as logging
|
||||
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
@ -13,14 +13,13 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from trove.openstack.common import log as logging
|
||||
|
||||
from trove.common import wsgi
|
||||
import trove.common.apischema as apischema
|
||||
from trove.common.auth import admin_context
|
||||
from trove.common.i18n import _
|
||||
from trove.common import wsgi
|
||||
from trove.extensions.account import models
|
||||
from trove.extensions.account import views
|
||||
from trove.common.i18n import _
|
||||
import trove.common.apischema as apischema
|
||||
from trove.openstack.common import log as logging
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
||||
|
@ -15,14 +15,14 @@
|
||||
|
||||
|
||||
from trove.cluster.service import ClusterController
|
||||
from trove.common import exception
|
||||
from trove.common import wsgi
|
||||
import trove.common.apischema as apischema
|
||||
from trove.common.auth import admin_context
|
||||
from trove.common import exception
|
||||
from trove.common.i18n import _
|
||||
from trove.common import wsgi
|
||||
from trove.extensions.mgmt.clusters import models
|
||||
from trove.extensions.mgmt.clusters import views
|
||||
from trove.openstack.common import log as logging
|
||||
from trove.common.i18n import _
|
||||
import trove.common.apischema as apischema
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
||||
|
@ -14,15 +14,15 @@
|
||||
# under the License.
|
||||
|
||||
|
||||
from trove.common import exception
|
||||
from trove.common import wsgi
|
||||
import trove.common.apischema as apischema
|
||||
from trove.common.auth import admin_context
|
||||
from trove.common import exception
|
||||
from trove.common.i18n import _
|
||||
from trove.common import wsgi
|
||||
from trove.configuration import models as config_models
|
||||
from trove.datastore import models as ds_models
|
||||
from trove.extensions.mgmt.configuration import views
|
||||
from trove.openstack.common import log as logging
|
||||
from trove.common.i18n import _
|
||||
import trove.common.apischema as apischema
|
||||
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
@ -15,10 +15,10 @@
|
||||
|
||||
|
||||
from trove.common import exception
|
||||
from trove.common.i18n import _
|
||||
from trove.common import wsgi
|
||||
from trove.extensions.mgmt.host import models
|
||||
from trove.openstack.common import log as logging
|
||||
from trove.common.i18n import _
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
||||
|
@ -17,16 +17,16 @@
|
||||
Model classes that extend the instances functionality for MySQL instances.
|
||||
"""
|
||||
|
||||
from trove.openstack.common import log as logging
|
||||
from trove.common.i18n import _
|
||||
from novaclient import exceptions as nova_exceptions
|
||||
|
||||
from trove.common import exception
|
||||
from trove.common.i18n import _
|
||||
from trove.common.remote import create_guest_client
|
||||
from trove.common.remote import create_nova_client
|
||||
from trove.instance.models import DBInstance
|
||||
from trove.instance.models import InstanceServiceStatus
|
||||
from trove.instance.models import SimpleInstance
|
||||
from trove.common.remote import create_guest_client
|
||||
from trove.common.remote import create_nova_client
|
||||
from novaclient import exceptions as nova_exceptions
|
||||
from trove.openstack.common import log as logging
|
||||
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
@ -14,13 +14,13 @@
|
||||
# under the License.
|
||||
|
||||
|
||||
from trove.common import wsgi
|
||||
from trove.common.auth import admin_context
|
||||
from trove.common.i18n import _
|
||||
from trove.common import wsgi
|
||||
from trove.extensions.mgmt.host import models
|
||||
from trove.extensions.mgmt.host import views
|
||||
from trove.instance.service import InstanceController
|
||||
from trove.openstack.common import log as logging
|
||||
from trove.common.i18n import _
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
||||
|
@ -17,11 +17,11 @@ from trove.common import cfg
|
||||
from trove.common import exception
|
||||
from trove.common import remote
|
||||
from trove.common import utils
|
||||
from trove.openstack.common import log as logging
|
||||
from trove.instance import models as imodels
|
||||
from trove.instance.models import load_instance, InstanceServiceStatus
|
||||
from trove.instance import models as instance_models
|
||||
from trove.extensions.mysql import models as mysql_models
|
||||
from trove.instance import models as imodels
|
||||
from trove.instance import models as instance_models
|
||||
from trove.instance.models import load_instance, InstanceServiceStatus
|
||||
from trove.openstack.common import log as logging
|
||||
from trove import rpc
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
@ -17,19 +17,19 @@
|
||||
from novaclient import exceptions as nova_exceptions
|
||||
|
||||
from trove.backup.models import Backup
|
||||
from trove.common import exception
|
||||
from trove.common import wsgi
|
||||
import trove.common.apischema as apischema
|
||||
from trove.common.auth import admin_context
|
||||
from trove.instance import models as instance_models
|
||||
from trove.common import exception
|
||||
from trove.common.i18n import _
|
||||
from trove.common import wsgi
|
||||
from trove.extensions.mgmt.instances import models
|
||||
from trove.extensions.mgmt.instances import views
|
||||
from trove.extensions.mgmt.instances.views import DiagnosticsView
|
||||
from trove.extensions.mgmt.instances.views import HwInfoView
|
||||
from trove.extensions.mysql import models as mysql_models
|
||||
from trove.instance import models as instance_models
|
||||
from trove.instance.service import InstanceController
|
||||
from trove.openstack.common import log as logging
|
||||
from trove.common.i18n import _
|
||||
import trove.common.apischema as apischema
|
||||
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
@ -13,13 +13,13 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from trove.common import wsgi
|
||||
from trove.common import exception
|
||||
from trove.common.auth import admin_context
|
||||
from trove.common import exception
|
||||
from trove.common import wsgi
|
||||
from trove.extensions.mgmt.quota import views
|
||||
from trove.openstack.common import log as logging
|
||||
from trove.quota.quota import QUOTAS as quota_engine
|
||||
from trove.quota.models import Quota
|
||||
from trove.quota.quota import QUOTAS as quota_engine
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
||||
|
@ -13,12 +13,12 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from trove.common import wsgi
|
||||
import trove.common.apischema as apischema
|
||||
from trove.common.auth import admin_context
|
||||
from trove.common.i18n import _
|
||||
from trove.common import wsgi
|
||||
from trove.extensions.mgmt.upgrade.models import UpgradeMessageSender
|
||||
from trove.openstack.common import log as logging
|
||||
from trove.common.i18n import _
|
||||
import trove.common.apischema as apischema
|
||||
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
@ -14,12 +14,12 @@
|
||||
# under the License.
|
||||
|
||||
|
||||
from trove.common import wsgi
|
||||
from trove.common.auth import admin_context
|
||||
from trove.common.i18n import _
|
||||
from trove.common import wsgi
|
||||
from trove.extensions.mgmt.volume import models
|
||||
from trove.extensions.mgmt.volume import views
|
||||
from trove.openstack.common import log as logging
|
||||
from trove.common.i18n import _
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
||||
|
@ -19,8 +19,8 @@ Model classes that extend the instances functionality for MySQL instances.
|
||||
|
||||
from trove.common import cfg
|
||||
from trove.common import exception
|
||||
from trove.common import utils
|
||||
from trove.common.remote import create_guest_client
|
||||
from trove.common import utils
|
||||
from trove.db import get_db_api
|
||||
from trove.guestagent.db import models as guest_models
|
||||
from trove.instance import models as base_models
|
||||
|
@ -13,23 +13,22 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from oslo_utils import strutils
|
||||
import webob.exc
|
||||
|
||||
from oslo_utils import strutils
|
||||
|
||||
import trove.common.apischema as apischema
|
||||
from trove.common import exception
|
||||
from trove.common.i18n import _
|
||||
from trove.common import pagination
|
||||
from trove.common import wsgi
|
||||
from trove.common.utils import correct_id_with_req
|
||||
from trove.extensions.mysql.common import populate_validated_databases
|
||||
from trove.common import wsgi
|
||||
from trove.extensions.mysql.common import populate_users
|
||||
from trove.extensions.mysql.common import populate_validated_databases
|
||||
from trove.extensions.mysql.common import unquote_user_host
|
||||
from trove.extensions.mysql import models
|
||||
from trove.extensions.mysql import views
|
||||
from trove.guestagent.db import models as guest_models
|
||||
from trove.openstack.common import log as logging
|
||||
from trove.common.i18n import _
|
||||
import trove.common.apischema as apischema
|
||||
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
@ -13,17 +13,16 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from trove.openstack.common import log as logging
|
||||
|
||||
from trove.common import extensions
|
||||
from trove.extensions.mgmt.clusters.service import MgmtClusterController
|
||||
from trove.extensions.mgmt.configuration import service as conf_service
|
||||
from trove.extensions.mgmt.instances.service import MgmtInstanceController
|
||||
from trove.extensions.mgmt.host.service import HostController
|
||||
from trove.extensions.mgmt.quota.service import QuotaController
|
||||
from trove.extensions.mgmt.host.instance import service as hostservice
|
||||
from trove.extensions.mgmt.volume.service import StorageController
|
||||
from trove.extensions.mgmt.host.service import HostController
|
||||
from trove.extensions.mgmt.instances.service import MgmtInstanceController
|
||||
from trove.extensions.mgmt.quota.service import QuotaController
|
||||
from trove.extensions.mgmt.upgrade.service import UpgradeController
|
||||
from trove.extensions.mgmt.volume.service import StorageController
|
||||
from trove.openstack.common import log as logging
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
||||
|
@ -14,11 +14,11 @@
|
||||
# under the License.
|
||||
#
|
||||
|
||||
from trove.openstack.common import log as logging
|
||||
|
||||
from trove.common import extensions
|
||||
from trove.common import cfg
|
||||
from trove.common import extensions
|
||||
from trove.extensions.security_group import service
|
||||
from trove.openstack.common import log as logging
|
||||
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
@ -19,10 +19,10 @@ Model classes for Security Groups and Security Group Rules on instances.
|
||||
"""
|
||||
from trove.common import cfg
|
||||
from trove.common import exception
|
||||
from trove.db.models import DatabaseModelBase
|
||||
from trove.common.models import NetworkRemoteModelBase
|
||||
from trove.openstack.common import log as logging
|
||||
from trove.common.i18n import _
|
||||
from trove.common.models import NetworkRemoteModelBase
|
||||
from trove.db.models import DatabaseModelBase
|
||||
from trove.openstack.common import log as logging
|
||||
|
||||
|
||||
CONF = cfg.CONF
|
||||
|
@ -15,14 +15,14 @@
|
||||
#
|
||||
from trove.common import cfg
|
||||
from trove.common import exception
|
||||
from trove.common import wsgi
|
||||
from trove.common.i18n import _
|
||||
from trove.common import utils
|
||||
from trove.common import wsgi
|
||||
from trove.datastore.models import DatastoreVersion
|
||||
from trove.extensions.security_group import models
|
||||
from trove.extensions.security_group import views
|
||||
from trove.instance import models as instance_models
|
||||
from trove.openstack.common import log as logging
|
||||
from trove.common.i18n import _
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
CONF = cfg.CONF
|
||||
|
@ -14,9 +14,10 @@
|
||||
# under the License.
|
||||
#
|
||||
|
||||
from trove.openstack.common import log as logging
|
||||
import os
|
||||
|
||||
from trove.openstack.common import log as logging
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
||||
|
||||
|
@ -14,8 +14,8 @@
|
||||
# under the License.
|
||||
|
||||
|
||||
from trove.common.views import create_links
|
||||
from trove.common import cfg
|
||||
from trove.common.views import create_links
|
||||
|
||||
CONF = cfg.CONF
|
||||
|
||||
|
@ -18,8 +18,8 @@ Handles all request to the Platform or Guest VM
|
||||
"""
|
||||
|
||||
from eventlet import Timeout
|
||||
from oslo_messaging.rpc.client import RemoteError
|
||||
import oslo_messaging as messaging
|
||||
from oslo_messaging.rpc.client import RemoteError
|
||||
|
||||
from trove.common import cfg
|
||||
from trove.common import exception
|
||||
|
@ -15,18 +15,19 @@
|
||||
#
|
||||
|
||||
import logging
|
||||
|
||||
from trove.backup.state import BackupState
|
||||
from trove.common import cfg
|
||||
from trove.common import context as trove_context
|
||||
from trove.common.i18n import _
|
||||
from trove.conductor import api as conductor_api
|
||||
from trove.guestagent.common import timeutils
|
||||
from trove.guestagent.dbaas import get_filesystem_volume_stats
|
||||
from trove.guestagent.strategies.backup.base import BackupError
|
||||
from trove.guestagent.strategies.backup.base import UnknownBackupType
|
||||
from trove.guestagent.strategies.storage import get_storage_strategy
|
||||
from trove.guestagent.strategies.backup import get_backup_strategy
|
||||
from trove.guestagent.strategies.restore import get_restore_strategy
|
||||
from trove.common.i18n import _ # noqa
|
||||
from trove.guestagent.strategies.storage import get_storage_strategy
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
CONF = cfg.CONF
|
||||
|
@ -14,14 +14,15 @@
|
||||
# under the License.
|
||||
|
||||
import inspect
|
||||
import operator
|
||||
import os
|
||||
import stat
|
||||
|
||||
import operator
|
||||
from oslo_concurrency.processutils import UnknownArgumentError
|
||||
|
||||
from trove.common import exception
|
||||
from trove.common import utils
|
||||
from trove.common.i18n import _
|
||||
from trove.common import utils
|
||||
|
||||
REDHAT = 'redhat'
|
||||
DEBIAN = 'debian'
|
||||
|
@ -442,7 +442,7 @@ class SetServerVariable(object):
|
||||
else:
|
||||
return "SET GLOBAL %s=%s" % (self.key, self.value)
|
||||
|
||||
### Miscellaneous queries that need no parameters.
|
||||
# Miscellaneous queries that need no parameters.
|
||||
|
||||
FLUSH = "FLUSH PRIVILEGES;"
|
||||
ROOT_ENABLED = ("SELECT User FROM mysql.user "
|
||||
|
@ -1,6 +1,7 @@
|
||||
from oslo_utils import timeutils
|
||||
from datetime import datetime
|
||||
|
||||
from oslo_utils import timeutils
|
||||
|
||||
|
||||
def float_utcnow():
|
||||
return float(datetime.strftime(timeutils.utcnow(), "%s.%f"))
|
||||
|
@ -15,14 +15,15 @@
|
||||
#
|
||||
|
||||
import os
|
||||
|
||||
from trove.common import cfg
|
||||
from trove.common import exception
|
||||
from trove.guestagent import volume
|
||||
from trove.guestagent.datastore.experimental.cassandra import service
|
||||
from trove.openstack.common import periodic_task
|
||||
from trove.openstack.common import log as logging
|
||||
from trove.common.i18n import _
|
||||
from trove.guestagent.datastore.experimental.cassandra import service
|
||||
from trove.guestagent import dbaas
|
||||
from trove.guestagent import volume
|
||||
from trove.openstack.common import log as logging
|
||||
from trove.openstack.common import periodic_task
|
||||
|
||||
CONF = cfg.CONF
|
||||
LOG = logging.getLogger(__name__)
|
||||
@ -91,9 +92,9 @@ class Manager(periodic_task.PeriodicTasks):
|
||||
device.unmount_device(device_path)
|
||||
device.format()
|
||||
if os.path.exists(mount_point):
|
||||
#rsync exiting data
|
||||
# rsync exiting data
|
||||
device.migrate_data(mount_point)
|
||||
#mount the volume
|
||||
# mount the volume
|
||||
device.mount(mount_point)
|
||||
LOG.debug("Mounting new volume.")
|
||||
|
||||
|
@ -15,19 +15,21 @@
|
||||
|
||||
import os
|
||||
import tempfile
|
||||
import yaml
|
||||
|
||||
from oslo_utils import netutils
|
||||
import yaml
|
||||
|
||||
from trove.common import cfg
|
||||
from trove.common import utils
|
||||
from trove.common import exception
|
||||
from trove.common.i18n import _
|
||||
from trove.common import instance as rd_instance
|
||||
from trove.common import utils
|
||||
from trove.guestagent.common import operating_system
|
||||
from trove.guestagent.common.operating_system import FileMode
|
||||
from trove.guestagent.datastore.experimental.cassandra import system
|
||||
from trove.guestagent.datastore import service
|
||||
from trove.guestagent import pkg
|
||||
from trove.openstack.common import log as logging
|
||||
from trove.common.i18n import _
|
||||
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
@ -138,7 +140,7 @@ class CassandraApp(object):
|
||||
os.write(conf_fd, config_contents)
|
||||
operating_system.move(conf_path, system.CASSANDRA_CONF,
|
||||
as_root=True)
|
||||
#TODO(denis_makogon): figure out the dynamic way to discover
|
||||
# TODO(denis_makogon): figure out the dynamic way to discover
|
||||
# configs owner since it can cause errors if there is
|
||||
# no cassandra user in operating system
|
||||
operating_system.chown(system.CASSANDRA_CONF,
|
||||
|
@ -17,15 +17,15 @@ import os
|
||||
|
||||
from trove.common import cfg
|
||||
from trove.common import exception
|
||||
from trove.common.i18n import _
|
||||
from trove.common import instance as rd_instance
|
||||
from trove.guestagent import backup
|
||||
from trove.guestagent import dbaas
|
||||
from trove.guestagent import volume
|
||||
from trove.guestagent.datastore.experimental.couchbase import service
|
||||
from trove.guestagent.datastore.experimental.couchbase import system
|
||||
from trove.guestagent import dbaas
|
||||
from trove.guestagent import volume
|
||||
from trove.openstack.common import log as logging
|
||||
from trove.openstack.common import periodic_task
|
||||
from trove.common.i18n import _
|
||||
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
@ -14,24 +14,25 @@
|
||||
# under the License.
|
||||
|
||||
import json
|
||||
import pexpect
|
||||
import os
|
||||
import stat
|
||||
import subprocess
|
||||
import tempfile
|
||||
|
||||
from oslo_utils import netutils
|
||||
import pexpect
|
||||
|
||||
from trove.common import cfg
|
||||
from trove.common import exception
|
||||
from trove.common.i18n import _
|
||||
from trove.common import instance as rd_instance
|
||||
from trove.common import utils as utils
|
||||
from trove.guestagent import pkg
|
||||
from trove.guestagent.common import operating_system
|
||||
from trove.guestagent.datastore import service
|
||||
from trove.guestagent.datastore.experimental.couchbase import system
|
||||
from trove.guestagent.datastore import service
|
||||
from trove.guestagent.db import models
|
||||
from trove.guestagent import pkg
|
||||
from trove.openstack.common import log as logging
|
||||
from trove.common.i18n import _
|
||||
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
@ -17,12 +17,12 @@ import os
|
||||
|
||||
from trove.common import cfg
|
||||
from trove.common import exception
|
||||
from trove.openstack.common import log as logging
|
||||
from trove.openstack.common import periodic_task
|
||||
from trove.common.i18n import _
|
||||
from trove.guestagent.datastore.experimental.couchdb import service
|
||||
from trove.guestagent import dbaas
|
||||
from trove.guestagent import volume
|
||||
from trove.guestagent.datastore.experimental.couchdb import service
|
||||
from trove.common.i18n import _
|
||||
from trove.openstack.common import log as logging
|
||||
from trove.openstack.common import periodic_task
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
CONF = cfg.CONF
|
||||
|
@ -17,15 +17,15 @@ import json
|
||||
|
||||
from trove.common import cfg
|
||||
from trove.common import exception
|
||||
from trove.common.i18n import _
|
||||
from trove.common import instance as rd_instance
|
||||
from trove.common import utils as utils
|
||||
from trove.guestagent import pkg
|
||||
from trove.guestagent.common import operating_system
|
||||
from trove.guestagent.common.operating_system import FileMode
|
||||
from trove.guestagent.datastore import service
|
||||
from trove.guestagent.datastore.experimental.couchdb import system
|
||||
from trove.guestagent.datastore import service
|
||||
from trove.guestagent import pkg
|
||||
from trove.openstack.common import log as logging
|
||||
from trove.common.i18n import _
|
||||
|
||||
CONF = cfg.CONF
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
@ -15,12 +15,12 @@
|
||||
|
||||
from trove.common import cfg
|
||||
from trove.common import exception
|
||||
from trove.openstack.common import log as logging
|
||||
from trove.openstack.common import periodic_task
|
||||
from trove.guestagent.datastore.experimental.db2 import service
|
||||
from trove.guestagent import dbaas
|
||||
from trove.guestagent import volume
|
||||
from trove.guestagent.datastore.experimental.db2 import service
|
||||
from trove.openstack.common.gettextutils import _
|
||||
from trove.openstack.common import log as logging
|
||||
from trove.openstack.common import periodic_task
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
CONF = cfg.CONF
|
||||
|
@ -18,11 +18,11 @@ from trove.common import exception
|
||||
from trove.common import instance as rd_instance
|
||||
from trove.common import utils as utils
|
||||
from trove.guestagent.common import operating_system
|
||||
from trove.guestagent.datastore import service
|
||||
from trove.guestagent.datastore.experimental.db2 import system
|
||||
from trove.guestagent.datastore import service
|
||||
from trove.guestagent.db import models
|
||||
from trove.openstack.common import log as logging
|
||||
from trove.openstack.common.gettextutils import _
|
||||
from trove.openstack.common import log as logging
|
||||
|
||||
CONF = cfg.CONF
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
@ -16,17 +16,18 @@
|
||||
import os
|
||||
|
||||
from oslo_utils import netutils
|
||||
|
||||
from trove.common import cfg
|
||||
from trove.common import exception
|
||||
from trove.common.i18n import _
|
||||
from trove.common import instance as ds_instance
|
||||
from trove.guestagent import dbaas
|
||||
from trove.guestagent import volume
|
||||
from trove.guestagent.common import operating_system
|
||||
from trove.guestagent.datastore.experimental.mongodb import (
|
||||
service as mongo_service)
|
||||
from trove.guestagent.datastore.experimental.mongodb import system
|
||||
from trove.guestagent import dbaas
|
||||
from trove.guestagent import volume
|
||||
from trove.openstack.common import log as logging
|
||||
from trove.common.i18n import _
|
||||
from trove.openstack.common import periodic_task
|
||||
|
||||
|
||||
|
@ -14,20 +14,21 @@
|
||||
# under the License.
|
||||
|
||||
import json
|
||||
import os
|
||||
import re
|
||||
|
||||
import os
|
||||
from oslo_utils import netutils
|
||||
|
||||
from trove.common import cfg
|
||||
from trove.common import utils as utils
|
||||
from trove.common import exception
|
||||
from trove.common import instance as ds_instance
|
||||
from trove.common.exception import ProcessExecutionError
|
||||
from trove.guestagent.datastore import service
|
||||
from trove.guestagent.datastore.experimental.mongodb import system
|
||||
from trove.openstack.common import log as logging
|
||||
from trove.guestagent.common import operating_system
|
||||
from trove.common.i18n import _
|
||||
from trove.common import instance as ds_instance
|
||||
from trove.common import utils as utils
|
||||
from trove.guestagent.common import operating_system
|
||||
from trove.guestagent.datastore.experimental.mongodb import system
|
||||
from trove.guestagent.datastore import service
|
||||
from trove.openstack.common import log as logging
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
CONF = cfg.CONF
|
||||
@ -323,7 +324,7 @@ class MongoDBApp(object):
|
||||
# add replica-set members
|
||||
for member in members:
|
||||
self.do_mongo('rs.add("' + member + '")')
|
||||
# TODO(ramashri) see if hardcoded values can be removed
|
||||
# TODO(ramashri) see if hardcoded values can be removed
|
||||
utils.poll_until(check_rs_status, sleep_time=60, time_out=100)
|
||||
|
||||
|
||||
@ -359,7 +360,7 @@ class MongoDbAppStatus(service.BaseDbStatus):
|
||||
if self._is_config_server() is True:
|
||||
status_check = (system.CMD_STATUS %
|
||||
(netutils.get_my_ipv4() +
|
||||
' --port 27019'))
|
||||
' --port 27019'))
|
||||
else:
|
||||
status_check = (system.CMD_STATUS %
|
||||
netutils.get_my_ipv4())
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user