Commit e5339ccb by Guba Sándor

fixing disconnect when LIBVIRT_KEEPALIVE is defined

parent b103d9bc
#!/usr/bin/env python
import libvirt import libvirt
import logging import logging
import os import os
...@@ -69,12 +67,15 @@ def disconnect(): ...@@ -69,12 +67,15 @@ def disconnect():
'''Disconnect from the active libvirt daemon connection. '''Disconnect from the active libvirt daemon connection.
''' '''
global connection global connection
if connection is None: if os.getenv('LIBVIRT_KEEPALIVE') is None:
logging.debug('There is no available libvirt conection.') if connection is None:
logging.debug('There is no available libvirt conection.')
else:
connection.close()
logging.debug('Connection closed to libvirt.')
connection = None
else: else:
connection.close() logging.debug('Keepalive connection should not close.')
logging.debug('Connection closed to libvirt.')
connection = None
@celery.task @celery.task
......
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 sign in to comment