~hopem/charms/trusty/cinder/ensure-apache-restart

« back to all changes in this revision

Viewing changes to hooks/charmhelpers/core/templating.py

  • Committer: Liam Young
  • Date: 2015-01-09 16:02:39 UTC
  • mfrom: (65 cinder.next)
  • mto: This revision was merged to the branch mainline in revision 67.
  • Revision ID: liam.young@canonical.com-20150109160239-qldk423wxfno2ao3
Merged next in and resolved conflicts

Show diffs side-by-side

added added

removed removed

Lines of Context:
4
4
from charmhelpers.core import hookenv
5
5
 
6
6
 
7
 
def render(source, target, context, owner='root', group='root', perms=0444, templates_dir=None):
 
7
def render(source, target, context, owner='root', group='root',
 
8
           perms=0o444, templates_dir=None):
8
9
    """
9
10
    Render a template.
10
11
 
47
48
                    level=hookenv.ERROR)
48
49
        raise e
49
50
    content = template.render(context)
50
 
    host.mkdir(os.path.dirname(target))
 
51
    host.mkdir(os.path.dirname(target), owner, group)
51
52
    host.write_file(target, content, owner, group, perms)