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

Fix variable name @director_name -> @director #124

Merged
merged 1 commit into from Aug 3, 2018

Conversation

smortex
Copy link
Member

@smortex smortex commented Aug 1, 2018

While converting templates to EPP, I found an undeclared variable used in templates/messages.erb.

There is no @director_name in the current scope, but an unused @director variable may exist. When using the existing variable, the resulting configuration is adjusted this way:

diff -Nur bacula.orig/bacula-fd.conf bacula/bacula-fd.conf
--- bacula.orig/bacula-fd.conf  2018-08-01 16:55:15.552571000 +0200
+++ bacula/bacula-fd.conf       2018-08-01 18:31:52.378892000 +0200
@@ -43,9 +43,9 @@
 }
 Messages {
     Name     = Standard
+    Director = marvin.blogreen.org-dir = all, !skipped, !restored
     Append   = "/var/log/bacula/bacula-fd.log" = all, !skipped
 }
 
diff -Nur bacula.orig/bacula-sd.conf bacula/bacula-sd.conf
--- bacula.orig/bacula-sd.conf  2018-08-01 16:55:15.552673000 +0200
+++ bacula/bacula-sd.conf       2018-08-01 20:11:42.553968000 +0200
@@ -16,9 +16,9 @@
 }
 Messages {
     Name     = Standard
+    Director = marvin.blogreen.org-dir = all
     Append   = "/var/log/bacula/bacula-sd.log" = all, !skipped
 }
 

The director values are from these files:

This looks quite consistent to me. I guess this regression was unnoticed because ERB templates are very forgiving when using the wrong variable names (it just returns nil). On the opposite, EPP require all accessed variable to exist (at least with an undef value) and raise an error otherwise.

@zachfi
Copy link
Contributor

zachfi commented Aug 1, 2018

I have the impression that there are dragons lurking here. I probably left breadcrumbs in the commit log, but I can't recall the specifics. Probably near a major version bump. I remember there being some specific reason that I wanted to keep storage_name different from storage, and director_name different from director. These could be old reasons by now, and might have had something to do with particular versions of Puppet. So many vagueities. I make up new words too. Let me dig around in the log this week, if you don't mind, and get back to you here.

There is no `$director_name` in the current scope, but here is an unused
`$director`.
@zachfi
Copy link
Contributor

zachfi commented Aug 3, 2018

This is all good, I didn't look very close earlier. Thanks for the PR @smortex.

@zachfi zachfi merged commit b3ef743 into voxpupuli:master Aug 3, 2018
@smortex smortex deleted the messages-director branch August 3, 2018 16:58
@smortex smortex added the bug label Mar 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants