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

pan: support default/fallback value for built-in function value() #167

Merged
merged 1 commit into from
Mar 28, 2018

Conversation

stdweird
Copy link
Member

Fixes #139

Copy link
Contributor

@ned21 ned21 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We require a unit test that checks the behaviour:

'/path' = undef;
'/path2' = value('/path', 'default');

@jouvin and I would like to see the behaviour in this case be that /path2 is set to 'default' not undef as this is more useful to the user and consistent with the way undef is handled in the schema. But we are open to further discussion,.

@ned21 ned21 added this to the 10.5 milestone Oct 26, 2017
@stdweird
Copy link
Member Author

stdweird commented Oct 26, 2017

i'm also in favour of using the default value rather than undef; but only because it makes more sense than using undef and relying on schema to set it (one can assume that the orignal path has a default in the schema; but why would another path have a default set and why would it be the same).

@ned21 but i also looked at our code, and found little use of path_exists(path) && is_defined(value(path))
however i found plenty of use of other exists && defined. i opened #173

@stdweird
Copy link
Member Author

stdweird commented Nov 2, 2017

@ned21 please check the updated description and unittest value9.

@jrha jrha merged commit 4e64bce into quattor:master Mar 28, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants