Merge lp:~tvansteenburgh/charm-tools/lp-1334299 into lp:charm-tools/1.3

Proposed by Tim Van Steenburgh
Status: Merged
Merged at revision: 336
Proposed branch: lp:~tvansteenburgh/charm-tools/lp-1334299
Merge into: lp:charm-tools/1.3
Diff against target: 19 lines (+3/-4)
1 file modified
charmtools/templates/python/template.py (+3/-4)
To merge this branch: bzr merge lp:~tvansteenburgh/charm-tools/lp-1334299
Reviewer Review Type Date Requested Status
Marco Ceppi (community) Approve
Review via email: mp+224455@code.launchpad.net

Description of the change

Fixed symlinks in python charm by using relative paths so that symlinks are copied properly when the charm is moved to it's final filesystem location.

To post a comment you must log in.
Revision history for this message
Marco Ceppi (marcoceppi) wrote :

LGTM

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'charmtools/templates/python/template.py'
2--- charmtools/templates/python/template.py 2014-06-20 18:57:25 +0000
3+++ charmtools/templates/python/template.py 2014-06-25 14:25:27 +0000
4@@ -81,12 +81,11 @@
5 os.path.join(output_dir, 'hooks_symlinked'),
6 os.path.join(output_dir, 'hooks')
7 )
8+ # Symlinks must be relative so that they are copied properly
9+ # when output_dir is moved to it's final location.
10 for link in ['config-changed', 'install', 'start', 'stop',
11 'upgrade-charm']:
12- os.symlink(
13- os.path.join(output_dir, 'hooks', 'hooks.py'),
14- os.path.join(output_dir, 'hooks', link)
15- )
16+ os.symlink('hooks.py', os.path.join(output_dir, 'hooks', link))
17
18 def _install_charmhelpers(self, output_dir):
19 helpers_dest = os.path.join(output_dir, 'lib', 'charmhelpers')

Subscribers

People subscribed via source and target branches