~ubuntu-branches/ubuntu/saucy/neutron/saucy

« back to all changes in this revision

Viewing changes to neutron/plugins/ml2/drivers/cisco/nexus_snippets.py

  • Committer: Package Import Robot
  • Author(s): Chuck Short, Chuck Short, Adam Gandelman, James Page
  • Date: 2013-09-09 13:12:57 UTC
  • mfrom: (1.1.1)
  • Revision ID: package-import@ubuntu.com-20130909131257-ne8foyhf9f9s94km
Tags: 1:2013.2~b3-0ubuntu1
[ Chuck Short ]
* New upstream release.
* debian/patches/fix-quantum-configuration.patch: Refreshed.
* debian/patches/neutron-conf.patch: Dropped.
* debian/patches/ignore-quantum-binaries.patch: Dropped
* debian/control: Add python-babel as a build depends.
* debian/neutron-common.install: Add neutron-usage-audit binary.
* debian/rules: Pass the tests even if it fails, temporary measure 
  until we figure out why the tests fail.

[ Adam Gandelman ]
* debian/rules: Limit testr concurrency to 1 CPU.
* debian/patches: Refresh.

[ James Page ]
* d/*.upstart: Added respawn stanza (LP: #1170393), tidied
  descriptions and rationalized stop on stanzas to be consistent.
* d/neutron-dhcp-agent.install: Drop neutron-dhcp-agent-dnsmasq-lease-
  update inline with upstream.
* d/rules: Ignore deprecated quantum binaries when checking for
  missing files.
* d/control: Update/add versioned depends for upgrades:
  - python-anyjson >= 0.3.3
  - python-stevedore >= 0.9
  - python-oslo.config >= 1:1.2.0
  - python-keystoneclient >= 1:0.2.0
* d/*: Wrap and sort.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# Copyright 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
 
 
17
"""
 
18
Cisco Nexus-OS XML-based configuration snippets.
 
19
"""
 
20
 
 
21
import logging
 
22
 
 
23
 
 
24
LOG = logging.getLogger(__name__)
 
25
 
 
26
 
 
27
# The following are standard strings, messages used to communicate with Nexus.
 
28
EXEC_CONF_SNIPPET = """
 
29
      <config xmlns:xc="urn:ietf:params:xml:ns:netconf:base:1.0">
 
30
        <configure>
 
31
          <__XML__MODE__exec_configure>%s
 
32
          </__XML__MODE__exec_configure>
 
33
        </configure>
 
34
      </config>
 
35
"""
 
36
 
 
37
CMD_VLAN_CONF_SNIPPET = """
 
38
            <vlan>
 
39
              <vlan-id-create-delete>
 
40
                <__XML__PARAM_value>%s</__XML__PARAM_value>
 
41
                <__XML__MODE_vlan>
 
42
                  <name>
 
43
                    <vlan-name>%s</vlan-name>
 
44
                  </name>
 
45
                </__XML__MODE_vlan>
 
46
              </vlan-id-create-delete>
 
47
            </vlan>
 
48
"""
 
49
 
 
50
CMD_VLAN_ACTIVE_SNIPPET = """
 
51
            <vlan>
 
52
              <vlan-id-create-delete>
 
53
                <__XML__PARAM_value>%s</__XML__PARAM_value>
 
54
                <__XML__MODE_vlan>
 
55
                  <state>
 
56
                    <vstate>active</vstate>
 
57
                  </state>
 
58
                </__XML__MODE_vlan>
 
59
              </vlan-id-create-delete>
 
60
            </vlan>
 
61
"""
 
62
 
 
63
CMD_VLAN_NO_SHUTDOWN_SNIPPET = """
 
64
            <vlan>
 
65
              <vlan-id-create-delete>
 
66
                <__XML__PARAM_value>%s</__XML__PARAM_value>
 
67
                <__XML__MODE_vlan>
 
68
                  <no>
 
69
                    <shutdown/>
 
70
                  </no>
 
71
                </__XML__MODE_vlan>
 
72
              </vlan-id-create-delete>
 
73
            </vlan>
 
74
"""
 
75
 
 
76
CMD_NO_VLAN_CONF_SNIPPET = """
 
77
          <no>
 
78
          <vlan>
 
79
            <vlan-id-create-delete>
 
80
              <__XML__PARAM_value>%s</__XML__PARAM_value>
 
81
            </vlan-id-create-delete>
 
82
          </vlan>
 
83
          </no>
 
84
"""
 
85
 
 
86
CMD_INT_VLAN_HEADER = """
 
87
          <interface>
 
88
            <ethernet>
 
89
              <interface>%s</interface>
 
90
              <__XML__MODE_if-ethernet-switch>
 
91
                <switchport>
 
92
                  <trunk>
 
93
                    <allowed>
 
94
                      <vlan>"""
 
95
 
 
96
CMD_VLAN_ID = """
 
97
                          <vlan_id>%s</vlan_id>"""
 
98
 
 
99
CMD_VLAN_ADD_ID = """
 
100
                        <add>%s
 
101
                        </add>""" % CMD_VLAN_ID
 
102
 
 
103
CMD_INT_VLAN_TRAILER = """
 
104
                      </vlan>
 
105
                    </allowed>
 
106
                  </trunk>
 
107
                </switchport>
 
108
              </__XML__MODE_if-ethernet-switch>
 
109
            </ethernet>
 
110
          </interface>
 
111
"""
 
112
 
 
113
CMD_INT_VLAN_SNIPPET = (CMD_INT_VLAN_HEADER +
 
114
                        CMD_VLAN_ID +
 
115
                        CMD_INT_VLAN_TRAILER)
 
116
 
 
117
CMD_INT_VLAN_ADD_SNIPPET = (CMD_INT_VLAN_HEADER +
 
118
                            CMD_VLAN_ADD_ID +
 
119
                            CMD_INT_VLAN_TRAILER)
 
120
 
 
121
CMD_PORT_TRUNK = """
 
122
          <interface>
 
123
            <ethernet>
 
124
              <interface>%s</interface>
 
125
              <__XML__MODE_if-ethernet-switch>
 
126
                <switchport></switchport>
 
127
                <switchport>
 
128
                  <mode>
 
129
                    <trunk>
 
130
                    </trunk>
 
131
                  </mode>
 
132
                </switchport>
 
133
              </__XML__MODE_if-ethernet-switch>
 
134
            </ethernet>
 
135
          </interface>
 
136
"""
 
137
 
 
138
CMD_NO_SWITCHPORT = """
 
139
          <interface>
 
140
            <ethernet>
 
141
              <interface>%s</interface>
 
142
              <__XML__MODE_if-ethernet-switch>
 
143
                <no>
 
144
                  <switchport>
 
145
                  </switchport>
 
146
                </no>
 
147
              </__XML__MODE_if-ethernet-switch>
 
148
            </ethernet>
 
149
          </interface>
 
150
"""
 
151
 
 
152
CMD_NO_VLAN_INT_SNIPPET = """
 
153
          <interface>
 
154
            <ethernet>
 
155
              <interface>%s</interface>
 
156
              <__XML__MODE_if-ethernet-switch>
 
157
                <switchport></switchport>
 
158
                <switchport>
 
159
                  <trunk>
 
160
                    <allowed>
 
161
                      <vlan>
 
162
                        <remove>
 
163
                          <vlan>%s</vlan>
 
164
                        </remove>
 
165
                      </vlan>
 
166
                    </allowed>
 
167
                  </trunk>
 
168
                </switchport>
 
169
              </__XML__MODE_if-ethernet-switch>
 
170
            </ethernet>
 
171
          </interface>
 
172
"""
 
173
 
 
174
CMD_VLAN_SVI_SNIPPET = """
 
175
<interface>
 
176
    <vlan>
 
177
        <vlan>%s</vlan>
 
178
        <__XML__MODE_vlan>
 
179
            <no>
 
180
              <shutdown/>
 
181
            </no>
 
182
            <ip>
 
183
                <address>
 
184
                    <address>%s</address>
 
185
                </address>
 
186
            </ip>
 
187
        </__XML__MODE_vlan>
 
188
    </vlan>
 
189
</interface>
 
190
"""
 
191
 
 
192
CMD_NO_VLAN_SVI_SNIPPET = """
 
193
<no>
 
194
    <interface>
 
195
        <vlan>
 
196
            <vlan>%s</vlan>
 
197
        </vlan>
 
198
    </interface>
 
199
</no>
 
200
"""