[PUP-9963] The 'value' field of 'selboolean' should accept Booleans Created: 2019/08/13  Updated: 2020/01/08  Resolved: 2019/11/06

Status: Resolved
Project: Puppet
Component/s: Modules
Affects Version/s: PUP 5.5.16, PUP 6.7.2
Fix Version/s: PUP 5.5.18, PUP 6.4.5, PUP 6.11.0

Type: Improvement Priority: Normal
Reporter: Trevor Vaughan Assignee: Ciprian Badescu
Resolution: Fixed Votes: 0
Labels: resolved-issue-added
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Cloners
is cloned by MODULES-10057 The 'value' field of 'selboolean' sho... Resolved
Relates
relates to PUP-2368 using booleans result in unmanaged pr... Accepted
Template:
Sub-team: Coremunity
Team: Night's Watch
Story Points: 3
Sprint: PR - Triage, NW - 2019-11-13
Release Notes: Enhancement
Release Notes Summary: Allow selboolean value property to accept true/false as values besides on/off
QA Risk Assessment: Needs Assessment

 Description   

Puppet Version: Any
Puppet Server Version: Any
OS Name/Version: Linux with SELinux

Presently, the selboolean native type accepts either on or off as valid entries for the value parameter.

Desired Behavior:

 

The value parameter should accept Boolean values since they will reduce the need for simple translation statements every time selboolean is used.



 Comments   
Comment by Henrik Lindberg [ 2019/08/21 ]

This is a duplicate of PUP-8117 scratch that, this is not about `Boolean` data type. Sorry for the noise...

Comment by Henrik Lindberg [ 2019/08/21 ]

It would be reasonable to fix this by allowing `Boolean` to be constructed from "on", and "off" (since it already supports variations of true/false, yes/no strings).
Then, this can be implemented so that the selbolean accepts `Init[Boolean]` and calls `Boolean(val)` to create an actual boolean value.

Comment by Ciprian Badescu [ 2019/10/30 ]

there is an on-going issue with boolean properties, https://tickets.puppetlabs.com/browse/PUP-2368

Comment by Ciprian Badescu [ 2019/10/31 ]

Trevor Vaughan, is this ticket about the input accepted for `value` property or about how `value` property is handled internally in puppet?

Can you give an example of what you want to do and it is not working?

 

Comment by Trevor Vaughan [ 2019/11/01 ]

Ciprian Badescu Honestly, I just wanted to be able to pass true or false instead of on and off to the value property.

Comment by Ciprian Badescu [ 2019/11/04 ]

Trevor Vaughan, PR done

Generated at Wed Sep 30 00:18:18 PDT 2020 using Jira 8.5.2#805002-sha1:a66f9354b9e12ac788984e5d84669c903a370049.