We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I have dhcp_static.conf which has 118 IP assigments and i want to parse with python. This file will be included in dhcpd.conf file.
dhcp_static.conf
host host_0 { hardware ethernet 18:DB:F2:5E:00:00; fixed-address 10.12.24.81; } host host_1 { hardware ethernet D4:AE:52:BD:00:00; fixed-address 10.12.42.1; } ... (many more) ... host host_118 { hardware ethernet DC:A6:32:B7:00:00; fixed-address 10.12.67.22; }
assigments.py (my script)
import os, types, iscpy NAMED_FILE = 'dhcp_static.conf' named_file = open(NAMED_FILE).read() # print("named_file:",named_file) isc_arr = iscpy.ParseISCString(named_file) print(isc_arr)
Result:
$ python assigments.py [{'host host_117': {'hardware': 'ethernet 18:DB:F2:5E:00:00', 'fixed-address': '10.12.24.81'}}, {'host host_118': {'hardware': 'ethernet DC:A6:32:B7:00:00', 'fixed-address': '10.12.67.22'}}]
If i uncomment printing named_file then i see whole file. So it means that the problem lies in parser.
Additional info:
$ python --version Python 3.8.10 $ pip freeze certifi==2021.10.8 charset-normalizer==2.0.10 idna==3.3 iscpy==1.8 openssh-wrapper==0.4 proxmoxer==1.2.0 requests==2.27.1 urllib3==1.26.8
The text was updated successfully, but these errors were encountered:
@utamid maintains the original.
I forked this git clone from his repository.
It has been awhile since I've visited this repo (in fact, I am thinking about deleting my copy of this repository).
Perhaps you can repost the issue over at the https://github.com/utamid/iscpy_modified.
Sorry, something went wrong.
No branches or pull requests
I have dhcp_static.conf which has 118 IP assigments and i want to parse with python. This file will be included in dhcpd.conf file.
dhcp_static.conf
assigments.py (my script)
Result:
If i uncomment printing named_file then i see whole file. So it means that the problem lies in parser.
Additional info:
The text was updated successfully, but these errors were encountered: