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.
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.
By default, the YAML dumper will output lists that are values in a
dictionary flush with the key they are under:
```
key1: value1
key2:
- a
- b
- c
```
This new dumper causes the list members to be indented by two spaces,
improving readability:
```
key1: value1
key2:
- a
- b
- c
```
It can be used by passing the new `IndentedSafeOrderedDumper`,
or any other dumper which includes the `IndentMixin`,
to the `yaml.dump` function:
```
dumper = __utils__['yamldumper.get_dumper']('IndentedSafeOrderedDumper')
yaml.dump(some_dict, Dumper=dumper)
```
Without this, if append or prepend is used with file.replace, the backslashes
will not be interpreted when appending the file, but the next time the state is
run, the backslashes could be interpreted and removed from the line.
After upgrading my master (now in 2017.7), salt-api stopped working with the following stacktrace:
```
Tornado /usr/local/lib/python2.7/dist-packages/tornado/__init__.pyc
Process salt.loaded.int.netapi.rest_tornado.start:
Traceback (most recent call last):
File "/usr/lib/python2.7/multiprocessing/process.py", line 258, in _bootstrap
self.run()
File "/usr/lib/python2.7/multiprocessing/process.py", line 114, in run
self._target(*self._args, **self._kwargs)
File "/usr/lib/python2.7/dist-packages/salt/netapi/rest_tornado/__init__.py", line 118, in start
http_server = tornado.httpserver.HTTPServer(get_application(__opts__), **kwargs)
AttributeError: 'module' object has no attribute 'httpserver'
```
Reproduced with tornado 4.2 and 4.5
This PR fixes the error above.
This option allows users to specify a list of shell commands that should
be executed on the VM right before the bootstrap script runs (or whatever
deploy script is set).