Univention Bugzilla – Attachment 6453 Details for
Bug 36923
sysinfo/system: KeyError: 'mem'
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
patch
bug36923.patch (text/plain), 1.14 KB, created by
Florian Best
on 2014-11-20 14:42 CET
(
hide
)
Description:
patch
Filename:
MIME Type:
Creator:
Florian Best
Created:
2014-11-20 14:42 CET
Size:
1.14 KB
patch
obsolete
>diff --git a/ucs-4.0-0/management/univention-system-info/umc/python/sysinfo/__init__.py b/ucs-4.0-0/management/univention-system-info/umc/python/sysinfo/__init__.py >index 4fd5711..e184502 100644 >--- a/ucs-4.0-0/management/univention-system-info/umc/python/sysinfo/__init__.py >+++ b/ucs-4.0-0/management/univention-system-info/umc/python/sysinfo/__init__.py >@@ -112,21 +112,20 @@ class Instance(umcm.Base): > result = {} > for line in stdout.splitlines(): > try: >- info, value = line.split(':') >+ info, value = line.split(':', 1) > result[info] = value >- except: >+ except ValueError: > pass >- if result['mem']: >+ if result.get('mem'): > match = self.mem_regex.match(result['mem']) > if match: > try: > converted_mem = (float(match.groups()[0]) / 1048576) > result['mem'] = '%.2f GB' % converted_mem > result['mem'] = request['mem'].replace('.', ',') >- except: >+ except (IndexError, ValueError): > pass >- if result['Temp']: >- del result['Temp'] # remove unnecessary entry >+ result.pop('Temp', None) # remove unnecessary entry > request.status = SUCCESS > > self.finished(request.id, result)
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
Actions:
View
|
Diff
Attachments on
bug 36923
: 6453