[ovs-dev] [PATCH] github: Fix up malformed /etc/hosts.

David Marchand david.marchand at redhat.com
Tue May 11 13:35:48 UTC 2021


On Tue, May 11, 2021 at 3:21 PM Ilya Maximets <i.maximets at ovn.org> wrote:
>
> For some reason /etc/hosts in GHA now contains a plain text line
> like this:
>
>   Note: Don't Delete this file. Also, don't remove this line. ...
>
> This breaks libunbound and makes a series of unit tests to emit
> following warning:
>   |00001|dns_resolve|WARN|Failed to read etc/hosts: syntax error
>
> Working around this issue by removing a bad line from /etc/hosts
> until this fixed properly by GitHub team.  This in combination
> with other fixes should unblock CI.
>
> Bug for virtual-environments:
>   https://github.com/actions/virtual-environments/issues/3353
>
> Signed-off-by: Ilya Maximets <i.maximets at ovn.org>
> ---
>
> Succesful build with this change + previous fix for shinx 4.0:
>   https://github.com/igsilya/ovs/actions/runs/831558418
>
> OVN is also affected, so the same patch could be applied there.
>
>  .github/workflows/build-and-test.yml | 6 ++++++
>  1 file changed, 6 insertions(+)
>
> diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml
> index ce98a9f98..e2350c6d9 100644
> --- a/.github/workflows/build-and-test.yml
> +++ b/.github/workflows/build-and-test.yml
> @@ -113,6 +113,12 @@ jobs:
>      - name: checkout
>        uses: actions/checkout at v2
>
> +    - name: fix up /etc/hosts
> +      # https://github.com/actions/virtual-environments/issues/3353
> +      run:  |
> +        cat /etc/hosts
> +        sudo sed -i "/don't remove this line/d" /etc/hosts || true

I like the irony of deleting this line :-).


This || true is probably not necessary: sed won't complain if this
line is not present in /etc/hosts.
But it won't hurt to have it.


Either way lgtm:
Reviewed-by: David Marchand <david.marchand at redhat.com>


-- 
David Marchand



More information about the dev mailing list