Example #1
0
                        def _common_path(self):
                            if self.parent is None:
                                raise YPYDataValidationError('parent is not set . Cannot derive path.')
                            if self.backbone_name is None:
                                raise YPYDataValidationError('Key property backbone_name is None')

                            return self.parent._common_path +'/Cisco-IOS-XR-rgmgr-cfg:backbone[Cisco-IOS-XR-rgmgr-cfg:backbone-name = ' + str(self.backbone_name) + ']'
Example #2
0
                            def _common_path(self):
                                if self.parent is None:
                                    raise YPYDataValidationError('parent is not set . Cannot derive path.')
                                if self.statistic_name is None:
                                    raise YPYDataValidationError('Key property statistic_name is None')

                                return self.parent._common_path +'/Cisco-IOS-XR-ethernet-cfm-cfg:statistic[Cisco-IOS-XR-ethernet-cfm-cfg:statistic-name = ' + str(self.statistic_name) + ']'
Example #3
0
                            def _common_path(self):
                                if self.parent is None:
                                    raise YPYDataValidationError('parent is not set . Cannot derive path.')
                                if self.interface_name is None:
                                    raise YPYDataValidationError('Key property interface_name is None')

                                return self.parent._common_path +'/Cisco-IOS-XR-ip-pfilter-oper:interface[Cisco-IOS-XR-ip-pfilter-oper:interface-name = ' + str(self.interface_name) + ']'
Example #4
0
def modify_member_meta(full_name, deviation_table, member):
    """ Return modified member meta """
    deviation_typ = deviation_table[full_name]['deviation_typ']
    if deviation_typ == 'not_supported':
        return None
    key_vals = deviation_table[full_name]['keyword_value']
    for key, val in key_vals:
        if key == 'config':
            # ignore config change
            raise YPYDataValidationError("Ignore config change at the moment")
        if key == 'type' and deviation_typ == 'replace':
            # should only appear once per deviation
            member = val
            break
        if deviation_typ in ('add', 'replace'):
            try:
                setattr(member, '_%s' % key, val)
            except:
                raise YPYDataValidationError("Key {} not found in {}".format(
                    member.presentation_name))
        elif key != 'default':
            # TODO: other keyword not necessary to modify in client side
            try:
                delattr(member, '_%s' % key)
            except:
                raise YPYDataValidationError("Key {} not found in {}".format(
                    member.presentation_name))
    return member
Example #5
0
            def _common_path(self):
                if self.parent is None:
                    raise YPYDataValidationError('parent is not set . Cannot derive path.')
                if self.name is None:
                    raise YPYDataValidationError('Key property name is None')

                return self.parent._common_path +'/ietf-netconf-acm:rule[ietf-netconf-acm:name = ' + str(self.name) + ']'
                        def _common_path(self):
                            if self.parent is None:
                                raise YPYDataValidationError('parent is not set . Cannot derive path.')
                            if self.name is None:
                                raise YPYDataValidationError('Key property name is None')

                            return self.parent._common_path +'/Cisco-IOS-XR-tty-server-cfg:user-group[Cisco-IOS-XR-tty-server-cfg:name = ' + str(self.name) + ']'
Example #7
0
                        def _common_path(self):
                            if self.parent is None:
                                raise YPYDataValidationError('parent is not set . Cannot derive path.')
                            if self.neighbor_address is None:
                                raise YPYDataValidationError('Key property neighbor_address is None')

                            return self.parent._common_path +'/Cisco-IOS-XR-rgmgr-cfg:member[Cisco-IOS-XR-rgmgr-cfg:neighbor-address = ' + str(self.neighbor_address) + ']'
                def _common_path(self):
                    if self.parent is None:
                        raise YPYDataValidationError(
                            'parent is not set . Cannot derive path.')
                    if self.id is None:
                        raise YPYDataValidationError('Key property id is None')

                    return self.parent._common_path + '/Cisco-IOS-XR-ip-iep-cfg:identifier[Cisco-IOS-XR-ip-iep-cfg:id = ' + str(
                        self.id) + ']'
                    def _common_path(self):
                        if self.parent is None:
                            raise YPYDataValidationError(
                                'parent is not set . Cannot derive path.')
                        if self.host_name is None:
                            raise YPYDataValidationError(
                                'Key property host_name is None')

                        return self.parent._common_path + '/Cisco-IOS-XR-ip-domain-oper:host[Cisco-IOS-XR-ip-domain-oper:host-name = ' + str(
                            self.host_name) + ']'
                        def _common_path(self):
                            if self.parent is None:
                                raise YPYDataValidationError(
                                    'parent is not set . Cannot derive path.')
                            if self.prefix_string is None:
                                raise YPYDataValidationError(
                                    'Key property prefix_string is None')

                            return self.parent._common_path + '/Cisco-IOS-XR-ipv4-arp-cfg:peer[Cisco-IOS-XR-ipv4-arp-cfg:prefix-string = ' + str(
                                self.prefix_string) + ']'
                    def _common_path(self):
                        if self.parent is None:
                            raise YPYDataValidationError(
                                'parent is not set . Cannot derive path.')
                        if self.local_label_id is None:
                            raise YPYDataValidationError(
                                'Key property local_label_id is None')

                        return self.parent._common_path + '/Cisco-IOS-XR-mpls-static-oper:local-label[Cisco-IOS-XR-mpls-static-oper:local-label-id = ' + str(
                            self.local_label_id) + ']'
Example #12
0
                        def _common_path(self):
                            if self.parent is None:
                                raise YPYDataValidationError(
                                    'parent is not set . Cannot derive path.')
                            if self.index_number is None:
                                raise YPYDataValidationError(
                                    'Key property index_number is None')

                            return self.parent._common_path + '/Cisco-IOS-XR-ip-iep-cfg:hop[Cisco-IOS-XR-ip-iep-cfg:index-number = ' + str(
                                self.index_number) + ']'
                    def _common_path(self):
                        if self.parent is None:
                            raise YPYDataValidationError(
                                'parent is not set . Cannot derive path.')
                        if self.rcmd_priority is None:
                            raise YPYDataValidationError(
                                'Key property rcmd_priority is None')

                        return self.parent._common_path + '/Cisco-IOS-XR-infra-rcmd-cfg:priority[Cisco-IOS-XR-infra-rcmd-cfg:rcmd-priority = ' + str(
                            self.rcmd_priority) + ']'
                def _common_path(self):
                    if self.parent is None:
                        raise YPYDataValidationError(
                            'parent is not set . Cannot derive path.')
                    if self.slice_id is None:
                        raise YPYDataValidationError(
                            'Key property slice_id is None')

                    return self.parent._common_path + '/Cisco-IOS-XR-ncs1k-mxp-cfg:value[Cisco-IOS-XR-ncs1k-mxp-cfg:slice-id = ' + str(
                        self.slice_id) + ']'
Example #15
0
                    def _common_path(self):
                        if self.parent is None:
                            raise YPYDataValidationError(
                                'parent is not set . Cannot derive path.')
                        if self.name is None:
                            raise YPYDataValidationError(
                                'Key property name is None')

                        return self.parent._common_path + '/Cisco-IOS-XR-aaa-locald-admin-cfg:usergroup-under-username[Cisco-IOS-XR-aaa-locald-admin-cfg:name = ' + str(
                            self.name) + ']'
                def _common_path(self):
                    if self.parent is None:
                        raise YPYDataValidationError(
                            'parent is not set . Cannot derive path.')
                    if self.address is None:
                        raise YPYDataValidationError(
                            'Key property address is None')

                    return self.parent._common_path + '/Cisco-IOS-XR-ipv4-arp-cfg:entry[Cisco-IOS-XR-ipv4-arp-cfg:address = ' + str(
                        self.address) + ']'
Example #17
0
                def _common_path(self):
                    if self.parent is None:
                        raise YPYDataValidationError(
                            'parent is not set . Cannot derive path.')
                    if self.name is None:
                        raise YPYDataValidationError(
                            'Key property name is None')

                    return self.parent._common_path + '/openconfig-inventory:subcomponent[openconfig-inventory:name = ' + str(
                        self.name) + ']'
                    def _common_path(self):
                        if self.parent is None:
                            raise YPYDataValidationError(
                                'parent is not set . Cannot derive path.')
                        if self.job_id is None:
                            raise YPYDataValidationError(
                                'Key property job_id is None')

                        return self.parent._common_path + '/Cisco-IOS-XR-procmem-oper:job-id[Cisco-IOS-XR-procmem-oper:job-id = ' + str(
                            self.job_id) + ']'
Example #19
0
                    def _common_path(self):
                        if self.parent is None:
                            raise YPYDataValidationError(
                                'parent is not set . Cannot derive path.')
                        if self.name is None:
                            raise YPYDataValidationError(
                                'Key property name is None')

                        return self.parent._common_path + '/Cisco-IOS-XR-cmproxy-oper:node-entry[Cisco-IOS-XR-cmproxy-oper:name = ' + str(
                            self.name) + ']'
Example #20
0
            def _common_path(self):
                if self.neighbor_address is None:
                    raise YPYDataValidationError(
                        'Key property neighbor_address is None')
                if self.interface_name is None:
                    raise YPYDataValidationError(
                        'Key property interface_name is None')

                return '/Cisco-IOS-XR-ipv6-nd-cfg:ipv6-neighbor/Cisco-IOS-XR-ipv6-nd-cfg:neighbors/Cisco-IOS-XR-ipv6-nd-cfg:neighbor[Cisco-IOS-XR-ipv6-nd-cfg:neighbor-address = ' + str(
                    self.neighbor_address
                ) + '][Cisco-IOS-XR-ipv6-nd-cfg:interface-name = ' + str(
                    self.interface_name) + ']'
                    def _common_path(self):
                        if self.parent is None:
                            raise YPYDataValidationError(
                                'parent is not set . Cannot derive path.')
                        if self.order is None:
                            raise YPYDataValidationError(
                                'Key property order is None')
                        if self.server_address is None:
                            raise YPYDataValidationError(
                                'Key property server_address is None')

                        return self.parent._common_path + '/Cisco-IOS-XR-ip-domain-cfg:server[Cisco-IOS-XR-ip-domain-cfg:order = ' + str(
                            self.order
                        ) + '][Cisco-IOS-XR-ip-domain-cfg:server-address = ' + str(
                            self.server_address) + ']'
            def _common_path(self):
                if self.node_id is None:
                    raise YPYDataValidationError(
                        'Key property node_id is None')

                return '/Cisco-IOS-XR-infra-rmf-oper:redundancy/Cisco-IOS-XR-infra-rmf-oper:nodes/Cisco-IOS-XR-infra-rmf-oper:node[Cisco-IOS-XR-infra-rmf-oper:node-id = ' + str(
                    self.node_id) + ']'
            def _common_path(self):
                if self.node_name is None:
                    raise YPYDataValidationError(
                        'Key property node_name is None')

                return '/Cisco-IOS-XR-procmem-oper:processes-memory/Cisco-IOS-XR-procmem-oper:nodes/Cisco-IOS-XR-procmem-oper:node[Cisco-IOS-XR-procmem-oper:node-name = ' + str(
                    self.node_name) + ']'
Example #24
0
            def _common_path(self):
                if self.location is None:
                    raise YPYDataValidationError(
                        'Key property location is None')

                return '/Cisco-IOS-XR-ip-bfd-cfg:bfd/Cisco-IOS-XR-ip-bfd-cfg:multi-path-includes/Cisco-IOS-XR-ip-bfd-cfg:multi-path-include[Cisco-IOS-XR-ip-bfd-cfg:location = ' + str(
                    self.location) + ']'
Example #25
0
            def _common_path(self):
                if self.interface_name is None:
                    raise YPYDataValidationError(
                        'Key property interface_name is None')

                return '/Cisco-IOS-XR-ip-bfd-cfg:bfd/Cisco-IOS-XR-ip-bfd-cfg:interfaces/Cisco-IOS-XR-ip-bfd-cfg:interface[Cisco-IOS-XR-ip-bfd-cfg:interface-name = ' + str(
                    self.interface_name) + ']'
            def _common_path(self):
                if self.node_name is None:
                    raise YPYDataValidationError(
                        'Key property node_name is None')

                return '/Cisco-IOS-XR-nto-misc-oper:memory-summary/Cisco-IOS-XR-nto-misc-oper:nodes/Cisco-IOS-XR-nto-misc-oper:node[Cisco-IOS-XR-nto-misc-oper:node-name = ' + str(
                    self.node_name) + ']'
                def _common_path(self):
                    if self.group_id is None:
                        raise YPYDataValidationError(
                            'Key property group_id is None')

                    return '/Cisco-IOS-XR-ipv4-arp-cfg:arp-redundancy/Cisco-IOS-XR-ipv4-arp-cfg:redundancy/Cisco-IOS-XR-ipv4-arp-cfg:groups/Cisco-IOS-XR-ipv4-arp-cfg:group[Cisco-IOS-XR-ipv4-arp-cfg:group-id = ' + str(
                        self.group_id) + ']'
Example #28
0
            def _common_path(self):
                if self.identifier_id is None:
                    raise YPYDataValidationError(
                        'Key property identifier_id is None')

                return '/Cisco-IOS-XR-ip-iep-oper:explicit-paths/Cisco-IOS-XR-ip-iep-oper:identifiers/Cisco-IOS-XR-ip-iep-oper:identifier[Cisco-IOS-XR-ip-iep-oper:identifier-id = ' + str(
                    self.identifier_id) + ']'
            def _common_path(self):
                if self.vrf_name is None:
                    raise YPYDataValidationError(
                        'Key property vrf_name is None')

                return '/Cisco-IOS-XR-ip-domain-oper:ip-domain/Cisco-IOS-XR-ip-domain-oper:vrfs/Cisco-IOS-XR-ip-domain-oper:vrf[Cisco-IOS-XR-ip-domain-oper:vrf-name = ' + str(
                    self.vrf_name) + ']'
Example #30
0
            def _common_path(self):
                if self.path_name is None:
                    raise YPYDataValidationError(
                        'Key property path_name is None')

                return '/Cisco-IOS-XR-ip-iep-oper:explicit-paths/Cisco-IOS-XR-ip-iep-oper:names/Cisco-IOS-XR-ip-iep-oper:name[Cisco-IOS-XR-ip-iep-oper:path-name = ' + str(
                    self.path_name) + ']'