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

get_vlans() method and test getter not present (Napalm < 3.0) #35

Closed
jefvantongerloo opened this issue Jan 20, 2021 · 4 comments
Closed
Assignees

Comments

@jefvantongerloo
Copy link

jefvantongerloo commented Jan 20, 2021

Reference pull request
Add Napalm get_vlans() method #34

**Dependent pull request (solution)
Make compatible with Napalm 3 #30

Issue

  • get_vlans method not available in Napalm base 2.3.1
def get_vlans(self):
        """
        Return structure being spit balled is as follows.
            * vlan_id (int)
                * name (text_type)
                * interfaces (list)

        Example::

            {
                1: {
                    "name": "default",
                    "interfaces": ["GigabitEthernet0/0/1", "GigabitEthernet0/0/2"]
                },
                2: {
                    "name": "vlan2",
                    "interfaces": []
                }
            }
        """
        raise NotImplementedError
  • get_vlans test case not present in Napalm 2.3.1
    @wrap_test_cases
    def test_get_vlans(self, test_case):
        """Test get_vlans."""
        get_vlans = self.device.get_vlans()

        assert len(get_vlans) > 0

        for vlan, vlan_data in get_vlans.items():
            assert helpers.test_model(models.vlan, vlan_data)

        return get_vlans

Tests
get_vlans() tested and confirmed working in Napalm versions:

@jefvantongerloo jefvantongerloo changed the title implement get_vlans() getter get_vlans() method and test getter not present Jan 20, 2021
@jefvantongerloo jefvantongerloo changed the title get_vlans() method and test getter not present get_vlans() method and test getter not present nees Napalm >= 3.0 Jan 20, 2021
@jefvantongerloo jefvantongerloo changed the title get_vlans() method and test getter not present nees Napalm >= 3.0 get_vlans() method and test getter not present (Napalm < 3.0) Jan 20, 2021
@napalmaos
Copy link
Collaborator

Updated the code please help to retest

@jefvantongerloo
Copy link
Author

jefvantongerloo commented Apr 27, 2021

Why did you copy paste code instead of merging this PR?

@napalmaos
Copy link
Collaborator

Thank for your contribution,

Actually, we create the changes with others for testing with our setup, We need to test on all devices platform,

Sorry for inconvenience,

@jefvantongerloo
Copy link
Author

You could pull this PR test and commit your own additions to the fork or test in CI/CD.
Afterwards you can merge the PR.

How is this suppose to be an open-source project where people contribute to improve the napalm-aos library when you just copy paste code. Nevertheless thank you for the Napalm 3.0 compatibility upgrade.

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

No branches or pull requests

2 participants