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

Add HP Comware config parser #467

Merged

Conversation

bintangf
Copy link
Contributor

@bintangf bintangf commented Feb 26, 2024

  • test: ✅ Add HP Comware config parser

  • test: ✅ Add HP Comware parser tests

  • test: ✅ Add HP Comware compliance tests

rule 2 permit source 10.180.50.0 0.0.0.127 destination 10.1.4.62 0
rule 3 permit source 10.180.50.0 0.0.0.127 destination 10.2.4.62 0
#
header motd #
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you add

  • a one line motd
  • A non-compliant banner

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

test: ✅ Add non-compliant banner test

Copy link
Contributor

Choose a reason for hiding this comment

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

sometimes 1 banner line is like

header motd "my banner"

Which doesn't have the same delimiters, trying to verify that as well.

Copy link

Choose a reason for hiding this comment

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

Hi @itdependsnetworks ,

I want to make sure about CiscoConfigParser banner parser.
I saw that the delimiter was set statically: _, delimeter, banner = config_line.partition("^C")

Is the IOSConfigParser supported whenever the banner is delimited using $ or # instead of ^C?

Because, I have difficulties to dynamically get HP delimiter, and want to set the partition parameter with #.
So I can support the single/multiline banner with # delimiter only. (like Cisco using ^C)

Copy link

Choose a reason for hiding this comment

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

nvm :)
solved by making build_banner without inherit the super class

Choose a reason for hiding this comment

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

Hi @itdependsnetworks,
Instead of handling multiline banner, we also finished handle the singleline banner as your suggest above.

I wanted to let you know that I handle two types of delimiter:

  1. caret_c ^C - for example:
    header motd ^CThis is a single line banner^C
  2. Single delimiter - for example:
    header motd "This is a single line banner", or
    header motd #This is a single line banner#

My colleague @bintangf will be responsible for creating the unit testing, as well as the MR.
Please let us know if you have any additional input other than the single-line banner above.

Best regards,

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have added more commits about single-line banners and banners with different delimiters.

@jeffkala
Copy link
Collaborator

I'm good with this, just need the conflicts resolved.

@itdependsnetworks itdependsnetworks merged commit 5df7f31 into networktocode:develop Mar 28, 2024
19 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.

None yet

4 participants