~ubuntu-branches/ubuntu/raring/quantum/raring-updates

« back to all changes in this revision

Viewing changes to quantum/plugins/cisco/nexus/cisco_nexus_network_driver_v2.py

  • Committer: Package Import Robot
  • Author(s): Adam Gandelman
  • Date: 2013-10-17 13:53:32 UTC
  • mfrom: (2.1.25)
  • Revision ID: package-import@ubuntu.com-20131017135332-r4tcq2gyu8co8q8n
Tags: 1:2013.1.4-0ubuntu1
* Resynchronize with stable/grizzly (c57c0fa) (LP: #1241202):
  - [043837e] _retrieve_extra_groups in Nicira plugin incompatible with
    oslo.config >= 1.2.0 LP: 1200609
  - [a150dc6] dhcp-agent network namespace does not have a default route,
    can't use upstream dns LP: 1181378
  - [be16384] Cisco plugin (grizzly) device connection errors LP: 1212834
  - [045c0b0] Cisco plugin (grizzly) does not pass proper args LP: 1213147
  - [5bb6b60] metadata network handling causes stacktrace in nvp plugin
    LP: 1216110
  - [85c92b0] Nicira plugin: get_port reports wrong port status for extended
    switches LP: 1188652
  - [4601b14] Hyper-V agent does not report the correct exception when the
    network type is set to GRE LP: 1224583
  - [8180381] Multiple  Neutron operations  using a script fails on Brocade
    Plugin LP: 1223754
  - [06f7e75] Neutron network delete fails with brocade plugin LP: 1223747
  - [1ca02f6] nec-agent: port_added message can be dropped when RPC timeout
    occurs LP: 1235111
  - [c57c0fa] make nvp plugin future version friendly LP: 1217479

Show diffs side-by-side

added added

removed removed

Lines of Context:
40
40
    Nexus Driver Main Class
41
41
    """
42
42
    def __init__(self):
43
 
        pass
 
43
        self.connections = {}
44
44
 
45
45
    def _edit_config(self, mgr, target='running', config='',
46
46
                     allowed_exc_strs=None):
71
71
 
72
72
    def nxos_connect(self, nexus_host, nexus_ssh_port, nexus_user,
73
73
                     nexus_password):
74
 
        """
75
 
        Makes the SSH connection to the Nexus Switch
76
 
        """
77
 
        man = manager.connect(host=nexus_host, port=nexus_ssh_port,
78
 
                              username=nexus_user, password=nexus_password)
79
 
        return man
 
74
        """Make SSH connection to the Nexus Switch."""
 
75
        if getattr(self.connections.get(nexus_host), 'connected', None):
 
76
            return self.connections[nexus_host]
 
77
 
 
78
        try:
 
79
            man = manager.connect(host=nexus_host,
 
80
                                  port=nexus_ssh_port,
 
81
                                  username=nexus_user,
 
82
                                  password=nexus_password)
 
83
            self.connections[nexus_host] = man
 
84
        except Exception as e:
 
85
            # Raise a Quantum exception. Include a description of
 
86
            # the original ncclient exception.
 
87
            raise cisco_exceptions.NexusConnectFailed(nexus_host=nexus_host,
 
88
                                                      exc=e)
 
89
 
 
90
        return self.connections[nexus_host]
80
91
 
81
92
    def create_xml_snippet(self, cutomized_config):
82
93
        """