Merge lp:~abentley/juju-release-tools/update-agent-paths into lp:juju-release-tools

Proposed by Aaron Bentley
Status: Merged
Merged at revision: 264
Proposed branch: lp:~abentley/juju-release-tools/update-agent-paths
Merge into: lp:juju-release-tools
Diff against target: 16 lines (+4/-2)
1 file modified
agent_paths.py (+4/-2)
To merge this branch: bzr merge lp:~abentley/juju-release-tools/update-agent-paths
Reviewer Review Type Date Requested Status
Curtis Hovey (community) code Approve
Review via email: mp+286406@code.launchpad.net

Commit message

Update agent paths, handle new Windows agents.

Description of the change

This branch updates the agent path rewriting and supports new Windows agents.

The new agent paths contain the version, so e.g. "agent/1.25.2/juju-1.25.2-wily-armhf.tgz" rather than "agent/juju-1.25.2-wily-armhf.tgz".

The detection of windows agents has been updated to include win2016, win2016nano and win10.

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

Thank you.

review: Approve (code)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'agent_paths.py'
2--- agent_paths.py 2016-01-25 16:10:34 +0000
3+++ agent_paths.py 2016-02-17 20:57:21 +0000
4@@ -21,8 +21,10 @@
5 for stanza in stanzas:
6 path_hash = stanza['sha256']
7 old_hash_urls[path_hash] = stanza['item_url']
8- path = os.path.join('agent', os.path.basename(stanza['path']))
9- path = re.sub('-win(2012(hv)?(r2)?|7|8|81)-', '-windows-', path)
10+ agent_filename = stanza['path'].split('/')[-1]
11+ path = 'agent/{}/{}'.format(stanza['version'], agent_filename)
12+ path = re.sub('-win(2012(hv)?(r2)?|2016(nano)?|7|8|81|10)-',
13+ '-windows-', path)
14 paths_hashes.setdefault(path, stanza['sha256'])
15 if paths_hashes[path] != path_hash:
16 raise ValueError('Conflicting hash')

Subscribers

People subscribed via source and target branches