trim md5sum string so it does not contain the filename
also fix a bug/typo in the reporting from playbook
This commit is contained in:
parent
bfd93081ae
commit
deb71da91e
3 changed files with 5 additions and 5 deletions
|
@ -183,7 +183,7 @@ class PlayBook(object):
|
||||||
if not self.changed.has_key(host):
|
if not self.changed.has_key(host):
|
||||||
self.changed[host] = 1
|
self.changed[host] = 1
|
||||||
else:
|
else:
|
||||||
self.changes[host] = self.changed[host] + 1
|
self.changed[host] = self.changed[host] + 1
|
||||||
|
|
||||||
|
|
||||||
# flag which notify handlers need to be run
|
# flag which notify handlers need to be run
|
||||||
|
|
|
@ -22,11 +22,11 @@ if not os.path.exists(source):
|
||||||
md5sum = None
|
md5sum = None
|
||||||
changed = False
|
changed = False
|
||||||
if os.path.exists(dest):
|
if os.path.exists(dest):
|
||||||
md5sum = os.popen("md5sum %s" % dest).read()
|
md5sum = os.popen("md5sum %s" % dest).read().split()[0]
|
||||||
|
|
||||||
os.system("cp %s %s" % (source, dest))
|
os.system("cp %s %s" % (source, dest))
|
||||||
|
|
||||||
md5sum2 = os.popen("md5sum %s" % dest).read()
|
md5sum2 = os.popen("md5sum %s" % dest).read().split()[0]
|
||||||
|
|
||||||
if md5sum != md5sum2:
|
if md5sum != md5sum2:
|
||||||
changed = True
|
changed = True
|
||||||
|
|
|
@ -45,7 +45,7 @@ source = file(source).read()
|
||||||
changed = False
|
changed = False
|
||||||
md5sum = None
|
md5sum = None
|
||||||
if os.path.exists(dest):
|
if os.path.exists(dest):
|
||||||
md5sum = os.popen("md5sum %s" % dest).read()
|
md5sum = os.popen("md5sum %s" % dest).read().split()[0]
|
||||||
|
|
||||||
# call Jinja2 here and save the new template file
|
# call Jinja2 here and save the new template file
|
||||||
template = jinja2.Template(source)
|
template = jinja2.Template(source)
|
||||||
|
@ -58,7 +58,7 @@ f.close()
|
||||||
# other end unless things were successful
|
# other end unless things were successful
|
||||||
|
|
||||||
# record m5sum and return success and whether things have changed
|
# record m5sum and return success and whether things have changed
|
||||||
md5sum2 = os.popen("md5sum %s" % dest).read()
|
md5sum2 = os.popen("md5sum %s" % dest).read().split()[0]
|
||||||
|
|
||||||
if md5sum != md5sum2:
|
if md5sum != md5sum2:
|
||||||
changed = True
|
changed = True
|
||||||
|
|
Loading…
Reference in a new issue