Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: check list range to avoid exception #3576

Merged
merged 1 commit into from
Nov 3, 2022
Merged

fix: check list range to avoid exception #3576

merged 1 commit into from
Nov 3, 2022

Conversation

takayuki-nagata
Copy link
Contributor

Signed-off-by: Takayuki Nagata [email protected]

All Pull Requests:

Check all that apply:

  • Have you followed the guidelines in our Contributing document, including the instructions about commit messages?
  • Is this PR to correct an issue?
  • Is this PR an enhancement?

Complete Description of Additions/Changes:

pcs config shows empty Corosync Nodes on pacemaker remote nodes, and data[in_line] has an empty list. This fix checks the range before accessing data[in_line][0]. Without this fix, an exception is raised.

insights/parsers/pcs_config.py Outdated Show resolved Hide resolved
pcs config shows empty "Corosync Nodes" on pacemaker remote nodes, and
data[in_line] has an empty list. This fix checks the range before
accessing data[in_line][0]. Without this fix, an exception is raised.

Signed-off-by: Takayuki Nagata <[email protected]>
Copy link
Contributor

@ryan-blakley ryan-blakley left a comment

Choose a reason for hiding this comment

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

Looks good to me.

@psachin psachin merged commit f5fb7ba into RedHatInsights:master Nov 3, 2022
psachin pushed a commit that referenced this pull request Nov 3, 2022
pcs config shows empty "Corosync Nodes" on pacemaker remote nodes, and
data[in_line] has an empty list. This fix checks the range before
accessing data[in_line][0]. Without this fix, an exception is raised.

Signed-off-by: Takayuki Nagata <[email protected]>

Signed-off-by: Takayuki Nagata <[email protected]>
(cherry picked from commit f5fb7ba)
xiangce pushed a commit that referenced this pull request Sep 6, 2024
pcs config shows empty "Corosync Nodes" on pacemaker remote nodes, and
data[in_line] has an empty list. This fix checks the range before
accessing data[in_line][0]. Without this fix, an exception is raised.

Signed-off-by: Takayuki Nagata <[email protected]>

Signed-off-by: Takayuki Nagata <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants