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
d1909792
authored
Oct 31, 2014
by
Bach Dániel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
handle exceptions in get_driver_version()
parent
3230b2c6
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
0 deletions
+4
-0
vmdriver.py
+4
-0
No files found.
vmdriver.py
View file @
d1909792
...
@@ -621,12 +621,16 @@ def get_ram_size():
...
@@ -621,12 +621,16 @@ def get_ram_size():
@celery.task
@celery.task
def
get_driver_version
():
def
get_driver_version
():
from
git
import
Repo
from
git
import
Repo
try
:
repo
=
Repo
(
path
=
os
.
getcwd
())
repo
=
Repo
(
path
=
os
.
getcwd
())
lc
=
repo
.
log
()[
0
]
lc
=
repo
.
log
()[
0
]
return
{
'branch'
:
repo
.
active_branch
,
return
{
'branch'
:
repo
.
active_branch
,
'commit'
:
lc
.
id_abbrev
,
'commit'
:
lc
.
id_abbrev
,
'commit_text'
:
lc
.
summary
,
'commit_text'
:
lc
.
summary
,
'is_dirty'
:
repo
.
is_dirty
}
'is_dirty'
:
repo
.
is_dirty
}
except
:
logging
.
exception
(
"Unhandled exception: "
)
return
None
@celery.task
@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