Skip to content

Conversation

@joewesch
Copy link
Collaborator

Closes: #752

NTC-4804

This PR adds a more robust config example as well as some edge cases for the HP Comware platform and adds a custom parser method to properly parse the different sections.

I also was confused which class to update initially, but then I noticed that the HPComwareConfigParser class wasn't really doing much by itself and was redundant. I consolidated the two classes and then added some deprecation warnings and updated the parser to directly use the HPEConfigParser class.

@itdependsnetworks
Copy link
Contributor

can you add a compliance check here: https://github.com/networktocode/netutils/tree/develop/tests/unit/mock/config/compliance/compliance

I am interested to see how you define the scope of the configs when there is a space at the start of the line, and would ask that we consider how that will work with GC

@joewesch
Copy link
Collaborator Author

can you add a compliance check here: https://github.com/networktocode/netutils/tree/develop/tests/unit/mock/config/compliance/compliance

I am interested to see how you define the scope of the configs when there is a space at the start of the line, and would ask that we consider how that will work with GC

Hmm, ok. In that case I'd probably just lstrip() all config lines without parents.

@itdependsnetworks
Copy link
Contributor

can you add a compliance check here: https://github.com/networktocode/netutils/tree/develop/tests/unit/mock/config/compliance/compliance
I am interested to see how you define the scope of the configs when there is a space at the start of the line, and would ask that we consider how that will work with GC

Hmm, ok. In that case I'd probably just lstrip() all config lines without parents.

That may come with other issues for compliance or remediation. Once you put in a compliance test I will take a look at how it works. Pinging @jeffkala on this as well.

@joewesch
Copy link
Collaborator Author

Ok, I have added the compliance tests as requested.

I have also changed the parser to allow the following to be equivalent so that you don't need to format the intended config in the same manner as the backup config (always separate sections by comments):

vlan 1
#
vlan 101
  name 101
vlan 1
vlan 101
  name 101

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.

hp_comware config parsing with initial space

3 participants