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

Lease File: options not recognized #9

Closed
amamitzsch opened this issue Feb 27, 2016 · 1 comment
Closed

Lease File: options not recognized #9

amamitzsch opened this issue Feb 27, 2016 · 1 comment

Comments

@amamitzsch
Copy link

the "option" sections in the lease files are not properly detected:

lease 10.10.10.10 {
starts 6 2016/02/27 07:11:41;
ends 6 2016/02/27 09:11:41;
cltt 6 2016/02/27 07:11:41;
binding state active;
next binding state free;
rewind binding state free;
hardware ethernet 24:65:11:d9:a6:b3;
uid "\377\021\331\246\263\000\003\000\001$e\021\331\246\263";
option agent.circuit-id 0:1:3:e9;
option agent.remote-id a4:a2:4a:33:db:e5;
option agent.DOCSIS-device-class 2;
option agent.unknown-9 0:0:11:8b:6:1:4:1:2:3:0;
client-hostname "KRONOS";
}

returns in the data section {"option" : "agent.unknown-9 0:0:11:8b:6:1:4:1:2:3:0"}, previous entries are overwritten.

To fix that, adjust the regex:

-self.regex_properties = re.compile(r"\s+(?P\S+) (?P[\s\S]+?);")
+self.regex_properties = re.compile(r"\s+(?Poption\s+\S+|\S+) (?P[\s\S]+?);")

Andre

@MartijnBraam
Copy link
Owner

Thanks for the fix, I added a unit test for the options and an extra property to the lease object (lease.options) for the options that are extracted. The fix is in release 0.6.0

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

No branches or pull requests

2 participants