Commit 697a4963 authored by Christos Stavrakakis's avatar Christos Stavrakakis

Misc minor bug fixes

parent 46098a3a
......@@ -220,7 +220,7 @@ def process_network_status(back_network, etime, jobid, opcode, status, logmsg):
if status == 'success' and state_for_success is not None:
back_network.operstate = state_for_success
if status in ('canceled', 'error') and opcode == 'OP_NETWORK_CREATE':
if status in ('canceled', 'error') and opcode == 'OP_NETWORK_ADD':
utils.update_state(back_network, 'ERROR')
back_network.backendtime = etime
......@@ -250,7 +250,6 @@ def update_network_state(serials, network):
all_equal = len(set(backend_states)) <= 1
network.state = all_equal and backend_states[0] or 'PENDING'
# Release the resources on the deletion of the Network
if old_state != 'DELETED' and network.state == 'DELETED':
log.info("Network %r deleted. Releasing link %r mac_prefix %r",
......@@ -270,7 +269,6 @@ def update_network_state(serials, network):
network.serial = serial
serial.accepted = True
serial.save()
network.save()
......
......@@ -51,6 +51,7 @@ def handle_message_delivery(func):
@wraps(func)
def wrapper(client, message, *args, **kwargs):
try:
msg = None
msg = json.loads(message['body'])
func(msg)
client.basic_ack(message)
......@@ -62,7 +63,10 @@ def handle_message_delivery(func):
e, message)
client.basic_nack(message)
except Exception as e:
log.exception("Unexpected error: %s, msg: %s", e, msg)
if msg:
log.exception("Unexpected error: %s, msg: %s", e, msg)
else:
log.exception("Unexpected error: %s", e)
client.basic_reject(message)
return wrapper
......
......@@ -177,7 +177,7 @@ class Command(BaseCommand):
unsynced_nics = reconciliation.unsynced_nics(DBNics, GNics)
if len(unsynced_nics) > 0:
print >> sys.stderr, "The NICs of servers with the folloing IDs "\
print >> sys.stderr, "The NICs of servers with the following IDs "\
"are unsynced:"
for id, nics in unsynced_nics.items():
print ''.ljust(2) + '%6d:' % id
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment