Skip to content

Fixed pylint issue from common directory #3016

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

Merged
merged 14 commits into from
Jun 10, 2025

Conversation

youngjae-hur7
Copy link

@youngjae-hur7 youngjae-hur7 commented Jun 3, 2025

Issues Resolved by this Pull Request

Please be sure to associate your pull request with one or more open issues. Use the word Fixes as well as a hashtag (#) prior to the issue number in order to automatically resolve associated issues (e.g., Fixes #100).

Fixes #

Description of the Solution

Please describe the solution provided and how it resolves the associated issues.

  1. Fixed pylint issues from the common directory

Suggested Reviewers

If you wish to suggest specific reviewers for this solution, please include them in this section. Be sure to include the @ before the GitHub username.
@abhishek-sa1
@priti-parate

@Omnia-svc
Copy link
Collaborator

Can one of the admins verify this patch?

@youngjae-hur7 youngjae-hur7 marked this pull request as ready for review June 9, 2025 13:45
def create_connection():
"""
Create a database connection to the omniadb.

This function establishes a connection to the omniadb database using the provided password.
It reads the encrypted password from a file, decrypts it using the provided key, and connects to the database.
It reads the encrypted password from a file,
decrypts it using the provided key, and connects to the database.

Choose a reason for hiding this comment

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

Is there a reason in all the comment blocks there is an additional indent for longer lines? It reads a little weird to have an extra indent.

Copy link
Author

Choose a reason for hiding this comment

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

I agree. pylint only gives us 100 spaces for each line. It's kinda a tradeoff beween whether we sacrifice readability or improve the pylint score, and I chose the later option

@@ -160,7 +198,8 @@ def get_data_from_db(db='omniadb', table_name='cluster.nodeinfo', filter_dict={}
"""
conn = get_db_connection(db)
cursor = conn.cursor(cursor_factory=DictCursor)

if filter_dict is None:

Choose a reason for hiding this comment

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

Why add this, instead of having it default to an empty dict like it originally was?

Copy link
Author

Choose a reason for hiding this comment

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

yea unfortunately pylint complains about the filter_dict={} as an argument. so I've updated it as filter_dict=None and checks for the None case in the line 201 because as Suman commented above in this PR, there are some cases that filter_dict aren't None

else:
message = f"Unsupported file: {input_file_path, data}"
logger.error(message)
# else:

Choose a reason for hiding this comment

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

Remove the comment #else:

Copy link
Author

Choose a reason for hiding this comment

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

fixed

@@ -284,65 +288,72 @@ def validate_vip_address(
service_node_vip,
admin_network,
admin_netmaskbits,
oim_admin_ip
oim_admin_ip,
Copy link

@Coleman-Trader Coleman-Trader Jun 10, 2025

Choose a reason for hiding this comment

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

There seems to be a trailing comma for all functions in this file?

Copy link
Author

Choose a reason for hiding this comment

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

what a hawk eyes! thanks Coleman! fixed

groups[group].get(parent, None)
):
# If parent is not empty and group is associated with login,
# compiler_node, service_node, kube_control_plane,

Choose a reason for hiding this comment

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

Extra space in this comment.

@abhishek-sa1
Copy link
Collaborator

run omnia-checkers

@abhishek-sa1
Copy link
Collaborator

run omnia-checkers

@abhishek-sa1 abhishek-sa1 merged commit 88e3457 into dell:pub/new_arch_pylint Jun 10, 2025
3 checks passed
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.

6 participants