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
A prog2-höz tartozó friss repo anyagok itt elérhetőek:
https://git.iit.bme.hu/
Commit
ae4a3d82
authored
Nov 30, 2025
by
Szeberényi Imre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fured fix2
parent
f408ecd0
Hide 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
# serializers.py
from
kombu.serialization
import
register
from
kombu.serialization
import
register
import
pickle
import
pickle
import
logging
logger
=
logging
.
getLogger
(
__name__
)
def
pickle_v2_dumps
(
obj
):
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
)
return
pickle
.
dumps
(
obj
,
protocol
=
2
)
def
pickle_v2_loads
(
s
):
def
pickle_v2_loads
(
s
):
logger
.
debug
(
"pickle_v2_loads CALLED len=
%
r"
,
len
(
s
))
return
pickle
.
loads
(
s
)
return
pickle
.
loads
(
s
)
register
(
register
(
...
...
vmdriver.py
View file @
ae4a3d82
...
@@ -2,6 +2,7 @@
...
@@ -2,6 +2,7 @@
import
libvirt
import
libvirt
import
logging
import
logging
import
os
import
os
import
subprocess
import
sys
import
sys
import
socket
import
socket
import
json
import
json
...
@@ -663,16 +664,40 @@ def get_ram_size():
...
@@ -663,16 +664,40 @@ def get_ram_size():
@celery.task
@celery.task
def
get_driver_version
():
def
get_driver_version
():
from
git
import
Repo
try
:
try
:
repo
=
Repo
(
path
=
os
.
getcwd
())
cwd
=
os
.
getcwd
()
lc
=
repo
.
head
.
commit
branch
=
subprocess
.
check_output
(
return
{
'branch'
:
repo
.
active_branch
.
name
,
[
"git"
,
"rev-parse"
,
"--abbrev-ref"
,
"HEAD"
],
'commit'
:
lc
.
hexsha
,
cwd
=
cwd
,
text
=
True
'commit_text'
:
lc
.
summary
,
)
.
strip
()
'is_dirty'
:
repo
.
is_dirty
()}
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
:
except
Exception
as
e
:
logger
.
exception
(
"
Unhandled exception
:
%
s"
,
e
)
logger
.
exception
(
"
Git version check failed
:
%
s"
,
e
)
return
None
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