mirror of
https://github.com/ansible/awx.git
synced 2026-01-11 10:00:01 -03:30
Merge branch 'release_2.4.5' into devel
* release_2.4.5: Remove distribute from the setup virtualenv if installed (#1631) Update changelogs for 2.4.5 release Only export changed targets in reprepro Improve the efficiency of the stdout dump database migration Added logic to not show the loop summary events in the UI by looking at event_data.event_loop. Handle runner items from ansible v2 bump boto fix case of Ansible v2 _result.cmd is list for release 2.4.5 Handle both string and list hosts in our hosts->name conversion Default play names to the hosts the play was run against Use better isinstance(x) type checking Backporting test fixes from PR #1020: Fix error with ad hoc command events when running in check mode. Fix for tasks breaking when using 'yum' with ansible 1.9.4 Bump 2.4.5 version, changelogs, and reprepo
This commit is contained in:
commit
cf7b71ae2c
2
Makefile
2
Makefile
@ -80,7 +80,7 @@ DEBUILD_OPTS = --source-option="-I"
|
||||
DPUT_BIN ?= dput
|
||||
DPUT_OPTS ?= -c .dput.cf -u
|
||||
REPREPRO_BIN ?= reprepro
|
||||
REPREPRO_OPTS ?= -b reprepro --export=force
|
||||
REPREPRO_OPTS ?= -b reprepro --export=changed
|
||||
DEB_DIST ?=
|
||||
ifeq ($(OFFICIAL),yes)
|
||||
# Sign official builds
|
||||
|
||||
@ -12,7 +12,7 @@ from django.conf import settings
|
||||
class Migration(DataMigration):
|
||||
|
||||
def forwards(self, orm):
|
||||
for j in orm.UnifiedJob.objects.filter(active=True):
|
||||
for j in orm.UnifiedJob.objects.filter(active=True).only('id'):
|
||||
cur = connection.cursor()
|
||||
stdout_filename = os.path.join(settings.JOBOUTPUT_ROOT, "%d-%s.out" % (j.pk, str(uuid.uuid1())))
|
||||
fd = open(stdout_filename, 'w')
|
||||
@ -20,7 +20,7 @@ class Migration(DataMigration):
|
||||
fd.close()
|
||||
j.result_stdout_file = stdout_filename
|
||||
j.result_stdout_text = ""
|
||||
j.save()
|
||||
j.save(update_fields=['result_stdout_file', 'result_stdout_text'])
|
||||
sed_command = subprocess.Popen(["sed", "-i", "-e", "s/\\\\r\\\\n/\\n/g", stdout_filename])
|
||||
sed_command.wait()
|
||||
|
||||
|
||||
@ -98,6 +98,8 @@ def censor(obj, no_log=False):
|
||||
if k in obj:
|
||||
new_obj[k] = obj[k]
|
||||
if k == 'cmd' and k in obj:
|
||||
if isinstance(obj['cmd'], list):
|
||||
obj['cmd'] = ' '.join(obj['cmd'])
|
||||
if re.search(r'\s', obj['cmd']):
|
||||
new_obj['cmd'] = re.sub(r'^(([^\s\\]|\\\s)+).*$',
|
||||
r'\1 <censored>',
|
||||
@ -110,7 +112,6 @@ def censor(obj, no_log=False):
|
||||
obj['results'][i] = censor(obj['results'][i], obj.get('_ansible_no_log', no_log))
|
||||
elif obj.get('_ansible_no_log', False):
|
||||
obj['results'] = "the output has been hidden due to the fact that 'no_log: true' was specified for this result"
|
||||
|
||||
return obj
|
||||
|
||||
class TokenAuth(requests.auth.AuthBase):
|
||||
@ -218,7 +219,6 @@ class BaseCallbackModule(object):
|
||||
r'\1 <censored>',
|
||||
res['invocation']['module_args']['_raw_params'])
|
||||
msg['event_data']['res'] = res
|
||||
|
||||
self.socket.send_json(msg)
|
||||
self.socket.recv()
|
||||
return
|
||||
@ -524,6 +524,13 @@ class JobCallbackModule(BaseCallbackModule):
|
||||
|
||||
def v2_playbook_on_play_start(self, play):
|
||||
setattr(self, 'play', play)
|
||||
# Ansible 2.0.0.2 doesn't default .name to hosts like it did in 1.9.4,
|
||||
# though that default will likely return in a future version of Ansible.
|
||||
if (not hasattr(play, 'name') or not play.name) and hasattr(play, 'hosts'):
|
||||
if isinstance(play.hosts, list):
|
||||
play.name = ','.join(play.hosts)
|
||||
else:
|
||||
play.name = play.hosts
|
||||
self._log_event('playbook_on_play_start', name=play.name,
|
||||
pattern=play.hosts)
|
||||
|
||||
@ -571,7 +578,6 @@ class AdHocCommandCallbackModule(BaseCallbackModule):
|
||||
super(AdHocCommandCallbackModule, self).runner_on_skipped(host, item)
|
||||
self.skipped_hosts.add(host)
|
||||
|
||||
|
||||
if os.getenv('JOB_ID', ''):
|
||||
CallbackModule = JobCallbackModule
|
||||
elif os.getenv('AD_HOC_COMMAND_ID', ''):
|
||||
|
||||
@ -5,7 +5,7 @@ apache-libcloud==0.15.1
|
||||
appdirs==1.4.0
|
||||
Babel==2.2.0
|
||||
billiard==3.3.0.16
|
||||
boto==2.34.0
|
||||
boto==2.39.0
|
||||
celery==3.1.10
|
||||
cffi==1.5.0
|
||||
cliff==1.15.0
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user