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
4b45be09
Commit
4b45be09
authored
May 25, 2011
by
Georgios Gousios
Browse files
Various small bugs
-Print vm_ids as strings, not numbers -Filter top X VMs to update
parent
eb79cea5
Changes
1
Hide whitespace changes
Inline
Side-by-side
logic/management/commands/reconciliate.py
View file @
4b45be09
...
...
@@ -41,7 +41,7 @@ class Command(NoArgsCommand):
to_update
=
all
.
count
()
/
settings
.
RECONCILIATION_MIN
vm_ids
=
map
(
lambda
x
:
x
.
vm_id
,
all
.
filter
())
#TODO: Fix filtering
vm_ids
=
map
(
lambda
x
:
x
.
name
,
VirtualMachine
.
objects
.
all
()[:
to_update
])
sent
=
False
for
vmid
in
vm_ids
:
...
...
@@ -50,7 +50,7 @@ class Command(NoArgsCommand):
msg
=
dict
(
type
=
"reconciliate"
,
vmid
=
vmid
)
self
.
chan
.
basic_publish
(
json
.
dumps
(
msg
),
exchange
=
settings
.
EXCHANGE_CRON
,
routing_key
=
"reconciliation.%s"
,
vmid
)
routing_key
=
"reconciliation.%s"
%
vmid
)
sent
=
True
except
socket
.
error
:
self
.
chan
=
self
.
open_channel
()
...
...
@@ -58,4 +58,4 @@ class Command(NoArgsCommand):
raise
print
"All:%d,
Not U
pdate
d
:%d, Triggered update for:
%d
"
%
(
all
.
count
(),
not_updated
.
count
(),
vm_ids
)
print
"All:
%d,
To u
pdate:
%d, Triggered update for:
%s
"
%
(
all
.
count
(),
not_updated
.
count
(),
vm_ids
)
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