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

Refactor ovs_offload_lnw_v2.py (example) #6

Closed
wants to merge 1 commit into from

Conversation

ffoulkes
Copy link
Contributor

Revised ovs_offload_lnw_v2.py to make it easier to read and maintain.

  1. Refactored monolithic main program.

    • Extracted command strings to module level.
    • Extracted subcommand processing to individual functions.
    • Implemented validate_host_password() and print_banner() helper functions.
  2. Corrected some grammar errors.

    • Corrected prepositional verbs in printed messages and comments (e.g. "Setup" -> "Set up").
    • Fixed comma splices in help text.
  3. Did a little reformatting.

    • Ran a Python formatter, whose main effect was to insert spaces before and after plus signs.
    • Wrapped a couple of long comments.

Revised ovs_offload_lnw_v2.py to make it easier to read and
maintain.

1) Refactored monolithic main program.

   - Extracted command strings to module level.

   - Extracted subcommand processing to individual functions.

   - Implemented validate_host_password() and print_banner()
     helper functions.

2) Corrected some grammar errors.

   - Corrected prepositional verbs in printed messages and
     comments (e.g. "Setup" -> "Set up").

   - Fixed comma splices in help text.

3) Did a little reformatting.

   - Ran a Python formatter, whose main effect was to insert
     spaces before and after plus signs.

   - Wrapped a couple of long comments.

Signed-off-by: Derek Foster <[email protected]>
@ffoulkes ffoulkes closed this Oct 28, 2024
@ffoulkes ffoulkes deleted the sample-refactoring branch October 28, 2024 14:41
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.

1 participant