From 894e0a6849f2a9f6adc4054bee53a9d9807ce7b7 Mon Sep 17 00:00:00 2001 From: Silvan Raijer Date: Fri, 14 Feb 2020 16:50:40 +0100 Subject: [PATCH] Truncate dbshell output (#283) Truncate dbshell output dbshell prints a line with the fields name when using MySQL. Using `tail -n1` fixes the issue. --- tasks/configure.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tasks/configure.yml b/tasks/configure.yml index 866ac59d..2700d4bc 100644 --- a/tasks/configure.yml +++ b/tasks/configure.yml @@ -25,7 +25,7 @@ - name: "Get SS API Key" shell: > echo "select \`key\` from tastypie_apikey where id in (select id from auth_user where username = '{{ archivematica_src_configure_ss_user }}');" - | {{ archivematica_src_ss_virtualenv }}/bin/python manage.py dbshell + | {{ archivematica_src_ss_virtualenv }}/bin/python manage.py dbshell | tail -n1 args: chdir: "{{ archivematica_src_ss_app }}" executable: /bin/bash @@ -41,7 +41,7 @@ - name: "Check for default SS user" become: "yes" - shell: echo 'select username from auth_user where (id=1 and last_login is NULL and first_name="" and last_name="" and email="x@x.com" and username="test");' | {{ archivematica_src_ss_virtualenv }}/bin/python manage.py dbshell + shell: echo 'select username from auth_user where (id=1 and last_login is NULL and first_name="" and last_name="" and email="x@x.com" and username="test");' | {{ archivematica_src_ss_virtualenv }}/bin/python manage.py dbshell | tail -n1 args: chdir: "{{ archivematica_src_ss_app }}" executable: /bin/bash @@ -66,7 +66,7 @@ - name: "Check for SS user" become: "yes" - shell: echo 'select username from auth_user where username="{{ archivematica_src_configure_ss_user }}";' | {{ archivematica_src_ss_virtualenv }}/bin/python manage.py dbshell + shell: echo 'select username from auth_user where username="{{ archivematica_src_configure_ss_user }}";' | {{ archivematica_src_ss_virtualenv }}/bin/python manage.py dbshell | tail -n1 args: chdir: "{{ archivematica_src_ss_app }}" executable: /bin/bash