Merge lp:~sinzui/juju-release-tools/ignroe-epoch into lp:juju-release-tools

Proposed by Curtis Hovey
Status: Merged
Merged at revision: 344
Proposed branch: lp:~sinzui/juju-release-tools/ignroe-epoch
Merge into: lp:juju-release-tools
Diff against target: 13 lines (+2/-1)
1 file modified
generate_agents.py (+2/-1)
To merge this branch: bzr merge lp:~sinzui/juju-release-tools/ignroe-epoch
Reviewer Review Type Date Requested Status
Nicholas Skaggs (community) Approve
Review via email: mp+308465@code.launchpad.net

Description of the change

Strip the epoch from the base_version when making aagents

We saw this error after debs were download and they were extracted to convert the jujud into an agent

OSError: [Errno 2] No such file or directory: '/tmp/tmpNlQsjT/contents/usr/lib/juju-1:2.0.0/bin/jujud'

^ lib/juju-1:2.0.0 should be lib/juju-2.0

The epoch was not stripped, corrupting both the base_version and the major_minor.

To post a comment you must log in.
Revision history for this message
Curtis Hovey (sinzui) wrote :

This works with
    control_version = "1:2.0.0-0ubuntu1~16.10.1~juju1"
and
    control_version = "2.0.0-0ubuntu1~16.10.1~juju1"

Revision history for this message
Nicholas Skaggs (nskaggs) wrote :

Thank you!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'generate_agents.py'
2--- generate_agents.py 2016-07-15 22:07:02 +0000
3+++ generate_agents.py 2016-10-13 22:22:13 +0000
4@@ -119,7 +119,8 @@
5 'control'])
6 control = deb822.Deb822(control_str)
7 control_version = control['Version']
8- base_version = re.sub('(~|-0ubuntu).*$', '', control_version)
9+ epoch_version = re.sub('(~|-0ubuntu).*$', '', control_version)
10+ base_version = re.sub('^.:', '', epoch_version)
11 major_minor = '.'.join(base_version.split('-')[0].split('.')[0:2])
12 series = juju_series.get_name_from_package_version(control_version)
13 architecture = control['Architecture']

Subscribers

People subscribed via source and target branches