-
Notifications
You must be signed in to change notification settings - Fork 29
issue_498 #499
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
issue_498 #499
Conversation
Add condition to check if nfs_volumes is defined before mounting shares.
| $nfs_volumes = $instances.dig($nfs_server, 'volumes', 'nfs') | ||
| $shares_to_mount = keys($nfs_volumes) + $share_names | ||
| if $nfs_volumes != undef { | ||
| $shares_to_mount = keys($nfs_volumes) + $share_names |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hum, this still does the keys(...) + $share_names even if it's undef.
And it discards $share_names if it's undef.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As @mboisson said, $shares_to_mount initialization needs to be based on wether nfs_volumes is undef or not.
if $nfs_volumes != undef {
$shares_to_mount = keys($nfs_volumes) + $share_names
} else {
$shares_to_mount = $share_names
}
I am digging if I can come up with a one-liner, but this works.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe something like
$shares_to_mount = $nfs_volume != undef ? { keys($nfs_volumes) + $share_names, $share_names }
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh, typos in my patch
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$shares_to_mount = keys($nfs_volumes)
if $nfs_volumes != undef {
$shares_to_mount = keys($nfs_volumes) + $share_names
}
Is default and if ok with you @cmd-ntrf ?
|
This relates to #498 |
|
Superseded by PR #500. |
Add condition to check if nfs_volumes is defined before mounting shares.