gyptazy / ProxLB

ProxLB - (Re)Balance VM Workloads Across Nodes in Proxmox Clusters. A Load Balancer for Proxmox - and more!
https://proxlb.de
GNU General Public License v3.0
195 stars 9 forks source link

`Bug`: Certain config values that should always be int become bool if value is "0" or "1" #115

Open elliotnev27 opened 6 days ago

elliotnev27 commented 6 days ago

General

I noticed that when I set "schedule" to "1" I get a long message <6> ProxLB: Info: [daemon]: Running in daemon mode. Next run in TRUE hours.

In this particular case, schedule work as intended, but I noticed, storage_balanciness, vm_balanciness, schedule, config_version, might have the same issue. And it could cause unintended behaviors.

I still need to test this fix, but I believe there would be an easy fix in __update_config_parser_bools d9c133f

Weighting

Score: 2

Config

[proxmox]
api_host: foo
api_user: foo
api_password: ***
verify_ssl: 0
[vm_balancing]
enable: 1
method: memory
mode: used
type: vm
ignore_nodes: foo1
ignore_vms: foo2
[update_service]
enable: 0
[api]
enable: 0
[service]
demon: 1
schedule: 1
log_verbosity: WARN
config_version:3

Meta

install from .deb in container

Version: 1.0.4 Installed from: deb file Running as: Container

gyptazy commented 6 days ago

Hey @elliotnev27,

thanks for raising this up. Please do not spend any time into this as long as this is just a visual thing and does not have any impacts to the features. I currently refactor the whole code base (https://github.com/gyptazy/ProxLB/issues/114) and also switch from config file in ini style to yaml to do not waste time and sluggy code for type converts. The new code base will deprecate the current one. Maybe it might make sense when reaching a certain level of code to already create a PR to provide other ones a way to also test this.

I expect to have it hopefully done by the end of October.

Cheers, gyptazy

elliotnev27 commented 4 days ago

👍 sounds good! I figured as much enjoy the rest of your weekend!