starsliao / TenSunS

🦄后羿 - TenSunS(原ConsulManager):基于Consul的运维平台:更优雅的Consul管理UI&多云与自建ECS/MySQL/Redis同步Prometheus/JumpServer&ECS/MySQL/Redis云监控指标采集&Blackbox站点监控维护&漏洞通知/资源到期余额告警&各类资源Grafana看板展示
https://StarsL.cn
Do What The F*ck You Want To Public License
1.33k stars 244 forks source link

jumpserver同步中统计总内存不能处理float #104

Closed ZZYhho closed 9 months ago

ZZYhho commented 10 months ago

同步的主机中有内存为0.5GB的主机,报错信息:

Traceback (most recent call last):
  File "/usr/local/lib/python3.10/site-packages/flask/app.py", line 1516, in full_dispatch_request
    rv = self.dispatch_request()
  File "/usr/local/lib/python3.10/site-packages/flask/app.py", line 1502, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**req.view_args)
  File "/usr/local/lib/python3.10/site-packages/flask_restful/__init__.py", line 467, in wrapper
    resp = resource(*args, **kwargs)
  File "/usr/local/lib/python3.10/site-packages/flask_httpauth.py", line 172, in decorated
    return self.ensure_sync(f)(*args, **kwargs)
  File "/usr/local/lib/python3.10/site-packages/flask/views.py", line 84, in view
    return current_app.ensure_sync(self.dispatch_request)(*args, **kwargs)
  File "/usr/local/lib/python3.10/site-packages/flask_restful/__init__.py", line 582, in dispatch_request
    resp = meth(*args, **kwargs)
  File "/flask/views/jms.py", line 56, in get
    mem = int(i['mem'].replace('GB',''))
ValueError: invalid literal for int() with base 10: '0.5'
starsliao commented 10 months ago

感谢提交bug 我修改下.

starsliao commented 9 months ago

已修复, docker-compose pull && docker-compose up -d 更新下镜像