Always add a newline character for 'contents'; already fixed in salt->=2014.7.0.

This commit is contained in:
ajacoutot 2014-09-11 06:28:41 +00:00
parent e39252b964
commit bcb859e54f
2 changed files with 19 additions and 2 deletions

View File

@ -1,4 +1,4 @@
# $OpenBSD: Makefile,v 1.41 2014/09/10 17:08:03 ajacoutot Exp $
# $OpenBSD: Makefile,v 1.42 2014/09/11 06:28:41 ajacoutot Exp $
# optional dependencies
# https://github.com/saltstack/salt/blob/develop/doc/conf.py#L42
@ -18,7 +18,7 @@ COMMENT = remote execution and configuration management system
MODPY_EGG_VERSION = 2014.1.11
DISTNAME = salt-${MODPY_EGG_VERSION}
REVISION = 0
REVISION = 1
CATEGORIES = sysutils net devel

View File

@ -0,0 +1,17 @@
$OpenBSD: patch-salt_states_file_py,v 1.1 2014/09/11 06:28:41 ajacoutot Exp $
XXX drop when ugrading to >=2014.7.0
--- salt/states/file.py.orig Tue Sep 9 22:42:17 2014
+++ salt/states/file.py Thu Sep 11 08:19:54 2014
@@ -1210,7 +1210,9 @@ def managed(name,
# If contents_pillar was used, get the pillar data
if contents_pillar:
contents = __salt__['pillar.get'](contents_pillar)
- # Make sure file ends in newline
+
+ # Make sure file ends in newline
+ if contents:
if not contents.endswith('\n'):
contents += '\n'