Add exceptions hierarchy
nailgun.errors have a huge set of exceptions but without hierarchy. This patch remove exception generation from dict and make it explicitly with python classes and add some exceptions hierarchy. Now all network errors inherit from NetworkException and same for other exceptions. Change-Id: I9a2c6b358ea02a16711da74562308664ad7aed97 Closes-bug: #1566195
This commit is contained in:
parent
4922a9820f
commit
d5a790caab
|
@ -29,7 +29,7 @@ from nailgun.api.v1.validators.orchestrator_graph import \
|
|||
GraphSolverTasksValidator
|
||||
from nailgun import consts
|
||||
from nailgun.db import db
|
||||
from nailgun.errors import errors
|
||||
from nailgun import errors
|
||||
from nailgun.logger import logger
|
||||
from nailgun import objects
|
||||
from nailgun.objects.serializers.base import BasicSerializer
|
||||
|
|
|
@ -38,7 +38,7 @@ from nailgun.api.v1.validators.cluster import ClusterStopDeploymentValidator
|
|||
from nailgun.api.v1.validators.cluster import ClusterValidator
|
||||
from nailgun.api.v1.validators.cluster import VmwareAttributesValidator
|
||||
|
||||
from nailgun.errors import errors
|
||||
from nailgun import errors
|
||||
from nailgun.logger import logger
|
||||
from nailgun import objects
|
||||
from nailgun import utils
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
from nailgun.api.v1.handlers import base
|
||||
from nailgun.api.v1.handlers.base import content
|
||||
from nailgun.api.v1.validators import plugin_link
|
||||
from nailgun.errors import errors
|
||||
from nailgun import errors
|
||||
from nailgun import objects
|
||||
|
||||
|
||||
|
|
|
@ -36,7 +36,7 @@ from nailgun.api.v1.validators.network \
|
|||
from nailgun import consts
|
||||
from nailgun import objects
|
||||
|
||||
from nailgun.errors import errors
|
||||
from nailgun import errors
|
||||
from nailgun.logger import logger
|
||||
from nailgun.task.manager import CheckNetworksTaskManager
|
||||
from nailgun.task.manager import UpdateDnsmasqTaskManager
|
||||
|
|
|
@ -30,7 +30,7 @@ from nailgun.api.v1.validators.network import NetAssignmentValidator
|
|||
from nailgun.api.v1.validators import node as node_validators
|
||||
|
||||
from nailgun import consts
|
||||
from nailgun.errors import errors
|
||||
from nailgun import errors
|
||||
from nailgun import objects
|
||||
|
||||
from nailgun.extensions.network_manager.objects.serializers.nic import \
|
||||
|
|
|
@ -29,7 +29,7 @@ from nailgun.api.v1.validators.node_group import NodeGroupValidator
|
|||
from nailgun import consts
|
||||
from nailgun.db import db
|
||||
|
||||
from nailgun.errors import errors
|
||||
from nailgun import errors
|
||||
from nailgun import objects
|
||||
from nailgun.task.manager import UpdateDnsmasqTaskManager
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@ from nailgun.api.v1.handlers.base import BaseHandler
|
|||
from nailgun.api.v1.handlers.base import content
|
||||
from nailgun.api.v1.handlers.base import SingleHandler
|
||||
from nailgun.api.v1.validators.openstack_config import OpenstackConfigValidator
|
||||
from nailgun.errors import errors
|
||||
from nailgun import errors
|
||||
from nailgun.logger import logger
|
||||
from nailgun import objects
|
||||
from nailgun.task.manager import OpenstackConfigTaskManager
|
||||
|
|
|
@ -30,7 +30,7 @@ from nailgun.api.v1.validators.orchestrator_graph import \
|
|||
|
||||
from nailgun.logger import logger
|
||||
|
||||
from nailgun.errors import errors
|
||||
from nailgun import errors
|
||||
from nailgun import objects
|
||||
|
||||
from nailgun.orchestrator import deployment_serializers
|
||||
|
|
|
@ -23,7 +23,7 @@ from nailgun.api.v1.handlers.deployment_graph import \
|
|||
from nailgun.api.v1.handlers.deployment_graph import \
|
||||
RelatedDeploymentGraphHandler
|
||||
from nailgun.api.v1.validators import plugin
|
||||
from nailgun.errors import errors
|
||||
from nailgun import errors
|
||||
from nailgun import objects
|
||||
from nailgun.plugins.manager import PluginManager
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
from nailgun.api.v1.handlers import base
|
||||
from nailgun.api.v1.handlers.base import content
|
||||
from nailgun.api.v1.validators import plugin_link
|
||||
from nailgun.errors import errors
|
||||
from nailgun import errors
|
||||
from nailgun import objects
|
||||
|
||||
|
||||
|
|
|
@ -19,7 +19,7 @@ import six
|
|||
from nailgun.api.v1.handlers import base
|
||||
from nailgun.api.v1.handlers.base import content
|
||||
from nailgun.api.v1.validators.role import RoleValidator
|
||||
from nailgun.errors import errors
|
||||
from nailgun import errors
|
||||
from nailgun import objects
|
||||
from nailgun.objects.serializers.role import RoleSerializer
|
||||
|
||||
|
|
|
@ -21,7 +21,8 @@ from nailgun.api.v1.handlers.base import SingleHandler
|
|||
from nailgun.api.v1.handlers.base import content
|
||||
from nailgun.api.v1.validators.task import TaskValidator
|
||||
|
||||
from nailgun.errors import errors
|
||||
from nailgun import errors
|
||||
|
||||
from nailgun import objects
|
||||
from nailgun import utils
|
||||
|
||||
|
|
|
@ -22,7 +22,7 @@ from nailgun.api.v1.validators.json_schema.assignment \
|
|||
import unassignment_format_schema
|
||||
from nailgun.db import db
|
||||
from nailgun.db.sqlalchemy.models import Node
|
||||
from nailgun.errors import errors
|
||||
from nailgun import errors
|
||||
from nailgun.expression import Expression
|
||||
from nailgun import objects
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@ from oslo_serialization import jsonutils
|
|||
import six
|
||||
|
||||
from nailgun.api.v1.validators.json_schema import base_types
|
||||
from nailgun.errors import errors
|
||||
from nailgun import errors
|
||||
from nailgun import objects
|
||||
from nailgun.utils import restrictions
|
||||
|
||||
|
@ -39,7 +39,7 @@ class BasicValidator(object):
|
|||
try:
|
||||
res = jsonutils.loads(data)
|
||||
except Exception:
|
||||
raise errors.InvalidData(
|
||||
raise errors.JsonDecodeError(
|
||||
"Invalid json received",
|
||||
log_message=True
|
||||
)
|
||||
|
@ -65,7 +65,7 @@ class BasicValidator(object):
|
|||
jsonschema.validate(json_req, use_schema)
|
||||
except exceptions.ValidationError as exc:
|
||||
if len(exc.path) > 0:
|
||||
raise errors.InvalidData(
|
||||
raise errors.JsonValidationError(
|
||||
# NOTE(ikutukov): here was a exc.path.pop(). It was buggy
|
||||
# because JSONSchema error path could contain integers
|
||||
# and joining integers as string is not a good idea in
|
||||
|
@ -73,7 +73,7 @@ class BasicValidator(object):
|
|||
# properly and give 500 error code except 400.
|
||||
": ".join([six.text_type(exc.path), exc.message])
|
||||
)
|
||||
raise errors.InvalidData(exc.message)
|
||||
raise errors.JsonValidationError(exc.message)
|
||||
|
||||
@classmethod
|
||||
def validate_response(cls, resp, resource_type,
|
||||
|
@ -195,13 +195,14 @@ class BasicAttributesValidator(BasicValidator):
|
|||
|
||||
try:
|
||||
cls.validate_schema(attr, schema)
|
||||
except errors.InvalidData as e:
|
||||
raise errors.InvalidData('[{0}] {1}'.format(attr_name, e.message))
|
||||
except errors.JsonValidationError as e:
|
||||
raise errors.JsonValidationError(
|
||||
'[{0}] {1}'.format(attr_name, e.message))
|
||||
|
||||
# Validate regexp only if some value is present
|
||||
# Otherwise regexp might be invalid
|
||||
if attr['value']:
|
||||
regex_err = restrictions.AttributesRestriction.validate_regex(attr)
|
||||
if regex_err is not None:
|
||||
raise errors.InvalidData(
|
||||
raise errors.JsonValidationError(
|
||||
'[{0}] {1}'.format(attr_name, regex_err))
|
||||
|
|
|
@ -25,7 +25,7 @@ from nailgun.api.v1.validators.node import ProvisionSelectedNodesValidator
|
|||
from nailgun import consts
|
||||
from nailgun.db import db
|
||||
from nailgun.db.sqlalchemy.models import Node
|
||||
from nailgun.errors import errors
|
||||
from nailgun import errors
|
||||
from nailgun import objects
|
||||
from nailgun.plugins.manager import PluginManager
|
||||
|
||||
|
|
|
@ -20,7 +20,7 @@ from oslo_serialization import jsonutils
|
|||
from nailgun.api.v1.validators.base import BasicValidator
|
||||
from nailgun.api.v1.validators.json_schema import ip_addr
|
||||
from nailgun.db.sqlalchemy import models
|
||||
from nailgun.errors import errors
|
||||
from nailgun import errors
|
||||
from nailgun import objects
|
||||
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@ from nailgun.db.sqlalchemy.models import IPAddrRange
|
|||
from nailgun.db.sqlalchemy.models import NetworkGroup
|
||||
from nailgun.db.sqlalchemy.models import Node
|
||||
from nailgun.db.sqlalchemy.models import NodeGroup
|
||||
from nailgun.errors import errors
|
||||
from nailgun import errors
|
||||
from nailgun import objects
|
||||
from nailgun import utils
|
||||
|
||||
|
|
|
@ -24,7 +24,7 @@ from nailgun import consts
|
|||
from nailgun.db import db
|
||||
from nailgun.db.sqlalchemy.models import Node
|
||||
from nailgun.db.sqlalchemy.models import NodeNICInterface
|
||||
from nailgun.errors import errors
|
||||
from nailgun import errors
|
||||
from nailgun import objects
|
||||
from nailgun import utils
|
||||
|
||||
|
|
|
@ -18,7 +18,7 @@ from distutils.version import StrictVersion
|
|||
from nailgun.api.v1.validators.base import BasicValidator
|
||||
from nailgun import consts
|
||||
from nailgun.db import db
|
||||
from nailgun.errors import errors
|
||||
from nailgun import errors
|
||||
from nailgun import objects
|
||||
|
||||
from nailgun.api.v1.validators.json_schema import node_group
|
||||
|
|
|
@ -17,7 +17,7 @@ from nailgun import consts
|
|||
from nailgun import objects
|
||||
|
||||
from nailgun.api.v1.validators.base import BasicValidator
|
||||
from nailgun.errors import errors
|
||||
from nailgun import errors
|
||||
|
||||
|
||||
class NotificationValidator(BasicValidator):
|
||||
|
|
|
@ -18,7 +18,7 @@ from nailgun.api.v1.validators.base import BasicValidator
|
|||
from nailgun.api.v1.validators.json_schema import openstack_config as schema
|
||||
from nailgun import consts
|
||||
from nailgun.db.sqlalchemy import models
|
||||
from nailgun.errors import errors
|
||||
from nailgun import errors
|
||||
from nailgun import objects
|
||||
from nailgun import utils
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@ from nailgun.api.v1.validators.base import BasicValidator
|
|||
from nailgun.api.v1.validators.json_schema import base_types
|
||||
from nailgun.api.v1.validators.json_schema import tasks
|
||||
from nailgun import consts
|
||||
from nailgun.errors import errors
|
||||
from nailgun import errors
|
||||
from nailgun import objects
|
||||
from nailgun.orchestrator import orchestrator_graph
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
|
||||
from nailgun.api.v1.validators.base import BasicValidator
|
||||
from nailgun.api.v1.validators.json_schema import plugin
|
||||
from nailgun.errors import errors
|
||||
from nailgun import errors
|
||||
from nailgun.objects import ClusterPlugins
|
||||
from nailgun.objects import Plugin
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@ from nailgun.api.v1.validators.json_schema import release
|
|||
from nailgun import consts
|
||||
from nailgun.db import db
|
||||
from nailgun.db.sqlalchemy import models
|
||||
from nailgun.errors import errors
|
||||
from nailgun import errors
|
||||
|
||||
|
||||
class ReleaseValidator(BasicValidator):
|
||||
|
|
|
@ -19,7 +19,7 @@ from nailgun.api.v1.validators.base import BasicValidator
|
|||
from nailgun.api.v1.validators.json_schema import role
|
||||
from nailgun.db import db
|
||||
from nailgun.db.sqlalchemy import models
|
||||
from nailgun.errors import errors
|
||||
from nailgun import errors
|
||||
|
||||
|
||||
class RoleValidator(BasicValidator):
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
from nailgun import consts
|
||||
|
||||
from nailgun.api.v1.validators.base import BasicValidator
|
||||
from nailgun.errors import errors
|
||||
from nailgun import errors
|
||||
|
||||
|
||||
class TaskValidator(BasicValidator):
|
||||
|
|
|
@ -14,133 +14,18 @@
|
|||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
import six
|
||||
from .base import NailgunException
|
||||
|
||||
from nailgun.errors.base import NailgunException
|
||||
|
||||
default_messages = {
|
||||
# common errors
|
||||
"InvalidData": "Invalid data received",
|
||||
"AlreadyExists": "Object already exists",
|
||||
"TaskAlreadyRunning": "Task is already running",
|
||||
|
||||
# REST errors
|
||||
"CannotDelete": "Can't delete object",
|
||||
"CannotCreate": "Can't create object",
|
||||
"CannotUpdate": "Can't update object",
|
||||
"NotAllowed": "Action is not allowed",
|
||||
"InvalidField": "Invalid field specified for object",
|
||||
"ObjectNotFound": "Object not found in DB",
|
||||
|
||||
# node discovering errors
|
||||
"InvalidInterfacesInfo": "Invalid interfaces info",
|
||||
"InvalidMetadata": "Invalid metadata specified for node",
|
||||
"CannotFindNodeIDForDiscovering": "Cannot find node for discovering",
|
||||
|
||||
# deployment errors
|
||||
"CheckBeforeDeploymentError": "Pre-Deployment check wasn't successful",
|
||||
"DeploymentAlreadyStarted": "Deployment already started",
|
||||
"DeploymentNotRunning": "Deployment is not running",
|
||||
"NoDeploymentTasks": "Deployment tasks not found for specific release in the database",
|
||||
"DeletionAlreadyStarted": "Environment removal already started",
|
||||
"StopAlreadyRunning": "Stopping deployment already initiated",
|
||||
"CannotBeStopped": "Stop action is forbidden for the cluster",
|
||||
"FailedProvisioning": "Failed to start provisioning",
|
||||
"WrongNodeStatus": "Wrong node status",
|
||||
"NodeOffline": "Node is offline",
|
||||
"NotEnoughControllers": "Not enough controllers",
|
||||
"RedHatSetupError": "Red Hat setup error",
|
||||
"TaskAlreadyRunning": "A task is already running",
|
||||
"InvalidReleaseId": "Release Id is invalid",
|
||||
"InvalidOperatingSystem": "Invalid operating system",
|
||||
"CannotFindPluginForRelease": "Cannot find plugin for the release",
|
||||
"UnavailableRelease": "Release is unavailable",
|
||||
"ControllerInErrorState": ("One of the cluster controllers is in error "
|
||||
"state, please, eliminate the problem prior "
|
||||
"to proceeding further"),
|
||||
"SerializerNotSupported": ("Serialization of the task is not supported "
|
||||
"because of unknown type"),
|
||||
|
||||
# mongo errors
|
||||
"ExtMongoCheckerError": "Mongo nodes shouldn`t be used with external mongo",
|
||||
"MongoNodesCheckError": "Mongo nodes have to be present if ceilometer is chosen",
|
||||
|
||||
# disk errors
|
||||
"NotEnoughFreeSpace": "Not enough free space",
|
||||
"NotEnoughOsdNodes": "Not enough OSD nodes",
|
||||
|
||||
# network errors
|
||||
"AdminNetworkNotFound": "Admin network info not found",
|
||||
"InvalidNetworkCidr": "Invalid network CIDR",
|
||||
"InvalidNetworkVLANIDs": "Invalid network VLAN IDs",
|
||||
"AssignIPError": "Failed to assign IP to node",
|
||||
"NetworkCheckError": "Network checking failed",
|
||||
"CantRemoveOldVerificationTask": "Can't remove old verification task, still running",
|
||||
"OutOfVLANs": "Not enough available VLAN IDs",
|
||||
"OutOfIPs": "Not enough free IP addresses in pool",
|
||||
"NoSuitableCIDR": "Cannot find suitable CIDR",
|
||||
"CanNotFindInterface": "Cannot find interface",
|
||||
"CanNotDetermineEndPointIP": "Cannot determine end point IP",
|
||||
"CanNotFindNetworkForNode": "Cannot find network for node",
|
||||
"CanNotFindNetworkForNodeGroup": "Cannot find network for node group",
|
||||
"CanNotFindCommonNodeGroup": "Node role doesn't have common node group",
|
||||
"NetworkRoleConflict": "Cannot override existing network role",
|
||||
"NetworkTemplateMissingRoles": "Roles are missing from network template",
|
||||
"NetworkTemplateMissingNetRoles": "Network roles are missing",
|
||||
"NetworkTemplateMissingNetworkGroup": "Network group is missing",
|
||||
"NetworkTemplateCannotBeApplied": "Network template cannot be applied",
|
||||
"DuplicatedVIPNames": ("Cannot assign VIPs for the cluster due to "
|
||||
"overlapping of names of the VIPs"),
|
||||
"UpdateDnsmasqTaskIsRunning": ("update_dnsmasq task is not finished "
|
||||
"after the previous configuration change. "
|
||||
"Please try again after a few seconds."),
|
||||
"NovaNetworkNotSupported": ("Nova network is not supported in current "
|
||||
"release"),
|
||||
|
||||
# RPC errors
|
||||
"CannotFindTask": "Cannot find task",
|
||||
|
||||
# expression parser errors
|
||||
"LexError": "Illegal character",
|
||||
"ParseError": "Synxtax error",
|
||||
"UnknownModel": "Unknown model",
|
||||
|
||||
# Tracking errors
|
||||
"TrackingError": "Action failed",
|
||||
|
||||
# Zabbix errors
|
||||
"CannotMakeZabbixRequest": "Can't make a request to Zabbix",
|
||||
"ZabbixRequestError": "Zabbix request returned an error",
|
||||
|
||||
# Plugin errors
|
||||
"PackageVersionIsNotCompatible": "Package version is not compatible",
|
||||
|
||||
# Extensions
|
||||
"CannotFindExtension": "Cannot find extension",
|
||||
|
||||
# unknown
|
||||
"UnknownError": "Unknown error",
|
||||
"UnresolvableConflict": "Unresolvable conflict",
|
||||
"NodeNotBelongToCluster": "The Node doesn't belong to the Cluster",
|
||||
"TaskBaseDeploymentNotAllowed": "The task-based deployment is not allowed",
|
||||
"NoChanges": "There is no changes to apply."
|
||||
}
|
||||
|
||||
|
||||
class ErrorFactory(object):
|
||||
|
||||
def __init__(self):
|
||||
for name, msg in six.iteritems(default_messages):
|
||||
setattr(self, name, self._build_exc(name, msg))
|
||||
|
||||
def _build_exc(self, name, msg):
|
||||
return type(
|
||||
name,
|
||||
(NailgunException,),
|
||||
{
|
||||
"message": msg
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
errors = ErrorFactory()
|
||||
from .api import *
|
||||
from .deployment import *
|
||||
from .disk import *
|
||||
from .extension import *
|
||||
from .mongodb import *
|
||||
from .network import *
|
||||
from .network_template import *
|
||||
from .node import *
|
||||
from .parses import *
|
||||
from .plugins import *
|
||||
from .rpc import *
|
||||
from .validation import *
|
||||
from .zabbix import *
|
||||
|
|
|
@ -0,0 +1,41 @@
|
|||
# coding: utf-8
|
||||
|
||||
# Copyright 2016 Mirantis, Inc.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
# a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from .base import NailgunException
|
||||
|
||||
|
||||
class ApiException(NailgunException):
|
||||
"""Base REST exception"""
|
||||
|
||||
|
||||
class CannotDelete(ApiException):
|
||||
message = "Can't delete object"
|
||||
|
||||
|
||||
class CannotCreate(ApiException):
|
||||
message = "Can't create object"
|
||||
|
||||
|
||||
class CannotUpdate(ApiException):
|
||||
message = "Can't update object"
|
||||
|
||||
|
||||
class NotAllowed(ApiException):
|
||||
message = "Action is not allowed"
|
||||
|
||||
|
||||
class ObjectNotFound(ApiException):
|
||||
message = "Object not found in DB"
|
|
@ -13,10 +13,14 @@
|
|||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
import six
|
||||
|
||||
from nailgun.logger import logger
|
||||
|
||||
|
||||
@six.python_2_unicode_compatible
|
||||
class NailgunException(Exception):
|
||||
message = ""
|
||||
|
||||
def __init__(self,
|
||||
message="",
|
||||
|
@ -34,6 +38,3 @@ class NailgunException(Exception):
|
|||
|
||||
def __str__(self):
|
||||
return self.message
|
||||
|
||||
def __unicode__(self):
|
||||
return self.message
|
||||
|
|
|
@ -0,0 +1,103 @@
|
|||
# coding: utf-8
|
||||
|
||||
# Copyright 2016 Mirantis, Inc.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
# a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from .base import NailgunException
|
||||
|
||||
|
||||
class DeploymentException(NailgunException):
|
||||
"""Base deployment exception"""
|
||||
|
||||
|
||||
class CheckBeforeDeploymentError(DeploymentException):
|
||||
message = "Pre-Deployment check wasn't successful"
|
||||
|
||||
|
||||
class DeploymentAlreadyStarted(DeploymentException):
|
||||
message = "Deployment already started"
|
||||
|
||||
|
||||
class DeploymentNotRunning(DeploymentException):
|
||||
message = "Deployment is not running"
|
||||
|
||||
|
||||
class NoDeploymentTasks(DeploymentException):
|
||||
message = "Deployment tasks not found for specific release in the database"
|
||||
|
||||
|
||||
class DeletionAlreadyStarted(DeploymentException):
|
||||
message = "Environment removal already started"
|
||||
|
||||
|
||||
class StopAlreadyRunning(DeploymentException):
|
||||
message = "Stopping deployment already initiated"
|
||||
|
||||
|
||||
class CannotBeStopped(DeploymentException):
|
||||
message = "Stop action is forbidden for the cluster"
|
||||
|
||||
|
||||
class WrongNodeStatus(DeploymentException):
|
||||
message = "Wrong node status"
|
||||
|
||||
|
||||
class NodeOffline(DeploymentException):
|
||||
message = "Node is offline"
|
||||
|
||||
|
||||
class NotEnoughControllers(DeploymentException):
|
||||
message = "Not enough controllers"
|
||||
|
||||
|
||||
class RedHatSetupError(DeploymentException):
|
||||
message = "Red Hat setup error"
|
||||
|
||||
|
||||
class TaskAlreadyRunning(DeploymentException):
|
||||
message = "A task is already running"
|
||||
|
||||
|
||||
class InvalidReleaseId(DeploymentException):
|
||||
message = "Release Id is invalid"
|
||||
|
||||
|
||||
class InvalidOperatingSystem(DeploymentException):
|
||||
message = "Invalid operating system"
|
||||
|
||||
|
||||
class CannotFindPluginForRelease(DeploymentException):
|
||||
message = "Cannot find plugin for the release"
|
||||
|
||||
|
||||
class UnavailableRelease(DeploymentException):
|
||||
message = "Release is unavailable"
|
||||
|
||||
|
||||
class ControllerInErrorState(DeploymentException):
|
||||
message = ("One of the cluster controllers is in error state,"
|
||||
" please, eliminate the problem prior to proceeding further")
|
||||
|
||||
|
||||
class SerializerNotSupported(DeploymentException):
|
||||
message = ("Serialization of the task is not supported because of"
|
||||
" unknown type")
|
||||
|
||||
|
||||
class TaskBaseDeploymentNotAllowed(DeploymentException):
|
||||
message = "The task-based deployment is not allowed"
|
||||
|
||||
|
||||
class NoChanges(DeploymentException):
|
||||
message = "There is no changes to apply"
|
|
@ -0,0 +1,29 @@
|
|||
# coding: utf-8
|
||||
|
||||
# Copyright 2016 Mirantis, Inc.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
# a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from .base import NailgunException
|
||||
|
||||
|
||||
class DiskException(NailgunException):
|
||||
"""Base disk exception"""
|
||||
|
||||
|
||||
class NotEnoughFreeSpace(DiskException):
|
||||
message = "Not enough free space"
|
||||
|
||||
|
||||
class NotEnoughOsdNodes(DiskException):
|
||||
message = "Not enough OSD nodes"
|
|
@ -0,0 +1,25 @@
|
|||
# coding: utf-8
|
||||
|
||||
# Copyright 2016 Mirantis, Inc.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
# a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from .base import NailgunException
|
||||
|
||||
|
||||
class ExtensionException(NailgunException):
|
||||
"""Base extension exception"""
|
||||
|
||||
|
||||
class CannotFindExtension(ExtensionException):
|
||||
message = "Cannot find extension"
|
|
@ -0,0 +1,29 @@
|
|||
# coding: utf-8
|
||||
|
||||
# Copyright 2016 Mirantis, Inc.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
# a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from .base import NailgunException
|
||||
|
||||
|
||||
class MongoException(NailgunException):
|
||||
"""Base mongodb exception"""
|
||||
|
||||
|
||||
class ExtMongoCheckerError(MongoException):
|
||||
message = "Mongo nodes shouldn`t be used with external mongo"
|
||||
|
||||
|
||||
class MongoNodesCheckError(MongoException):
|
||||
message = "Mongo nodes have to be present if ceilometer is chosen"
|
|
@ -0,0 +1,95 @@
|
|||
# coding: utf-8
|
||||
|
||||
# Copyright 2016 Mirantis, Inc.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
# a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from .base import NailgunException
|
||||
|
||||
|
||||
class NetworkException(NailgunException):
|
||||
"""Base network exception"""
|
||||
|
||||
|
||||
class AdminNetworkNotFound(NetworkException):
|
||||
message = "Admin network info not found"
|
||||
|
||||
|
||||
class InvalidNetworkCidr(NetworkException):
|
||||
message = "Invalid network CIDR"
|
||||
|
||||
|
||||
class InvalidNetworkVLANIDs(NetworkException):
|
||||
message = "Invalid network VLAN IDs"
|
||||
|
||||
|
||||
class AssignIPError(NetworkException):
|
||||
message = "Failed to assign IP to node"
|
||||
|
||||
|
||||
class NetworkCheckError(NetworkException):
|
||||
message = "Network checking failed"
|
||||
|
||||
|
||||
class CantRemoveOldVerificationTask(NetworkException):
|
||||
message = "Can't remove old verification task, still running"
|
||||
|
||||
|
||||
class OutOfVLANs(NetworkException):
|
||||
message = "Not enough available VLAN IDs"
|
||||
|
||||
|
||||
class OutOfIPs(NetworkException):
|
||||
message = "Not enough free IP addresses in pool"
|
||||
|
||||
|
||||
class NoSuitableCIDR(NetworkException):
|
||||
message = "Cannot find suitable CIDR"
|
||||
|
||||
|
||||
class CanNotFindInterface(NetworkException):
|
||||
message = "Cannot find interface"
|
||||
|
||||
|
||||
class CanNotDetermineEndPointIP(NetworkException):
|
||||
message = "Cannot determine end point IP"
|
||||
|
||||
|
||||
class CanNotFindNetworkForNode(NetworkException):
|
||||
message = "Cannot find network for node"
|
||||
|
||||
|
||||
class CanNotFindNetworkForNodeGroup(NetworkException):
|
||||
message = "Cannot find network for node group"
|
||||
|
||||
|
||||
class CanNotFindCommonNodeGroup(NetworkException):
|
||||
message = "Node role doesn't have common node group"
|
||||
|
||||
|
||||
class NetworkRoleConflict(NetworkException):
|
||||
message = "Cannot override existing network role"
|
||||
|
||||
|
||||
class DuplicatedVIPNames(NetworkException):
|
||||
message = ("Cannot assign VIPs for the cluster due to overlapping of"
|
||||
" names of the VIPs")
|
||||
|
||||
|
||||
class UpdateDnsmasqTaskIsRunning(NetworkException):
|
||||
message = ("update_dnsmasq task is not finished after the previous"
|
||||
" configuration change. Please try again after a few seconds")
|
||||
|
||||
|
||||
class UnresolvableConflict(NetworkException):
|
||||
message = "Unresolvable conflict"
|
|
@ -0,0 +1,41 @@
|
|||
# coding: utf-8
|
||||
|
||||
# Copyright 2016 Mirantis, Inc.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
# a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from .network import NetworkException
|
||||
|
||||
|
||||
class NetworkTemplateException(NetworkException):
|
||||
"""Base network template exception"""
|
||||
|
||||
|
||||
class NetworkTemplateMissingRoles(NetworkTemplateException):
|
||||
message = "Roles are missing from network template"
|
||||
|
||||
|
||||
class NetworkTemplateMissingNetRoles(NetworkTemplateException):
|
||||
message = "Network roles are missing"
|
||||
|
||||
|
||||
class NetworkTemplateMissingNetworkGroup(NetworkTemplateException):
|
||||
message = "Network group is missing"
|
||||
|
||||
|
||||
class NetworkTemplateCannotBeApplied(NetworkTemplateException):
|
||||
message = "Network template cannot be applied"
|
||||
|
||||
|
||||
class NovaNetworkNotSupported(NetworkException):
|
||||
message = "Nova network is not supported in current release"
|
|
@ -0,0 +1,37 @@
|
|||
# coding: utf-8
|
||||
|
||||
# Copyright 2016 Mirantis, Inc.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
# a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from .base import NailgunException
|
||||
|
||||
|
||||
class NodeNotBelongToCluster(NailgunException):
|
||||
message = "The Node doesn't belong to the Cluster"
|
||||
|
||||
|
||||
class NodeDiscoveringException(NailgunException):
|
||||
"""Base node discovering exception"""
|
||||
|
||||
|
||||
class InvalidInterfacesInfo(NodeDiscoveringException):
|
||||
message = "Invalid interfaces info"
|
||||
|
||||
|
||||
class InvalidMetadata(NodeDiscoveringException):
|
||||
message = "Invalid metadata specified for node"
|
||||
|
||||
|
||||
class CannotFindNodeIDForDiscovering(NodeDiscoveringException):
|
||||
message = "Cannot find node for discovering"
|
|
@ -0,0 +1,33 @@
|
|||
# coding: utf-8
|
||||
|
||||
# Copyright 2016 Mirantis, Inc.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
# a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from .base import NailgunException
|
||||
|
||||
|
||||
class ExpressionParserException(NailgunException):
|
||||
"""Base expression parser exception"""
|
||||
|
||||
|
||||
class LexError(ExpressionParserException):
|
||||
message = "Illegal character"
|
||||
|
||||
|
||||
class ParseError(ExpressionParserException):
|
||||
message = "Synxtax error"
|
||||
|
||||
|
||||
class UnknownModel(ExpressionParserException):
|
||||
message = "Unknown model"
|
|
@ -0,0 +1,25 @@
|
|||
# coding: utf-8
|
||||
|
||||
# Copyright 2016 Mirantis, Inc.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
# a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from .base import NailgunException
|
||||
|
||||
|
||||
class PluginException(NailgunException):
|
||||
"""Base plugn exception"""
|
||||
|
||||
|
||||
class PackageVersionIsNotCompatible(PluginException):
|
||||
message = "Package version is not compatible"
|
|
@ -0,0 +1,25 @@
|
|||
# coding: utf-8
|
||||
|
||||
# Copyright 2016 Mirantis, Inc.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
# a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from .base import NailgunException
|
||||
|
||||
|
||||
class RPCException(NailgunException):
|
||||
"""Base RPC exception"""
|
||||
|
||||
|
||||
class CannotFindTask(RPCException):
|
||||
message = "Cannot find task"
|
|
@ -0,0 +1,37 @@
|
|||
# coding: utf-8
|
||||
|
||||
# Copyright 2016 Mirantis, Inc.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
# a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from .base import NailgunException
|
||||
|
||||
|
||||
class ValidationException(NailgunException):
|
||||
"""Base validateion exception"""
|
||||
|
||||
|
||||
class InvalidData(ValidationException):
|
||||
message = "Invalid data received"
|
||||
|
||||
|
||||
class AlreadyExists(ValidationException):
|
||||
message = "Object already exists"
|
||||
|
||||
|
||||
class JsonDecodeError(InvalidData):
|
||||
message = "Malformed json format"
|
||||
|
||||
|
||||
class JsonValidationError(InvalidData):
|
||||
message = "JSON data is not valid"
|
|
@ -0,0 +1,29 @@
|
|||
# coding: utf-8
|
||||
|
||||
# Copyright 2016 Mirantis, Inc.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
# a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from .base import NailgunException
|
||||
|
||||
|
||||
class ZabbixException(NailgunException):
|
||||
"""Base zabbix exception"""
|
||||
|
||||
|
||||
class CannotMakeZabbixRequest(ZabbixException):
|
||||
message = "Can't make a request to Zabbix"
|
||||
|
||||
|
||||
class ZabbixRequestError(ZabbixException):
|
||||
message = "Zabbix request returned an error"
|
|
@ -17,7 +17,7 @@
|
|||
import ply.lex
|
||||
import ply.yacc
|
||||
|
||||
from nailgun.errors import errors
|
||||
from nailgun import errors
|
||||
from nailgun.expression.objects import ModelPathWrapper
|
||||
from nailgun.expression.objects import ScalarWrapper
|
||||
from nailgun.expression.objects import SubexpressionWrapper
|
||||
|
|
|
@ -19,7 +19,7 @@ import mock
|
|||
from oslo_serialization import jsonutils
|
||||
|
||||
from nailgun import consts
|
||||
from nailgun.errors import errors
|
||||
from nailgun import errors
|
||||
from nailgun.settings import settings
|
||||
from nailgun.test import base
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
from nailgun.api.v1.validators import assignment
|
||||
from nailgun.api.v1.validators import base
|
||||
from nailgun import consts
|
||||
from nailgun.errors import errors
|
||||
from nailgun import errors
|
||||
from nailgun import objects
|
||||
|
||||
from .objects import adapters
|
||||
|
|
|
@ -18,7 +18,7 @@ from itertools import chain
|
|||
|
||||
from stevedore.extension import ExtensionManager
|
||||
|
||||
from nailgun.errors import errors
|
||||
from nailgun import errors
|
||||
from nailgun.extensions import consts
|
||||
|
||||
_EXTENSION_MANAGER = None
|
||||
|
|
|
@ -27,7 +27,8 @@ from netaddr import IPRange
|
|||
import six
|
||||
|
||||
from nailgun import consts
|
||||
from nailgun.errors import errors
|
||||
|
||||
from nailgun import errors
|
||||
from nailgun.extensions.network_manager.objects.serializers.nic import \
|
||||
NodeInterfacesSerializer
|
||||
from nailgun.logger import logger
|
||||
|
|
|
@ -22,7 +22,7 @@ from nailgun import consts
|
|||
from nailgun.db import db
|
||||
from nailgun.db.sqlalchemy import models
|
||||
|
||||
from nailgun.errors import errors
|
||||
from nailgun import errors
|
||||
from nailgun.logger import logger
|
||||
|
||||
from nailgun.extensions.network_manager.manager import AllocateVIPs70Mixin
|
||||
|
|
|
@ -19,7 +19,7 @@ from sqlalchemy.sql import not_
|
|||
|
||||
from nailgun.db import db
|
||||
from nailgun.db.sqlalchemy import models
|
||||
from nailgun.errors import errors
|
||||
from nailgun import errors
|
||||
from nailgun.extensions.network_manager.objects.serializers.ip_addr import \
|
||||
IPAddrSerializer
|
||||
from nailgun.objects import Cluster
|
||||
|
|
|
@ -19,7 +19,7 @@ from netaddr import IPNetwork
|
|||
from nailgun import consts
|
||||
from nailgun.db import db
|
||||
from nailgun.db.sqlalchemy import models
|
||||
from nailgun.errors import errors
|
||||
from nailgun import errors
|
||||
from nailgun.extensions.network_manager.objects.serializers.network_group \
|
||||
import NetworkGroupSerializer
|
||||
from nailgun.logger import logger
|
||||
|
|
|
@ -25,7 +25,7 @@ from functools import partial
|
|||
from oslo_serialization import jsonutils
|
||||
import six
|
||||
|
||||
from nailgun.errors import errors
|
||||
from nailgun import errors
|
||||
from nailgun.logger import logger
|
||||
|
||||
from .objects.adapters import NailgunNodeAdapter
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
from ..objects.adapters import NailgunNodeAdapter
|
||||
from .json_schema.disks import disks_simple_format_schema
|
||||
from nailgun.api.v1.validators.base import BasicValidator
|
||||
from nailgun.errors import errors
|
||||
from nailgun import errors
|
||||
|
||||
|
||||
class NodeDisksValidator(BasicValidator):
|
||||
|
|
|
@ -20,7 +20,7 @@ import re
|
|||
import six
|
||||
|
||||
from nailgun import consts
|
||||
from nailgun.errors import errors
|
||||
from nailgun import errors
|
||||
from nailgun.expression import Expression
|
||||
from nailgun.logger import logger
|
||||
from nailgun.settings import settings
|
||||
|
|
|
@ -19,7 +19,7 @@ from distutils.version import StrictVersion
|
|||
import six
|
||||
|
||||
from nailgun import consts
|
||||
from nailgun.errors import errors
|
||||
from nailgun import errors
|
||||
from nailgun.lcm.task_serializer import TasksSerializersFactory
|
||||
from nailgun.logger import logger
|
||||
from nailgun.utils.role_resolver import NameMatchingPolicy
|
||||
|
|
|
@ -23,7 +23,7 @@ import netaddr
|
|||
import six
|
||||
|
||||
from nailgun import consts
|
||||
from nailgun.errors import errors
|
||||
from nailgun import errors
|
||||
from nailgun.logger import logger
|
||||
from nailgun import objects
|
||||
from nailgun.task.helpers import TaskHelper
|
||||
|
|
|
@ -33,7 +33,7 @@ from sqlalchemy.orm import Query
|
|||
from nailgun.objects.serializers.base import BasicSerializer
|
||||
|
||||
from nailgun.db import db
|
||||
from nailgun.errors import errors
|
||||
from nailgun import errors
|
||||
|
||||
|
||||
class NailgunObject(object):
|
||||
|
|
|
@ -32,7 +32,7 @@ from sqlalchemy.orm.exc import NoResultFound
|
|||
from nailgun import consts
|
||||
from nailgun.db import db
|
||||
from nailgun.db.sqlalchemy import models
|
||||
from nailgun.errors import errors
|
||||
from nailgun import errors
|
||||
from nailgun.extensions import fire_callback_on_cluster_delete
|
||||
from nailgun.extensions import fire_callback_on_node_collection_delete
|
||||
from nailgun.logger import logger
|
||||
|
|
|
@ -19,7 +19,7 @@ import six
|
|||
from nailgun import consts
|
||||
from nailgun.db import db
|
||||
from nailgun.db.sqlalchemy import models
|
||||
from nailgun.errors import errors
|
||||
from nailgun import errors
|
||||
from nailgun.logger import logger
|
||||
from nailgun.objects import NailgunCollection
|
||||
from nailgun.objects import NailgunObject
|
||||
|
|
|
@ -16,7 +16,7 @@ import six
|
|||
|
||||
from nailgun.db import db
|
||||
from nailgun.db.sqlalchemy.models import MasterNodeSettings
|
||||
from nailgun.errors import errors
|
||||
from nailgun import errors
|
||||
from nailgun import logger
|
||||
from nailgun.objects.base import NailgunObject
|
||||
from nailgun.objects.serializers.master_node_settings \
|
||||
|
|
|
@ -36,7 +36,7 @@ from sqlalchemy.orm import subqueryload_all
|
|||
from nailgun import consts
|
||||
from nailgun.db import db
|
||||
from nailgun.db.sqlalchemy import models
|
||||
from nailgun.errors import errors
|
||||
from nailgun import errors
|
||||
from nailgun.extensions import fire_callback_on_node_collection_delete
|
||||
from nailgun.extensions import fire_callback_on_node_create
|
||||
from nailgun.extensions import fire_callback_on_node_delete
|
||||
|
|
|
@ -19,7 +19,7 @@ from nailgun.objects.serializers.node_group import NodeGroupSerializer
|
|||
|
||||
from nailgun.db import db
|
||||
from nailgun.db.sqlalchemy import models
|
||||
from nailgun.errors import errors
|
||||
from nailgun import errors
|
||||
from nailgun.objects import Cluster
|
||||
from nailgun.objects import NailgunCollection
|
||||
from nailgun.objects import NailgunObject
|
||||
|
|
|
@ -18,7 +18,7 @@ from datetime import datetime
|
|||
|
||||
from nailgun.db.sqlalchemy import models
|
||||
|
||||
from nailgun.errors import errors
|
||||
from nailgun import errors
|
||||
from nailgun.logger import logger
|
||||
|
||||
from nailgun.objects import NailgunCollection
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
from nailgun import consts
|
||||
from nailgun.db import db
|
||||
from nailgun.db.sqlalchemy import models
|
||||
from nailgun.errors import errors
|
||||
from nailgun import errors
|
||||
from nailgun.objects import NailgunCollection
|
||||
from nailgun.objects import NailgunObject
|
||||
from nailgun.objects.serializers.openstack_config \
|
||||
|
|
|
@ -24,7 +24,7 @@ from nailgun.db.sqlalchemy import models
|
|||
|
||||
from nailgun import consts
|
||||
|
||||
from nailgun.errors import errors
|
||||
from nailgun import errors
|
||||
|
||||
from nailgun.logger import logger
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
from nailgun import consts
|
||||
from nailgun.db import db
|
||||
from nailgun.db.sqlalchemy import models
|
||||
from nailgun.errors import errors
|
||||
from nailgun import errors
|
||||
from nailgun.objects import NailgunCollection
|
||||
from nailgun.objects import NailgunObject
|
||||
from nailgun.objects.serializers.transaction import TransactionSerializer
|
||||
|
|
|
@ -21,7 +21,7 @@ from netaddr import IPNetwork
|
|||
|
||||
from nailgun.db import db
|
||||
from nailgun.db.sqlalchemy.models import NetworkGroup
|
||||
from nailgun.errors import errors
|
||||
from nailgun import errors
|
||||
from nailgun import objects
|
||||
from nailgun.settings import settings
|
||||
|
||||
|
|
|
@ -24,7 +24,7 @@ import networkx as nx
|
|||
import six
|
||||
|
||||
from nailgun import consts
|
||||
from nailgun.errors import errors
|
||||
from nailgun import errors
|
||||
from nailgun.logger import logger
|
||||
from nailgun import objects
|
||||
from nailgun.orchestrator import priority_serializers as ps
|
||||
|
|
|
@ -21,7 +21,7 @@ import itertools
|
|||
import six
|
||||
|
||||
from nailgun import consts
|
||||
from nailgun.errors import errors
|
||||
from nailgun import errors
|
||||
from nailgun.logger import logger
|
||||
import nailgun.orchestrator.tasks_templates as templates
|
||||
from nailgun.settings import settings
|
||||
|
|
|
@ -22,7 +22,7 @@ import itertools
|
|||
import six
|
||||
|
||||
from nailgun import consts
|
||||
from nailgun.errors import errors
|
||||
from nailgun import errors
|
||||
from nailgun.logger import logger
|
||||
from nailgun.orchestrator import plugins_serializers
|
||||
from nailgun.orchestrator.tasks_serializer import CreateVMsOnCompute
|
||||
|
|
|
@ -21,7 +21,7 @@ import six
|
|||
import yaml
|
||||
|
||||
from nailgun import consts
|
||||
from nailgun.errors import errors
|
||||
from nailgun import errors
|
||||
from nailgun.expression import Expression
|
||||
from nailgun import objects
|
||||
from nailgun.orchestrator import deployment_serializers
|
||||
|
|
|
@ -24,7 +24,7 @@ import six
|
|||
import yaml
|
||||
|
||||
from nailgun import consts
|
||||
from nailgun.errors import errors
|
||||
from nailgun import errors
|
||||
from nailgun.logger import logger
|
||||
from nailgun.objects.deployment_graph import DeploymentGraph
|
||||
from nailgun.settings import settings
|
||||
|
|
|
@ -16,7 +16,7 @@ import copy
|
|||
import six
|
||||
from six.moves import map
|
||||
|
||||
from nailgun.errors import errors
|
||||
from nailgun import errors
|
||||
from nailgun.logger import logger
|
||||
from nailgun.objects.plugin import ClusterPlugins
|
||||
from nailgun.objects.plugin import Plugin
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
import abc
|
||||
import six
|
||||
|
||||
from nailgun.errors import errors
|
||||
from nailgun import errors
|
||||
|
||||
|
||||
@six.add_metaclass(abc.ABCMeta)
|
||||
|
|
|
@ -26,7 +26,7 @@ from oslo_serialization import jsonutils
|
|||
from sqlalchemy import or_
|
||||
|
||||
from nailgun import consts
|
||||
from nailgun.errors import errors as nailgun_errors
|
||||
from nailgun import errors as nailgun_errors
|
||||
from nailgun import notifier
|
||||
from nailgun import objects
|
||||
from nailgun.settings import settings
|
||||
|
|
|
@ -30,7 +30,7 @@ from kombu.mixins import ConsumerMixin
|
|||
import amqp.exceptions as amqp_exceptions
|
||||
|
||||
from nailgun.db import db
|
||||
from nailgun.errors import errors
|
||||
from nailgun import errors
|
||||
import nailgun.rpc as rpc
|
||||
from nailgun.rpc.receiver import NailgunReceiver
|
||||
from nailgun.rpc import utils
|
||||
|
|
|
@ -22,7 +22,7 @@ from kombu import Connection
|
|||
from kombu.mixins import ConsumerMixin
|
||||
|
||||
from nailgun.db import db
|
||||
from nailgun.errors import errors
|
||||
from nailgun import errors
|
||||
import nailgun.rpc as rpc
|
||||
from nailgun.rpc.receiver import NailgunReceiver
|
||||
|
||||
|
|
|
@ -25,7 +25,7 @@ from nailgun import consts
|
|||
from nailgun.db import db
|
||||
from nailgun.db.sqlalchemy.models import Node
|
||||
from nailgun.db.sqlalchemy.models import Task
|
||||
from nailgun.errors import errors
|
||||
from nailgun import errors
|
||||
from nailgun.logger import logger
|
||||
from nailgun.statistics.fuel_statistics.tasks_params_white_lists \
|
||||
import task_output_white_list
|
||||
|
|
|
@ -29,7 +29,7 @@ from nailgun import consts
|
|||
from nailgun.db import db
|
||||
from nailgun.db.sqlalchemy.models import Cluster
|
||||
from nailgun.db.sqlalchemy.models import Task
|
||||
from nailgun.errors import errors
|
||||
from nailgun import errors
|
||||
from nailgun.logger import logger
|
||||
from nailgun import notifier
|
||||
from nailgun import objects
|
||||
|
|
|
@ -35,7 +35,7 @@ from nailgun.db.sqlalchemy.models import CapacityLog
|
|||
from nailgun.db.sqlalchemy.models import Cluster
|
||||
from nailgun.db.sqlalchemy.models import Node
|
||||
from nailgun.db.sqlalchemy.models import Task
|
||||
from nailgun.errors import errors
|
||||
from nailgun import errors
|
||||
from nailgun.extensions.network_manager.manager import NetworkManager
|
||||
from nailgun import lcm
|
||||
from nailgun.logger import logger
|
||||
|
|
|
@ -42,7 +42,7 @@ from webtest import app
|
|||
import nailgun
|
||||
|
||||
from nailgun import consts
|
||||
from nailgun.errors import errors
|
||||
from nailgun import errors
|
||||
from nailgun.settings import settings
|
||||
|
||||
from nailgun.db import db
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
|
||||
from nailgun.consts import TASK_NAMES
|
||||
from nailgun.db.sqlalchemy.models import Task
|
||||
from nailgun.errors import errors
|
||||
from nailgun import errors
|
||||
from nailgun import objects
|
||||
from nailgun.task.task import CheckBeforeDeploymentTask
|
||||
from nailgun.test import base
|
||||
|
|
|
@ -29,7 +29,7 @@ import yaml
|
|||
|
||||
import nailgun
|
||||
from nailgun import consts
|
||||
from nailgun.errors import errors
|
||||
from nailgun import errors
|
||||
from nailgun.extensions.network_manager.objects.serializers \
|
||||
import network_configuration
|
||||
from nailgun import objects
|
||||
|
|
|
@ -25,7 +25,7 @@ from nailgun.db.sqlalchemy.models import Cluster
|
|||
from nailgun.db.sqlalchemy.models import NetworkGroup
|
||||
from nailgun.db.sqlalchemy.models import NeutronConfig
|
||||
from nailgun.db.sqlalchemy.models import NovaNetworkConfig
|
||||
from nailgun.errors import errors
|
||||
from nailgun import errors
|
||||
from nailgun.network.checker import NetworkCheck
|
||||
from nailgun import objects
|
||||
from nailgun.test.base import BaseIntegrationTest
|
||||
|
|
|
@ -21,7 +21,7 @@ from oslo_serialization import jsonutils
|
|||
from nailgun import consts
|
||||
from nailgun.db.sqlalchemy.models import Notification
|
||||
from nailgun.db.sqlalchemy.models import Task
|
||||
from nailgun.errors import errors
|
||||
from nailgun import errors
|
||||
from nailgun import notifier
|
||||
from nailgun.rpc import receiver as rcvr
|
||||
from nailgun.test.base import BaseIntegrationTest
|
||||
|
|
|
@ -19,7 +19,7 @@ from oslo_serialization import jsonutils
|
|||
import six
|
||||
|
||||
from nailgun import consts
|
||||
from nailgun.errors import errors
|
||||
from nailgun import errors
|
||||
from nailgun import objects
|
||||
from nailgun.objects import DeploymentGraph
|
||||
from nailgun.orchestrator.task_based_deployment import TaskProcessor
|
||||
|
|
|
@ -18,7 +18,7 @@ import mock
|
|||
import uuid
|
||||
|
||||
from nailgun import consts
|
||||
from nailgun.errors import errors
|
||||
from nailgun import errors
|
||||
from nailgun.objects import ClusterPlugins
|
||||
from nailgun.plugins.adapters import PluginAdapterV3
|
||||
from nailgun.plugins.manager import PluginManager
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
import mock
|
||||
|
||||
from nailgun import consts
|
||||
from nailgun.errors import errors
|
||||
from nailgun import errors
|
||||
from nailgun.objects import Task
|
||||
from nailgun.orchestrator.task_based_deployment import TaskProcessor
|
||||
from nailgun.test.base import BaseIntegrationTest
|
||||
|
|
|
@ -34,7 +34,7 @@ from nailgun.consts import TASK_NAMES
|
|||
from nailgun.consts import TASK_STATUSES
|
||||
|
||||
from nailgun.db.sqlalchemy import models
|
||||
from nailgun.errors import errors
|
||||
from nailgun import errors
|
||||
from nailgun.rpc.receiver import NailgunReceiver
|
||||
from nailgun.task.helpers import TaskHelper
|
||||
from nailgun.task import manager
|
||||
|
|
|
@ -16,7 +16,7 @@ import mock
|
|||
|
||||
from nailgun.api.v1.validators.network import NetAssignmentValidator
|
||||
from nailgun import consts
|
||||
from nailgun.errors import errors
|
||||
from nailgun import errors
|
||||
from nailgun import objects
|
||||
from nailgun.test.base import BaseValidatorTest
|
||||
from nailgun import utils
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
# under the License.
|
||||
|
||||
from nailgun.api.v1.validators.assignment import NodeAssignmentValidator
|
||||
from nailgun.errors import errors
|
||||
from nailgun import errors
|
||||
from nailgun.test.base import BaseUnitTest
|
||||
|
||||
|
||||
|
|
|
@ -20,7 +20,7 @@ import yaml
|
|||
|
||||
from nailgun.api.v1.validators import base
|
||||
from nailgun.api.v1.validators import cluster
|
||||
from nailgun.errors import errors
|
||||
from nailgun import errors
|
||||
from nailgun.test import base as base_test
|
||||
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@ from oslo_serialization import jsonutils
|
|||
from nailgun.api.v1.validators.cluster import ClusterStopDeploymentValidator
|
||||
from nailgun.api.v1.validators.cluster import ClusterValidator
|
||||
from nailgun import consts
|
||||
from nailgun.errors import errors
|
||||
from nailgun import errors
|
||||
from nailgun import objects
|
||||
from nailgun.test.base import BaseTestCase
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
|
||||
import inspect
|
||||
|
||||
from nailgun.errors import errors
|
||||
from nailgun import errors
|
||||
from nailgun.expression import Expression
|
||||
from nailgun.test.base import BaseTestCase
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
import copy
|
||||
import mock
|
||||
|
||||
from nailgun.errors import errors
|
||||
from nailgun import errors
|
||||
from nailgun.extensions import BaseExtension
|
||||
from nailgun.extensions import BasePipeline
|
||||
from nailgun.extensions import fire_callback_on_cluster_delete
|
||||
|
|
|
@ -21,7 +21,7 @@ from itertools import groupby
|
|||
import mock
|
||||
import yaml
|
||||
|
||||
from nailgun.errors import errors
|
||||
from nailgun import errors
|
||||
from nailgun.orchestrator import graph_configuration
|
||||
from nailgun.orchestrator import orchestrator_graph
|
||||
from nailgun.test import base
|
||||
|
|
|
@ -18,7 +18,7 @@ import copy
|
|||
import mock
|
||||
|
||||
from nailgun.api.v1.validators import ip_addr
|
||||
from nailgun.errors import errors
|
||||
from nailgun import errors
|
||||
from nailgun.test import base
|
||||
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
# under the License.
|
||||
|
||||
from nailgun import consts
|
||||
from nailgun.errors import errors
|
||||
from nailgun import errors
|
||||
from nailgun.lcm.context import TransactionContext
|
||||
from nailgun.lcm import task_serializer
|
||||
from nailgun.settings import settings
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
import mock
|
||||
|
||||
from nailgun import consts
|
||||
from nailgun.errors import errors
|
||||
from nailgun import errors
|
||||
from nailgun import lcm
|
||||
from nailgun.utils.role_resolver import RoleResolver
|
||||
|
||||
|
|
|
@ -26,7 +26,7 @@ from oslo_serialization import jsonutils
|
|||
|
||||
import nailgun
|
||||
from nailgun.api.v1.handlers.logs import read_backwards
|
||||
from nailgun.errors import errors
|
||||
from nailgun import errors
|
||||
from nailgun.settings import settings
|
||||
from nailgun.task.manager import DumpTaskManager
|
||||
from nailgun.task.task import DumpTask
|
||||
|
|
|
@ -21,7 +21,7 @@ from nailgun.db.sqlalchemy.models import Cluster
|
|||
from nailgun.db.sqlalchemy.models import network as network_db
|
||||
from nailgun.db.sqlalchemy.models import NetworkGroup
|
||||
from nailgun.db.sqlalchemy.models import Task
|
||||
from nailgun.errors import errors
|
||||
from nailgun import errors
|
||||
from nailgun.network.checker import NetworkCheck
|
||||
from nailgun.task import helpers
|
||||
from nailgun.task.manager import ApplyChangesTaskManager
|
||||
|
|
|
@ -23,7 +23,7 @@ from nailgun.api.v1.validators.network import \
|
|||
from nailgun.api.v1.validators.network import NovaNetworkConfigurationValidator
|
||||
from nailgun import consts
|
||||
from nailgun.db.sqlalchemy.models import NetworkGroup
|
||||
from nailgun.errors import errors
|
||||
from nailgun import errors
|
||||
from nailgun import objects
|
||||
from nailgun.test import base
|
||||
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue