mirror of
https://github.com/kevingruesser/bootstrap-vz.git
synced 2025-10-07 17:40:30 +00:00
docker: Use a standard escaping function.
The outer double-quotes (") were breaking things on some versions of Docker, such as the one currently available on Travis.
This commit is contained in:
parent
765430bfad
commit
eca54d6c21
1 changed files with 2 additions and 8 deletions
|
@ -50,15 +50,9 @@ class PopulateLabels(Task):
|
|||
for label, value in info.manifest.provider['labels'].items():
|
||||
labels[label] = value.format(**info.manifest_vars)
|
||||
|
||||
# pipes.quote converts newlines into \n rather than just prefixing
|
||||
# it with a backslash, so we need to escape manually
|
||||
def escape(value):
|
||||
value = value.replace('"', '\\"')
|
||||
value = value.replace('\n', '\\\n')
|
||||
value = '"' + value + '"'
|
||||
return value
|
||||
from pipes import quote
|
||||
for label, value in labels.items():
|
||||
info._docker['dockerfile'].append('LABEL {}={}'.format(label, escape(value)))
|
||||
info._docker['dockerfile'].append('LABEL {}={}'.format(label, quote(value)))
|
||||
|
||||
|
||||
class AppendManifestDockerfile(Task):
|
||||
|
|
Loading…
Add table
Reference in a new issue