~0x44/nova/extdoc

« back to all changes in this revision

Viewing changes to nova/tests/db/fakes.py

  • Committer: Tarmac
  • Author(s): Vishvananda Ishaya
  • Date: 2011-09-14 20:57:15 UTC
  • mfrom: (1541.5.1 fix-floating-reboot)
  • mto: This revision was merged to the branch mainline in revision 1574.
  • Revision ID: tarmac-20110914205715-v9sihsampg55jwb3
Fix issue where floating ips don't get recreated when a network host reboots.

Show diffs side-by-side

added added

removed removed

Lines of Context:
125
125
            if ips[0]['fixed_ip']:
126
126
                fixed_ip_address = ips[0]['fixed_ip']['address']
127
127
            ips[0]['fixed_ip'] = None
 
128
            ips[0]['host'] = None
128
129
            return fixed_ip_address
129
130
 
130
131
    def fake_floating_ip_fixed_ip_associate(context, floating_address,
131
 
                                            fixed_address):
 
132
                                            fixed_address, host):
132
133
        float = filter(lambda i: i['address'] == floating_address,
133
134
                       floating_ips)
134
135
        fixed = filter(lambda i: i['address'] == fixed_address,
136
137
        if float and fixed:
137
138
            float[0]['fixed_ip'] = fixed[0]
138
139
            float[0]['fixed_ip_id'] = fixed[0]['id']
 
140
            float[0]['host'] = host
139
141
 
140
142
    def fake_floating_ip_get_all_by_host(context, host):
141
143
        # TODO(jkoelker): Once we get the patches that remove host from