Confusing heredoc message

Bug #1502241 reported by Ian Cordasco
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
bash8
New
Undecided
Unassigned

Bug Description

While adding bashate to openstack/openstack-ansible, we found that bashate emits:

     E012: heredoc did not end before EOF: ' string=$(python <<EOF'

From https://github.com/openstack/openstack-ansible/blob/ff4cd964c8bd1afd6dc9ce8df742cc0860adff2b/playbooks/roles/os_tempest/templates/openstack_tempest_gate.sh.j2#L107 (reproduced generically below)

     foo=$(cmd <<HEREDOC
     some text
     in a heredoc
     HEREDOC)

It does accept the following:

     foo=$(cmd <<HEREDOC
     some text
     in a heredoc
     HEREDOC
     )

It might be better to provide a better error message if the former is against bashate's style guidelines. That said this seems like a bug that it's missing this and providing that error message.

Revision history for this message
Tin Lam (lamt) wrote :

I wasn't able to reproduce this with the latest bashate.

  (.venv) 631 [bashate]$ cat heredoc.sh
  foo=$(cmd <<HEREDOC
  some text
  in a heredoc
  HEREDOC)
  (.venv) 632 [bashate]$ bashate heredoc.sh
  (.venv) 633 [bashate]$

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.