mirror of https://git.dn42.dev/dn42/registry.git
add schema bootstrap
This commit is contained in:
parent
73706cfdce
commit
8efd1feb80
|
@ -0,0 +1,9 @@
|
|||
namespace: dn42
|
||||
schema: schema
|
||||
owner: mntner
|
||||
default-owner: DN42-MNT
|
||||
network-owner: inet6num inet6num
|
||||
network-owner: inet6num route
|
||||
network-owner: inet6num inetnum
|
||||
network-owner: inetnum inetnum
|
||||
network-owner: inetnum route
|
|
@ -3,6 +3,6 @@ remarks: test
|
|||
contact: xmpp:xuu@xmpp.dn42
|
||||
contact: mail:xuu@dn42.us
|
||||
pgp-fingerprint: 20AE2F310A74EA7CEC3AE69F8B3B0604F164E04F
|
||||
nic-hdl: XU0-DN42
|
||||
nic-hdl: XUU-DN42
|
||||
mnt-by: XUU-MNT
|
||||
source: DN42
|
|
@ -18,5 +18,8 @@ key: mnt-routes optional multiple lookup=dn42.mntner
|
|||
key: org optional single lookup=dn42.organisation
|
||||
key: remarks optional multiple
|
||||
key: source required single lookup=dn42.registry
|
||||
network-owner: inet6num
|
||||
network-owner: inetnum
|
||||
network-owner: route6
|
||||
mnt-by: DN42-MNT
|
||||
source: DN42
|
||||
|
|
|
@ -18,5 +18,7 @@ key: mnt-routes optional multiple lookup=dn42.mntner
|
|||
key: org optional single lookup=dn42.organisation
|
||||
key: remarks optional multiple
|
||||
key: source required single lookup=dn42.registry
|
||||
network-owner: inetnum
|
||||
network-owner: route
|
||||
mnt-by: DN42-MNT
|
||||
source: DN42
|
||||
|
|
|
@ -0,0 +1,9 @@
|
|||
schema: NAMESPACE-SCHEMA
|
||||
ref: dn42.schema
|
||||
key: namespace required single primary schema > [name]
|
||||
key: ns-schema required single > [schema]
|
||||
key: ns-owner required single > [schema]
|
||||
key: default-owner optional single lookup=dn42.mntner > [mntner]
|
||||
key: network-owner optional multiple > [parent-schema] [child-schema]
|
||||
mnt-by: DN42-MNT
|
||||
source: DN42
|
|
@ -9,6 +9,7 @@ key: key required multiple > [key-name]
|
|||
key: mnt-by required multiple lookup=dn42.mntner > [mntner]
|
||||
key: remarks optional multiple > [text]...
|
||||
key: source required single lookup=dn42.registry
|
||||
key: network-owner optional multiple > [child-schema]
|
||||
mnt-by: DN42-MNT
|
||||
source: DN42
|
||||
remarks: # option descriptions
|
||||
|
|
|
@ -148,8 +148,8 @@ class FileDOM:
|
|||
@property
|
||||
def schema(self) -> str:
|
||||
"""return the schema name for file"""
|
||||
if len(self.dom) < 0:
|
||||
return "none"
|
||||
if len(self.dom) < 1:
|
||||
return None
|
||||
|
||||
return self.dom[0].key
|
||||
|
||||
|
|
|
@ -62,6 +62,7 @@ def run(path: str = "."):
|
|||
s = schemas.get(dom.rel)
|
||||
if s is None:
|
||||
print(f"{dom.src} schema not found for {dom.rel}")
|
||||
continue
|
||||
|
||||
status = s.check_file(dom, lookups)
|
||||
status.print()
|
||||
|
|
Loading…
Reference in New Issue