Skip to content
This repository has been archived by the owner on Jan 16, 2025. It is now read-only.

Make script more resilient, lint, fix shellcheck warnings #38

Draft
wants to merge 21 commits into
base: master
Choose a base branch
from

Conversation

runejuhl
Copy link

Hi,

I have a whole bunch of assorted fixes for storhaug in this draft PR. Is that something you'd be interested in merging?

My intention is to make the following changes:

  • fix all shellcheck warnings
  • run with set -euo pipefail (errexit, nounset, pipefail)
  • use ${#var} for counting items in arrays instead of looping over
  • remove uses of eval for creating arrays in favor of declare
  • use find instead of ls

I've marked this PR as draft because it's currently only big PR that both lints/refactors and changes functionality. I'd be happy to split it up into multiple PRs if you'd like.

@ryno83
Copy link
Contributor

ryno83 commented Aug 15, 2019

Great Work,
I wonder if storhaug will still be maintain in next releases of Gluster. See this post on mailing list: https://lists.gluster.org/pipermail/gluster-users/2019-April/036461.html

@kalebskeithley Do you know if storhaug will be replaced?

}
}
EOF

exp_id=$(ls -1 /run/gluster/shared_storage/nfs-ganesha/exports/export.*.conf | wc -l)
exp_id=$(find /run/gluster/shared_storage/nfs-ganesha/exports -name 'export.*.conf' | wc -l)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't test your code but did you think about this issue #26 ?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nope, hadn't looked through the issues. I see that it was just merged, I'll rebase my PR against master.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants