bernardodemarco opened a new pull request, #10663:
URL: https://github.com/apache/cloudstack/pull/10663

   ### Description
   
   Currently, when updating boolean settings, the Management Server performs a 
case sensitive validation of the inserted values. Thus, only the `true` and 
`false` values are accepted.
   
   This PR proposes to extend this validation to encompass case insensitive 
boolean values. Therefore, values such as `True` and `FALSE` will be accepted 
and will be properly normalized before being persisted in the database.
   
   ### Types of changes
   
   - [ ] Breaking change (fix or feature that would cause existing 
functionality to change)
   - [ ] New feature (non-breaking change which adds functionality)
   - [ ] Bug fix (non-breaking change which fixes an issue)
   - [X] Enhancement (improves an existing feature and functionality)
   - [ ] Cleanup (Code refactoring and cleanup, that may add test cases)
   - [ ] build/CI
   - [ ] test (unit or integration test code)
   
   ### Feature/Enhancement Scale or Bug Severity
   
   #### Feature/Enhancement Scale
   
   - [ ] Major
   - [X] Minor
   
   ### Screenshots (if appropriate):
   
   ### How Has This Been Tested?
   
   - Verified that it was possible to update the `quota.enable.service` global 
setting to `FaLsE`.
   
   <details>
   <summary><code>updateConfiguration</code> API execution</summary>
   
   ```bash
   (acs-all-in-one) 🦌 > update configuration name="quota.enable.service" 
value="FaLsE"
   {
     "configuration": {
       "category": "Advanced",
       "component": "QUOTA-PLUGIN",
       "defaultvalue": "false",
       "description": "Indicates whether Quota plugin is enabled or not.",
       "displaytext": "Quota enable service",
       "group": "Miscellaneous",
       "isdynamic": true,
       "name": "quota.enable.service",
       "subgroup": "Quota",
       "type": "Boolean",
       "value": "FaLsE"
     }
   }
   ```
   </details>
   
   <details>
   <summary>Persisted configuration value in the database</summary>
   
   ```sql
   MariaDB [cloud]> select name,value from configuration where name = 
"quota.enable.service";
   +----------------------+-------+
   | name                 | value |
   +----------------------+-------+
   | quota.enable.service | false |
   +----------------------+-------+
   1 row in set (0.000 sec)
   ```
   </details>
   
   - Verified that it was possible to update the setting value to `TRUe`:
   
   <details>
   <summary><code>updateConfiguration</code> API execution</summary>
   
   ```bash
   (acs-all-in-one) 🐓 > update configuration name="quota.enable.service" 
value="TRUe"
   {
     "configuration": {
       "category": "Advanced",
       "component": "QUOTA-PLUGIN",
       "defaultvalue": "false",
       "description": "Indicates whether Quota plugin is enabled or not.",
       "displaytext": "Quota enable service",
       "group": "Miscellaneous",
       "isdynamic": true,
       "name": "quota.enable.service",
       "subgroup": "Quota",
       "type": "Boolean",
       "value": "TRUe"
     }
   }
   ```
   </details>
   
   <details>
   <summary>Persisted configuration value in the database</summary>
   
   ```sql
   MariaDB [cloud]> select name,value from configuration where name = 
"quota.enable.service";
   +----------------------+-------+
   | name                 | value |
   +----------------------+-------+
   | quota.enable.service | true  |
   +----------------------+-------+
   1 row in set (0.000 sec)
   ```
   </details>
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to