Bashate violations in OCF scripts

Bug #1550203 reported by Norbert Illes
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
openstack-resource-agents
Fix Committed
Medium
Norbert Illes

Bug Description

Running bashate check against OCF scripts (tox -e bashate) indicates several violations.

Norbert Illes (nilles)
tags: added: low-hanging-fruit
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to openstack-resource-agents (master)

Reviewed: https://review.openstack.org/285170
Committed: https://git.openstack.org/cgit/openstack/openstack-resource-agents/commit/?id=ad9cefd1d65c36a9d24ba2fe6648b44a73d74a1a
Submitter: Jenkins
Branch: master

commit ad9cefd1d65c36a9d24ba2fe6648b44a73d74a1a
Author: Norbert Illes <email address hidden>
Date: Thu Feb 25 15:32:59 2016 +0100

    Fix bashate E001 violations

    This commit fixes bashate E001 (lines ending with trailing whitespace)
    violations in the OCF scripts.

    Partial-Bug: #1550203
    Change-Id: I9ed3a5012509d85463098b3489641f67cfa69eac
    Signed-off-by: Norbert Illes <email address hidden>

Norbert Illes (nilles)
Changed in openstack-resource-agents:
assignee: nobody → Norbert Illes (nilles)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Reviewed: https://review.openstack.org/285175
Committed: https://git.openstack.org/cgit/openstack/openstack-resource-agents/commit/?id=43973551930266f5b53b71a976fc24bb3c88fefe
Submitter: Jenkins
Branch: master

commit 43973551930266f5b53b71a976fc24bb3c88fefe
Author: Norbert Illes <email address hidden>
Date: Thu Feb 25 16:29:29 2016 +0100

    Fix bashate E002 violations

    This commit fixes bashate E002 (indents are only spaces, and not hard
    tabs) violations

    Partial-Bug: #1550203
    Change-Id: I7d156d47023781be74e6fa8daef6ffc311b55d9d
    Signed-off-by: Norbert Illes <email address hidden>

Revision history for this message
Adam Spiers (adam.spiers) wrote :

We have a problem with E006: https://review.openstack.org/#/c/248253/

I'm not sure what to do about that.

Changed in openstack-resource-agents:
status: New → Confirmed
importance: Undecided → Medium
Revision history for this message
Norbert Illes (nilles) wrote :

Thanks for letting me know!

The patch set you mentioned has a comment on it (along with a -1) from Ian Wienand. He has a merged patch set to ignore the heredoc contents: https://review.openstack.org/#/c/237429/ (BTW, I absolutely agree whit that)
As far as I can see, currently we only have E006 false-positives in heredoc sections, but after I've applied the above patch set,
the false-positives are gone.

So I think, a way forward with E006 can be to fix the issues, but exclude the errors in heredocs. Then temporarily modify tox.ini to run bashate with "--ignore E006" until a new bashate version released with Ian's patch.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to openstack-resource-agents (master)

Fix proposed to branch: master
Review: https://review.openstack.org/285662

Changed in openstack-resource-agents:
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to openstack-resource-agents (master)

Reviewed: https://review.openstack.org/285662
Committed: https://git.openstack.org/cgit/openstack/openstack-resource-agents/commit/?id=173a77cec8d13975dcf9ca6869553944d0959b2e
Submitter: Jenkins
Branch: master

commit 173a77cec8d13975dcf9ca6869553944d0959b2e
Author: Norbert Illes <email address hidden>
Date: Fri Feb 26 15:08:37 2016 +0100

    Fix bashate E003 violations

    This commit fixes bashate E003 (indents are a multiple of 4 spaces)
    violations in the OCF scripts.

    Partial-Bug: #1550203
    Change-Id: I6fbc935bd5f9b383ca97c45f2dd89d7d33a5780f
    Signed-off-by: Norbert Illes <email address hidden>

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Reviewed: https://review.openstack.org/285683
Committed: https://git.openstack.org/cgit/openstack/openstack-resource-agents/commit/?id=1d019f5f739deab0e715d74a21eca5a929e04da1
Submitter: Jenkins
Branch: master

commit 1d019f5f739deab0e715d74a21eca5a929e04da1
Author: Adam Spiers <email address hidden>
Date: Sat Feb 27 14:06:26 2016 +0000

    Fix bashate E010 violation

    This commit fixes a bashate E010 violation:

    [E] E010: The "do" should be on same line as for: ' for i in `ps -o pid --no-headers --ppid $pid`'
     - /home/adam/SUSE/cloud/OpenStack/git/openstack-resource-agents/ocf/cinder-volume : L219

    Change-Id: I25b6e05336b1679818ad6f876bf94679a6d5ac10
    Partial-Bug: #1550203
    Signed-off-by: Adam Spiers <email address hidden>

Revision history for this message
Adam Spiers (adam.spiers) wrote :

When checking with latest bashate from git, now we only see a bunch of E006 non-heredoc violations which should easy to fix. So we're getting closer to a point when we can configure Jenkins to run bashate as CI.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to openstack-resource-agents (master)

Fix proposed to branch: master
Review: https://review.openstack.org/286231

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to openstack-resource-agents (master)

Reviewed: https://review.openstack.org/286231
Committed: https://git.openstack.org/cgit/openstack/openstack-resource-agents/commit/?id=98a54ad759ea4d22dec58b1955af0ef56bb5a29b
Submitter: Jenkins
Branch: master

commit 98a54ad759ea4d22dec58b1955af0ef56bb5a29b
Author: Norbert Illes <email address hidden>
Date: Mon Feb 29 13:08:26 2016 +0100

    Fix bashate E006 violations

    This commit fixes bashate E006 (lines longer than 79 columns) violations
    in the OCF scripts.

    Partial-Bug: #1550203
    Change-Id: Ic208477b2299697a03b641f8272a0946c897fb3e
    Signed-off-by: Norbert Illes <email address hidden>

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to openstack-resource-agents (master)

Fix proposed to branch: master
Review: https://review.openstack.org/288863

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to openstack-resource-agents (master)

Reviewed: https://review.openstack.org/288863
Committed: https://git.openstack.org/cgit/openstack/openstack-resource-agents/commit/?id=fa93525ceab1fcb6133d3a8dd7e33ddce7a089fb
Submitter: Jenkins
Branch: master

commit fa93525ceab1fcb6133d3a8dd7e33ddce7a089fb
Author: Norbert Illes <email address hidden>
Date: Sat Mar 5 09:48:12 2016 +0100

    Temporary ignore bashate E006 errors

    The currently available bashate releases are considering heredocs as
    normal code lines, hence lines longer than 79 columns in these sections
    are also considered as E006 violations. As the OCF scripts are
    containing lots of heredocs, we are affected by this behaviour.
    However, there is a commit in the bashate repository (649c7dc79948)
    which modifies bashate to ignore long lines in heredocs.

    Currently there is no bashate release which contains the above commit,
    so we ignore E006 errors until a new bashate released.

    Change-Id: I33a9737ce1ec7eddab0b24ddedefe5c17da03b7a
    Partial-Bug: #1550203
    Signed-off-by: Norbert Illes <email address hidden>

Revision history for this message
Adam Spiers (adam.spiers) wrote :

I think we can resolve this bug now, right?

Revision history for this message
Norbert Illes (nilles) wrote :

Yes, I think we can.

Changed in openstack-resource-agents:
status: In Progress → Fix Committed
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.