Commit 9bdb329a by Guba Sándor

vmdriver: add git repository info to the get_info method

parent 308b9e03
...@@ -4,3 +4,4 @@ lxml==3.2.3 ...@@ -4,3 +4,4 @@ lxml==3.2.3
psutil==1.1.3 psutil==1.1.3
Pillow==2.3.0 Pillow==2.3.0
pylibmc==1.2.3 pylibmc==1.2.3
GitPython
...@@ -619,10 +619,22 @@ def get_ram_size(): ...@@ -619,10 +619,22 @@ def get_ram_size():
@celery.task @celery.task
def get_driver_version():
from git import Repo
repo = Repo(path=os.getcwd())
lc = repo.log()[0]
return {'branch': repo.active_branch,
'commit': lc.id_abbrev,
'commit_text': lc.summary,
'is_dirty': repo.is_dirty}
@celery.task
def get_info(): def get_info():
return {'core_num': get_core_num(), return {'core_num': get_core_num(),
'ram_size': get_ram_size(), 'ram_size': get_ram_size(),
'architecture': get_architecture()} 'architecture': get_architecture(),
'driver_version': get_driver_version()}
@celery.task @celery.task
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment