Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
CIRCLE
/
vmdriver
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
2
Merge Requests
0
Wiki
Members
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
4718a1c0
authored
Jul 23, 2013
by
tarokkk
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixing decorator to work as connection handler
parent
21d399b7
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
+4
-2
vmdriver.py
+4
-2
No files found.
vmdriver.py
View file @
4718a1c0
...
...
@@ -10,12 +10,14 @@ connection = None
def
req_connection
(
original_function
):
'''Connection checking decorator for libvirt.
'''
def
new_function
(
*
args
,
**
kwargs
):
global
connection
if
connection
is
None
:
connect
ion
=
connect
()
else
:
connect
()
try
:
return_value
=
original_function
(
*
args
,
**
kwargs
)
finally
:
disconnect
()
return
return_value
return
new_function
...
...
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