Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
OpnSense
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kulya
OpnSense
Commits
e7137c1e
Commit
e7137c1e
authored
Apr 04, 2017
by
Ad Schellevis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dhcpd.leases using wrong timezone, closes
https://github.com/opnsense/core/issues/1521
parent
184c79b1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
dhcpd.py
src/opnsense/site-python/watchers/dhcpd.py
+5
-5
No files found.
src/opnsense/site-python/watchers/dhcpd.py
View file @
e7137c1e
...
...
@@ -24,16 +24,16 @@
POSSIBILITY OF SUCH DAMAGE.
"""
import
os
import
time
import
calendar
import
datetime
class
DHCPDLease
(
object
):
watch_file
=
'/var/dhcpd/var/db/dhcpd.leases'
def
__init__
(
self
):
def
__init__
(
self
,
watch_file
=
'/var/dhcpd/var/db/dhcpd.leases'
):
""" init watcher
:param watch_file: filename to watch
:return: watcher object
"""
self
.
watch_file
=
watch_file
self
.
_section_data
=
[]
self
.
_fhandle
=
None
self
.
_last_pos
=
None
...
...
@@ -67,7 +67,7 @@ class DHCPDLease(object):
if
field_name
in
(
'starts'
,
'ends'
,
'tstp'
,
'tsfp'
,
'atsfp'
,
'cltt'
)
and
len
(
parts
)
>=
3
:
dt
=
'
%
s
%
s'
%
(
parts
[
2
],
parts
[
3
])
try
:
field_value
=
time
.
mktime
(
datetime
.
datetime
.
strptime
(
dt
,
"
%
Y/
%
m/
%
d
%
H:
%
M:
%
S;"
)
.
timetuple
())
field_value
=
calendar
.
timegm
(
datetime
.
datetime
.
strptime
(
dt
,
"
%
Y/
%
m/
%
d
%
H:
%
M:
%
S;"
)
.
timetuple
())
except
ValueError
:
field_value
=
None
elif
field_name
==
'hardware'
and
len
(
parts
)
>=
3
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment