Commit Graph

6 Commits

Author SHA1 Message Date
Nicole Thomas
f83960c02a Lint: Remove extra line at end of file. 2017-07-28 09:13:59 -06:00
Andrew Bulford
c7d364ec56 Add regression tests for #41982
These test the scenarios where another network with a similar name
already exists, verifying that absent doesn't attempt to remove a
network which isn't specified, and present still attempts to create the
specified network despite a similarly named network already being present.
2017-07-28 10:41:44 +01:00
Andrew Bulford
d31f2913bd Fix broken unit test test_network_absent
This started failing following commit 515c612, which relied on the
'Name' key being present in the return value of docker.networks -
as the mock didn't have this set the test started failing.
2017-07-28 09:57:45 +01:00
Pedro Algarvio
99bc71dc4e
Proper mocking. 2017-03-28 19:04:01 +01:00
Erik Johnson
774a3f1147 Rename docker execution module to avoid shadowing in the loader
With the merging of #39996, salt/modules/docker.py now imports
salt.utils.docker. However, our loader appends the module dir (in
this case salt/modules/) to sys.path temporarily for the length of the
loading process. So, as the docker execution module tries to import
salt.utils.docker, when salt.utils.docker attempts to do an "import
docker", and docker-py is *not* installed, this results in
salt/modules/docker.py (the docker execution module) being loaded in its
place, which results in tracebacks in the minion log.

Renaming the docker execution module keeps this import shadowing from
occurring. Note that we don't need to do this for the placeholder
salt/states/docker.py as it does not import salt.utils.docker.
2017-03-28 10:50:47 -05:00
Erik Johnson
5ad476936d Overhaul Docker support
This does the following:

- Splits states for container/volume/image/network management into four
  separate state modules.

- Preserves backward compatibility by making ``docker.image_present``
  invoke ``docker_image.present``, etc.

- Changes how Salt detects that a container needs to be replaced.
  Instead of comparing each passed argument to the named container's
  configuration, it creates a temporary container, and compares that
  container to the named container. If the two differ, then the older
  container is removed, and the new one is renamed and started, becoming
  the named container.

- Removes the unit tests for container management and replaces them with
  integration tests.

- Adds unit tests for the new salt.utils.docker
2017-03-21 16:53:19 -05:00