Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
D
docker-py
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
docker-py
Commits
657420a4
Kaydet (Commit)
657420a4
authored
Tem 20, 2015
tarafından
Aanand Prasad
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Enforce UTC datetimes in arguments to `events()`
Signed-off-by:
Aanand Prasad
<
aanand.prasad@gmail.com
>
üst
946eb964
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
6 deletions
+6
-6
utils.py
docker/utils/utils.py
+3
-3
api.md
docs/api.md
+2
-2
test.py
tests/test.py
+1
-1
No files found.
docker/utils/utils.py
Dosyayı görüntüle @
657420a4
...
...
@@ -333,9 +333,9 @@ def convert_filters(filters):
return
json
.
dumps
(
result
)
def
datetime_to_timestamp
(
dt
=
datetime
.
now
()
):
"""Convert a
datetime in local timezone to a u
nix timestamp"""
delta
=
dt
-
datetime
.
fromtimestamp
(
0
)
def
datetime_to_timestamp
(
dt
):
"""Convert a
UTC datetime to a U
nix timestamp"""
delta
=
dt
-
datetime
.
utc
fromtimestamp
(
0
)
return
delta
.
seconds
+
delta
.
days
*
24
*
3600
...
...
docs/api.md
Dosyayı görüntüle @
657420a4
...
...
@@ -251,8 +251,8 @@ function return a blocking generator you can iterate over to retrieve events as
**Params**
:
*
since (datetime or int): get events from this point
*
until (datetime or int): get events until this point
*
since (
UTC
datetime or int): get events from this point
*
until (
UTC
datetime or int): get events until this point
*
filters (dict): filter the events by event time, container or image
*
decode (bool): If set to true, stream will be decoded into dicts on the
fly. False by default.
...
...
tests/test.py
Dosyayı görüntüle @
657420a4
...
...
@@ -221,7 +221,7 @@ class DockerClientTest(Cleanup, base.BaseTestCase):
def
test_events_with_since_until
(
self
):
ts
=
1356048000
now
=
datetime
.
datetime
.
fromtimestamp
(
ts
)
now
=
datetime
.
datetime
.
utc
fromtimestamp
(
ts
)
since
=
now
-
datetime
.
timedelta
(
seconds
=
10
)
until
=
now
+
datetime
.
timedelta
(
seconds
=
10
)
try
:
...
...
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