Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
CIRCLE3
/
vmdriver
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
ae4a3d82
authored
Nov 30, 2025
by
Szeberényi Imre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fured fix2
parent
f408ecd0
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
38 additions
and
8 deletions
+38
-8
serializers.py
+5
-0
vmdriver.py
+33
-8
No files found.
serializers.py
View file @
ae4a3d82
# serializers.py
from
kombu.serialization
import
register
import
pickle
import
logging
logger
=
logging
.
getLogger
(
__name__
)
def
pickle_v2_dumps
(
obj
):
logger
.
debug
(
"pickle_v2_dumps CALLED type=
%
r repr=
%
r"
,
type
(
obj
),
repr
(
obj
))
return
pickle
.
dumps
(
obj
,
protocol
=
2
)
def
pickle_v2_loads
(
s
):
logger
.
debug
(
"pickle_v2_loads CALLED len=
%
r"
,
len
(
s
))
return
pickle
.
loads
(
s
)
register
(
...
...
vmdriver.py
View file @
ae4a3d82
...
...
@@ -2,6 +2,7 @@
import
libvirt
import
logging
import
os
import
subprocess
import
sys
import
socket
import
json
...
...
@@ -663,16 +664,40 @@ def get_ram_size():
@celery.task
def
get_driver_version
():
from
git
import
Repo
try
:
repo
=
Repo
(
path
=
os
.
getcwd
())
lc
=
repo
.
head
.
commit
return
{
'branch'
:
repo
.
active_branch
.
name
,
'commit'
:
lc
.
hexsha
,
'commit_text'
:
lc
.
summary
,
'is_dirty'
:
repo
.
is_dirty
()}
cwd
=
os
.
getcwd
()
branch
=
subprocess
.
check_output
(
[
"git"
,
"rev-parse"
,
"--abbrev-ref"
,
"HEAD"
],
cwd
=
cwd
,
text
=
True
)
.
strip
()
commit
=
subprocess
.
check_output
(
[
"git"
,
"rev-parse"
,
"HEAD"
],
cwd
=
cwd
,
text
=
True
)
.
strip
()
commit_text
=
subprocess
.
check_output
(
[
"git"
,
"log"
,
"-1"
,
"--pretty=
%
s"
],
cwd
=
cwd
,
text
=
True
)
.
strip
()
is_dirty
=
subprocess
.
call
(
[
"git"
,
"diff"
,
"--quiet"
],
cwd
=
cwd
)
!=
0
repo_url
=
subprocess
.
check_output
(
[
"git"
,
"config"
,
"--get"
,
"remote.origin.url"
],
cwd
=
cwd
,
text
=
True
)
.
strip
()
path
=
repo_url
.
split
(
"://"
,
1
)[
-
1
]
path
=
path
.
split
(
"/"
,
1
)[
-
1
]
parts
=
path
.
split
(
"/"
)
return
{
"group"
:
parts
[
0
],
"branch"
:
branch
,
"commit"
:
commit
[:
7
],
"commit_text"
:
commit_text
,
"is_dirty"
:
is_dirty
,
}
except
Exception
as
e
:
logger
.
exception
(
"
Unhandled exception
:
%
s"
,
e
)
logger
.
exception
(
"
Git version check failed
:
%
s"
,
e
)
return
None
...
...
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