Fixed creating jobs diff generating.
diff --git a/_states/jenkins_job.py b/_states/jenkins_job.py
index a8ee964..69deb37 100644
--- a/_states/jenkins_job.py
+++ b/_states/jenkins_job.py
@@ -65,7 +65,7 @@
ET.tostringlist(oldXML, encoding='utf8', method='xml'),
ET.tostringlist(newXML, encoding='utf8', method='xml'), lineterm='')
__salt__['jenkins.update_job'](name, config, __env__)
- ret['changes'] = ''.join(diff)
+ ret['changes'][name] = ''.join(diff)
ret['comment'].append('Job {0} updated.'.format(name))
else:
@@ -76,10 +76,8 @@
__salt__['jenkins.create_job'](name, config, __env__)
buf = six.moves.StringIO(new_config_xml)
- _current_job_config = buf.readlines()
-
- diff = difflib.unified_diff('', buf, lineterm='')
- ret['changes'] = ''.join(diff)
+ diff = difflib.unified_diff('', buf.readlines(), lineterm='')
+ ret['changes'][name] = ''.join(diff)
ret['comment'].append('Job {0} added.'.format(name))
ret['comment'] = '\n'.join(ret['comment'])