applying indentation patch from skvidal
This commit is contained in:
parent
62dee290c5
commit
fed3462502
5 changed files with 14 additions and 14 deletions
4
command
4
command
|
@ -1,9 +1,9 @@
|
|||
#!/usr/bin/python
|
||||
|
||||
try:
|
||||
import json
|
||||
import json
|
||||
except ImportError:
|
||||
import simplejson as json
|
||||
import simplejson as json
|
||||
|
||||
import subprocess
|
||||
import sys
|
||||
|
|
8
copy
8
copy
|
@ -4,9 +4,9 @@ import sys
|
|||
import os
|
||||
|
||||
try:
|
||||
import json
|
||||
import json
|
||||
except ImportError:
|
||||
import simplejson as json
|
||||
import simplejson as json
|
||||
|
||||
source = sys.argv[1]
|
||||
dest = sys.argv[2]
|
||||
|
@ -22,14 +22,14 @@ if not os.path.exists(source):
|
|||
md5sum = None
|
||||
changed = False
|
||||
if os.path.exists(dest):
|
||||
md5sum = os.popen("md5sum %s" % dest).read()
|
||||
md5sum = os.popen("md5sum %s" % dest).read()
|
||||
|
||||
os.system("cp %s %s" % (source, dest))
|
||||
|
||||
md5sum2 = os.popen("md5sum %s" % dest).read()
|
||||
|
||||
if md5sum != md5sum2:
|
||||
changed = True
|
||||
changed = True
|
||||
|
||||
# mission accomplished
|
||||
print json.dumps({
|
||||
|
|
4
ohai
4
ohai
|
@ -3,9 +3,9 @@
|
|||
# requires 'ohai' to be installed
|
||||
|
||||
try:
|
||||
import json
|
||||
import json
|
||||
except ImportError:
|
||||
import simplejson as json
|
||||
import simplejson as json
|
||||
|
||||
import subprocess
|
||||
|
||||
|
|
4
ping
4
ping
|
@ -1,8 +1,8 @@
|
|||
#!/usr/bin/python
|
||||
|
||||
try:
|
||||
import json
|
||||
import json
|
||||
except ImportError:
|
||||
import simplejson as json
|
||||
import simplejson as json
|
||||
|
||||
print json.dumps(1)
|
||||
|
|
8
template
8
template
|
@ -4,9 +4,9 @@ import sys
|
|||
import os
|
||||
import jinja2
|
||||
try:
|
||||
import json
|
||||
import json
|
||||
except ImportError:
|
||||
import simplejson as json
|
||||
import simplejson as json
|
||||
|
||||
source = sys.argv[1]
|
||||
dest = sys.argv[2]
|
||||
|
@ -45,7 +45,7 @@ source = file(source).read()
|
|||
changed = False
|
||||
md5sum = None
|
||||
if os.path.exists(dest):
|
||||
md5sum = os.popen("md5sum %s" % dest).read()
|
||||
md5sum = os.popen("md5sum %s" % dest).read()
|
||||
|
||||
# call Jinja2 here and save the new template file
|
||||
template = jinja2.Template(source)
|
||||
|
@ -61,7 +61,7 @@ f.close()
|
|||
md5sum2 = os.popen("md5sum %s" % dest).read()
|
||||
|
||||
if md5sum != md5sum2:
|
||||
changed = True
|
||||
changed = True
|
||||
|
||||
# mission accomplished
|
||||
print json.dumps({
|
||||
|
|
Loading…
Reference in a new issue