~ubuntu-branches/ubuntu/vivid/neutron/vivid-updates

« back to all changes in this revision

Viewing changes to neutron/plugins/ml2/drivers/cisco/nexus/exceptions.py

  • Committer: Package Import Robot
  • Author(s): James Page
  • Date: 2015-03-30 11:17:19 UTC
  • mfrom: (1.1.21)
  • Revision ID: package-import@ubuntu.com-20150330111719-h0gx7233p4jkkgfh
Tags: 1:2015.1~b3-0ubuntu1
* New upstream milestone release:
  - d/control: Align version requirements with upstream.
  - d/control: Add new dependency on oslo-log.
  - d/p/*: Rebase.
  - d/control,d/neutron-plugin-hyperv*: Dropped, decomposed into
    separate project upstream.
  - d/control,d/neutron-plugin-openflow*: Dropped, decomposed into
    separate project upstream.
  - d/neutron-common.install: Add neutron-rootwrap-daemon and 
    neutron-keepalived-state-change binaries.
  - d/rules: Ignore neutron-hyperv-agent when installing; only for Windows.
  - d/neutron-plugin-cisco.install: Drop neutron-cisco-cfg-agent as
    decomposed into separate project upstream.
  - d/neutron-plugin-vmware.install: Drop neutron-check-nsx-config and
    neutron-nsx-manage as decomposed into separate project upstream.
  - d/control: Add dependency on python-neutron-fwaas to neutron-l3-agent.
* d/pydist-overrides: Add overrides for oslo packages.
* d/control: Fixup type in package description (LP: #1263539).
* d/p/fixup-driver-test-execution.patch: Cherry pick fix from upstream VCS
  to support unit test exection in out-of-tree vendor drivers.
* d/neutron-common.postinst: Allow general access to /etc/neutron but limit
  access to root/neutron to /etc/neutron/neutron.conf to support execution
  of unit tests in decomposed vendor drivers.
* d/control: Add dependency on python-neutron-fwaas to neutron-l3-agent
  package.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (c) 2013 OpenStack Foundation
2
 
# All Rights Reserved.
3
 
#
4
 
#    Licensed under the Apache License, Version 2.0 (the "License"); you may
5
 
#    not use this file except in compliance with the License. You may obtain
6
 
#    a copy of the License at
7
 
#
8
 
#         http://www.apache.org/licenses/LICENSE-2.0
9
 
#
10
 
#    Unless required by applicable law or agreed to in writing, software
11
 
#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12
 
#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13
 
#    License for the specific language governing permissions and limitations
14
 
#    under the License.
15
 
 
16
 
"""Exceptions used by Cisco Nexus ML2 mechanism driver."""
17
 
 
18
 
from neutron.common import exceptions
19
 
 
20
 
 
21
 
class CredentialNotFound(exceptions.NeutronException):
22
 
    """Credential with this ID cannot be found."""
23
 
    message = _("Credential %(credential_id)s could not be found.")
24
 
 
25
 
 
26
 
class CredentialNameNotFound(exceptions.NeutronException):
27
 
    """Credential Name could not be found."""
28
 
    message = _("Credential %(credential_name)s could not be found.")
29
 
 
30
 
 
31
 
class CredentialAlreadyExists(exceptions.NeutronException):
32
 
    """Credential name already exists."""
33
 
    message = _("Credential %(credential_name)s already exists "
34
 
                "for tenant %(tenant_id)s.")
35
 
 
36
 
 
37
 
class NexusComputeHostNotConfigured(exceptions.NeutronException):
38
 
    """Connection to compute host is not configured."""
39
 
    message = _("Connection to %(host)s is not configured.")
40
 
 
41
 
 
42
 
class NexusConnectFailed(exceptions.NeutronException):
43
 
    """Failed to connect to Nexus switch."""
44
 
    message = _("Unable to connect to Nexus %(nexus_host)s. Reason: %(exc)s.")
45
 
 
46
 
 
47
 
class NexusConfigFailed(exceptions.NeutronException):
48
 
    """Failed to configure Nexus switch."""
49
 
    message = _("Failed to configure Nexus: %(config)s. Reason: %(exc)s.")
50
 
 
51
 
 
52
 
class NexusPortBindingNotFound(exceptions.NeutronException):
53
 
    """NexusPort Binding is not present."""
54
 
    message = _("Nexus Port Binding (%(filters)s) is not present")
55
 
 
56
 
    def __init__(self, **kwargs):
57
 
        filters = ','.join('%s=%s' % i for i in kwargs.items())
58
 
        super(NexusPortBindingNotFound, self).__init__(filters=filters)
59
 
 
60
 
 
61
 
class NexusMissingRequiredFields(exceptions.NeutronException):
62
 
    """Missing required fields to configure nexus switch."""
63
 
    message = _("Missing required field(s) to configure nexus switch: "
64
 
                "%(fields)s")
65
 
 
66
 
 
67
 
class NoNexusSviSwitch(exceptions.NeutronException):
68
 
    """No usable nexus switch found."""
69
 
    message = _("No usable Nexus switch found to create SVI interface.")
70
 
 
71
 
 
72
 
class SubnetNotSpecified(exceptions.NeutronException):
73
 
    """Subnet id not specified."""
74
 
    message = _("No subnet_id specified for router gateway.")
75
 
 
76
 
 
77
 
class SubnetInterfacePresent(exceptions.NeutronException):
78
 
    """Subnet SVI interface already exists."""
79
 
    message = _("Subnet %(subnet_id)s has an interface on %(router_id)s.")
80
 
 
81
 
 
82
 
class PortIdForNexusSvi(exceptions.NeutronException):
83
 
        """Port Id specified for Nexus SVI."""
84
 
        message = _('Nexus hardware router gateway only uses Subnet Ids.')