Skip to content

Commit 9f3960d

Browse files
authored
Merge pull request #14 from akshaysalunke13/master
Fix yaml output to reflect latest docker-compose reference.
2 parents e0f6c83 + 98704a8 commit 9f3960d

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
venv
2+
.vscode
3+
.DS_Store

autocompose.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ def generate(cname):
6060
#'log_driver': cattrs['HostConfig']['LogConfig']['Type'],
6161
#'log_opt': cattrs['HostConfig']['LogConfig']['Config'],
6262
'logging': {'driver': cattrs['HostConfig']['LogConfig']['Type'], 'options': cattrs['HostConfig']['LogConfig']['Config']},
63-
'networks': {x: {'aliases': cattrs['NetworkSettings']['Networks'][x]['Aliases']} for x in cattrs['NetworkSettings']['Networks'].keys()},
63+
'networks': {x for x in cattrs['NetworkSettings']['Networks'].keys()},
6464
'security_opt': cattrs['HostConfig']['SecurityOpt'],
6565
'ulimits': cattrs['HostConfig']['Ulimits'],
6666
'volumes': cattrs['HostConfig']['Binds'],
@@ -87,7 +87,7 @@ def generate(cname):
8787
networklist = c.networks.list()
8888
networks = {}
8989
for network in networklist:
90-
if network.attrs['Name'] in values['networks'].keys():
90+
if network.attrs['Name'] in values['networks']:
9191
networks[network.attrs['Name']] = {'external': (not network.attrs['Internal'])}
9292

9393
# Check for command and add it if present.

requirements.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
pyaml==20.4.0
2+
docker==4.4.4

0 commit comments

Comments
 (0)