Skip to content

Commit

Permalink
Truncate dbshell output (#283)
Browse files Browse the repository at this point in the history
Truncate dbshell output

dbshell prints a line with the fields name when using MySQL.
Using `tail -n1` fixes the issue.
  • Loading branch information
rayzilt authored Feb 14, 2020
1 parent b8e4fe9 commit 894e0a6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tasks/configure.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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="[email protected]" 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="[email protected]" and username="test");' | {{ archivematica_src_ss_virtualenv }}/bin/python manage.py dbshell | tail -n1
args:
chdir: "{{ archivematica_src_ss_app }}"
executable: /bin/bash
Expand All @@ -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
Expand Down

0 comments on commit 894e0a6

Please sign in to comment.