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

How to activate the boolean plugin in a specification file #2451

Open
Piankero opened this Issue Mar 1, 2019 · 10 comments

Comments

2 participants
@Piankero
Copy link
Contributor

Piankero commented Mar 1, 2019

Steps to Reproduce the Problem

The boolean plugin does not correctly convert to a canonicalizes value
Mount the specification with the following content:

[]
mountpoint = test-spec.conf
infos/plugin = ini boolean

[/setting/enabled]
check/type = boolean
kdb mount <path>/test.ini spec/test ni                     
kdb spec-mount /test                                                    
kdb set /test/setting/enabled true                                      
#> Using name user/test/setting/enabled
#> 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 boolean failed to match for user/test/setting/enabled with string: true
#> Ingroup: plugin
#> Module: type
#> At: ..../src/plugins/type/type.cpp:31
#> Mountpoint: user/test
#> Configfile: .../user/test-spec.conf.11243:1551466614.338725.tmp

Expected Result

true gets accepted for the type plugin

Actual Result

true gets rejected

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

Notes:
How exactly can I see what plugins are currently active? (There is a certain key which holds those 5 plugin I remember)

@markus2330

This comment has been minimized.

Copy link
Contributor

markus2330 commented Mar 2, 2019

Thank you for reporting this problem!

How exactly can I see what plugins are currently active? (There is a certain key which holds those 5 plugin I remember)

Please ask questions in separate issues, then they are easier to find in future. kdb mountpoint-info tells you which plugins exist for a mountpoint. With kdb find-tools -t mount you would have been able to find this tool.

Please also always add the issues you create to LCDproc and assign yourself if you will work on it.

Now to the issue itself:

I think the problem here is that the type checker checks before the boolean plugin canonicalizes. It should be easy to fix with infos/ordering, see doc/CONTRACT.ini

@Piankero

This comment has been minimized.

Copy link
Contributor Author

Piankero commented Mar 8, 2019

I added - infos/ordering = type in the README.md from the boolean plugin but it does not make a difference. Also the plugin does not get loaded at all.

kdb mountpoint-info /test                                                                         
Version: 0.8.26
Default resolver: resolver_fm_hpu_b
Default storage: ini
Mountpoint: /test
File: test-spec.conf
	config:
	path = test-spec.conf
getplugins:
	#0#resolver
	#5#ini#storage#
	#9#range#range#
setplugins:
	#0#resolver
	#1#range
	#2#type#type#
	#5#storage
	#6#sync#sync#
	#7#resolver
errorplugins:
	#5#resolver_fm_hpu_b#resolver#

The plugin is available though (verified via kdb list | grep boolean)

@markus2330

This comment has been minimized.

Copy link
Contributor

markus2330 commented Mar 9, 2019

Please create PRs if you change something. Otherwise it is unclear where exactly you added what.

"ordering" only defines the order, it does not automatically load the plugin.

@Piankero

This comment has been minimized.

Copy link
Contributor Author

Piankero commented Mar 10, 2019

See my changes here: #2473

Why does the boolean plugin not get loaded? It is in infos/plugin. Also how to configure it once it is loaded? infos/plugin = ini boolean true=1 false=0 validation ....?

@markus2330

This comment has been minimized.

Copy link
Contributor

markus2330 commented Mar 10, 2019

No configuration should be necessary, the boolean plugin already accepts everything what we need.

@Piankero

This comment has been minimized.

Copy link
Contributor Author

Piankero commented Mar 10, 2019

For LCDproc it is necessary because they have "yes/no" and "on/off" which I need to configure. It is not available per default.

Unfortunately this is blocked by #2466 anyway now.

@markus2330

This comment has been minimized.

Copy link
Contributor

markus2330 commented Mar 10, 2019

For LCDproc it is necessary because they have "yes/no" and "on/off" which I need to configure. It is not available per default.

By default TRUE; 1; ON; ENABLE; ENABLED; YES are available (see docu). This exactly matches our requirement.

@Piankero

This comment has been minimized.

Copy link
Contributor Author

Piankero commented Mar 10, 2019

So the question remains why the plugin is not being loaded by the specification file. Do you have a clue or how can I help you on doing this

@markus2330

This comment has been minimized.

Copy link
Contributor

markus2330 commented Mar 10, 2019

Is this still the case even after you added infos/ordering?

@Piankero

This comment has been minimized.

Copy link
Contributor Author

Piankero commented Mar 11, 2019

Yes, I added a shell recorder test in the PR (#2473) which fails on the build system.

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.