Boavizta / boaviztapi

🛠 Giving access to BOAVIZTA reference data and methodologies trough a RESTful API
GNU Affero General Public License v3.0
76 stars 25 forks source link

In server.csv, SSD.units value has wrong separator for archetype storage_high #257

Closed VincentVillet closed 10 months ago

VincentVillet commented 11 months ago

Bug description

The value is 48,32,64 instead of 48;32;64. The bug doesn’t show directly because it is masked by https://github.com/Boavizta/boaviztapi/issues/256, but when issue 256 is fixed this bug will cause storage_high’s number of SSD units to be set to default: in boavizta.service.archetype.py, the logic of the following function will arrive at the last "else" clause:

def parse_to_boattribute_json(value): json = {} if value == "" or value is None: return json elif ";" in value: values = value.split(";") if len(values) == 3: json["default"] = convert(values[0]) json["min"] = convert(values[1]) json["max"] = convert(values[2]) if len(values) == 2: json["default"] = convert(values[0]) if convert(values[1]) > convert(values[0]): json["min"] = convert(values[0]) json["max"] = convert(values[1]) else: json["min"] = convert(values[1]) json["max"] = convert(values[0]) else: json["default"] = convert(value) return json

Expected behavior

Replace , by ; in the csv

da-ekchajzer commented 11 months ago

Thank you, @VincentVillet, for your PR. This bug was identified and fixed during the code refactoring conducted in this https://github.com/Boavizta/boaviztapi/pull/255. I'll let you test on the PR or wait for the release to test if the bug persists.