~ubuntu-branches/ubuntu/saucy/quantum/saucy

« back to all changes in this revision

Viewing changes to quantum/plugins/ryu/db/api_v2.py

  • Committer: Package Import Robot
  • Author(s): Chuck Short
  • Date: 2013-05-31 09:37:25 UTC
  • mfrom: (2.1.22)
  • Revision ID: package-import@ubuntu.com-20130531093725-bf9jom93l7jm57iv
Tags: 1:2013.2~b1-0ubuntu1
* New upstream release.
* debian/patches/fix-quantum-configuration.patch: Refreshed
* debian/control: Add testrepository.
* debian/control: Add subunit.
* debian/control: Add python-d21o1 and python-pbr as build-depends.
* debian/control: Add python-stevedore.

Show diffs side-by-side

added added

removed removed

Lines of Context:
53
53
    plugin = manager.QuantumManager.get_plugin()
54
54
    port_dict = plugin._make_port_dict(port)
55
55
    port_dict[ext_sg.SECURITYGROUPS] = [
56
 
        sg_id for port, sg_id in port_and_sgs if sg_id]
 
56
        sg_id for port_, sg_id in port_and_sgs if sg_id]
57
57
    port_dict['security_group_rules'] = []
58
58
    port_dict['security_group_source_groups'] = []
59
59
    port_dict['fixed_ips'] = [ip['ip_address'] for ip in port['fixed_ips']]
98
98
        return session.query(ryu_models_v2.TunnelKeyLast).one()
99
99
 
100
100
    def _find_key(self, session, last_key):
101
 
        """
102
 
        Try to find unused tunnel key in TunnelKey table starting
 
101
        """Try to find unused tunnel key.
 
102
 
 
103
        Trying to find unused tunnel key in TunnelKey table starting
103
104
        from last_key + 1.
104
105
        When all keys are used, raise sqlalchemy.orm.exc.NoResultFound
105
106
        """
153
154
 
154
155
        new_key = new_key[0]  # the result is tuple.
155
156
        LOG.debug(_("last_key %(last_key)s new_key %(new_key)s"),
156
 
                  locals())
 
157
                  {'last_key': last_key, 'new_key': new_key})
157
158
        if new_key > self.key_max:
158
159
            LOG.debug(_("No key found"))
159
160
            raise orm_exc.NoResultFound()