~juju-deployers/juju-deployer/trunk

« back to all changes in this revision

Viewing changes to deployer/deployment.py

  • Committer: mergebot at canonical
  • Author(s): "Tom Haddon"
  • Date: 2021-09-17 13:19:08 UTC
  • mfrom: (222.1.1 juju-deployer)
  • Revision ID: mergebot@juju-139df4-prod-is-toolbox-0.canonical.com-20210917131908-9r2pnxlke7j21epr
Update diff to deal correctly with include files lp#1892423

Reviewed-on: https://code.launchpad.net/~mthaddon/juju-deployer/lp-1892423/+merge/408802
Reviewed-by: Benjamin Allot <benjamin.allot@canonical.com>

Show diffs side-by-side

added added

removed removed

Lines of Context:
5
5
import logging
6
6
import pprint
7
7
import os
 
8
import textwrap
8
9
import yaml
9
10
 
10
11
import six
268
269
            with open(ip, 'rb') as fh:
269
270
                v = fh.read()
270
271
                if include_type == "base64":
271
 
                    v = b64encode(v)
272
 
                return v
 
272
                    # Follow Juju's approach of wrapping at 76 characters.
 
273
                    return "\n".join(textwrap.wrap(b64encode(v).decode(), 76))
 
274
                else:
 
275
                    return v.strip().decode()
273
276
        if feedback:
274
277
            return feedback
275
278