fix bug in namespace usage (lp:1461354) #2489

Merged
merged 2 commits into from Jun 3, 2015

Conversation

Projects
None yet
3 participants
Contributor

natefinch commented Jun 3, 2015

fixes-1461354

https://bugs.launchpad.net/juju-core/+bug/1461354
debug-log EOF: invalid tag and panic seen in state server logs

This was a result of me changing the namespace stored in the config to no longer store the leading "-". Instead, it just stores the namespace itself, and where we use it, we have to format it correctly. This seems like a much more sane way to do it, so the value you set is the value that exists, and we don't dictate formatting to everyone using the namespace.... however, it meant I forgot to check for an empty namespace in this one case.

(Review request: http://reviews.vapour.ws/r/1855/)

Contributor

natefinch commented Jun 3, 2015

$$merge$$

Contributor

jujubot commented Jun 3, 2015

Status: merge request accepted. Url: http://juju-ci.vapour.ws:8080/job/github-merge-juju

Contributor

jujubot commented Jun 3, 2015

Build failed: Tests failed
build url: http://juju-ci.vapour.ws:8080/job/github-merge-juju/3524

Owner

wallyworld commented Jun 3, 2015

$$merge$$

Contributor

jujubot commented Jun 3, 2015

Status: merge request accepted. Url: http://juju-ci.vapour.ws:8080/job/github-merge-juju

jujubot added a commit that referenced this pull request Jun 3, 2015

Merge pull request #2489 from natefinch/fix-1461354-tryagain
fix bug in namespace usage (lp:1461354)

fixes-1461354

https://bugs.launchpad.net/juju-core/+bug/1461354
debug-log EOF: invalid tag and panic seen in state server logs

This was a result of me changing the namespace stored in the config to no longer store the leading "-". Instead, it just stores the namespace itself, and where we use it, we have to format it correctly. This seems like a much more sane way to do it, so the value you set is the value that exists, and we don't dictate formatting to everyone using the namespace.... however, it meant I forgot to check for an empty namespace in this one case.

(Review request: http://reviews.vapour.ws/r/1855/)

@jujubot jujubot merged commit 7e97a2b into juju:1.24 Jun 3, 2015

jujubot added a commit that referenced this pull request Jul 14, 2015

Merge pull request #2505 from natefinch/fp-fix-1370896-master
FP: fix 1370896 on master

FP of #2458, #2476, and #2489 since the latter two are just fixes to the original PR. 

Fix 1370896 - juju has conf files in /var/log/juju on instances

Fixes https://bugs.launchpad.net/juju-core/+bug/1370896

All the rsyslog configuration files are now created in juju's data directory (by default, /var/lib/juju), instead of the log directory (/var/log/juju).  Also added an upgrade step to move the files from old location to new location.

I made a couple changes to how you create a SyslogConfig, mostly because it was using a function with a huge number of string arguments, which made it very difficult to read, and to understand what value was being assigned to what field.  This made updating the code almost impossible, because of minor positional differences in the function signatures.

I changed  syslog.NewAccumulateConfig and NewForwardConfig to just take a pointer to a SyslogConfig, since pretty much all they did was set exported fields on the type.  Now they just set the non-exported field, and the caller sets everything else in a struct literal.

I also changed it so that the Namespace field in SyslogConfig always stays just "Namespace", not "-Namespace", since it's an exported value, and having it be something different than what was set is really confusing.  Instead, we just add the dash when rendering to the template.

Changed the tests much the same way - just set up the struct and pass it in is so much easier to read than a huge function call with a ton of different string parameters in a random order.  Also changed the test template, so that there aren't hard-coded values in it, and instead actually use the values passed in.

(Review request: http://reviews.vapour.ws/r/1871/)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment