Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
itminedu
synnefo
Commits
67ed2904
Commit
67ed2904
authored
Jul 23, 2012
by
Christos Stavrakakis
Browse files
Fix case of empty address pool
parent
faed0ec2
Changes
1
Hide whitespace changes
Inline
Side-by-side
snf-cyclades-app/synnefo/logic/management/commands/reconcile-networks.py
View file @
67ed2904
...
...
@@ -157,14 +157,15 @@ def reconcile_networks(out, fix, conflicting_ips):
ip_map
=
ganeti_networks
[
b
][
net_id
][
'map'
]
ip_address_maps
.
append
(
bitarray_from_o1
(
ip_map
))
network_bitarray
=
reduce
(
lambda
x
,
y
:
x
|
y
,
ip_address_maps
)
if
not
network
.
pool
.
reservations
==
network_bitarray
:
out
.
write
(
'D: Unsynced pool of network %d
\n
'
%
net_id
)
out
.
write
(
'
\t
DB:
\t
%s
\n
'
%
network
.
pool
.
reservations
.
to01
())
out
.
write
(
'
\t
Ganeti:%s
\n
'
%
network_bitarray
.
to01
())
if
fix
:
update_network_reservations
(
network
,
network_bitarray
)
out
.
write
(
'F: Synchronized network pools
\n
'
)
if
ip_address_maps
:
network_bitarray
=
reduce
(
lambda
x
,
y
:
x
|
y
,
ip_address_maps
)
if
not
network
.
pool
.
reservations
==
network_bitarray
:
out
.
write
(
'D: Unsynced pool of network %d
\n
'
%
net_id
)
out
.
write
(
'
\t
DB:
\t
%s
\n
'
%
network
.
pool
.
reservations
.
to01
())
out
.
write
(
'
\t
Ganeti:%s
\n
'
%
network_bitarray
.
to01
())
if
fix
:
update_network_reservations
(
network
,
network_bitarray
)
out
.
write
(
'F: Synchronized network pools
\n
'
)
# Detect conflicting IPs: Detect NIC's that have the same IP
# in the same network.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment