i18n - Make string translatable
Since internationalization should be enabled in Watcher, this patchset refactors the Watcher codebase to wrap previously untranslatable strings with i18n translation functions so we can import them for translation into the .pot template file. Partially Implements: blueprint support-translation Change-Id: I425967a60b5a7957f753894e5d2ba0d2c5009d1d
This commit is contained in:
@@ -181,8 +181,9 @@ class MultiType(wtypes.UserType):
|
|||||||
return value
|
return value
|
||||||
else:
|
else:
|
||||||
raise ValueError(
|
raise ValueError(
|
||||||
_("Wrong type. Expected '%(type)s', got '%(value)s'")
|
_("Wrong type. Expected '%(type)s', got '%(value)s'"),
|
||||||
% {'type': self.types, 'value': type(value)})
|
type=self.types, value=type(value)
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
class JsonPatchType(wtypes.Base):
|
class JsonPatchType(wtypes.Base):
|
||||||
|
|||||||
@@ -40,10 +40,9 @@ class AuthTokenMiddleware(auth_token.AuthProtocol):
|
|||||||
self.public_api_routes = [re.compile(route_pattern_tpl % route_tpl)
|
self.public_api_routes = [re.compile(route_pattern_tpl % route_tpl)
|
||||||
for route_tpl in public_api_routes]
|
for route_tpl in public_api_routes]
|
||||||
except re.error as e:
|
except re.error as e:
|
||||||
msg = _('Cannot compile public API routes: %s') % e
|
LOG.exception(e)
|
||||||
|
raise exception.ConfigInvalid(
|
||||||
LOG.error(msg)
|
error_msg=_('Cannot compile public API routes'))
|
||||||
raise exception.ConfigInvalid(error_msg=msg)
|
|
||||||
|
|
||||||
super(AuthTokenMiddleware, self).__init__(app, conf)
|
super(AuthTokenMiddleware, self).__init__(app, conf)
|
||||||
|
|
||||||
|
|||||||
@@ -89,5 +89,5 @@ class ApplierManager(MessagingCore):
|
|||||||
LOG.debug("type_event => %s" % str(event_type))
|
LOG.debug("type_event => %s" % str(event_type))
|
||||||
LOG.debug("data => %s" % str(data))
|
LOG.debug("data => %s" % str(data))
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
LOG.error("evt %s" % e.message)
|
LOG.exception(e)
|
||||||
raise e
|
raise
|
||||||
|
|||||||
@@ -20,7 +20,7 @@
|
|||||||
|
|
||||||
from oslo_config import cfg
|
from oslo_config import cfg
|
||||||
|
|
||||||
|
from watcher._i18n import _
|
||||||
from watcher.applier.primitives.base import BasePrimitive
|
from watcher.applier.primitives.base import BasePrimitive
|
||||||
from watcher.applier.primitives.wrapper.nova_wrapper import NovaWrapper
|
from watcher.applier.primitives.wrapper.nova_wrapper import NovaWrapper
|
||||||
from watcher.applier.promise import Promise
|
from watcher.applier.promise import Promise
|
||||||
@@ -70,7 +70,8 @@ class ChangeNovaServiceState(BasePrimitive):
|
|||||||
|
|
||||||
def nova_manage_service(self, state):
|
def nova_manage_service(self, state):
|
||||||
if state is None:
|
if state is None:
|
||||||
raise IllegalArgumentException("The target state is not defined")
|
raise IllegalArgumentException(
|
||||||
|
_("The target state is not defined"))
|
||||||
|
|
||||||
keystone = KeystoneClient()
|
keystone = KeystoneClient()
|
||||||
wrapper = NovaWrapper(keystone.get_credentials(),
|
wrapper = NovaWrapper(keystone.get_credentials(),
|
||||||
|
|||||||
@@ -20,7 +20,6 @@ from oslo_config import cfg
|
|||||||
from oslo_log import log
|
from oslo_log import log
|
||||||
import oslo_messaging as om
|
import oslo_messaging as om
|
||||||
|
|
||||||
|
|
||||||
from watcher.applier.manager import APPLIER_MANAGER_OPTS
|
from watcher.applier.manager import APPLIER_MANAGER_OPTS
|
||||||
from watcher.applier.manager import opt_group
|
from watcher.applier.manager import opt_group
|
||||||
from watcher.common import exception
|
from watcher.common import exception
|
||||||
@@ -69,5 +68,5 @@ class ApplierAPI(MessagingCore):
|
|||||||
try:
|
try:
|
||||||
pass
|
pass
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
LOG.error("evt %s" % e.message)
|
LOG.exception(e)
|
||||||
raise e
|
raise
|
||||||
|
|||||||
@@ -24,11 +24,9 @@ SHOULD include dedicated exception logging.
|
|||||||
|
|
||||||
from oslo_config import cfg
|
from oslo_config import cfg
|
||||||
from oslo_log import log as logging
|
from oslo_log import log as logging
|
||||||
|
|
||||||
import six
|
import six
|
||||||
|
|
||||||
from watcher._i18n import _
|
from watcher._i18n import _, _LE
|
||||||
from watcher._i18n import _LE
|
|
||||||
|
|
||||||
LOG = logging.getLogger(__name__)
|
LOG = logging.getLogger(__name__)
|
||||||
|
|
||||||
@@ -43,7 +41,7 @@ CONF.register_opts(exc_log_opts)
|
|||||||
|
|
||||||
|
|
||||||
def _cleanse_dict(original):
|
def _cleanse_dict(original):
|
||||||
"""Strip all admin_password, new_pass, rescue_pass keys from a dict."""
|
"""Strip all admin_password, new_pass, rescue_pass keys from a dict"""
|
||||||
return dict((k, v) for k, v in six.iteritems(original) if "_pass" not in k)
|
return dict((k, v) for k, v in six.iteritems(original) if "_pass" not in k)
|
||||||
|
|
||||||
|
|
||||||
@@ -55,7 +53,7 @@ class WatcherException(Exception):
|
|||||||
with the keyword arguments provided to the constructor.
|
with the keyword arguments provided to the constructor.
|
||||||
|
|
||||||
"""
|
"""
|
||||||
message = _("An unknown exception occurred.")
|
message = _("An unknown exception occurred")
|
||||||
code = 500
|
code = 500
|
||||||
headers = {}
|
headers = {}
|
||||||
safe = False
|
safe = False
|
||||||
@@ -78,7 +76,7 @@ class WatcherException(Exception):
|
|||||||
# log the issue and the kwargs
|
# log the issue and the kwargs
|
||||||
LOG.exception(_LE('Exception in string format operation'))
|
LOG.exception(_LE('Exception in string format operation'))
|
||||||
for name, value in six.iteritems(kwargs):
|
for name, value in six.iteritems(kwargs):
|
||||||
LOG.error("%s: %s" % (name, value))
|
LOG.error("%s: %s", name, value)
|
||||||
|
|
||||||
if CONF.fatal_exception_format_errors:
|
if CONF.fatal_exception_format_errors:
|
||||||
raise e
|
raise e
|
||||||
@@ -89,7 +87,7 @@ class WatcherException(Exception):
|
|||||||
super(WatcherException, self).__init__(message)
|
super(WatcherException, self).__init__(message)
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
"""Encode to utf-8 then wsme api can consume it as well."""
|
"""Encode to utf-8 then wsme api can consume it as well"""
|
||||||
if not six.PY3:
|
if not six.PY3:
|
||||||
return unicode(self.args[0]).encode('utf-8')
|
return unicode(self.args[0]).encode('utf-8')
|
||||||
else:
|
else:
|
||||||
@@ -106,39 +104,39 @@ class WatcherException(Exception):
|
|||||||
|
|
||||||
|
|
||||||
class NotAuthorized(WatcherException):
|
class NotAuthorized(WatcherException):
|
||||||
message = _("Not authorized.")
|
message = _("Not authorized")
|
||||||
code = 403
|
code = 403
|
||||||
|
|
||||||
|
|
||||||
class OperationNotPermitted(NotAuthorized):
|
class OperationNotPermitted(NotAuthorized):
|
||||||
message = _("Operation not permitted.")
|
message = _("Operation not permitted")
|
||||||
|
|
||||||
|
|
||||||
class Invalid(WatcherException):
|
class Invalid(WatcherException):
|
||||||
message = _("Unacceptable parameters.")
|
message = _("Unacceptable parameters")
|
||||||
code = 400
|
code = 400
|
||||||
|
|
||||||
|
|
||||||
class ObjectNotFound(WatcherException):
|
class ObjectNotFound(WatcherException):
|
||||||
message = _("The %(name)s %(id)s could not be found.")
|
message = _("The %(name)s %(id)s could not be found")
|
||||||
|
|
||||||
|
|
||||||
class Conflict(WatcherException):
|
class Conflict(WatcherException):
|
||||||
message = _('Conflict.')
|
message = _('Conflict')
|
||||||
code = 409
|
code = 409
|
||||||
|
|
||||||
|
|
||||||
class ResourceNotFound(ObjectNotFound):
|
class ResourceNotFound(ObjectNotFound):
|
||||||
message = _("The %(name)s resource %(id)s could not be found.")
|
message = _("The %(name)s resource %(id)s could not be found")
|
||||||
code = 404
|
code = 404
|
||||||
|
|
||||||
|
|
||||||
class InvalidIdentity(Invalid):
|
class InvalidIdentity(Invalid):
|
||||||
message = _("Expected an uuid or int but received %(identity)s.")
|
message = _("Expected an uuid or int but received %(identity)s")
|
||||||
|
|
||||||
|
|
||||||
class InvalidGoal(Invalid):
|
class InvalidGoal(Invalid):
|
||||||
message = _("Goal %(goal)s is not defined in Watcher configuration file.")
|
message = _("Goal %(goal)s is not defined in Watcher configuration file")
|
||||||
|
|
||||||
|
|
||||||
# Cannot be templated as the error syntax varies.
|
# Cannot be templated as the error syntax varies.
|
||||||
@@ -148,73 +146,73 @@ class InvalidParameterValue(Invalid):
|
|||||||
|
|
||||||
|
|
||||||
class InvalidUUID(Invalid):
|
class InvalidUUID(Invalid):
|
||||||
message = _("Expected a uuid but received %(uuid)s.")
|
message = _("Expected a uuid but received %(uuid)s")
|
||||||
|
|
||||||
|
|
||||||
class InvalidName(Invalid):
|
class InvalidName(Invalid):
|
||||||
message = _("Expected a logical name but received %(name)s.")
|
message = _("Expected a logical name but received %(name)s")
|
||||||
|
|
||||||
|
|
||||||
class InvalidUuidOrName(Invalid):
|
class InvalidUuidOrName(Invalid):
|
||||||
message = _("Expected a logical name or uuid but received %(name)s.")
|
message = _("Expected a logical name or uuid but received %(name)s")
|
||||||
|
|
||||||
|
|
||||||
class AuditTemplateNotFound(ResourceNotFound):
|
class AuditTemplateNotFound(ResourceNotFound):
|
||||||
message = _("AuditTemplate %(audit_template)s could not be found.")
|
message = _("AuditTemplate %(audit_template)s could not be found")
|
||||||
|
|
||||||
|
|
||||||
class AuditTemplateAlreadyExists(Conflict):
|
class AuditTemplateAlreadyExists(Conflict):
|
||||||
message = _("An audit_template with UUID %(uuid)s or name %(name)s "
|
message = _("An audit_template with UUID %(uuid)s or name %(name)s "
|
||||||
"already exists.")
|
"already exists")
|
||||||
|
|
||||||
|
|
||||||
class AuditTemplateReferenced(Invalid):
|
class AuditTemplateReferenced(Invalid):
|
||||||
message = _("AuditTemplate %(audit_template)s is referenced by one or "
|
message = _("AuditTemplate %(audit_template)s is referenced by one or "
|
||||||
"multiple audit.")
|
"multiple audit")
|
||||||
|
|
||||||
|
|
||||||
class AuditNotFound(ResourceNotFound):
|
class AuditNotFound(ResourceNotFound):
|
||||||
message = _("Audit %(audit)s could not be found.")
|
message = _("Audit %(audit)s could not be found")
|
||||||
|
|
||||||
|
|
||||||
class AuditAlreadyExists(Conflict):
|
class AuditAlreadyExists(Conflict):
|
||||||
message = _("An audit with UUID %(uuid)s already exists.")
|
message = _("An audit with UUID %(uuid)s already exists")
|
||||||
|
|
||||||
|
|
||||||
class AuditReferenced(Invalid):
|
class AuditReferenced(Invalid):
|
||||||
message = _("Audit %(audit)s is referenced by one or multiple action "
|
message = _("Audit %(audit)s is referenced by one or multiple action "
|
||||||
"plans.")
|
"plans")
|
||||||
|
|
||||||
|
|
||||||
class ActionPlanNotFound(ResourceNotFound):
|
class ActionPlanNotFound(ResourceNotFound):
|
||||||
message = _("ActionPlan %(action plan)s could not be found.")
|
message = _("ActionPlan %(action plan)s could not be found")
|
||||||
|
|
||||||
|
|
||||||
class ActionPlanAlreadyExists(Conflict):
|
class ActionPlanAlreadyExists(Conflict):
|
||||||
message = _("An action plan with UUID %(uuid)s already exists.")
|
message = _("An action plan with UUID %(uuid)s already exists")
|
||||||
|
|
||||||
|
|
||||||
class ActionPlanReferenced(Invalid):
|
class ActionPlanReferenced(Invalid):
|
||||||
message = _("Action Plan %(action_plan)s is referenced by one or "
|
message = _("Action Plan %(action_plan)s is referenced by one or "
|
||||||
"multiple actions.")
|
"multiple actions")
|
||||||
|
|
||||||
|
|
||||||
class ActionNotFound(ResourceNotFound):
|
class ActionNotFound(ResourceNotFound):
|
||||||
message = _("Action %(action)s could not be found.")
|
message = _("Action %(action)s could not be found")
|
||||||
|
|
||||||
|
|
||||||
class ActionAlreadyExists(Conflict):
|
class ActionAlreadyExists(Conflict):
|
||||||
message = _("An action with UUID %(uuid)s already exists.")
|
message = _("An action with UUID %(uuid)s already exists")
|
||||||
|
|
||||||
|
|
||||||
class ActionReferenced(Invalid):
|
class ActionReferenced(Invalid):
|
||||||
message = _("Action plan %(action_plan)s is referenced by one or "
|
message = _("Action plan %(action_plan)s is referenced by one or "
|
||||||
"multiple goals.")
|
"multiple goals")
|
||||||
|
|
||||||
|
|
||||||
class ActionFilterCombinationProhibited(Invalid):
|
class ActionFilterCombinationProhibited(Invalid):
|
||||||
message = _("Filtering actions on both audit and action-plan is "
|
message = _("Filtering actions on both audit and action-plan is "
|
||||||
"prohibited.")
|
"prohibited")
|
||||||
|
|
||||||
|
|
||||||
class HTTPNotFound(ResourceNotFound):
|
class HTTPNotFound(ResourceNotFound):
|
||||||
@@ -232,8 +230,7 @@ class BaseException(Exception):
|
|||||||
|
|
||||||
def __init__(self, desc=""):
|
def __init__(self, desc=""):
|
||||||
if (not isinstance(desc, six.string_types)):
|
if (not isinstance(desc, six.string_types)):
|
||||||
raise IllegalArgumentException(
|
raise ValueError(_("Description must be an instance of str"))
|
||||||
"Description must be an instance of str")
|
|
||||||
|
|
||||||
desc = desc.strip()
|
desc = desc.strip()
|
||||||
|
|
||||||
@@ -243,7 +240,7 @@ class BaseException(Exception):
|
|||||||
return self._desc
|
return self._desc
|
||||||
|
|
||||||
def get_message(self):
|
def get_message(self):
|
||||||
return "An exception occurred without a description."
|
return _("An exception occurred without a description")
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
return self.get_message()
|
return self.get_message()
|
||||||
@@ -251,10 +248,8 @@ class BaseException(Exception):
|
|||||||
|
|
||||||
class IllegalArgumentException(BaseException):
|
class IllegalArgumentException(BaseException):
|
||||||
def __init__(self, desc):
|
def __init__(self, desc):
|
||||||
BaseException.__init__(self, desc)
|
desc = desc or _("Description cannot be empty")
|
||||||
|
super(IllegalArgumentException, self).__init__(desc)
|
||||||
if self._desc == "":
|
|
||||||
raise IllegalArgumentException("Description cannot be empty")
|
|
||||||
|
|
||||||
def get_message(self):
|
def get_message(self):
|
||||||
return self._desc
|
return self._desc
|
||||||
@@ -262,10 +257,8 @@ class IllegalArgumentException(BaseException):
|
|||||||
|
|
||||||
class NoSuchMetric(BaseException):
|
class NoSuchMetric(BaseException):
|
||||||
def __init__(self, desc):
|
def __init__(self, desc):
|
||||||
BaseException.__init__(self, desc)
|
desc = desc or _("No such metric")
|
||||||
|
super(NoSuchMetric, self).__init__(desc)
|
||||||
if self._desc == "":
|
|
||||||
raise NoSuchMetric("No such metric")
|
|
||||||
|
|
||||||
def get_message(self):
|
def get_message(self):
|
||||||
return self._desc
|
return self._desc
|
||||||
@@ -273,10 +266,8 @@ class NoSuchMetric(BaseException):
|
|||||||
|
|
||||||
class NoDataFound(BaseException):
|
class NoDataFound(BaseException):
|
||||||
def __init__(self, desc):
|
def __init__(self, desc):
|
||||||
BaseException.__init__(self, desc)
|
desc = desc or _("No rows were returned")
|
||||||
|
super(NoDataFound, self).__init__(desc)
|
||||||
if self._desc == "":
|
|
||||||
raise NoSuchMetric("no rows were returned")
|
|
||||||
|
|
||||||
def get_message(self):
|
def get_message(self):
|
||||||
return self._desc
|
return self._desc
|
||||||
@@ -287,11 +278,11 @@ class KeystoneFailure(WatcherException):
|
|||||||
|
|
||||||
|
|
||||||
class ClusterEmpty(WatcherException):
|
class ClusterEmpty(WatcherException):
|
||||||
message = _("The list of hypervisor(s) in the cluster is empty.'")
|
message = _("The list of hypervisor(s) in the cluster is empty")
|
||||||
|
|
||||||
|
|
||||||
class MetricCollectorNotDefined(WatcherException):
|
class MetricCollectorNotDefined(WatcherException):
|
||||||
message = _("The metrics resource collector is not defined.'")
|
message = _("The metrics resource collector is not defined")
|
||||||
|
|
||||||
|
|
||||||
class ClusterStateNotDefined(WatcherException):
|
class ClusterStateNotDefined(WatcherException):
|
||||||
@@ -301,12 +292,12 @@ class ClusterStateNotDefined(WatcherException):
|
|||||||
# Model
|
# Model
|
||||||
|
|
||||||
class VMNotFound(WatcherException):
|
class VMNotFound(WatcherException):
|
||||||
message = _("The VM could not be found.")
|
message = _("The VM could not be found")
|
||||||
|
|
||||||
|
|
||||||
class HypervisorNotFound(WatcherException):
|
class HypervisorNotFound(WatcherException):
|
||||||
message = _("The hypervisor could not be found.")
|
message = _("The hypervisor could not be found")
|
||||||
|
|
||||||
|
|
||||||
class MetaActionNotFound(WatcherException):
|
class MetaActionNotFound(WatcherException):
|
||||||
message = _("The Meta-Action could not be found.")
|
message = _("The Meta-Action could not be found")
|
||||||
|
|||||||
@@ -17,16 +17,15 @@
|
|||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
#
|
#
|
||||||
|
|
||||||
|
from keystoneclient.auth.identity import generic
|
||||||
|
from keystoneclient import session as keystone_session
|
||||||
from oslo_config import cfg
|
from oslo_config import cfg
|
||||||
from oslo_log import log
|
from oslo_log import log
|
||||||
|
|
||||||
from six.moves.urllib.parse import urljoin
|
from six.moves.urllib.parse import urljoin
|
||||||
from six.moves.urllib.parse import urlparse
|
from six.moves.urllib.parse import urlparse
|
||||||
|
|
||||||
from keystoneclient.auth.identity import generic
|
from watcher._i18n import _
|
||||||
from keystoneclient import session as keystone_session
|
from watcher.common import exception
|
||||||
|
|
||||||
from watcher.common.exception import KeystoneFailure
|
|
||||||
|
|
||||||
|
|
||||||
LOG = log.getLogger(__name__)
|
LOG = log.getLogger(__name__)
|
||||||
@@ -56,8 +55,9 @@ class KeystoneClient(object):
|
|||||||
def get_endpoint(self, **kwargs):
|
def get_endpoint(self, **kwargs):
|
||||||
kc = self._get_ksclient()
|
kc = self._get_ksclient()
|
||||||
if not kc.has_service_catalog():
|
if not kc.has_service_catalog():
|
||||||
raise KeystoneFailure('No Keystone service catalog '
|
raise exception.KeystoneFailure(
|
||||||
'loaded')
|
_('No Keystone service catalog loaded')
|
||||||
|
)
|
||||||
attr = None
|
attr = None
|
||||||
filter_value = None
|
filter_value = None
|
||||||
if kwargs.get('region_name'):
|
if kwargs.get('region_name'):
|
||||||
|
|||||||
@@ -15,14 +15,15 @@
|
|||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
import socket
|
import socket
|
||||||
|
import threading
|
||||||
|
|
||||||
import eventlet
|
import eventlet
|
||||||
from oslo_config import cfg
|
from oslo_config import cfg
|
||||||
from oslo_log import log
|
from oslo_log import log
|
||||||
import oslo_messaging as om
|
import oslo_messaging as om
|
||||||
from threading import Thread
|
|
||||||
from watcher.common.rpc import JsonPayloadSerializer
|
from watcher.common import rpc
|
||||||
from watcher.common.rpc import RequestContextSerializer
|
from watcher._i18n import _LE, _LW
|
||||||
|
|
||||||
# NOTE:
|
# NOTE:
|
||||||
# Ubuntu 14.04 forces librabbitmq when kombu is used
|
# Ubuntu 14.04 forces librabbitmq when kombu is used
|
||||||
@@ -35,7 +36,7 @@ LOG = log.getLogger(__name__)
|
|||||||
CONF = cfg.CONF
|
CONF = cfg.CONF
|
||||||
|
|
||||||
|
|
||||||
class MessagingHandler(Thread):
|
class MessagingHandler(threading.Thread):
|
||||||
|
|
||||||
def __init__(self, publisher_id, topic_watcher, endpoint, version,
|
def __init__(self, publisher_id, topic_watcher, endpoint, version,
|
||||||
serializer=None):
|
serializer=None):
|
||||||
@@ -67,7 +68,7 @@ class MessagingHandler(Thread):
|
|||||||
return self.__transport
|
return self.__transport
|
||||||
|
|
||||||
def build_notifier(self):
|
def build_notifier(self):
|
||||||
serializer = RequestContextSerializer(JsonPayloadSerializer())
|
serializer = rpc.RequestContextSerializer(rpc.JsonPayloadSerializer())
|
||||||
return om.Notifier(
|
return om.Notifier(
|
||||||
self.__transport,
|
self.__transport,
|
||||||
publisher_id=self.publisher_id,
|
publisher_id=self.publisher_id,
|
||||||
@@ -93,11 +94,11 @@ class MessagingHandler(Thread):
|
|||||||
)
|
)
|
||||||
self.__server = self.build_server(target)
|
self.__server = self.build_server(target)
|
||||||
else:
|
else:
|
||||||
LOG.warn("you have no defined endpoint, "
|
LOG.warn(
|
||||||
"so you can only publish events")
|
_LW("No endpoint defined; can only publish events"))
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
LOG.exception(e)
|
LOG.exception(e)
|
||||||
LOG.error("configure : %s" % str(e.message))
|
LOG.error(_LE("Messaging configuration error"))
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
LOG.debug("configure MessagingHandler for %s" % self.topic_watcher)
|
LOG.debug("configure MessagingHandler for %s" % self.topic_watcher)
|
||||||
@@ -107,7 +108,7 @@ class MessagingHandler(Thread):
|
|||||||
self.__server.start()
|
self.__server.start()
|
||||||
|
|
||||||
def stop(self):
|
def stop(self):
|
||||||
LOG.debug('Stop up server')
|
LOG.debug('Stopped server')
|
||||||
self.__server.wait()
|
self.__server.wait()
|
||||||
self.__server.stop()
|
self.__server.stop()
|
||||||
|
|
||||||
|
|||||||
@@ -22,15 +22,14 @@ from oslo_db import exception as db_exc
|
|||||||
from oslo_db.sqlalchemy import session as db_session
|
from oslo_db.sqlalchemy import session as db_session
|
||||||
from oslo_db.sqlalchemy import utils as db_utils
|
from oslo_db.sqlalchemy import utils as db_utils
|
||||||
from oslo_log import log
|
from oslo_log import log
|
||||||
from sqlalchemy.orm.exc import MultipleResultsFound
|
from sqlalchemy.orm import exc
|
||||||
from sqlalchemy.orm.exc import NoResultFound
|
|
||||||
|
|
||||||
from watcher import _i18n
|
from watcher import _i18n
|
||||||
from watcher.common import exception
|
from watcher.common import exception
|
||||||
from watcher.common import utils
|
from watcher.common import utils
|
||||||
from watcher.db import api
|
from watcher.db import api
|
||||||
from watcher.db.sqlalchemy import models
|
from watcher.db.sqlalchemy import models
|
||||||
from watcher.objects.audit import AuditStatus
|
from watcher.objects import audit as audit_objects
|
||||||
|
|
||||||
CONF = cfg.CONF
|
CONF = cfg.CONF
|
||||||
LOG = log.getLogger(__name__)
|
LOG = log.getLogger(__name__)
|
||||||
@@ -223,7 +222,7 @@ class Connection(api.BaseConnection):
|
|||||||
raise exception.AuditTemplateNotFound(
|
raise exception.AuditTemplateNotFound(
|
||||||
audit_template=audit_template_id)
|
audit_template=audit_template_id)
|
||||||
return audit_template
|
return audit_template
|
||||||
except NoResultFound:
|
except exc.NoResultFound:
|
||||||
raise exception.AuditTemplateNotFound(
|
raise exception.AuditTemplateNotFound(
|
||||||
audit_template=audit_template_id)
|
audit_template=audit_template_id)
|
||||||
|
|
||||||
@@ -238,7 +237,7 @@ class Connection(api.BaseConnection):
|
|||||||
raise exception.AuditTemplateNotFound(
|
raise exception.AuditTemplateNotFound(
|
||||||
audit_template=audit_template_uuid)
|
audit_template=audit_template_uuid)
|
||||||
return audit_template
|
return audit_template
|
||||||
except NoResultFound:
|
except exc.NoResultFound:
|
||||||
raise exception.AuditTemplateNotFound(
|
raise exception.AuditTemplateNotFound(
|
||||||
audit_template=audit_template_uuid)
|
audit_template=audit_template_uuid)
|
||||||
|
|
||||||
@@ -252,11 +251,11 @@ class Connection(api.BaseConnection):
|
|||||||
raise exception.AuditTemplateNotFound(
|
raise exception.AuditTemplateNotFound(
|
||||||
audit_template=audit_template_name)
|
audit_template=audit_template_name)
|
||||||
return audit_template
|
return audit_template
|
||||||
except MultipleResultsFound:
|
except exc.MultipleResultsFound:
|
||||||
raise exception.Conflict(
|
raise exception.Conflict(
|
||||||
'Multiple audit templates exist with same name.'
|
_('Multiple audit templates exist with the same name.'
|
||||||
' Please use the audit template uuid instead.')
|
' Please use the audit template uuid instead'))
|
||||||
except NoResultFound:
|
except exc.NoResultFound:
|
||||||
raise exception.AuditTemplateNotFound(
|
raise exception.AuditTemplateNotFound(
|
||||||
audit_template=audit_template_name)
|
audit_template=audit_template_name)
|
||||||
|
|
||||||
@@ -268,7 +267,7 @@ class Connection(api.BaseConnection):
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
query.one()
|
query.one()
|
||||||
except NoResultFound:
|
except exc.NoResultFound:
|
||||||
raise exception.AuditTemplateNotFound(node=audit_template_id)
|
raise exception.AuditTemplateNotFound(node=audit_template_id)
|
||||||
|
|
||||||
query.delete()
|
query.delete()
|
||||||
@@ -287,7 +286,7 @@ class Connection(api.BaseConnection):
|
|||||||
query = add_identity_filter(query, audit_template_id)
|
query = add_identity_filter(query, audit_template_id)
|
||||||
try:
|
try:
|
||||||
ref = query.with_lockmode('update').one()
|
ref = query.with_lockmode('update').one()
|
||||||
except NoResultFound:
|
except exc.NoResultFound:
|
||||||
raise exception.AuditTemplateNotFound(
|
raise exception.AuditTemplateNotFound(
|
||||||
audit_template=audit_template_id)
|
audit_template=audit_template_id)
|
||||||
|
|
||||||
@@ -302,7 +301,7 @@ class Connection(api.BaseConnection):
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
query.one()
|
query.one()
|
||||||
except NoResultFound:
|
except exc.NoResultFound:
|
||||||
raise exception.AuditTemplateNotFound(node=audit_template_id)
|
raise exception.AuditTemplateNotFound(node=audit_template_id)
|
||||||
|
|
||||||
query.soft_delete()
|
query.soft_delete()
|
||||||
@@ -323,7 +322,7 @@ class Connection(api.BaseConnection):
|
|||||||
values['uuid'] = utils.generate_uuid()
|
values['uuid'] = utils.generate_uuid()
|
||||||
|
|
||||||
if values.get('state') is None:
|
if values.get('state') is None:
|
||||||
values['state'] = AuditStatus.PENDING
|
values['state'] = audit_objects.AuditStatus.PENDING
|
||||||
|
|
||||||
audit = models.Audit()
|
audit = models.Audit()
|
||||||
audit.update(values)
|
audit.update(values)
|
||||||
@@ -343,7 +342,7 @@ class Connection(api.BaseConnection):
|
|||||||
if audit.state == 'DELETED':
|
if audit.state == 'DELETED':
|
||||||
raise exception.AuditNotFound(audit=audit_id)
|
raise exception.AuditNotFound(audit=audit_id)
|
||||||
return audit
|
return audit
|
||||||
except NoResultFound:
|
except exc.NoResultFound:
|
||||||
raise exception.AuditNotFound(audit=audit_id)
|
raise exception.AuditNotFound(audit=audit_id)
|
||||||
|
|
||||||
def get_audit_by_uuid(self, context, audit_uuid):
|
def get_audit_by_uuid(self, context, audit_uuid):
|
||||||
@@ -356,7 +355,7 @@ class Connection(api.BaseConnection):
|
|||||||
if audit.state == 'DELETED':
|
if audit.state == 'DELETED':
|
||||||
raise exception.AuditNotFound(audit=audit_uuid)
|
raise exception.AuditNotFound(audit=audit_uuid)
|
||||||
return audit
|
return audit
|
||||||
except NoResultFound:
|
except exc.NoResultFound:
|
||||||
raise exception.AuditNotFound(audit=audit_uuid)
|
raise exception.AuditNotFound(audit=audit_uuid)
|
||||||
|
|
||||||
def destroy_audit(self, audit_id):
|
def destroy_audit(self, audit_id):
|
||||||
@@ -374,7 +373,7 @@ class Connection(api.BaseConnection):
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
audit_ref = query.one()
|
audit_ref = query.one()
|
||||||
except NoResultFound:
|
except exc.NoResultFound:
|
||||||
raise exception.AuditNotFound(audit=audit_id)
|
raise exception.AuditNotFound(audit=audit_id)
|
||||||
|
|
||||||
if is_audit_referenced(session, audit_ref['id']):
|
if is_audit_referenced(session, audit_ref['id']):
|
||||||
@@ -396,7 +395,7 @@ class Connection(api.BaseConnection):
|
|||||||
query = add_identity_filter(query, audit_id)
|
query = add_identity_filter(query, audit_id)
|
||||||
try:
|
try:
|
||||||
ref = query.with_lockmode('update').one()
|
ref = query.with_lockmode('update').one()
|
||||||
except NoResultFound:
|
except exc.NoResultFound:
|
||||||
raise exception.AuditNotFound(audit=audit_id)
|
raise exception.AuditNotFound(audit=audit_id)
|
||||||
|
|
||||||
ref.update(values)
|
ref.update(values)
|
||||||
@@ -410,7 +409,7 @@ class Connection(api.BaseConnection):
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
query.one()
|
query.one()
|
||||||
except NoResultFound:
|
except exc.NoResultFound:
|
||||||
raise exception.AuditNotFound(node=audit_id)
|
raise exception.AuditNotFound(node=audit_id)
|
||||||
|
|
||||||
query.soft_delete()
|
query.soft_delete()
|
||||||
@@ -447,7 +446,7 @@ class Connection(api.BaseConnection):
|
|||||||
raise exception.ActionNotFound(
|
raise exception.ActionNotFound(
|
||||||
action=action_id)
|
action=action_id)
|
||||||
return action
|
return action
|
||||||
except NoResultFound:
|
except exc.NoResultFound:
|
||||||
raise exception.ActionNotFound(action=action_id)
|
raise exception.ActionNotFound(action=action_id)
|
||||||
|
|
||||||
def get_action_by_uuid(self, context, action_uuid):
|
def get_action_by_uuid(self, context, action_uuid):
|
||||||
@@ -460,7 +459,7 @@ class Connection(api.BaseConnection):
|
|||||||
raise exception.ActionNotFound(
|
raise exception.ActionNotFound(
|
||||||
action=action_uuid)
|
action=action_uuid)
|
||||||
return action
|
return action
|
||||||
except NoResultFound:
|
except exc.NoResultFound:
|
||||||
raise exception.ActionNotFound(action=action_uuid)
|
raise exception.ActionNotFound(action=action_uuid)
|
||||||
|
|
||||||
def destroy_action(self, action_id):
|
def destroy_action(self, action_id):
|
||||||
@@ -487,7 +486,7 @@ class Connection(api.BaseConnection):
|
|||||||
query = add_identity_filter(query, action_id)
|
query = add_identity_filter(query, action_id)
|
||||||
try:
|
try:
|
||||||
ref = query.with_lockmode('update').one()
|
ref = query.with_lockmode('update').one()
|
||||||
except NoResultFound:
|
except exc.NoResultFound:
|
||||||
raise exception.ActionNotFound(action=action_id)
|
raise exception.ActionNotFound(action=action_id)
|
||||||
|
|
||||||
ref.update(values)
|
ref.update(values)
|
||||||
@@ -501,7 +500,7 @@ class Connection(api.BaseConnection):
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
query.one()
|
query.one()
|
||||||
except NoResultFound:
|
except exc.NoResultFound:
|
||||||
raise exception.ActionNotFound(node=action_id)
|
raise exception.ActionNotFound(node=action_id)
|
||||||
|
|
||||||
query.soft_delete()
|
query.soft_delete()
|
||||||
@@ -541,7 +540,7 @@ class Connection(api.BaseConnection):
|
|||||||
raise exception.ActionPlanNotFound(
|
raise exception.ActionPlanNotFound(
|
||||||
action_plan=action_plan_id)
|
action_plan=action_plan_id)
|
||||||
return action_plan
|
return action_plan
|
||||||
except NoResultFound:
|
except exc.NoResultFound:
|
||||||
raise exception.ActionPlanNotFound(action_plan=action_plan_id)
|
raise exception.ActionPlanNotFound(action_plan=action_plan_id)
|
||||||
|
|
||||||
def get_action_plan_by_uuid(self, context, action_plan__uuid):
|
def get_action_plan_by_uuid(self, context, action_plan__uuid):
|
||||||
@@ -555,7 +554,7 @@ class Connection(api.BaseConnection):
|
|||||||
raise exception.ActionPlanNotFound(
|
raise exception.ActionPlanNotFound(
|
||||||
action_plan=action_plan__uuid)
|
action_plan=action_plan__uuid)
|
||||||
return action_plan
|
return action_plan
|
||||||
except NoResultFound:
|
except exc.NoResultFound:
|
||||||
raise exception.ActionPlanNotFound(action_plan=action_plan__uuid)
|
raise exception.ActionPlanNotFound(action_plan=action_plan__uuid)
|
||||||
|
|
||||||
def destroy_action_plan(self, action_plan_id):
|
def destroy_action_plan(self, action_plan_id):
|
||||||
@@ -573,7 +572,7 @@ class Connection(api.BaseConnection):
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
action_plan_ref = query.one()
|
action_plan_ref = query.one()
|
||||||
except NoResultFound:
|
except exc.NoResultFound:
|
||||||
raise exception.ActionPlanNotFound(action_plan=action_plan_id)
|
raise exception.ActionPlanNotFound(action_plan=action_plan_id)
|
||||||
|
|
||||||
if is_action_plan_referenced(session, action_plan_ref['id']):
|
if is_action_plan_referenced(session, action_plan_ref['id']):
|
||||||
@@ -596,7 +595,7 @@ class Connection(api.BaseConnection):
|
|||||||
query = add_identity_filter(query, action_plan_id)
|
query = add_identity_filter(query, action_plan_id)
|
||||||
try:
|
try:
|
||||||
ref = query.with_lockmode('update').one()
|
ref = query.with_lockmode('update').one()
|
||||||
except NoResultFound:
|
except exc.NoResultFound:
|
||||||
raise exception.ActionPlanNotFound(action_plan=action_plan_id)
|
raise exception.ActionPlanNotFound(action_plan=action_plan_id)
|
||||||
|
|
||||||
ref.update(values)
|
ref.update(values)
|
||||||
@@ -610,7 +609,7 @@ class Connection(api.BaseConnection):
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
query.one()
|
query.one()
|
||||||
except NoResultFound:
|
except exc.NoResultFound:
|
||||||
raise exception.ActionPlanNotFound(node=action_plan_id)
|
raise exception.ActionPlanNotFound(node=action_plan_id)
|
||||||
|
|
||||||
query.soft_delete()
|
query.soft_delete()
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ from alembic import config as alembic_config
|
|||||||
import alembic.migration as alembic_migration
|
import alembic.migration as alembic_migration
|
||||||
from oslo_db import exception as db_exc
|
from oslo_db import exception as db_exc
|
||||||
|
|
||||||
|
from watcher._i18n import _
|
||||||
from watcher.db.sqlalchemy import api as sqla_api
|
from watcher.db.sqlalchemy import api as sqla_api
|
||||||
from watcher.db.sqlalchemy import models
|
from watcher.db.sqlalchemy import models
|
||||||
|
|
||||||
@@ -68,8 +69,9 @@ def create_schema(config=None, engine=None):
|
|||||||
# schema, it will only add the new tables, but leave
|
# schema, it will only add the new tables, but leave
|
||||||
# existing as is. So we should avoid of this situation.
|
# existing as is. So we should avoid of this situation.
|
||||||
if version(engine=engine) is not None:
|
if version(engine=engine) is not None:
|
||||||
raise db_exc.DbMigrationError("DB schema is already under version"
|
raise db_exc.DbMigrationError(
|
||||||
" control. Use upgrade() instead")
|
_("Watcher database schema is already under version control; "
|
||||||
|
"use upgrade() instead"))
|
||||||
|
|
||||||
models.Base.metadata.create_all(engine)
|
models.Base.metadata.create_all(engine)
|
||||||
stamp('head', config=config)
|
stamp('head', config=config)
|
||||||
|
|||||||
@@ -15,12 +15,11 @@
|
|||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
from oslo_log import log
|
from oslo_log import log
|
||||||
|
|
||||||
from watcher.common.exception import HypervisorNotFound
|
from watcher._i18n import _
|
||||||
from watcher.common.exception import IllegalArgumentException
|
from watcher.common import exception
|
||||||
from watcher.common.exception import VMNotFound
|
from watcher.decision_engine.model import hypervisor
|
||||||
from watcher.decision_engine.model.hypervisor import Hypervisor
|
from watcher.decision_engine.model import mapping
|
||||||
from watcher.decision_engine.model.mapping import Mapping
|
from watcher.decision_engine.model import vm
|
||||||
from watcher.decision_engine.model.vm import VM
|
|
||||||
|
|
||||||
LOG = log.getLogger(__name__)
|
LOG = log.getLogger(__name__)
|
||||||
|
|
||||||
@@ -29,18 +28,18 @@ class ModelRoot(object):
|
|||||||
def __init__(self):
|
def __init__(self):
|
||||||
self._hypervisors = {}
|
self._hypervisors = {}
|
||||||
self._vms = {}
|
self._vms = {}
|
||||||
self.mapping = Mapping(self)
|
self.mapping = mapping.Mapping(self)
|
||||||
self.resource = {}
|
self.resource = {}
|
||||||
|
|
||||||
def assert_hypervisor(self, hypervisor):
|
def assert_hypervisor(self, obj):
|
||||||
if not isinstance(hypervisor, Hypervisor):
|
if not isinstance(obj, hypervisor.Hypervisor):
|
||||||
raise IllegalArgumentException(
|
raise exception.IllegalArgumentException(
|
||||||
"Hypervisor must be an instance of hypervisor")
|
_("'obj' argument type is not valid"))
|
||||||
|
|
||||||
def assert_vm(self, vm):
|
def assert_vm(self, obj):
|
||||||
if not isinstance(vm, VM):
|
if not isinstance(obj, vm.VM):
|
||||||
raise IllegalArgumentException(
|
raise exception.IllegalArgumentException(
|
||||||
"VM must be an instance of VM")
|
_("'obj' argument type is not valid"))
|
||||||
|
|
||||||
def add_hypervisor(self, hypervisor):
|
def add_hypervisor(self, hypervisor):
|
||||||
self.assert_hypervisor(hypervisor)
|
self.assert_hypervisor(hypervisor)
|
||||||
@@ -49,7 +48,7 @@ class ModelRoot(object):
|
|||||||
def remove_hypervisor(self, hypervisor):
|
def remove_hypervisor(self, hypervisor):
|
||||||
self.assert_hypervisor(hypervisor)
|
self.assert_hypervisor(hypervisor)
|
||||||
if str(hypervisor.uuid) not in self._hypervisors.keys():
|
if str(hypervisor.uuid) not in self._hypervisors.keys():
|
||||||
raise HypervisorNotFound(hypervisor.uuid)
|
raise exception.HypervisorNotFound(hypervisor.uuid)
|
||||||
else:
|
else:
|
||||||
del self._hypervisors[hypervisor.uuid]
|
del self._hypervisors[hypervisor.uuid]
|
||||||
|
|
||||||
@@ -62,12 +61,12 @@ class ModelRoot(object):
|
|||||||
|
|
||||||
def get_hypervisor_from_id(self, hypervisor_uuid):
|
def get_hypervisor_from_id(self, hypervisor_uuid):
|
||||||
if str(hypervisor_uuid) not in self._hypervisors.keys():
|
if str(hypervisor_uuid) not in self._hypervisors.keys():
|
||||||
raise HypervisorNotFound(hypervisor_uuid)
|
raise exception.HypervisorNotFound(hypervisor_uuid)
|
||||||
return self._hypervisors[str(hypervisor_uuid)]
|
return self._hypervisors[str(hypervisor_uuid)]
|
||||||
|
|
||||||
def get_vm_from_id(self, uuid):
|
def get_vm_from_id(self, uuid):
|
||||||
if str(uuid) not in self._vms.keys():
|
if str(uuid) not in self._vms.keys():
|
||||||
raise VMNotFound(uuid)
|
raise exception.VMNotFound(uuid)
|
||||||
return self._vms[str(uuid)]
|
return self._vms[str(uuid)]
|
||||||
|
|
||||||
def get_all_vms(self):
|
def get_all_vms(self):
|
||||||
|
|||||||
@@ -19,20 +19,17 @@
|
|||||||
from oslo_log import log
|
from oslo_log import log
|
||||||
|
|
||||||
from enum import Enum
|
from enum import Enum
|
||||||
from watcher.common.exception import MetaActionNotFound
|
|
||||||
|
from watcher._i18n import _LW
|
||||||
|
from watcher.common import exception
|
||||||
from watcher.common import utils
|
from watcher.common import utils
|
||||||
from watcher.decision_engine.planner.base import BasePlanner
|
from watcher.decision_engine.actions import hypervisor_state
|
||||||
|
from watcher.decision_engine.actions import migration
|
||||||
|
from watcher.decision_engine.actions import nop
|
||||||
|
from watcher.decision_engine.actions import power_state
|
||||||
|
from watcher.decision_engine.planner import base
|
||||||
from watcher import objects
|
from watcher import objects
|
||||||
|
|
||||||
from watcher.decision_engine.actions.hypervisor_state import \
|
|
||||||
ChangeHypervisorState
|
|
||||||
from watcher.decision_engine.actions.migration import Migrate
|
|
||||||
from watcher.decision_engine.actions.nop import Nop
|
|
||||||
from watcher.decision_engine.actions.power_state import ChangePowerState
|
|
||||||
from watcher.objects.action import Status as AStatus
|
|
||||||
from watcher.objects.action_plan import Status as APStatus
|
|
||||||
|
|
||||||
LOG = log.getLogger(__name__)
|
LOG = log.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
@@ -57,7 +54,7 @@ priority_primitives = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
class DefaultPlanner(BasePlanner):
|
class DefaultPlanner(base.BasePlanner):
|
||||||
def create_action(self, action_plan_id, action_type, applies_to=None,
|
def create_action(self, action_plan_id, action_type, applies_to=None,
|
||||||
src=None,
|
src=None,
|
||||||
dst=None,
|
dst=None,
|
||||||
@@ -74,7 +71,7 @@ class DefaultPlanner(BasePlanner):
|
|||||||
'dst': dst,
|
'dst': dst,
|
||||||
'parameter': parameter,
|
'parameter': parameter,
|
||||||
'description': description,
|
'description': description,
|
||||||
'state': AStatus.PENDING,
|
'state': objects.action.Status.PENDING,
|
||||||
'alarm': None,
|
'alarm': None,
|
||||||
'next': None,
|
'next': None,
|
||||||
}
|
}
|
||||||
@@ -88,7 +85,7 @@ class DefaultPlanner(BasePlanner):
|
|||||||
to_schedule = []
|
to_schedule = []
|
||||||
|
|
||||||
for action in actions:
|
for action in actions:
|
||||||
if isinstance(action, Migrate):
|
if isinstance(action, migration.Migrate):
|
||||||
# TODO(jed) type
|
# TODO(jed) type
|
||||||
primitive = self.create_action(action_plan.id,
|
primitive = self.create_action(action_plan.id,
|
||||||
Primitives.LIVE_MIGRATE.value,
|
Primitives.LIVE_MIGRATE.value,
|
||||||
@@ -101,7 +98,7 @@ class DefaultPlanner(BasePlanner):
|
|||||||
action)
|
action)
|
||||||
)
|
)
|
||||||
|
|
||||||
elif isinstance(action, ChangePowerState):
|
elif isinstance(action, power_state.ChangePowerState):
|
||||||
primitive = self.create_action(action_plan_id=action_plan.id,
|
primitive = self.create_action(action_plan_id=action_plan.id,
|
||||||
action_type=Primitives.
|
action_type=Primitives.
|
||||||
POWER_STATE.value,
|
POWER_STATE.value,
|
||||||
@@ -111,7 +108,7 @@ class DefaultPlanner(BasePlanner):
|
|||||||
value,
|
value,
|
||||||
description="{0}".format(
|
description="{0}".format(
|
||||||
action))
|
action))
|
||||||
elif isinstance(action, ChangeHypervisorState):
|
elif isinstance(action, hypervisor_state.ChangeHypervisorState):
|
||||||
primitive = self.create_action(action_plan_id=action_plan.id,
|
primitive = self.create_action(action_plan_id=action_plan.id,
|
||||||
action_type=Primitives.
|
action_type=Primitives.
|
||||||
HYPERVISOR_STATE.value,
|
HYPERVISOR_STATE.value,
|
||||||
@@ -120,21 +117,21 @@ class DefaultPlanner(BasePlanner):
|
|||||||
value,
|
value,
|
||||||
description="{0}".format(
|
description="{0}".format(
|
||||||
action))
|
action))
|
||||||
elif isinstance(action, Nop):
|
elif isinstance(action, nop.Nop):
|
||||||
primitive = self.create_action(action_plan_id=action_plan.id,
|
primitive = self.create_action(action_plan_id=action_plan.id,
|
||||||
action_type=Primitives.
|
action_type=Primitives.
|
||||||
NOP.value,
|
NOP.value,
|
||||||
description="{0}".format(
|
description="{0}".format(
|
||||||
action))
|
action))
|
||||||
else:
|
else:
|
||||||
raise MetaActionNotFound()
|
raise exception.MetaActionNotFound()
|
||||||
priority = priority_primitives[primitive['action_type']]
|
priority = priority_primitives[primitive['action_type']]
|
||||||
to_schedule.append((priority, primitive))
|
to_schedule.append((priority, primitive))
|
||||||
|
|
||||||
# scheduling
|
# scheduling
|
||||||
scheduled = sorted(to_schedule, reverse=False, key=lambda x: (x[0]))
|
scheduled = sorted(to_schedule, reverse=False, key=lambda x: (x[0]))
|
||||||
if len(scheduled) == 0:
|
if len(scheduled) == 0:
|
||||||
LOG.warning("The ActionPlan is empty")
|
LOG.warning(_LW("The action plan is empty"))
|
||||||
action_plan.first_action_id = None
|
action_plan.first_action_id = None
|
||||||
action_plan.save()
|
action_plan.save()
|
||||||
else:
|
else:
|
||||||
@@ -157,7 +154,7 @@ class DefaultPlanner(BasePlanner):
|
|||||||
'uuid': utils.generate_uuid(),
|
'uuid': utils.generate_uuid(),
|
||||||
'audit_id': audit_id,
|
'audit_id': audit_id,
|
||||||
'first_action_id': None,
|
'first_action_id': None,
|
||||||
'state': APStatus.RECOMMENDED
|
'state': objects.action_plan.Status.RECOMMENDED
|
||||||
}
|
}
|
||||||
|
|
||||||
new_action_plan = objects.ActionPlan(context, **action_plan_dict)
|
new_action_plan = objects.ActionPlan(context, **action_plan_dict)
|
||||||
|
|||||||
@@ -28,7 +28,6 @@ from watcher.common import utils
|
|||||||
from watcher.decision_engine.event.consumer_factory import EventConsumerFactory
|
from watcher.decision_engine.event.consumer_factory import EventConsumerFactory
|
||||||
from watcher.decision_engine.manager import decision_engine_opt_group
|
from watcher.decision_engine.manager import decision_engine_opt_group
|
||||||
from watcher.decision_engine.manager import WATCHER_DECISION_ENGINE_OPTS
|
from watcher.decision_engine.manager import WATCHER_DECISION_ENGINE_OPTS
|
||||||
|
|
||||||
from watcher.decision_engine.messaging.events import Events
|
from watcher.decision_engine.messaging.events import Events
|
||||||
|
|
||||||
LOG = log.getLogger(__name__)
|
LOG = log.getLogger(__name__)
|
||||||
@@ -82,5 +81,5 @@ class DecisionEngineAPI(MessagingCore):
|
|||||||
event_consumer = EventConsumerFactory.factory(event_type)
|
event_consumer = EventConsumerFactory.factory(event_type)
|
||||||
event_consumer.execute(request_id, self.context, data)
|
event_consumer.execute(request_id, self.context, data)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
LOG.error("evt %s" % e.message)
|
LOG.exception(e)
|
||||||
raise e
|
raise
|
||||||
|
|||||||
@@ -17,10 +17,10 @@
|
|||||||
from oslo_config import cfg
|
from oslo_config import cfg
|
||||||
from oslo_log import log
|
from oslo_log import log
|
||||||
|
|
||||||
from watcher.common.exception import WatcherException
|
from watcher._i18n import _
|
||||||
from watcher.decision_engine.strategy.loading.default import \
|
from watcher.common import exception
|
||||||
DefaultStrategyLoader
|
from watcher.decision_engine.strategy.loading import default
|
||||||
from watcher.decision_engine.strategy.selection.base import BaseSelector
|
from watcher.decision_engine.strategy.selection import base
|
||||||
|
|
||||||
LOG = log.getLogger(__name__)
|
LOG = log.getLogger(__name__)
|
||||||
CONF = cfg.CONF
|
CONF = cfg.CONF
|
||||||
@@ -41,11 +41,11 @@ CONF.register_group(goals_opt_group)
|
|||||||
CONF.register_opts(WATCHER_GOALS_OPTS, goals_opt_group)
|
CONF.register_opts(WATCHER_GOALS_OPTS, goals_opt_group)
|
||||||
|
|
||||||
|
|
||||||
class DefaultStrategySelector(BaseSelector):
|
class DefaultStrategySelector(base.BaseSelector):
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
super(DefaultStrategySelector, self).__init__()
|
super(DefaultStrategySelector, self).__init__()
|
||||||
self.strategy_loader = DefaultStrategyLoader()
|
self.strategy_loader = default.DefaultStrategyLoader()
|
||||||
|
|
||||||
def define_from_goal(self, goal_name):
|
def define_from_goal(self, goal_name):
|
||||||
strategy_to_load = None
|
strategy_to_load = None
|
||||||
@@ -54,7 +54,7 @@ class DefaultStrategySelector(BaseSelector):
|
|||||||
return self.strategy_loader.load(strategy_to_load)
|
return self.strategy_loader.load(strategy_to_load)
|
||||||
except KeyError as exc:
|
except KeyError as exc:
|
||||||
LOG.exception(exc)
|
LOG.exception(exc)
|
||||||
raise WatcherException(
|
raise exception.WatcherException(
|
||||||
"Incorrect mapping: could not find "
|
_("Incorrect mapping: could not find "
|
||||||
"associated strategy for '%s'" % goal_name
|
"associated strategy for '%s'") % goal_name
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -16,7 +16,10 @@
|
|||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
#
|
#
|
||||||
|
|
||||||
from oslo_log import log
|
from oslo_log import log
|
||||||
|
|
||||||
|
from watcher._i18n import _LE, _LI, _LW
|
||||||
from watcher.common.exception import ClusterEmpty
|
from watcher.common.exception import ClusterEmpty
|
||||||
from watcher.common.exception import ClusterStateNotDefined
|
from watcher.common.exception import ClusterStateNotDefined
|
||||||
from watcher.decision_engine.actions.hypervisor_state import \
|
from watcher.decision_engine.actions.hypervisor_state import \
|
||||||
@@ -40,6 +43,9 @@ class BasicConsolidation(BaseStrategy):
|
|||||||
DEFAULT_NAME = "basic"
|
DEFAULT_NAME = "basic"
|
||||||
DEFAULT_DESCRIPTION = "Basic offline consolidation"
|
DEFAULT_DESCRIPTION = "Basic offline consolidation"
|
||||||
|
|
||||||
|
host_cpu_usage_metric_name = 'compute.node.cpu.percent'
|
||||||
|
instance_cpu_usage_metric_name = 'cpu_util'
|
||||||
|
|
||||||
def __init__(self, name=DEFAULT_NAME, description=DEFAULT_DESCRIPTION):
|
def __init__(self, name=DEFAULT_NAME, description=DEFAULT_DESCRIPTION):
|
||||||
"""Basic offline Consolidation using live migration
|
"""Basic offline Consolidation using live migration
|
||||||
|
|
||||||
@@ -254,18 +260,20 @@ class BasicConsolidation(BaseStrategy):
|
|||||||
:param model:
|
:param model:
|
||||||
:return:
|
:return:
|
||||||
"""
|
"""
|
||||||
resource_id = "{0}_{1}".format(hypervisor.uuid,
|
resource_id = "%s_%s" % (hypervisor.uuid, hypervisor.hostname)
|
||||||
hypervisor.hostname)
|
|
||||||
cpu_avg_vm = self.ceilometer. \
|
cpu_avg_vm = self.ceilometer. \
|
||||||
statistic_aggregation(resource_id=resource_id,
|
statistic_aggregation(resource_id=resource_id,
|
||||||
meter_name='compute.node.cpu.percent',
|
meter_name=self.host_cpu_usage_metric_name,
|
||||||
period="7200",
|
period="7200",
|
||||||
aggregate='avg'
|
aggregate='avg'
|
||||||
)
|
)
|
||||||
if cpu_avg_vm is None:
|
if cpu_avg_vm is None:
|
||||||
LOG.error(
|
LOG.error(
|
||||||
"No values returned for {0} compute.node.cpu.percent".format(
|
_LE("No values returned by %(resource_id)s "
|
||||||
resource_id))
|
"for %(metric_name)s"),
|
||||||
|
resource_id=resource_id,
|
||||||
|
metric_name=self.host_cpu_usage_metric_name,
|
||||||
|
)
|
||||||
cpu_avg_vm = 100
|
cpu_avg_vm = 100
|
||||||
|
|
||||||
cpu_capacity = model.get_resource_from_id(
|
cpu_capacity = model.get_resource_from_id(
|
||||||
@@ -300,14 +308,19 @@ class BasicConsolidation(BaseStrategy):
|
|||||||
raise ClusterStateNotDefined()
|
raise ClusterStateNotDefined()
|
||||||
|
|
||||||
vm_cpu_utilization = self.ceilometer. \
|
vm_cpu_utilization = self.ceilometer. \
|
||||||
statistic_aggregation(resource_id=vm.uuid,
|
statistic_aggregation(
|
||||||
meter_name='cpu_util',
|
resource_id=vm.uuid,
|
||||||
period="7200",
|
meter_name=self.instance_cpu_usage_metric_name,
|
||||||
aggregate='avg'
|
period="7200",
|
||||||
)
|
aggregate='avg'
|
||||||
|
)
|
||||||
if vm_cpu_utilization is None:
|
if vm_cpu_utilization is None:
|
||||||
LOG.error(
|
LOG.error(
|
||||||
"No values returned for {0} cpu_util".format(vm.uuid))
|
_LE("No values returned by %(resource_id)s "
|
||||||
|
"for %(metric_name)s"),
|
||||||
|
resource_id=vm.uuid,
|
||||||
|
metric_name=self.instance_cpu_usage_metric_name,
|
||||||
|
)
|
||||||
vm_cpu_utilization = 100
|
vm_cpu_utilization = 100
|
||||||
|
|
||||||
cpu_capacity = model.get_resource_from_id(
|
cpu_capacity = model.get_resource_from_id(
|
||||||
@@ -331,7 +344,7 @@ class BasicConsolidation(BaseStrategy):
|
|||||||
model)))
|
model)))
|
||||||
|
|
||||||
def execute(self, orign_model):
|
def execute(self, orign_model):
|
||||||
LOG.debug("Initialize Sercon Consolidation")
|
LOG.info(_LI("Initializing Sercon Consolidation"))
|
||||||
|
|
||||||
if orign_model is None:
|
if orign_model is None:
|
||||||
raise ClusterStateNotDefined()
|
raise ClusterStateNotDefined()
|
||||||
@@ -393,9 +406,9 @@ class BasicConsolidation(BaseStrategy):
|
|||||||
|
|
||||||
''' get Node to be released '''
|
''' get Node to be released '''
|
||||||
if len(score) == 0:
|
if len(score) == 0:
|
||||||
LOG.warning(
|
LOG.warning(_LW(
|
||||||
"The workloads of the compute nodes"
|
"The workloads of the compute nodes"
|
||||||
" of the cluster is zero.")
|
" of the cluster is zero"))
|
||||||
break
|
break
|
||||||
|
|
||||||
node_to_release = s[len(score) - 1][0]
|
node_to_release = s[len(score) - 1][0]
|
||||||
@@ -413,6 +426,7 @@ class BasicConsolidation(BaseStrategy):
|
|||||||
|
|
||||||
''' sort VMs by Score '''
|
''' sort VMs by Score '''
|
||||||
v = sorted(vm_score, reverse=True, key=lambda x: (x[1]))
|
v = sorted(vm_score, reverse=True, key=lambda x: (x[1]))
|
||||||
|
# BFD: Best Fit Decrease
|
||||||
LOG.debug("VM(s) BFD {0}".format(v))
|
LOG.debug("VM(s) BFD {0}".format(v))
|
||||||
|
|
||||||
m = 0
|
m = 0
|
||||||
|
|||||||
@@ -1,285 +0,0 @@
|
|||||||
# French translations for python-watcher.
|
|
||||||
# Copyright (C) 2015 ORGANIZATION
|
|
||||||
# This file is distributed under the same license as the python-watcher
|
|
||||||
# project.
|
|
||||||
# FIRST AUTHOR <EMAIL@ADDRESS>, 2015.
|
|
||||||
#
|
|
||||||
#, fuzzy
|
|
||||||
msgid ""
|
|
||||||
msgstr ""
|
|
||||||
"Project-Id-Version: python-watcher 0.21.1.dev32\n"
|
|
||||||
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
|
|
||||||
"POT-Creation-Date: 2015-12-11 15:29+0100\n"
|
|
||||||
"PO-Revision-Date: 2015-12-11 15:42+0100\n"
|
|
||||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
|
||||||
"Language: fr\n"
|
|
||||||
"Language-Team: fr <LL@li.org>\n"
|
|
||||||
"Plural-Forms: nplurals=2; plural=(n > 1)\n"
|
|
||||||
"MIME-Version: 1.0\n"
|
|
||||||
"Content-Type: text/plain; charset=utf-8\n"
|
|
||||||
"Content-Transfer-Encoding: 8bit\n"
|
|
||||||
"Generated-By: Babel 2.1.1\n"
|
|
||||||
|
|
||||||
#: watcher/api/controllers/v1/types.py:148
|
|
||||||
#, python-format
|
|
||||||
msgid "%s is not JSON serializable"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: watcher/api/controllers/v1/types.py:184
|
|
||||||
#, python-format
|
|
||||||
msgid "Wrong type. Expected '%(type)s', got '%(value)s'"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: watcher/api/controllers/v1/types.py:222
|
|
||||||
#, python-format
|
|
||||||
msgid "'%s' is an internal attribute and can not be updated"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: watcher/api/controllers/v1/types.py:226
|
|
||||||
#, python-format
|
|
||||||
msgid "'%s' is a mandatory attribute and can not be removed"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: watcher/api/controllers/v1/types.py:231
|
|
||||||
msgid "'add' and 'replace' operations needs value"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: watcher/api/controllers/v1/utils.py:32
|
|
||||||
msgid "Limit must be positive"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: watcher/api/controllers/v1/utils.py:39
|
|
||||||
#, python-format
|
|
||||||
msgid "Invalid sort direction: %s. Acceptable values are 'asc' or 'desc'"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: watcher/api/controllers/v1/utils.py:49
|
|
||||||
#, python-format
|
|
||||||
msgid "Adding a new attribute (%s) to the root of the resource is not allowed"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: watcher/api/middleware/auth_token.py:43
|
|
||||||
#, python-format
|
|
||||||
msgid "Cannot compile public API routes: %s"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: watcher/api/middleware/parsable_error.py:53
|
|
||||||
#, python-format
|
|
||||||
msgid "ErrorDocumentMiddleware received an invalid status %s"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: watcher/cmd/api.py:45
|
|
||||||
#, python-format
|
|
||||||
msgid "Starting server in PID %s"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: watcher/cmd/api.py:50
|
|
||||||
#, python-format
|
|
||||||
msgid "serving on 0.0.0.0:%(port)s, view at http://127.0.0.1:%(port)s"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: watcher/cmd/api.py:54
|
|
||||||
#, python-format
|
|
||||||
msgid "serving on http://%(host)s:%(port)s"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: watcher/common/exception.py:58
|
|
||||||
msgid "An unknown exception occurred."
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: watcher/common/exception.py:109
|
|
||||||
msgid "Not authorized."
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: watcher/common/exception.py:114
|
|
||||||
msgid "Operation not permitted."
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: watcher/common/exception.py:118
|
|
||||||
msgid "Unacceptable parameters."
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: watcher/common/exception.py:123
|
|
||||||
#, python-format
|
|
||||||
msgid "The %(name)s %(id)s could not be found."
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: watcher/common/exception.py:127
|
|
||||||
msgid "Conflict."
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: watcher/common/exception.py:132
|
|
||||||
#, python-format
|
|
||||||
msgid "The %(name)s resource %(id)s could not be found."
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: watcher/common/exception.py:137
|
|
||||||
#, python-format
|
|
||||||
msgid "Expected an uuid or int but received %(identity)s."
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: watcher/common/exception.py:141
|
|
||||||
#, python-format
|
|
||||||
msgid "Goal %(goal)s is not defined in Watcher configuration file."
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: watcher/common/exception.py:147
|
|
||||||
#, python-format
|
|
||||||
msgid "%(err)s"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: watcher/common/exception.py:151
|
|
||||||
#, python-format
|
|
||||||
msgid "Expected a uuid but received %(uuid)s."
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: watcher/common/exception.py:155
|
|
||||||
#, python-format
|
|
||||||
msgid "Expected a logical name but received %(name)s."
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: watcher/common/exception.py:159
|
|
||||||
#, python-format
|
|
||||||
msgid "Expected a logical name or uuid but received %(name)s."
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: watcher/common/exception.py:163
|
|
||||||
#, python-format
|
|
||||||
msgid "AuditTemplate %(audit_template)s could not be found."
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: watcher/common/exception.py:167
|
|
||||||
#, python-format
|
|
||||||
msgid "An audit_template with UUID %(uuid)s or name %(name)s already exists."
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: watcher/common/exception.py:172
|
|
||||||
#, python-format
|
|
||||||
msgid "AuditTemplate %(audit_template)s is referenced by one or multiple audit."
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: watcher/common/exception.py:177
|
|
||||||
#, python-format
|
|
||||||
msgid "Audit %(audit)s could not be found."
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: watcher/common/exception.py:181
|
|
||||||
#, python-format
|
|
||||||
msgid "An audit with UUID %(uuid)s already exists."
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: watcher/common/exception.py:185
|
|
||||||
#, python-format
|
|
||||||
msgid "Audit %(audit)s is referenced by one or multiple action plans."
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: watcher/common/exception.py:190
|
|
||||||
msgid "ActionPlan %(action plan)s could not be found."
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: watcher/common/exception.py:194
|
|
||||||
#, python-format
|
|
||||||
msgid "An action plan with UUID %(uuid)s already exists."
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: watcher/common/exception.py:198
|
|
||||||
#, python-format
|
|
||||||
msgid "Action Plan %(action_plan)s is referenced by one or multiple actions."
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: watcher/common/exception.py:203
|
|
||||||
#, python-format
|
|
||||||
msgid "Action %(action)s could not be found."
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: watcher/common/exception.py:207
|
|
||||||
#, python-format
|
|
||||||
msgid "An action with UUID %(uuid)s already exists."
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: watcher/common/exception.py:211
|
|
||||||
#, python-format
|
|
||||||
msgid "Action plan %(action_plan)s is referenced by one or multiple goals."
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: watcher/common/exception.py:216
|
|
||||||
msgid "Filtering actions on both audit and action-plan is prohibited."
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: watcher/common/exception.py:225
|
|
||||||
#, python-format
|
|
||||||
msgid "Couldn't apply patch '%(patch)s'. Reason: %(reason)s"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: watcher/common/exception.py:286
|
|
||||||
msgid "'Keystone API endpoint is missing''"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: watcher/common/exception.py:290
|
|
||||||
msgid "The list of hypervisor(s) in the cluster is empty.'"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: watcher/common/exception.py:294
|
|
||||||
msgid "The metrics resource collector is not defined.'"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: watcher/common/exception.py:298
|
|
||||||
msgid "the cluster state is not defined"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: watcher/common/exception.py:304
|
|
||||||
msgid "The VM could not be found."
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: watcher/common/exception.py:308
|
|
||||||
msgid "The hypervisor could not be found."
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: watcher/common/exception.py:312
|
|
||||||
msgid "The Meta-Action could not be found."
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: watcher/db/sqlalchemy/api.py:278
|
|
||||||
msgid "Cannot overwrite UUID for an existing AuditTemplate."
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: watcher/db/sqlalchemy/api.py:387 watcher/db/sqlalchemy/api.py:587
|
|
||||||
msgid "Cannot overwrite UUID for an existing Audit."
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: watcher/db/sqlalchemy/api.py:478
|
|
||||||
msgid "Cannot overwrite UUID for an existing Action."
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: watcher/objects/base.py:108
|
|
||||||
msgid "Invalid version string"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: watcher/objects/base.py:299
|
|
||||||
#, python-format
|
|
||||||
msgid "Cannot load '%(attrname)s' in the base class"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: watcher/objects/base.py:308
|
|
||||||
msgid "Cannot save anything in the base class"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: watcher/objects/base.py:340
|
|
||||||
#, python-format
|
|
||||||
msgid "%(objname)s object has no attribute '%(attrname)s'"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: watcher/objects/base.py:389
|
|
||||||
#, python-format
|
|
||||||
msgid "'%(objclass)s' object has no attribute '%(attrname)s'"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: watcher/objects/utils.py:40
|
|
||||||
msgid "A datetime.datetime is required here"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: watcher/objects/utils.py:105
|
|
||||||
#, python-format
|
|
||||||
msgid "An object of class %s is required here"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
436
watcher/locale/fr/LC_MESSAGES/watcher.po
Normal file
436
watcher/locale/fr/LC_MESSAGES/watcher.po
Normal file
@@ -0,0 +1,436 @@
|
|||||||
|
# French translations for python-watcher.
|
||||||
|
# Copyright (C) 2015 ORGANIZATION
|
||||||
|
# This file is distributed under the same license as the python-watcher
|
||||||
|
# project.
|
||||||
|
# FIRST AUTHOR <EMAIL@ADDRESS>, 2015.
|
||||||
|
#
|
||||||
|
msgid ""
|
||||||
|
msgstr ""
|
||||||
|
"Project-Id-Version: python-watcher 0.21.1.dev32\n"
|
||||||
|
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
|
||||||
|
"POT-Creation-Date: 2015-12-18 15:33+0100\n"
|
||||||
|
"PO-Revision-Date: 2015-12-11 15:42+0100\n"
|
||||||
|
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||||
|
"Language: fr\n"
|
||||||
|
"Language-Team: fr <LL@li.org>\n"
|
||||||
|
"Plural-Forms: nplurals=2; plural=(n > 1)\n"
|
||||||
|
"MIME-Version: 1.0\n"
|
||||||
|
"Content-Type: text/plain; charset=utf-8\n"
|
||||||
|
"Content-Transfer-Encoding: 8bit\n"
|
||||||
|
"Generated-By: Babel 2.1.1\n"
|
||||||
|
|
||||||
|
#: watcher/api/controllers/v1/types.py:148
|
||||||
|
#, python-format
|
||||||
|
msgid "%s is not JSON serializable"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: watcher/api/controllers/v1/types.py:184
|
||||||
|
#, python-format
|
||||||
|
msgid "Wrong type. Expected '%(type)s', got '%(value)s'"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: watcher/api/controllers/v1/types.py:223
|
||||||
|
#, python-format
|
||||||
|
msgid "'%s' is an internal attribute and can not be updated"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: watcher/api/controllers/v1/types.py:227
|
||||||
|
#, python-format
|
||||||
|
msgid "'%s' is a mandatory attribute and can not be removed"
|
||||||
|
msgstr "'%s' est un attribut obligatoire et ne peut pas être enlevé"
|
||||||
|
|
||||||
|
#: watcher/api/controllers/v1/types.py:232
|
||||||
|
msgid "'add' and 'replace' operations needs value"
|
||||||
|
msgstr "Les opérations 'add' et 'replace' recquièrent une valeur"
|
||||||
|
|
||||||
|
#: watcher/api/controllers/v1/utils.py:36
|
||||||
|
msgid "Limit must be positive"
|
||||||
|
msgstr "Limit doit être positif"
|
||||||
|
|
||||||
|
#: watcher/api/controllers/v1/utils.py:47
|
||||||
|
#, python-format
|
||||||
|
msgid "Invalid sort direction: %s. Acceptable values are 'asc' or 'desc'"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: watcher/api/controllers/v1/utils.py:57
|
||||||
|
#, python-format
|
||||||
|
msgid "Adding a new attribute (%s) to the root of the resource is not allowed"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: watcher/api/middleware/auth_token.py:45
|
||||||
|
msgid "Cannot compile public API routes"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: watcher/api/middleware/parsable_error.py:52
|
||||||
|
#, python-format
|
||||||
|
msgid "ErrorDocumentMiddleware received an invalid status %s"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: watcher/applier/primitives/change_nova_service_state.py:74
|
||||||
|
msgid "The target state is not defined"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: watcher/cmd/api.py:46
|
||||||
|
#, python-format
|
||||||
|
msgid "Starting server in PID %s"
|
||||||
|
msgstr "Démarre le serveur avec pour PID %s"
|
||||||
|
|
||||||
|
#: watcher/cmd/api.py:51
|
||||||
|
#, python-format
|
||||||
|
msgid "serving on 0.0.0.0:%(port)s, view at http://127.0.0.1:%(port)s"
|
||||||
|
msgstr "Sert sur 0.0.0.0:%(port)s, accessible à http://127.0.0.1:%(port)s"
|
||||||
|
|
||||||
|
#: watcher/cmd/api.py:55
|
||||||
|
#, python-format
|
||||||
|
msgid "serving on http://%(host)s:%(port)s"
|
||||||
|
msgstr "Sert sur http://%(host)s:%(port)s"
|
||||||
|
|
||||||
|
#: watcher/common/exception.py:56
|
||||||
|
msgid "An unknown exception occurred"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: watcher/common/exception.py:107
|
||||||
|
msgid "Not authorized"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: watcher/common/exception.py:112
|
||||||
|
msgid "Operation not permitted"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: watcher/common/exception.py:116
|
||||||
|
msgid "Unacceptable parameters"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: watcher/common/exception.py:121
|
||||||
|
#, python-format
|
||||||
|
msgid "The %(name)s %(id)s could not be found"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: watcher/common/exception.py:125
|
||||||
|
#, fuzzy
|
||||||
|
msgid "Conflict"
|
||||||
|
msgstr "Conflit."
|
||||||
|
|
||||||
|
#: watcher/common/exception.py:130
|
||||||
|
#, python-format
|
||||||
|
msgid "The %(name)s resource %(id)s could not be found"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: watcher/common/exception.py:135
|
||||||
|
#, python-format
|
||||||
|
msgid "Expected an uuid or int but received %(identity)s"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: watcher/common/exception.py:139
|
||||||
|
#, python-format
|
||||||
|
msgid "Goal %(goal)s is not defined in Watcher configuration file"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: watcher/common/exception.py:145
|
||||||
|
#, python-format
|
||||||
|
msgid "%(err)s"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: watcher/common/exception.py:149
|
||||||
|
#, python-format
|
||||||
|
msgid "Expected a uuid but received %(uuid)s"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: watcher/common/exception.py:153
|
||||||
|
#, python-format
|
||||||
|
msgid "Expected a logical name but received %(name)s"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: watcher/common/exception.py:157
|
||||||
|
#, python-format
|
||||||
|
msgid "Expected a logical name or uuid but received %(name)s"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: watcher/common/exception.py:161
|
||||||
|
#, python-format
|
||||||
|
msgid "AuditTemplate %(audit_template)s could not be found"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: watcher/common/exception.py:165
|
||||||
|
#, python-format
|
||||||
|
msgid "An audit_template with UUID %(uuid)s or name %(name)s already exists"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: watcher/common/exception.py:170
|
||||||
|
#, python-format
|
||||||
|
msgid "AuditTemplate %(audit_template)s is referenced by one or multiple audit"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: watcher/common/exception.py:175
|
||||||
|
#, python-format
|
||||||
|
msgid "Audit %(audit)s could not be found"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: watcher/common/exception.py:179
|
||||||
|
#, python-format
|
||||||
|
msgid "An audit with UUID %(uuid)s already exists"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: watcher/common/exception.py:183
|
||||||
|
#, python-format
|
||||||
|
msgid "Audit %(audit)s is referenced by one or multiple action plans"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: watcher/common/exception.py:188
|
||||||
|
msgid "ActionPlan %(action plan)s could not be found"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: watcher/common/exception.py:192
|
||||||
|
#, python-format
|
||||||
|
msgid "An action plan with UUID %(uuid)s already exists"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: watcher/common/exception.py:196
|
||||||
|
#, python-format
|
||||||
|
msgid "Action Plan %(action_plan)s is referenced by one or multiple actions"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: watcher/common/exception.py:201
|
||||||
|
#, python-format
|
||||||
|
msgid "Action %(action)s could not be found"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: watcher/common/exception.py:205
|
||||||
|
#, python-format
|
||||||
|
msgid "An action with UUID %(uuid)s already exists"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: watcher/common/exception.py:209
|
||||||
|
#, python-format
|
||||||
|
msgid "Action plan %(action_plan)s is referenced by one or multiple goals"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: watcher/common/exception.py:214
|
||||||
|
msgid "Filtering actions on both audit and action-plan is prohibited"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: watcher/common/exception.py:223
|
||||||
|
#, python-format
|
||||||
|
msgid "Couldn't apply patch '%(patch)s'. Reason: %(reason)s"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: watcher/common/exception.py:233
|
||||||
|
msgid "Description must be an instance of str"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: watcher/common/exception.py:243
|
||||||
|
msgid "An exception occurred without a description"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: watcher/common/exception.py:251
|
||||||
|
msgid "Description cannot be empty"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: watcher/common/exception.py:260
|
||||||
|
msgid "No such metric"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: watcher/common/exception.py:269
|
||||||
|
msgid "No rows were returned"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: watcher/common/exception.py:277
|
||||||
|
msgid "'Keystone API endpoint is missing''"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: watcher/common/exception.py:281
|
||||||
|
msgid "The list of hypervisor(s) in the cluster is empty"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: watcher/common/exception.py:285
|
||||||
|
msgid "The metrics resource collector is not defined"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: watcher/common/exception.py:289
|
||||||
|
msgid "the cluster state is not defined"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: watcher/common/exception.py:295
|
||||||
|
msgid "The VM could not be found"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: watcher/common/exception.py:299
|
||||||
|
msgid "The hypervisor could not be found"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: watcher/common/exception.py:303
|
||||||
|
msgid "The Meta-Action could not be found"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: watcher/common/keystone.py:59
|
||||||
|
msgid "No Keystone service catalog loaded"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: watcher/db/sqlalchemy/api.py:256
|
||||||
|
msgid ""
|
||||||
|
"Multiple audit templates exist with the same name. Please use the audit "
|
||||||
|
"template uuid instead"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: watcher/db/sqlalchemy/api.py:277
|
||||||
|
msgid "Cannot overwrite UUID for an existing AuditTemplate."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: watcher/db/sqlalchemy/api.py:386 watcher/db/sqlalchemy/api.py:586
|
||||||
|
msgid "Cannot overwrite UUID for an existing Audit."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: watcher/db/sqlalchemy/api.py:477
|
||||||
|
msgid "Cannot overwrite UUID for an existing Action."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: watcher/db/sqlalchemy/migration.py:73
|
||||||
|
msgid ""
|
||||||
|
"Watcher database schema is already under version control; use upgrade() "
|
||||||
|
"instead"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: watcher/decision_engine/model/model_root.py:37
|
||||||
|
#: watcher/decision_engine/model/model_root.py:42
|
||||||
|
msgid "'obj' argument type is not valid"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: watcher/decision_engine/strategy/selection/default.py:56
|
||||||
|
#, python-format
|
||||||
|
msgid "Incorrect mapping: could not find associated strategy for '%s'"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: watcher/objects/base.py:108
|
||||||
|
msgid "Invalid version string"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: watcher/objects/base.py:299
|
||||||
|
#, python-format
|
||||||
|
msgid "Cannot load '%(attrname)s' in the base class"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: watcher/objects/base.py:308
|
||||||
|
msgid "Cannot save anything in the base class"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: watcher/objects/base.py:340
|
||||||
|
#, python-format
|
||||||
|
msgid "%(objname)s object has no attribute '%(attrname)s'"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: watcher/objects/base.py:390
|
||||||
|
#, python-format
|
||||||
|
msgid "'%(objclass)s' object has no attribute '%(attrname)s'"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: watcher/objects/utils.py:40
|
||||||
|
msgid "A datetime.datetime is required here"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: watcher/objects/utils.py:105
|
||||||
|
#, python-format
|
||||||
|
msgid "An object of class %s is required here"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#~ msgid "Cannot compile public API routes: %s"
|
||||||
|
#~ msgstr ""
|
||||||
|
|
||||||
|
#~ msgid "An exception occurred without a description."
|
||||||
|
#~ msgstr ""
|
||||||
|
|
||||||
|
#~ msgid "no rows were returned"
|
||||||
|
#~ msgstr ""
|
||||||
|
|
||||||
|
#~ msgid ""
|
||||||
|
#~ msgstr ""
|
||||||
|
|
||||||
|
#~ msgid "An unknown exception occurred."
|
||||||
|
#~ msgstr ""
|
||||||
|
|
||||||
|
#~ msgid "Not authorized."
|
||||||
|
#~ msgstr ""
|
||||||
|
|
||||||
|
#~ msgid "Operation not permitted."
|
||||||
|
#~ msgstr ""
|
||||||
|
|
||||||
|
#~ msgid "Unacceptable parameters."
|
||||||
|
#~ msgstr ""
|
||||||
|
|
||||||
|
#~ msgid "The %(name)s %(id)s could not be found."
|
||||||
|
#~ msgstr ""
|
||||||
|
|
||||||
|
#~ msgid "The %(name)s resource %(id)s could not be found."
|
||||||
|
#~ msgstr ""
|
||||||
|
|
||||||
|
#~ msgid "Expected an uuid or int but received %(identity)s."
|
||||||
|
#~ msgstr ""
|
||||||
|
|
||||||
|
#~ msgid "Goal %(goal)s is not defined in Watcher configuration file."
|
||||||
|
#~ msgstr ""
|
||||||
|
|
||||||
|
#~ msgid "Expected a uuid but received %(uuid)s."
|
||||||
|
#~ msgstr ""
|
||||||
|
|
||||||
|
#~ msgid "Expected a logical name but received %(name)s."
|
||||||
|
#~ msgstr ""
|
||||||
|
|
||||||
|
#~ msgid "Expected a logical name or uuid but received %(name)s."
|
||||||
|
#~ msgstr ""
|
||||||
|
|
||||||
|
#~ msgid "AuditTemplate %(audit_template)s could not be found."
|
||||||
|
#~ msgstr ""
|
||||||
|
|
||||||
|
#~ msgid "An audit_template with UUID %(uuid)s or name %(name)s already exists."
|
||||||
|
#~ msgstr ""
|
||||||
|
|
||||||
|
#~ msgid "Audit %(audit)s could not be found."
|
||||||
|
#~ msgstr ""
|
||||||
|
|
||||||
|
#~ msgid "An audit with UUID %(uuid)s already exists."
|
||||||
|
#~ msgstr ""
|
||||||
|
|
||||||
|
#~ msgid "Audit %(audit)s is referenced by one or multiple action plans."
|
||||||
|
#~ msgstr ""
|
||||||
|
|
||||||
|
#~ msgid "ActionPlan %(action plan)s could not be found."
|
||||||
|
#~ msgstr ""
|
||||||
|
|
||||||
|
#~ msgid "An action plan with UUID %(uuid)s already exists."
|
||||||
|
#~ msgstr ""
|
||||||
|
|
||||||
|
#~ msgid "Action Plan %(action_plan)s is referenced by one or multiple actions."
|
||||||
|
#~ msgstr ""
|
||||||
|
|
||||||
|
#~ msgid "Action %(action)s could not be found."
|
||||||
|
#~ msgstr ""
|
||||||
|
|
||||||
|
#~ msgid "An action with UUID %(uuid)s already exists."
|
||||||
|
#~ msgstr ""
|
||||||
|
|
||||||
|
#~ msgid "Action plan %(action_plan)s is referenced by one or multiple goals."
|
||||||
|
#~ msgstr ""
|
||||||
|
|
||||||
|
#~ msgid "Filtering actions on both audit and action-plan is prohibited."
|
||||||
|
#~ msgstr ""
|
||||||
|
|
||||||
|
#~ msgid "The list of hypervisor(s) in the cluster is empty.'"
|
||||||
|
#~ msgstr ""
|
||||||
|
|
||||||
|
#~ msgid "The metrics resource collector is not defined.'"
|
||||||
|
#~ msgstr ""
|
||||||
|
|
||||||
|
#~ msgid "The VM could not be found."
|
||||||
|
#~ msgstr ""
|
||||||
|
|
||||||
|
#~ msgid "The hypervisor could not be found."
|
||||||
|
#~ msgstr ""
|
||||||
|
|
||||||
|
#~ msgid "The Meta-Action could not be found."
|
||||||
|
#~ msgstr ""
|
||||||
|
|
||||||
|
#~ msgid "'hypervisor' argument type is not valid"
|
||||||
|
#~ msgstr ""
|
||||||
|
|
||||||
|
#~ msgid "'vm' argument type is not valid"
|
||||||
|
#~ msgstr ""
|
||||||
|
|
||||||
@@ -7,9 +7,9 @@
|
|||||||
#, fuzzy
|
#, fuzzy
|
||||||
msgid ""
|
msgid ""
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"Project-Id-Version: python-watcher 0.21.1.dev32\n"
|
"Project-Id-Version: python-watcher 0.21.1.dev62\n"
|
||||||
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
|
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
|
||||||
"POT-Creation-Date: 2015-12-11 15:29+0100\n"
|
"POT-Creation-Date: 2015-12-18 15:33+0100\n"
|
||||||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||||
"Language-Team: LANGUAGE <LL@li.org>\n"
|
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||||
@@ -28,227 +28,276 @@ msgstr ""
|
|||||||
msgid "Wrong type. Expected '%(type)s', got '%(value)s'"
|
msgid "Wrong type. Expected '%(type)s', got '%(value)s'"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: watcher/api/controllers/v1/types.py:222
|
#: watcher/api/controllers/v1/types.py:223
|
||||||
#, python-format
|
#, python-format
|
||||||
msgid "'%s' is an internal attribute and can not be updated"
|
msgid "'%s' is an internal attribute and can not be updated"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: watcher/api/controllers/v1/types.py:226
|
#: watcher/api/controllers/v1/types.py:227
|
||||||
#, python-format
|
#, python-format
|
||||||
msgid "'%s' is a mandatory attribute and can not be removed"
|
msgid "'%s' is a mandatory attribute and can not be removed"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: watcher/api/controllers/v1/types.py:231
|
#: watcher/api/controllers/v1/types.py:232
|
||||||
msgid "'add' and 'replace' operations needs value"
|
msgid "'add' and 'replace' operations needs value"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: watcher/api/controllers/v1/utils.py:32
|
#: watcher/api/controllers/v1/utils.py:36
|
||||||
msgid "Limit must be positive"
|
msgid "Limit must be positive"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: watcher/api/controllers/v1/utils.py:39
|
#: watcher/api/controllers/v1/utils.py:47
|
||||||
#, python-format
|
#, python-format
|
||||||
msgid "Invalid sort direction: %s. Acceptable values are 'asc' or 'desc'"
|
msgid "Invalid sort direction: %s. Acceptable values are 'asc' or 'desc'"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: watcher/api/controllers/v1/utils.py:49
|
#: watcher/api/controllers/v1/utils.py:57
|
||||||
#, python-format
|
#, python-format
|
||||||
msgid "Adding a new attribute (%s) to the root of the resource is not allowed"
|
msgid "Adding a new attribute (%s) to the root of the resource is not allowed"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: watcher/api/middleware/auth_token.py:43
|
#: watcher/api/middleware/auth_token.py:45
|
||||||
#, python-format
|
msgid "Cannot compile public API routes"
|
||||||
msgid "Cannot compile public API routes: %s"
|
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: watcher/api/middleware/parsable_error.py:53
|
#: watcher/api/middleware/parsable_error.py:52
|
||||||
#, python-format
|
#, python-format
|
||||||
msgid "ErrorDocumentMiddleware received an invalid status %s"
|
msgid "ErrorDocumentMiddleware received an invalid status %s"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: watcher/cmd/api.py:45
|
#: watcher/applier/primitives/change_nova_service_state.py:74
|
||||||
|
msgid "The target state is not defined"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: watcher/cmd/api.py:46
|
||||||
#, python-format
|
#, python-format
|
||||||
msgid "Starting server in PID %s"
|
msgid "Starting server in PID %s"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: watcher/cmd/api.py:50
|
#: watcher/cmd/api.py:51
|
||||||
#, python-format
|
#, python-format
|
||||||
msgid "serving on 0.0.0.0:%(port)s, view at http://127.0.0.1:%(port)s"
|
msgid "serving on 0.0.0.0:%(port)s, view at http://127.0.0.1:%(port)s"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: watcher/cmd/api.py:54
|
#: watcher/cmd/api.py:55
|
||||||
#, python-format
|
#, python-format
|
||||||
msgid "serving on http://%(host)s:%(port)s"
|
msgid "serving on http://%(host)s:%(port)s"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: watcher/common/exception.py:58
|
#: watcher/common/exception.py:56
|
||||||
msgid "An unknown exception occurred."
|
msgid "An unknown exception occurred"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: watcher/common/exception.py:109
|
#: watcher/common/exception.py:107
|
||||||
msgid "Not authorized."
|
msgid "Not authorized"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: watcher/common/exception.py:114
|
#: watcher/common/exception.py:112
|
||||||
msgid "Operation not permitted."
|
msgid "Operation not permitted"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: watcher/common/exception.py:118
|
#: watcher/common/exception.py:116
|
||||||
msgid "Unacceptable parameters."
|
msgid "Unacceptable parameters"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: watcher/common/exception.py:123
|
#: watcher/common/exception.py:121
|
||||||
#, python-format
|
#, python-format
|
||||||
msgid "The %(name)s %(id)s could not be found."
|
msgid "The %(name)s %(id)s could not be found"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: watcher/common/exception.py:127
|
#: watcher/common/exception.py:125
|
||||||
msgid "Conflict."
|
msgid "Conflict"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: watcher/common/exception.py:132
|
#: watcher/common/exception.py:130
|
||||||
#, python-format
|
#, python-format
|
||||||
msgid "The %(name)s resource %(id)s could not be found."
|
msgid "The %(name)s resource %(id)s could not be found"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: watcher/common/exception.py:137
|
#: watcher/common/exception.py:135
|
||||||
#, python-format
|
#, python-format
|
||||||
msgid "Expected an uuid or int but received %(identity)s."
|
msgid "Expected an uuid or int but received %(identity)s"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: watcher/common/exception.py:141
|
#: watcher/common/exception.py:139
|
||||||
#, python-format
|
#, python-format
|
||||||
msgid "Goal %(goal)s is not defined in Watcher configuration file."
|
msgid "Goal %(goal)s is not defined in Watcher configuration file"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: watcher/common/exception.py:147
|
#: watcher/common/exception.py:145
|
||||||
#, python-format
|
#, python-format
|
||||||
msgid "%(err)s"
|
msgid "%(err)s"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: watcher/common/exception.py:151
|
#: watcher/common/exception.py:149
|
||||||
#, python-format
|
#, python-format
|
||||||
msgid "Expected a uuid but received %(uuid)s."
|
msgid "Expected a uuid but received %(uuid)s"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: watcher/common/exception.py:155
|
#: watcher/common/exception.py:153
|
||||||
#, python-format
|
#, python-format
|
||||||
msgid "Expected a logical name but received %(name)s."
|
msgid "Expected a logical name but received %(name)s"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: watcher/common/exception.py:159
|
#: watcher/common/exception.py:157
|
||||||
#, python-format
|
#, python-format
|
||||||
msgid "Expected a logical name or uuid but received %(name)s."
|
msgid "Expected a logical name or uuid but received %(name)s"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: watcher/common/exception.py:163
|
#: watcher/common/exception.py:161
|
||||||
#, python-format
|
#, python-format
|
||||||
msgid "AuditTemplate %(audit_template)s could not be found."
|
msgid "AuditTemplate %(audit_template)s could not be found"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: watcher/common/exception.py:167
|
#: watcher/common/exception.py:165
|
||||||
#, python-format
|
#, python-format
|
||||||
msgid "An audit_template with UUID %(uuid)s or name %(name)s already exists."
|
msgid "An audit_template with UUID %(uuid)s or name %(name)s already exists"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: watcher/common/exception.py:172
|
#: watcher/common/exception.py:170
|
||||||
#, python-format
|
#, python-format
|
||||||
msgid "AuditTemplate %(audit_template)s is referenced by one or multiple audit."
|
msgid "AuditTemplate %(audit_template)s is referenced by one or multiple audit"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: watcher/common/exception.py:177
|
#: watcher/common/exception.py:175
|
||||||
#, python-format
|
#, python-format
|
||||||
msgid "Audit %(audit)s could not be found."
|
msgid "Audit %(audit)s could not be found"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: watcher/common/exception.py:181
|
#: watcher/common/exception.py:179
|
||||||
#, python-format
|
#, python-format
|
||||||
msgid "An audit with UUID %(uuid)s already exists."
|
msgid "An audit with UUID %(uuid)s already exists"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: watcher/common/exception.py:185
|
#: watcher/common/exception.py:183
|
||||||
#, python-format
|
#, python-format
|
||||||
msgid "Audit %(audit)s is referenced by one or multiple action plans."
|
msgid "Audit %(audit)s is referenced by one or multiple action plans"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: watcher/common/exception.py:190
|
#: watcher/common/exception.py:188
|
||||||
msgid "ActionPlan %(action plan)s could not be found."
|
msgid "ActionPlan %(action plan)s could not be found"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: watcher/common/exception.py:194
|
#: watcher/common/exception.py:192
|
||||||
#, python-format
|
#, python-format
|
||||||
msgid "An action plan with UUID %(uuid)s already exists."
|
msgid "An action plan with UUID %(uuid)s already exists"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: watcher/common/exception.py:198
|
#: watcher/common/exception.py:196
|
||||||
#, python-format
|
#, python-format
|
||||||
msgid "Action Plan %(action_plan)s is referenced by one or multiple actions."
|
msgid "Action Plan %(action_plan)s is referenced by one or multiple actions"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: watcher/common/exception.py:203
|
#: watcher/common/exception.py:201
|
||||||
#, python-format
|
#, python-format
|
||||||
msgid "Action %(action)s could not be found."
|
msgid "Action %(action)s could not be found"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: watcher/common/exception.py:207
|
#: watcher/common/exception.py:205
|
||||||
#, python-format
|
#, python-format
|
||||||
msgid "An action with UUID %(uuid)s already exists."
|
msgid "An action with UUID %(uuid)s already exists"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: watcher/common/exception.py:211
|
#: watcher/common/exception.py:209
|
||||||
#, python-format
|
#, python-format
|
||||||
msgid "Action plan %(action_plan)s is referenced by one or multiple goals."
|
msgid "Action plan %(action_plan)s is referenced by one or multiple goals"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: watcher/common/exception.py:216
|
#: watcher/common/exception.py:214
|
||||||
msgid "Filtering actions on both audit and action-plan is prohibited."
|
msgid "Filtering actions on both audit and action-plan is prohibited"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: watcher/common/exception.py:225
|
#: watcher/common/exception.py:223
|
||||||
#, python-format
|
#, python-format
|
||||||
msgid "Couldn't apply patch '%(patch)s'. Reason: %(reason)s"
|
msgid "Couldn't apply patch '%(patch)s'. Reason: %(reason)s"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: watcher/common/exception.py:286
|
#: watcher/common/exception.py:233
|
||||||
|
msgid "Description must be an instance of str"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: watcher/common/exception.py:243
|
||||||
|
msgid "An exception occurred without a description"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: watcher/common/exception.py:251
|
||||||
|
msgid "Description cannot be empty"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: watcher/common/exception.py:260
|
||||||
|
msgid "No such metric"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: watcher/common/exception.py:269
|
||||||
|
msgid "No rows were returned"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: watcher/common/exception.py:277
|
||||||
msgid "'Keystone API endpoint is missing''"
|
msgid "'Keystone API endpoint is missing''"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: watcher/common/exception.py:290
|
#: watcher/common/exception.py:281
|
||||||
msgid "The list of hypervisor(s) in the cluster is empty.'"
|
msgid "The list of hypervisor(s) in the cluster is empty"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: watcher/common/exception.py:294
|
#: watcher/common/exception.py:285
|
||||||
msgid "The metrics resource collector is not defined.'"
|
msgid "The metrics resource collector is not defined"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: watcher/common/exception.py:298
|
#: watcher/common/exception.py:289
|
||||||
msgid "the cluster state is not defined"
|
msgid "the cluster state is not defined"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: watcher/common/exception.py:304
|
#: watcher/common/exception.py:295
|
||||||
msgid "The VM could not be found."
|
msgid "The VM could not be found"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: watcher/common/exception.py:308
|
#: watcher/common/exception.py:299
|
||||||
msgid "The hypervisor could not be found."
|
msgid "The hypervisor could not be found"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: watcher/common/exception.py:312
|
#: watcher/common/exception.py:303
|
||||||
msgid "The Meta-Action could not be found."
|
msgid "The Meta-Action could not be found"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: watcher/db/sqlalchemy/api.py:278
|
#: watcher/common/keystone.py:59
|
||||||
|
msgid "No Keystone service catalog loaded"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: watcher/db/sqlalchemy/api.py:256
|
||||||
|
msgid ""
|
||||||
|
"Multiple audit templates exist with the same name. Please use the audit "
|
||||||
|
"template uuid instead"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: watcher/db/sqlalchemy/api.py:277
|
||||||
msgid "Cannot overwrite UUID for an existing AuditTemplate."
|
msgid "Cannot overwrite UUID for an existing AuditTemplate."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: watcher/db/sqlalchemy/api.py:387 watcher/db/sqlalchemy/api.py:587
|
#: watcher/db/sqlalchemy/api.py:386 watcher/db/sqlalchemy/api.py:586
|
||||||
msgid "Cannot overwrite UUID for an existing Audit."
|
msgid "Cannot overwrite UUID for an existing Audit."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: watcher/db/sqlalchemy/api.py:478
|
#: watcher/db/sqlalchemy/api.py:477
|
||||||
msgid "Cannot overwrite UUID for an existing Action."
|
msgid "Cannot overwrite UUID for an existing Action."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
#: watcher/db/sqlalchemy/migration.py:73
|
||||||
|
msgid ""
|
||||||
|
"Watcher database schema is already under version control; use upgrade() "
|
||||||
|
"instead"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: watcher/decision_engine/model/model_root.py:37
|
||||||
|
#: watcher/decision_engine/model/model_root.py:42
|
||||||
|
msgid "'obj' argument type is not valid"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: watcher/decision_engine/strategy/selection/default.py:56
|
||||||
|
#, python-format
|
||||||
|
msgid "Incorrect mapping: could not find associated strategy for '%s'"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
#: watcher/objects/base.py:108
|
#: watcher/objects/base.py:108
|
||||||
msgid "Invalid version string"
|
msgid "Invalid version string"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
@@ -267,7 +316,7 @@ msgstr ""
|
|||||||
msgid "%(objname)s object has no attribute '%(attrname)s'"
|
msgid "%(objname)s object has no attribute '%(attrname)s'"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: watcher/objects/base.py:389
|
#: watcher/objects/base.py:390
|
||||||
#, python-format
|
#, python-format
|
||||||
msgid "'%(objclass)s' object has no attribute '%(attrname)s'"
|
msgid "'%(objclass)s' object has no attribute '%(attrname)s'"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|||||||
Reference in New Issue
Block a user