versions file: Also look in /usr/lib/juju #7977

Merged
merged 1 commit into from Oct 27, 2017

Conversation

Projects
None yet
3 participants
Member

babbageclunk commented Oct 27, 2017

Description of change

Description of change

For snaps the versions file will be alongside the jujud binary in the
same directory, but when Juju is installed from a deb jujud will be in
/usr/bin, and we won't be able to install the version file there.
Instead, check /usr/lib/juju for the versions file if it's not beside
the binary. (If version files are in both locations the one alongside
the binary takes precedence.) The deb packaging will need to install the
versions file to that directory.

QA steps

Create a versions file for the locally-built jujud in /usr/lib/juju/jujud-versions.yaml (or move an existing one there).
Bootstrap with an agent-version that isn't in the stream (like 2.3-beta2) and --debug.
See that the version file from /usr/lib/juju is found and included in the agent bundle.
Check that the deployed controller doesn't report a build number in its version.

Small test change, but otherwise good!

environs/tools/build_test.go
@@ -51,6 +51,11 @@ func (b *buildSuite) SetUpTest(c *gc.C) {
dir1 := c.MkDir()
dir2 := c.MkDir()
+ // Ensure we don't look in the real /usr/lib/juju for jujud-versions.yaml.
+ oldVersionFileFallback := tools.VersionFileFallbackDir
@wallyworld

wallyworld Oct 27, 2017

Owner

There's a PatchValue that can be used here - does cleanup automatically

@babbageclunk

babbageclunk Oct 27, 2017

Member

Oh, nice - thanks.

Also look for versions file in /usr/lib/juju
For snaps the versions file will be alongside the jujud binary in the
same directory, but when Juju is installed from a deb jujud will be in
/usr/bin, and we won't be able to install the version file there.
Instead, check /usr/lib/juju for the versions file if it's not beside
the binary. (If version files are in both locations the one alongside
the binary takes precedence.) The deb packaging will need to install the
versions file to that directory.
Member

babbageclunk commented Oct 27, 2017

$$merge$$

Contributor

jujubot commented Oct 27, 2017

Status: merge request accepted. Url: http://ci.jujucharms.com/job/github-merge-juju

Contributor

jujubot commented Oct 27, 2017

Build failed: Tests failed
build url: http://ci.jujucharms.com/job/github-merge-juju/409

Owner

wallyworld commented Oct 27, 2017

$$merge$$

Contributor

jujubot commented Oct 27, 2017

Status: merge request accepted. Url: http://ci.jujucharms.com/job/github-merge-juju

Contributor

jujubot commented Oct 27, 2017

Build failed: Tests failed
build url: http://ci.jujucharms.com/job/github-merge-juju/413

Owner

wallyworld commented Oct 27, 2017

$$merge$$

Contributor

jujubot commented Oct 27, 2017

Status: merge request accepted. Url: http://ci.jujucharms.com/job/github-merge-juju

@jujubot jujubot merged commit b971917 into juju:develop Oct 27, 2017

1 check passed

continuous-integration/jenkins/pr-merge This commit looks good
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment