diff --git a/Makefile b/Makefile index db661315ef..a85aef6b69 100644 --- a/Makefile +++ b/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 diff --git a/awx/main/south_migrations/0070_v221_changes.py b/awx/main/south_migrations/0070_v221_changes.py index 0bc36f27ac..039ff600ce 100644 --- a/awx/main/south_migrations/0070_v221_changes.py +++ b/awx/main/south_migrations/0070_v221_changes.py @@ -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() diff --git a/awx/plugins/callback/job_event_callback.py b/awx/plugins/callback/job_event_callback.py index 9adf6153e8..8aa6dfc9e5 100644 --- a/awx/plugins/callback/job_event_callback.py +++ b/awx/plugins/callback/job_event_callback.py @@ -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 ', @@ -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 ', 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', ''): diff --git a/requirements/requirements.txt b/requirements/requirements.txt index 3e0bea4550..d4d88899e0 100644 --- a/requirements/requirements.txt +++ b/requirements/requirements.txt @@ -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