How to use the genie.conf.base.attributes.SubAttributesDict function in genie

To help you get started, we’ve selected a few genie examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github CiscoTestAutomation / genielibs / pkgs / conf-pkg / src / genie / libs / conf / route_policy / route_policy.py View on Github external
def statement_attr(self):
            return SubAttributesDict(self.StatementAttributes, parent=self)
github CiscoTestAutomation / genielibs / pkgs / conf-pkg / src / genie / libs / conf / pim / pim.py View on Github external
def vrf_attr(self):
            return SubAttributesDict(self.VrfAttributes, parent=self)
github CiscoTestAutomation / genielibs / pkgs / conf-pkg / src / genie / libs / conf / lisp / lisp.py View on Github external
def router_instance_attr(self):
            return SubAttributesDict(self.RouterInstanceAttributes, parent=self)
github CiscoTestAutomation / genielibs / pkgs / conf-pkg / src / genie / libs / conf / l2vpn / bridge_domain.py View on Github external
def interface_attr(self):
            return SubAttributesDict(self.InterfaceAttributes, parent=self)
github CiscoTestAutomation / genielibs / pkgs / conf-pkg / src / genie / libs / conf / vrf / vrf.py View on Github external
def __init__(self, *args, **kwargs):
            self.address_family_attr = SubAttributesDict(
                self.AddressFamilyAttributes, parent=self)
            super().__init__(*args, **kwargs)
github CiscoTestAutomation / genielibs / pkgs / conf-pkg / src / genie / libs / conf / lisp / lisp.py View on Github external
def eid_record_subscriber_attr(self):
                        return SubAttributesDict(self.EidRecordSubscriberAttributes, parent=self)
github CiscoTestAutomation / genielibs / pkgs / conf-pkg / src / genie / libs / conf / pim / pim.py View on Github external
def device_attr(self):
        return SubAttributesDict(self.DeviceAttributes, parent=self)
github CiscoTestAutomation / genielibs / pkgs / conf-pkg / src / genie / libs / conf / interface / iosxe / interface.py View on Github external
def path_option_attr(self):
        return SubAttributesDict(self.PathOptionAttributes, parent=self)
github CiscoTestAutomation / genielibs / pkgs / sdk-pkg / src / genie / libs / sdk / libs / utils / normalize.py View on Github external
def _to_dict(conf_obj, value=None):
    ret = {}
    for k, value in conf_obj.__dict__.items():
        # Disregard those, as cannot be compared between
        # run
        base = ConfigurableBase()
        k = base._convert(conf_obj, k)

        if isinstance(value, SubAttributesDict):
            # Its already a dict
            ret[k] = {}
            for k2, v2 in value.items():
                # Loop over the returned conf and substitute the objects with
                # their corresponding values
                k2 = _convert_obj_to_value(k2)
                ret[k][k2] = _to_dict(v2)
        else:
            # Loop over the returned conf and substitute the objects with their
            # corresponding values
            value = _convert_obj_to_value(value)
            ret[k] = value
    return ret