Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(2069)

Issue 62950043: Upgrade rsyslog config files (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
10 years, 2 months ago by wallyworld
Modified:
10 years, 2 months ago
Reviewers:
dimitern, axw, mp+206090, thumper
Visibility:
Public.

Description

Upgrade rsyslog config files Add upgrade capability for rsyslog config files. A chunk of code refactoring was also done. Previously committed code to upgrade the uniter lock directory was moved to its own file, plus code to test rsyslog config contents was pulled out so it could be reused. https://code.launchpad.net/~wallyworld/juju-core/rsyslogconf-upgrader-118/+merge/206090 (do not edit description out of merge proposal)

Patch Set 1 #

Total comments: 11

Patch Set 2 : Upgrade rsyslog config files #

Patch Set 3 : Upgrade rsyslog config files #

Patch Set 4 : Upgrade rsyslog config files #

Unified diffs Side-by-side diffs Delta from patch set Stats (+579 lines, -274 lines) Patch
A [revision details] View 1 2 3 1 chunk +2 lines, -0 lines 0 comments Download
M environs/cloudinit.go View 1 chunk +5 lines, -2 lines 0 comments Download
M log/syslog/config_test.go View 4 chunks +17 lines, -69 lines 0 comments Download
A log/syslog/testing/syslogconf.go View 1 chunk +87 lines, -0 lines 0 comments Download
M upgrades/export_test.go View 1 chunk +6 lines, -3 lines 0 comments Download
A upgrades/file.go View 1 2 3 1 chunk +30 lines, -0 lines 0 comments Download
A upgrades/file_test.go View 1 2 3 1 chunk +48 lines, -0 lines 0 comments Download
A upgrades/lockdirectory.go View 1 chunk +41 lines, -0 lines 0 comments Download
A upgrades/lockdirectory_test.go View 1 chunk +94 lines, -0 lines 0 comments Download
M upgrades/operations.go View 1 chunk +2 lines, -2 lines 0 comments Download
A upgrades/rsyslogconf.go View 1 2 3 1 chunk +50 lines, -0 lines 0 comments Download
A upgrades/rsyslogconf_test.go View 1 chunk +72 lines, -0 lines 0 comments Download
M upgrades/steps118.go View 1 chunk +12 lines, -40 lines 0 comments Download
upgrades/steps118_test.go View 1 chunk +0 lines, -117 lines 0 comments Download
D upgrades/steps118_test.go View 1 2 3 1 chunk +29 lines, -0 lines 0 comments Download
upgrades/upgrade.go View 5 chunks +6 lines, -19 lines 0 comments Download
upgrades/upgrade_test.go View 7 chunks +78 lines, -22 lines 0 comments Download

Messages

Total messages: 7
wallyworld
Please take a look.
10 years, 2 months ago (2014-02-13 06:01:47 UTC) #1
axw
https://codereview.appspot.com/62950043/diff/1/upgrades/file.go File upgrades/file.go (right): https://codereview.appspot.com/62950043/diff/1/upgrades/file.go#newcode13 upgrades/file.go:13: // contents, allowing for the fact that filename may ...
10 years, 2 months ago (2014-02-13 07:49:45 UTC) #2
dimitern
Diff is missing, repropose please.
10 years, 2 months ago (2014-02-13 09:38:10 UTC) #3
thumper
https://codereview.appspot.com/62950043/diff/1/log/syslog/testing/syslogconf.go File log/syslog/testing/syslogconf.go (right): https://codereview.appspot.com/62950043/diff/1/log/syslog/testing/syslogconf.go#newcode33 log/syslog/testing/syslogconf.go:33: $FileCreateMode 0640 If these are just copies of the ...
10 years, 2 months ago (2014-02-13 21:13:12 UTC) #4
wallyworld
https://codereview.appspot.com/62950043/diff/1/log/syslog/testing/syslogconf.go File log/syslog/testing/syslogconf.go (right): https://codereview.appspot.com/62950043/diff/1/log/syslog/testing/syslogconf.go#newcode33 log/syslog/testing/syslogconf.go:33: $FileCreateMode 0640 On 2014/02/13 21:13:13, thumper wrote: > If ...
10 years, 2 months ago (2014-02-13 21:53:28 UTC) #5
axw
https://codereview.appspot.com/62950043/diff/1/upgrades/lockdirectory.go File upgrades/lockdirectory.go (right): https://codereview.appspot.com/62950043/diff/1/upgrades/lockdirectory.go#newcode28 upgrades/lockdirectory.go:28: command := fmt.Sprintf(""+ On 2014/02/13 21:13:13, thumper wrote: > ...
10 years, 2 months ago (2014-02-14 01:02:53 UTC) #6
axw
10 years, 2 months ago (2014-02-14 01:09:27 UTC) #7
On 2014/02/13 21:53:28, wallyworld wrote:
>
https://codereview.appspot.com/62950043/diff/1/log/syslog/testing/syslogconf.go
> File log/syslog/testing/syslogconf.go (right):
> 
>
https://codereview.appspot.com/62950043/diff/1/log/syslog/testing/syslogconf....
> log/syslog/testing/syslogconf.go:33: $FileCreateMode 0640
> On 2014/02/13 21:13:13, thumper wrote:
> > If these are just copies of the templates in the log/syslog package, why
> > duplicate them here?
> > 
> > We should just be referring to the originals, otherwise we just have to
update
> > the file in two places when we change it.
> 
> This is deliberate - it means that if the actual content of the generated
files
> change, the tests will break.
> The stuff in this new file is simply transplanted (ie moved) from an existing
> _test file to a testing package so that it can be shared between tests in
> different packages.
> 
> https://codereview.appspot.com/62950043/diff/1/upgrades/file.go
> File upgrades/file.go (right):
> 
> https://codereview.appspot.com/62950043/diff/1/upgrades/file.go#newcode13
> upgrades/file.go:13: // contents, allowing for the fact that filename may
> already exist.
> On 2014/02/13 07:49:45, axw wrote:
> > what should happen if it exists? should perms/ownership be copied?
> 
> I think it's correct to override any existing perms/ownership. This method is
> called when doing an upgrade. The upgrade may create the new file with new
> ownership/perms and we want to retain these.

Okay, fair enough. May be good to have explicit mode then, but it can wait.

> https://codereview.appspot.com/62950043/diff/1/upgrades/file.go#newcode19
> upgrades/file.go:19: tempDir, err := ioutil.TempDir(confDir, "")
> On 2014/02/13 07:49:45, axw wrote:
> > why not just create a TempFile in confDir?
> 
> This code was copied from elsewhere. Not sure. It can be changed.
> 
> https://codereview.appspot.com/62950043/diff/1/upgrades/lockdirectory.go
> File upgrades/lockdirectory.go (right):
> 
>
https://codereview.appspot.com/62950043/diff/1/upgrades/lockdirectory.go#newc...
> upgrades/lockdirectory.go:1: // Copyright 2014 Canonical Ltd.
> On 2014/02/13 21:13:13, thumper wrote:
> > Ian, you were talking about moving these into sub-packages.
> > 
> > Still going to do this?  I think it would be good.
> 
> a. I want to land this branch first cause it's big enough already
> b. Let's see how it looks with 2 or 3 upgrade plugins so we can get a picture
of
> how best to do any sub packaging.
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b