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:
Matthew Jones
2016-04-22 10:54:23 -04:00
4 changed files with 13 additions and 7 deletions

View File

@@ -80,7 +80,7 @@ DEBUILD_OPTS = --source-option="-I"
DPUT_BIN ?= dput DPUT_BIN ?= dput
DPUT_OPTS ?= -c .dput.cf -u DPUT_OPTS ?= -c .dput.cf -u
REPREPRO_BIN ?= reprepro REPREPRO_BIN ?= reprepro
REPREPRO_OPTS ?= -b reprepro --export=force REPREPRO_OPTS ?= -b reprepro --export=changed
DEB_DIST ?= DEB_DIST ?=
ifeq ($(OFFICIAL),yes) ifeq ($(OFFICIAL),yes)
# Sign official builds # Sign official builds

View File

@@ -12,7 +12,7 @@ from django.conf import settings
class Migration(DataMigration): class Migration(DataMigration):
def forwards(self, orm): 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() cur = connection.cursor()
stdout_filename = os.path.join(settings.JOBOUTPUT_ROOT, "%d-%s.out" % (j.pk, str(uuid.uuid1()))) stdout_filename = os.path.join(settings.JOBOUTPUT_ROOT, "%d-%s.out" % (j.pk, str(uuid.uuid1())))
fd = open(stdout_filename, 'w') fd = open(stdout_filename, 'w')
@@ -20,7 +20,7 @@ class Migration(DataMigration):
fd.close() fd.close()
j.result_stdout_file = stdout_filename j.result_stdout_file = stdout_filename
j.result_stdout_text = "" 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 = subprocess.Popen(["sed", "-i", "-e", "s/\\\\r\\\\n/\\n/g", stdout_filename])
sed_command.wait() sed_command.wait()

View File

@@ -98,6 +98,8 @@ def censor(obj, no_log=False):
if k in obj: if k in obj:
new_obj[k] = obj[k] new_obj[k] = obj[k]
if k == 'cmd' and k in obj: if k == 'cmd' and k in obj:
if isinstance(obj['cmd'], list):
obj['cmd'] = ' '.join(obj['cmd'])
if re.search(r'\s', obj['cmd']): if re.search(r'\s', obj['cmd']):
new_obj['cmd'] = re.sub(r'^(([^\s\\]|\\\s)+).*$', new_obj['cmd'] = re.sub(r'^(([^\s\\]|\\\s)+).*$',
r'\1 <censored>', 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)) obj['results'][i] = censor(obj['results'][i], obj.get('_ansible_no_log', no_log))
elif obj.get('_ansible_no_log', False): 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" obj['results'] = "the output has been hidden due to the fact that 'no_log: true' was specified for this result"
return obj return obj
class TokenAuth(requests.auth.AuthBase): class TokenAuth(requests.auth.AuthBase):
@@ -218,7 +219,6 @@ class BaseCallbackModule(object):
r'\1 <censored>', r'\1 <censored>',
res['invocation']['module_args']['_raw_params']) res['invocation']['module_args']['_raw_params'])
msg['event_data']['res'] = res msg['event_data']['res'] = res
self.socket.send_json(msg) self.socket.send_json(msg)
self.socket.recv() self.socket.recv()
return return
@@ -524,6 +524,13 @@ class JobCallbackModule(BaseCallbackModule):
def v2_playbook_on_play_start(self, play): def v2_playbook_on_play_start(self, play):
setattr(self, 'play', 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, self._log_event('playbook_on_play_start', name=play.name,
pattern=play.hosts) pattern=play.hosts)
@@ -571,7 +578,6 @@ class AdHocCommandCallbackModule(BaseCallbackModule):
super(AdHocCommandCallbackModule, self).runner_on_skipped(host, item) super(AdHocCommandCallbackModule, self).runner_on_skipped(host, item)
self.skipped_hosts.add(host) self.skipped_hosts.add(host)
if os.getenv('JOB_ID', ''): if os.getenv('JOB_ID', ''):
CallbackModule = JobCallbackModule CallbackModule = JobCallbackModule
elif os.getenv('AD_HOC_COMMAND_ID', ''): elif os.getenv('AD_HOC_COMMAND_ID', ''):

View File

@@ -5,7 +5,7 @@ apache-libcloud==0.15.1
appdirs==1.4.0 appdirs==1.4.0
Babel==2.2.0 Babel==2.2.0
billiard==3.3.0.16 billiard==3.3.0.16
boto==2.34.0 boto==2.39.0
celery==3.1.10 celery==3.1.10
cffi==1.5.0 cffi==1.5.0
cliff==1.15.0 cliff==1.15.0