Commit Graph

172 Commits

Author SHA1 Message Date
Xiaojian Huang b9909c68f9 exec_resize is incorrectly passing param as json 2015-04-28 19:50:15 -07:00
Joffrey F f6b816c264 Fix #573 2015-04-28 10:48:09 -07:00
Joffrey F 7958110fda Added unit tests for container limits in build 2015-04-27 16:36:15 -07:00
Joffrey F ae329cb3ac * Separate file to store constants
* Added container_limits param to Client.build
2015-04-27 16:24:42 -07:00
Joffrey F e337a2317e Updated exec API documentation 2015-04-27 14:11:43 -07:00
Joffrey F e2ad91bdf7 Exec API tests 2015-04-27 13:57:15 -07:00
Joffrey F c2d48652ce Added check_resource decorator to interrupt command if container or image argument is None 2015-04-24 15:56:35 -07:00
Joffrey F 6228929a88 Handle ID truncate on client side in containers list (and changed default from True to False) 2015-04-22 18:00:53 -07:00
Joffrey F c7511481a6 BaseTestCase shims assertIn 2015-04-22 15:11:55 -07:00
Joffrey F a5519022d9 Merge branch 'sam/import-improvements' of https://github.com/ssssam/docker-py into ssssam-sam/import-improvements
Conflicts:
	docker/client.py
	docker/unixconn/unixconn.py
	tests/integration_test.py
2015-04-22 11:50:45 -07:00
Joffrey F 2f6579bf59 Use assertRaises in a backward compatible fashion 2015-03-25 16:07:16 -07:00
Joffrey F 6e0b5a8d70 Added assertIn shim for py2.6 2015-03-25 16:02:46 -07:00
Joffrey F b097d19f2f docs and unit test for security_opt 2015-03-25 15:40:14 -07:00
Aanand Prasad bd72bd13c7 Finish labels implementation, add tests and docs
Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
2015-03-20 15:42:10 -07:00
Joffrey F 7d5c1efbbe Fix unit tests 2015-03-05 12:16:53 -08:00
Tomas Tomecek 3e0496cc16 detect server version when version="auto"
heavily inspired by PR#281

Signed-off-by: Tomas Tomecek <ttomecek@redhat.com>
2015-03-05 08:53:29 +01:00
Roman Mohr a86bfffd89 Properly close files and sockets in unit tests 2015-02-28 21:03:15 +01:00
Daniel Nephin 0713488fac Resolves #497 - add support for dockerfile
Signed-off-by: Daniel Nephin <dnephin@gmail.com>
2015-02-20 21:20:21 -05:00
Joffrey F 1a7e3a2d6d Merge branch 'add-stats-api-support' of https://github.com/nir0s/docker-py into nir0s-add-stats-api-support 2015-02-12 13:15:59 -08:00
nir0s 52702f7da0 removed aggregation for now and added a unit test. also using stream_helper now 2015-02-12 09:48:33 +02:00
Christophe Labouisse 53b1bb41ac Fix datetime issue with Python 2.6
Signed-off-by: Christophe Labouisse <christophe@labouisse.org>
2015-02-11 07:25:59 +01:00
Christophe Labouisse a07bd28077 Add missing options to the events command
- Add since, until and filters parameters to `Client.events`
- Add missing `events`command in the documentation

Signed-off-by: Christophe Labouisse <christophe@labouisse.org>
2015-02-11 07:25:59 +01:00
Joffrey F d0512028be Merge pull request #482 from docker/rename_container
New Client.rename() method
2015-02-10 13:56:29 -08:00
Joffrey F a7f7fbb0fd rename() tests and docs 2015-02-10 12:55:44 -08:00
Vincent Giersch f3717f5815 Fix crash when building from remote sources
Avoid crashing when the Docker python client is able to load
registry credentials when building using a remote source

Signed-off-by: Vincent Giersch <vincent.giersch@ovh.net>
2015-02-04 16:26:55 +00:00
James Harris 301515ed56 Add Support for Mac Address
The new docker api allows specifing mac address for containers. This change is to allow docker py the same functionality.

Signed-off-by: James Harris <james@rancher.com>
2015-01-21 16:08:16 -07:00
Sam Thursfield 2f3b87a470 Rewrite Client.import_image() and add less-magical versions
Rather than have one function that can do 5 things and attempts to guess
what the user wanted, it's good to have a function for each possible
method of importing an image. Error cases are handled a lot better this
way.

The unit test test_import_image_from_file() was changed to be
test_import_image_from_bytes(), because if we try to import a temporary
file in the test, the 'data' parameter of the 'fake_request' object is
an instance of a funny internal type like <_io.BufferedReader
name='/tmp/tmpc9chux'> and it's very hard to match such a thing with
`mock.assert_called_with()`.
2015-01-05 12:32:56 +00:00
Sam Thursfield 42b91885a2 Rework Unix connection code so that 'chunked' transfers work
This allows streaming a system to the 'import' command, rather than
having to read the whole thing into memory before sending it.

Previously both the UnixAdapter and the docker.Client objects would
track the 'base URL' of the Docker daemon (socket path in the case of
local Unix-domain socket connections). The Client object would construct
URLs which contained the path to the socket with the path of the Docker
API call appended. The UnixHTTPConnection instance would then remove the
known socket path from the URL.

This relied on all calls going through the HTTPConnection.request()
function, where the URL could be rewritten. In the case of 'chunked'
HTTP POST requests this doesn't happen, so such calls would request
a path still including the socket path and would receive a 404 error.

The client now constructs URLs containing just the path of the desired API
endpoint, and expects the Unix socket transport to know the path to the
Docker daemon's socket.
2015-01-05 12:05:39 +00:00
Joffrey F 2218dbaa67 Use create_host_config in start (unifying parameter processing) 2014-12-18 18:03:27 -08:00
Joffrey F 53beba75f4 Merge pull request #427 from abanna/adding_multiple_dockercfg_support
adding the ability to login with different dockercfg files.
2014-12-18 10:39:59 -08:00
abanna d3cf874938 missed a lint error 2014-12-18 10:21:02 -08:00
Alex Banna 4cbf4e312c adding the ability to login with different dockercfg files. 2014-12-18 10:19:40 -08:00
Marcus Cobden 17c1869304 Tidy up stream test harness & fix race conditions 2014-12-18 09:23:21 +00:00
Joffrey F 8aded4842b Retry on connection error 2014-12-17 12:55:49 -08:00
Joffrey F b1e0ca0bd6 Merge branch 'master' of https://github.com/leth/docker-py into leth-master
Conflicts:
	tests/test.py
2014-12-17 11:56:58 -08:00
Joffrey F 12aad176b9 Re-added start with hostconfig tests 2014-12-17 11:44:52 -08:00
Joffrey F c29a6a2841 Fixed start_container tests 2014-12-17 11:44:52 -08:00
Joffrey F 19b1379f17 Updated unit tests
* Warnings will now raise exceptions in unit tests
* Updated several tests to use host_config
2014-12-17 11:44:51 -08:00
Joffrey F f2ba7f9b9d Merge pull request #429 from dims/master
Devices should be separated by colon separated string
2014-12-17 11:32:58 -08:00
Davanum Srinivas 3a51d3fe0b Devices should be separated by colon separated string
Totally bad test :( (written by me). The documentation and
code should match now. Many thanks to pranavs18 for spotting
the error and proposing the fix.
2014-12-17 07:35:07 -05:00
Marcus Cobden 578dda64c9 Consume from chunked streams without data loss
Data already in local python buffers was lost when stream socket
fileobject was re-created. We now use http.client to handle the chunk
transfer encoding, and we read only the data from each chunk.

This adds a test harness for stream responses which tries to trigger the
lost-buffer behaviour by responding to the HTTP request in full, as
early as possible.

NB: Python's http.client will close the socket fileobj early if there is
no content length or chunked transfer encoding header. If this happens,
requests/urllib3 will reopen it, but we lose some data which was stored
in buffers.
2014-12-16 20:36:08 +00:00
Derek Hammer d8e8400419 Allow for pull as an option to docker build
Signed-off-by: Derek Hammer <derek.r.hammer@gmail.com>
2014-12-13 10:31:47 -08:00
Joffrey F a9bc84cece Enforce passing string as version param in ctor 2014-11-26 23:14:19 +01:00
Joffrey F c4bb57286a Merge branch 'filters' of github.com:irachex/docker-py into irachex-filters
Conflicts:
	docker/utils/__init__.py
	docker/utils/utils.py
	tests/utils_test.py
2014-11-03 20:07:04 +01:00
Joffrey F 213ca7d71d Merge branch 'feature_logs-tail' of github.com:totem/docker-py into totem-feature_logs-tail
Conflicts:
	docker/client.py
	tests/fake_api.py
2014-10-30 15:07:58 +01:00
Joffrey F 92d1c8e77c Merge pull request #379 from tutumcloud/logs_tail
Added tail behaviour to logs command, same as CLI v1.3 (latest)
2014-10-30 14:57:12 +01:00
Joffrey F 9b63cc548a Merge pull request #324 from infoxchange/clear-unixconn-pool
Clear UNIX connections pool to avoid ResourceWarnings
2014-10-30 13:49:40 +01:00
Joffrey F 37c8072f60 Merge branch 'pause-unpause' of github.com:phensley/docker-py into phensley-pause-unpause
Conflicts:
	README.md
	tests/integration_test.py
	tests/test.py
2014-10-29 19:35:05 +01:00
Joffrey F 75d8ff16e4 Merge branch 'support-devices' of github.com:dims/docker-py into dims-support-devices
Conflicts:
	README.md
2014-10-29 17:23:42 +01:00
Joffrey F e0d6b267ee Merge branch 'exec' of github.com:phensley/docker-py into phensley-exec
Conflicts:
	README.md
2014-10-29 17:19:27 +01:00