Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

boolean: accepted true/false values cannot be configured #2466

Open
Piankero opened this Issue Mar 8, 2019 · 3 comments

Comments

2 participants
@Piankero
Copy link
Contributor

Piankero commented Mar 8, 2019

Steps to Reproduce the Problem

The boolean plugin does not accept correct configurations.

kdb mount test.ini /abc boolean true="1;yes" false="0;no" type
kdb set /abc/a 0
kdb setmeta /abc/a type boolean
kdb set /abc/a yes
#> The command kdb set failed while accessing the key database with the info:
#> Sorry, the error (#52) occurred ;(
#> Description: could not type check value of key
#> Reason: The type (null) failed to match for user/abc/a with string: yes
#> Ingroup: plugin
#> Module: type
#> At: ../libelektra/src/plugins/type/type.cpp:31
kdb mountpoint-info /abc                                               
#> Version: 0.8.26
#> Default resolver: resolver_fm_hpu_b
#> Default storage: ini
#> Mountpoint: /abc
#> File: test.ini
#> 	config:
#> 	path = test.ini
#> getplugins:
#> 	#0#resolver
#> 	#5#ini#storage#
#> 	#9#boolean#boolean#
#> 		config:
#> 		false = 0;no
#> 		true = 1;yes
#> setplugins:
#> 	#0#resolver
#> 	#1#boolean
#> 	#2#type#type#
#> 	#5#storage
#> 	#6#sync#sync#
#> 	#7#resolver
#> errorplugins:
#> 	#5#resolver_fm_hpu_b#resolver#

Update:
Interestingly the error switched after setting a correct value:

kdb set /abc/a 1
kdb set /abc/a no
#> Using name user/abc/a
#> The command kdb set failed while accessing the key database with the info:
#> Sorry, the error (#153) occurred ;(
#> Description: not a valid boolean value
#> Reason: 1 is not a valid boolean value
#> Ingroup: plugin
#> Module: boolean
#> At: /libelektra/src/plugins/boolean/boolean.c:346
#> Mountpoint: user/abc
#> Configfile: /kdb/user/test.ini.17556:1552203492.780059.tmp

Expected Result

The boolean plugin accepts "on"

Actual Result

It does not accept on

System Information

  • Elektra Version: master (0.8.26)
cat /etc/os-release
#> NAME="Linux Mint"
#> VERSION="18.2 (Sonya)"
#> ID=linuxmint
#> ID_LIKE=ubuntu
#> PRETTY_NAME="Linux Mint 18.2"
#> VERSION_ID="18.2"
#> HOME_URL="http://www.linuxmint.com/"
#> SUPPORT_URL="http://forums.linuxmint.com/"
#> BUG_REPORT_URL="http://bugs.launchpad.net/linuxmint/"
#> VERSION_CODENAME=sonya
#> UBUNTU_CODENAME=xenial
@markus2330

This comment has been minimized.

Copy link
Contributor

markus2330 commented Mar 9, 2019

Thank you for reporting!

For me the behavior is not surprising. You configure the boolean plugin not to use "on" (but only "1;yes") so why should it accept "on"?

@Piankero

This comment has been minimized.

Copy link
Contributor Author

Piankero commented Mar 10, 2019

My fault, I copied the wrong example from my shell history. Please take another look at the example

@markus2330 markus2330 changed the title Cannot configure the Boolean plugin boolean: accepted true/false values cannot be configured Mar 10, 2019

@markus2330

This comment has been minimized.

Copy link
Contributor

markus2330 commented Mar 10, 2019

Thank you! I was able to reproduce it! Seems like this config option does not work. There is also no shell recorder test for it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.