~celebdor/charms/trusty/neutron-agents-midonet/trunk

« back to all changes in this revision

Viewing changes to hooks/midonet_helpers/puppet.py

  • Committer: Antoni Segura Puimedon
  • Date: 2015-10-06 16:15:57 UTC
  • Revision ID: toni@midokura.com-20151006161557-auv3ed7ndi2br27e
sync midonet-helpers to get 2015.06 repos

It has no effect on this subordinate though.

Show diffs side-by-side

added added

removed removed

Lines of Context:
32
32
 
33
33
        with tempfile.NamedTemporaryFile(mode='w+t') as tmp:
34
34
            if self._fingerprint_key in context:
35
 
                tmp.write("apt::key { 'key': \n    key => '%s',\n} ->\n" %
 
35
                tmp.write("apt::key { 'key': \n    key => '%s',\n" %
36
36
                          context[self._fingerprint_key])
 
37
                if self._content_key in context:
 
38
                    tmp.write("    key_content => '%s',\n" %
 
39
                              context[self._content_key])
 
40
                tmp.write("} ->\n")
37
41
            tmp.write("class { '%s':\n}\n" % self._component)
38
42
            tmp.flush()
39
43
            _apply(tmp.name)
41
45
    def __init__(self, component):
42
46
        self._component = component
43
47
        self._fingerprint_key = 'midonet_key_fingerprint'
 
48
        self._content_key = 'midonet_key_content'
44
49
 
45
50
 
46
51
def _apply(path, debug=False):