Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Gelencsér Szabolcs
/
vmdriver
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Wiki
Members
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
e5339ccb
authored
Sep 06, 2013
by
Guba Sándor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixing disconnect when LIBVIRT_KEEPALIVE is defined
parent
b103d9bc
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
7 deletions
+8
-7
vmdriver.py
+8
-7
No files found.
vmdriver.py
100755 → 100644
View file @
e5339ccb
#!/usr/bin/env python
import
libvirt
import
logging
import
os
...
...
@@ -69,12 +67,15 @@ def disconnect():
'''Disconnect from the active libvirt daemon connection.
'''
global
connection
if
connection
is
None
:
logging
.
debug
(
'There is no available libvirt conection.'
)
if
os
.
getenv
(
'LIBVIRT_KEEPALIVE'
)
is
None
:
if
connection
is
None
:
logging
.
debug
(
'There is no available libvirt conection.'
)
else
:
connection
.
close
()
logging
.
debug
(
'Connection closed to libvirt.'
)
connection
=
None
else
:
connection
.
close
()
logging
.
debug
(
'Connection closed to libvirt.'
)
connection
=
None
logging
.
debug
(
'Keepalive connection should not close.'
)
@celery.task
...
...
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