Fixes on domain backend

This commit is contained in:
Marc 2014-10-17 13:57:34 +00:00
parent 46e4c13899
commit 21af6d5ee1
1 changed files with 2 additions and 2 deletions

View File

@ -42,7 +42,7 @@ class Bind9MasterDomainBackend(ServiceController):
self.append(textwrap.dedent("""\
cat -s <(sed -e 's/^};/};\\n/' %(conf_path)s) | \\
awk -v s=pangea.cat 'BEGIN { RS=""; s="zone \\""s"\\"" } $0~s{ print }' | \\
diff -I"^\s*//" - <(echo '%(conf)s') || {
diff -B -I"^\s*//" - <(echo '%(conf)s') || {
cat -s <(sed -e 's/^};/};\\n/' %(conf_path)s) | \\
awk -v s="%(name)s" 'BEGIN { RS=""; s="zone \\""s"\\"" } $0!~s{ print $0"\\n" }' \\
> %(conf_path)s.tmp
@ -69,7 +69,7 @@ class Bind9MasterDomainBackend(ServiceController):
awk -v s="%(name)s" 'BEGIN { RS=""; s="zone \\""s"\\"" } $0!~s{ print $0"\\n" }' \\
> %(conf_path)s.tmp""" % context
))
self.append('diff -I"^\s*//" %(conf_path)s.tmp %(conf_path)s || UPDATED=1' % context)
self.append('diff -B -I"^\s*//" %(conf_path)s.tmp %(conf_path)s || UPDATED=1' % context)
self.append('mv %(conf_path)s.tmp %(conf_path)s' % context)
def commit(self):