Show More
@@ -589,7 +589,8 b' class SettingsController(BaseController)' | |||||
589 | ('', '', ''), # spacer |
|
589 | ('', '', ''), # spacer | |
590 |
|
590 | |||
591 | # Platform/Python |
|
591 | # Platform/Python | |
592 | (_('Platform'), val('platform'), state('platform')), |
|
592 | (_('Platform'), val('platform')['name'], state('platform')), | |
|
593 | (_('Platform UUID'), val('platform')['uuid'], state('platform')), | |||
593 | (_('Python version'), val('python')['version'], state('python')), |
|
594 | (_('Python version'), val('python')['version'], state('python')), | |
594 | (_('Python path'), val('python')['executable'], state('python')), |
|
595 | (_('Python path'), val('python')['executable'], state('python')), | |
595 | ('', '', ''), # spacer |
|
596 | ('', '', ''), # spacer |
@@ -107,8 +107,12 b' def py_modules():' | |||||
107 |
|
107 | |||
108 |
|
108 | |||
109 | def platform_type(): |
|
109 | def platform_type(): | |
110 | from rhodecode.lib.utils import safe_unicode |
|
110 | from rhodecode.lib.utils import safe_unicode, generate_platform_uuid | |
111 | value = safe_unicode(platform.platform()) |
|
111 | ||
|
112 | value = dict( | |||
|
113 | name=safe_unicode(platform.platform()), | |||
|
114 | uuid=generate_platform_uuid() | |||
|
115 | ) | |||
112 | return SysInfoRes(value=value) |
|
116 | return SysInfoRes(value=value) | |
113 |
|
117 | |||
114 |
|
118 |
@@ -33,6 +33,7 b' import tempfile' | |||||
33 | import traceback |
|
33 | import traceback | |
34 | import tarfile |
|
34 | import tarfile | |
35 | import warnings |
|
35 | import warnings | |
|
36 | import hashlib | |||
36 | from os.path import join as jn |
|
37 | from os.path import join as jn | |
37 |
|
38 | |||
38 | import paste |
|
39 | import paste | |
@@ -1001,3 +1002,17 b' def get_registry(request):' | |||||
1001 | return request.registry |
|
1002 | return request.registry | |
1002 | except AttributeError: |
|
1003 | except AttributeError: | |
1003 | return get_current_registry() |
|
1004 | return get_current_registry() | |
|
1005 | ||||
|
1006 | ||||
|
1007 | def generate_platform_uuid(): | |||
|
1008 | """ | |||
|
1009 | Generates platform UUID based on it's name | |||
|
1010 | """ | |||
|
1011 | import platform | |||
|
1012 | ||||
|
1013 | try: | |||
|
1014 | uuid_list = [platform.platform()] | |||
|
1015 | return hashlib.sha256(':'.join(uuid_list)).hexdigest() | |||
|
1016 | except Exception as e: | |||
|
1017 | log.error('Failed to generate host uuid: %s' % e) | |||
|
1018 | return 'UNDEFINED' |
General Comments 0
You need to be logged in to leave comments.
Login now