Revision be4d8aed
b/snf-cyclades-app/synnefo/logic/backend.py | ||
---|---|---|
180 | 180 |
"""Return True if NICs have changed in any way.""" |
181 | 181 |
if len(old_nics) != len(new_nics): |
182 | 182 |
return True |
183 |
fields = ["ipv4", "ipv6", "mac", "firewall_profile", "index", "network"] |
|
183 | 184 |
for old_nic, new_nic in zip(old_nics, new_nics): |
184 |
if not (old_nic.ipv4 == new_nic['ipv4'] and |
|
185 |
old_nic.ipv6 == new_nic['ipv6'] and |
|
186 |
old_nic.mac == new_nic['mac'] and |
|
187 |
old_nic.firewall_profile == new_nic['firewall_profile'] and |
|
188 |
old_nic.index == new_nic['index'] and |
|
189 |
old_nic.network == new_nic['network']): |
|
190 |
return True |
|
185 |
for field in fields: |
|
186 |
if getattr(old_nic, field) != new_nic[field]: |
|
187 |
return True |
|
191 | 188 |
return False |
192 | 189 |
|
193 | 190 |
|
Also available in: Unified diff