netdb-client-lib issueshttps://git.scc.kit.edu/scc-net/netvs/netdb-client-lib/-/issues2024-02-16T15:01:10+01:00https://git.scc.kit.edu/scc-net/netvs/netdb-client-lib/-/issues/12Migration to gitlab.kit.edu done?2024-02-16T15:01:10+01:00uv7044Migration to gitlab.kit.edu done?Hi all,
has this project been migrated to gitlab.kit.edu already? If so, what is the new URL? I'd like to know that so our confogiration management will find it.
Ciao,
Xavier.
/cc [Nico]( @qn7750 )Hi all,
has this project been migrated to gitlab.kit.edu already? If so, what is the new URL? I'd like to know that so our confogiration management will find it.
Ciao,
Xavier.
/cc [Nico]( @qn7750 )https://git.scc.kit.edu/scc-net/netvs/netdb-client-lib/-/issues/11netdb-client-lib v3.2 fails to list reserved IPv6 addresses for subnet2023-07-23T23:24:30+02:00uv7044netdb-client-lib v3.2 fails to list reserved IPv6 addresses for subnetHi,
following the announcement of the release of NetDB WebAPI 4.0, I validated that our use-cases are still functional with it and found one operation broken: Listing reserved IPv6 addresses of a given subnet.
```
Python 3.8.14 (default...Hi,
following the announcement of the release of NetDB WebAPI 4.0, I validated that our use-cases are still functional with it and found one operation broken: Listing reserved IPv6 addresses of a given subnet.
```
Python 3.8.14 (default, Sep 19 2022, 09:47:48)
[GCC 9.1.1 20190605 (Red Hat 9.1.1-2)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import netdb_client
>>> import netdb_client.dns
>>> api = netdb_client.APISession(
... netdb_client.APIEndpoint(
... base_url='api.netdb-devel.scc.kit.edu',
... debug=True,
... endpoint=None,
... token='4230.ey...T44'
... )
... )
>>> netdb_client.dns.IpAddr.list(api, value_cidr_old='2a00:139c:2:579::/64', is_reserved_old=True)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/opt/rh/rh-python38/root/usr/local/lib/python3.8/site-packages/netdb_client/dns.py", line 735, in list
return [cls(**s) for s in res.json()[0]]
File "/opt/rh/rh-python38/root/usr/local/lib/python3.8/site-packages/netdb_client/dns.py", line 735, in <listcomp>
return [cls(**s) for s in res.json()[0]]
TypeError: __init__() missing 1 required positional argument: 'is_dhcp_unique'
```
As far as I can tell, there is no version 4.0 of `netdb-client-lib`, so this was done with the latest 3.2.
/cc @domrim, @klara.mall, @xe4704gq3345rainer.steinmueller@kit.edugq3345rainer.steinmueller@kit.eduhttps://git.scc.kit.edu/scc-net/netvs/netdb-client-lib/-/issues/10`wapi.DataType.list()` fails with ValueError: 'text_length' of incorrect type...2022-11-05T13:07:28+01:00qe7761`wapi.DataType.list()` fails with ValueError: 'text_length' of incorrect type. Expected int, got <class 'NoneType'>Apparently the wapi/datatype/list endpoint returns datatypes with a text_length field set to `None`. This leads to a failing type check in wapi.DataType.
Code to reproduce:
```python
import netdb_client.util
import netdb_client.api32 as...Apparently the wapi/datatype/list endpoint returns datatypes with a text_length field set to `None`. This leads to a failing type check in wapi.DataType.
Code to reproduce:
```python
import netdb_client.util
import netdb_client.api32 as api
import netdb_client.api32.wapi as wapi
from pprint import pprint
if __name__ == "__main__":
parser = netdb_client.util.ArgumentParser()
args = parser.parse_args()
endpoint = api.APIEndpoint(**vars(args))
session = api.APISession(endpoint)
ta = [wapi.DataType.list_ta()]
result = session.execute_ta(ta)
pprint(result)
result2 = wapi.DataType.list(session)
pprint(result2)
```
This gives me the following output from the prod database:
```
<...>
{'description': 'unsigned time interval',
'format_literal': None,
'json_name': 'string',
'name': 'intervalu',
'operator_list': [],
'text_length': None},
{'description': 'UUID',
'format_literal': None,
'json_name': 'string',
'name': 'uuid',
'operator_list': ['uuid_eq', 'uuid_gt', 'uuid_lt', 'uuid_range'],
'text_length': None}]]
Traceback (most recent call last):
File "/home/jo/KIT/netdoc-doc/netdocdoc/__main__.py", line 18, in <module>
result2 = wapi.DataType.list(session)
File "/home/jo/KIT/netdoc-doc/venv/lib/python3.10/site-packages/netdb_client/api32/wapi.py", line 365, in list
return [cls(**s) for s in res.json()[0]]
File "/home/jo/KIT/netdoc-doc/venv/lib/python3.10/site-packages/netdb_client/api32/wapi.py", line 365, in <listcomp>
return [cls(**s) for s in res.json()[0]]
File "<string>", line 9, in __init__
File "/home/jo/KIT/netdoc-doc/venv/lib/python3.10/site-packages/netdb_client/api32/wapi.py", line 323, in __post_init__
raise ValueError(f"'text_length' of incorrect type. Expected int, got {type(self.text_length)}")
ValueError: 'text_length' of incorrect type. Expected int, got <class 'NoneType'>
```
This was tested against the current netdb_client from the nightly build artifacts.gq3345rainer.steinmueller@kit.edugq3345rainer.steinmueller@kit.eduhttps://git.scc.kit.edu/scc-net/netvs/netdb-client-lib/-/issues/9Wiki-Example Link in README existiert nicht2023-01-09T19:37:42+01:00qe7761Wiki-Example Link in README existiert nichthttps://git.scc.kit.edu/scc-net/netvs/netdb-client-lib/-/blob/master/README.md?plain=1#L80 führt ins leere. Gabs das mal? Hat sich der Link evtl geändert?https://git.scc.kit.edu/scc-net/netvs/netdb-client-lib/-/blob/master/README.md?plain=1#L80 führt ins leere. Gabs das mal? Hat sich der Link evtl geändert?https://git.scc.kit.edu/scc-net/netvs/netdb-client-lib/-/issues/8Unnecessary imports?2022-08-17T18:56:22+02:00sg7149Unnecessary imports?Hello,
when we installed this library, we saw that argparse is being installed though argparse is part of Python for a long time (3.3). Does it make sense to explicitly depend on that package even for mainline-supported Python versions?...Hello,
when we installed this library, we saw that argparse is being installed though argparse is part of Python for a long time (3.3). Does it make sense to explicitly depend on that package even for mainline-supported Python versions?
I'm asking, because it is another dependency one has to take care of, e.g. when maintaining debian package builds.https://git.scc.kit.edu/scc-net/netvs/netdb-client-lib/-/issues/7Documentation2022-06-08T17:08:42+02:00ha2931dominik.rimpf@kit.eduDocumentationwe should document the new subpackages for api versionswe should document the new subpackages for api versionshttps://git.scc.kit.edu/scc-net/netvs/netdb-client-lib/-/issues/6current stable break,- not install even2022-02-04T16:11:19+01:00wm8650current stable break,- not install evenPlease update the current stable to the build master.
Setup breaks at all. Tested on python 3.10 with own even.Please update the current stable to the build master.
Setup breaks at all. Tested on python 3.10 with own even.https://git.scc.kit.edu/scc-net/netvs/netdb-client-lib/-/issues/5Download / __init__.py2020-11-30T16:20:03+01:00zm6441andreas.ley@kit.eduDownload / __init__.pyWenn ich auf https://git.scc.kit.edu/scc-net/netvs/netdb-client-lib/ gehe und auf Download (die F5 hat natürlich kein pip), bekomme ich ein Archiv, in dem die netdb_client/__init__.py 0 Bytes groß ist - da vermutete ich die eigentliche I...Wenn ich auf https://git.scc.kit.edu/scc-net/netvs/netdb-client-lib/ gehe und auf Download (die F5 hat natürlich kein pip), bekomme ich ein Archiv, in dem die netdb_client/__init__.py 0 Bytes groß ist - da vermutete ich die eigentliche Implementierung... mache/denke ich da was falsch?https://git.scc.kit.edu/scc-net/netvs/netdb-client-lib/-/issues/4util.py / docstring2020-11-30T15:26:23+01:00zm6441andreas.ley@kit.eduutil.py / docstringIch sollte doch typos in Quellcode korrigieren 😆
"""Mapping function to convert list of dicts to an mapping with value as key for each dict (1 to 1 Mapping). Returns an generator object."""
"an" steht nur vor Selbstlauten. Es heißt "...Ich sollte doch typos in Quellcode korrigieren 😆
"""Mapping function to convert list of dicts to an mapping with value as key for each dict (1 to 1 Mapping). Returns an generator object."""
"an" steht nur vor Selbstlauten. Es heißt "a mapping" und "a generator" 😉https://git.scc.kit.edu/scc-net/netvs/netdb-client-lib/-/issues/3README.md / Path2020-11-30T15:26:36+01:00zm6441andreas.ley@kit.eduREADME.md / PathProject 'scc-net/net-suite/netdb-client-lib' was moved to 'scc-net/netvs/netdb-client-lib'. Please update any links and bookmarks that may still have the old path.Project 'scc-net/net-suite/netdb-client-lib' was moved to 'scc-net/netvs/netdb-client-lib'. Please update any links and bookmarks that may still have the old path.https://git.scc.kit.edu/scc-net/netvs/netdb-client-lib/-/issues/2Fehlerausgabe: pretty print2022-02-25T22:36:59+01:00iv4011benedikt.neuffer@kit.eduFehlerausgabe: pretty printKann man eventuell den Fehlerstring einmal durch pretty print oder so jagen:
```
Traceback (most recent call last):
File "/usr/lib/python3.7/runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "/usr/lib/python...Kann man eventuell den Fehlerstring einmal durch pretty print oder so jagen:
```
Traceback (most recent call last):
File "/usr/lib/python3.7/runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "/usr/lib/python3.7/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/home/bene/dev/netvs-cli/netvs_cli/__main__.py", line 6, in <module>
main()
File "/usr/lib/python3.7/site-packages/click/core.py", line 829, in __call__
return self.main(*args, **kwargs)
File "/usr/lib/python3.7/site-packages/click/core.py", line 782, in main
rv = self.invoke(ctx)
File "/usr/lib/python3.7/site-packages/click/core.py", line 1259, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/usr/lib/python3.7/site-packages/click/core.py", line 1259, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/usr/lib/python3.7/site-packages/click/core.py", line 1259, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/usr/lib/python3.7/site-packages/click/core.py", line 1066, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/usr/lib/python3.7/site-packages/click/core.py", line 610, in invoke
return callback(*args, **kwargs)
File "/usr/lib/python3.7/site-packages/click/decorators.py", line 21, in new_func
return f(get_current_context(), *args, **kwargs)
File "/home/bene/dev/netvs-cli/netvs_cli/cli/nd/bcd/update.py", line 22, in cli
netdb_client.nd.Bcd.update(api_session=api_session, name_old=bcd, **params)
File "/home/bene/.local/lib/python3.7/site-packages/netdb_client/nd.py", line 884, in update
raise ValueError(f'Request returned unexpected results ({res.status_code}: {res.reason}). Result: \n{res.text}')
ValueError: Request returned unexpected results (400: Bad Request). Result:
{"exception": {"error": {"code": 1, "description": "[cntl] angeforderter Datensatz nicht vorhanden oder benutzte Referenzdaten ungültig", "details": "Der für diesen Vorgang bzw. diese Transaktion angeforderte Datensatz ist nicht vorhanden oder die Parametervorauswahl ist ungültig."}, "error_type": {"code": -20001, "name": "invalid_param", "description": "Parameter ungültig"}, "constraint": {"name": null, "description": null}, "stacked_diag_params": {"sqlstate": "P0001", "message": "raise_exception", "detail": "", "hint": "", "context": "PL/pgSQL function eh.set_err(eh.stacked_diag_params_rec_type,name,name,eh.userparams_kv_rec_type[],eh.typecode_rec_type) line 8 at RAISE\\nSQL statement \"SELECT eh.set_err(sd_rec, fpkg, fname, up_kv_rec_list, et_rec)\"\\nPL/pgSQL function nd.get_bcd_rec(text,integer) line 34 at PERFORM\\nPL/pgSQL function nd_wapi_3_0.build_bcd_imp_rec(jsonb,integer) line 13 at assignment\\nPL/pgSQL function nd_wapi_3_0.chk_bcd_perms(jsonb,wapi_3_0.exec_ta_stmt_rec_type) line 16 at assignment\\nPL/pgSQL function nd_wapi_3_0.ta_stmt_handler(jsonb,jsonb,wapi_3_0.exec_ta_stmt_rec_type) line 78 at assignment\\nPL/pgSQL function wapi_3_0.exec_ta_handler(bigint,jsonb,boolean,boolean,boolean,boolean) line 535 at FOR over SELECT rows\\nPL/pgSQL function wapi_3_0.ta_handler(text,bigint,boolean,boolean,boolean) line 7 at RETURN QUERY", "dml_src_table": null, "schema": "", "table": "", "column": "", "datatype": "", "constraint": ""}, "others": {}, "traceback": [{"function": "nd.get_bcd_rec", "param": {"nd.bcd.name [OLD]": "abc"}}, {"function": "wapi_3_0.exec_ta_handler", "param": {"wapi.transaction_stmt.index": 0}}]}}
```https://git.scc.kit.edu/scc-net/netvs/netdb-client-lib/-/issues/1Forward-/Backward compatibility (from 3.0 on)2022-02-25T16:35:26+01:00iv4011benedikt.neuffer@kit.eduForward-/Backward compatibility (from 3.0 on)Currently base_url is the primary key for a section. It is not posible to have multiple sections with same base_url but different tokens or api version.
I propose to separate endpoint and base_url. Here an example:
```ini
[DEFAULT]
end...Currently base_url is the primary key for a section. It is not posible to have multiple sections with same base_url but different tokens or api version.
I propose to separate endpoint and base_url. Here an example:
```ini
[DEFAULT]
endpoint = prod3.0
[prod3.0]
base_url = www-net.scc.kit.edu
version = 3.0
token = <token>
[prod3.1]
base_url = www-net.scc.kit.edu
version = 3.1
token = <token>
```iv4011benedikt.neuffer@kit.eduiv4011benedikt.neuffer@kit.edu