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

Multiple descr attributes duplicates inherited template attributes #4

Open
jalmargyyk opened this issue Oct 10, 2023 · 0 comments · May be fixed by #5
Open

Multiple descr attributes duplicates inherited template attributes #4

jalmargyyk opened this issue Oct 10, 2023 · 0 comments · May be fixed by #5

Comments

@jalmargyyk
Copy link

If a specific customer template has multiple "descr" attributes, the ripe update will fail. The reason for this seems to be duplication of status attribute and other attributes from the inherited base template.

e.g.
templates.json:

{
    "templates":
    {
        "TEST-NET": {
            "attributes": [
                {"descr": "Test Company Ltd."},
                {"descr": "Test road 1234"}
            ],
            "inherit": "base_test_company.json"
        }
    }
}

base_test_company.json:

{ "attributes": [
    {"org": ""},
    {"admin-c": "AA2-TEST"},
    {"tech-c": "AA2-TEST"},
    {"mnt-by": "TEST-NCC-HM-MNT"},
    {"status": "ASSIGNED PA"},
    {"source": "TEST"}
]}

ripe-updater tries to send the following object to ripe db:

{'objects': {'object': [
      {'source': {'id': 'RIPE'
        }, 'attributes': {'attribute': [
            {'name': 'inetnum', 'value': '192.168.0.0 - 192.168.0.255'
            },
            {'name': 'netname', 'value': 'TEST-NET'
            },
            {'name': 'descr', 'value': 'Test Company Ltd.'
            },
            {'name': 'descr', 'value': 'Test road 1234'
            },
            {'name': 'org', 'value': 'ORG-EIPB1-TEST'
            },
            {'name': 'country', 'value': 'FI'
            },
            {'name': 'admin-c', 'value': 'AA2-TEST'
            },
            {'name': 'tech-c', 'value': 'AA2-TEST'
            },
            {'name': 'mnt-by', 'value': 'TEST-NCC-HM-MNT'
            },
            {'name': 'admin-c', 'value': 'AA2-TEST'
            },
            {'name': 'tech-c', 'value': 'AA2-TEST'
            },
            {'name': 'mnt-by', 'value': 'TEST-NCC-HM-MNT'
            },
            {'name': 'status', 'value': 'ASSIGNED PA'
            },
            {'name': 'source', 'value': 'RIPE'
            },
            {'name': 'status', 'value': 'ASSIGNED PA'
            }
          ]
        }
      }
    ]
  }
}
@jalmargyyk jalmargyyk linked a pull request Nov 30, 2023 that will close this issue
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 a pull request may close this issue.

1 participant