Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Side by Side Diff: hiera/install_precise.py

Issue 6269682487132160: Issue 2151 - Drop hiera/private in favor of modules/private/hiera (Closed)
Patch Set: Created March 17, 2015, 9:06 a.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « hiera/hiera.yaml ('k') | hiera/puppet_node_classifier.rb » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 2
3 import distutils.spawn 3 import distutils.spawn
4 import io 4 import io
5 import os 5 import os
6 import subprocess 6 import subprocess
7 import sys 7 import sys
8 8
9 if distutils.spawn.find_executable('puppet') \ 9 if distutils.spawn.find_executable('puppet') \
10 and distutils.spawn.find_executable('hiera'): 10 and distutils.spawn.find_executable('hiera'):
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 handle.write(PUPPETLABS_SOURCES) 91 handle.write(PUPPETLABS_SOURCES)
92 92
93 with io.open('/etc/apt/preferences.d/puppetlabs', 'wb') as handle: 93 with io.open('/etc/apt/preferences.d/puppetlabs', 'wb') as handle:
94 handle.write(PUPPETLABS_PREFS) 94 handle.write(PUPPETLABS_PREFS)
95 95
96 subprocess.check_call(['apt-get', '-y', 'update']) 96 subprocess.check_call(['apt-get', '-y', 'update'])
97 subprocess.check_call(['apt-get', '-y', 'install', 'puppet']) 97 subprocess.check_call(['apt-get', '-y', 'install', 'puppet'])
98 subprocess.check_call(['apt-get', '-y', 'install', 'hiera-puppet']) 98 subprocess.check_call(['apt-get', '-y', 'install', 'hiera-puppet'])
99 99
100 if not os.path.exists('/etc/puppet/hiera.yaml'): 100 if not os.path.exists('/etc/puppet/hiera.yaml'):
101 config = os.path.join(os.path.dirname(__file__), 'hiera.yaml') 101 realpath = os.path.realpath(__file__)
102 dirname = os.path.dirname(realpath)
103 config = os.path.join(dirname, 'hiera.yaml')
mathias 2015/03/17 09:28:48 This is actually a bug I encountered and fixed dur
102 if os.path.exists(config): 104 if os.path.exists(config):
103 os.symlink(config, '/etc/puppet/hiera.yaml') 105 os.symlink(config, '/etc/puppet/hiera.yaml')
OLDNEW
« no previous file with comments | « hiera/hiera.yaml ('k') | hiera/puppet_node_classifier.rb » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld