Skip to content

Would like to get rid of "import board" from the file docsis.py #3

@mbanders

Description

@mbanders

The class docsis in this file takes mibs_paths as a parameter, but currently no caller actually does that. I'm willing to change every call to pass in mibs_paths so that we can remove the import board here:

        from devices import board
        if mibs_paths is None and hasattr(board, 'mibs_paths'):
            default = os.path.expandvars('/home/$USER/.snmp/mibs:/usr/share/snmp/mibs:/usr/share/snmp/mibs/iana:/usr/share/snmp/mibs/ietf:/usr/share/mibs/site:/usr/share/snmp/mibs:/usr/share/mibs/iana:/usr/share/mibs/ietf:/usr/share/mibs/netsnmp')
            mibs_path_arg = "-M "  + default

            for mibs_path in board.mibs_paths:
                mibs_path_arg = mibs_path_arg + ":" + mibs_path

            self.mibs_path_arg = mibs_path_arg

Basically we need to avoid importing dynamic things - things that can change.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions