PEP8ify docker-check-updates
This commit is contained in:
parent
40bcd9d842
commit
1bbbabac26
1 changed files with 12 additions and 10 deletions
|
@ -7,15 +7,17 @@ import subprocess
|
|||
|
||||
c = Client(base_url='unix://var/run/docker.sock')
|
||||
for container in c.containers():
|
||||
name = container['Names'][0]
|
||||
id_ = container['Id']
|
||||
image_id = c.inspect_container(id_)['Image']
|
||||
name = container['Names'][0]
|
||||
id_ = container['Id']
|
||||
image_id = c.inspect_container(id_)['Image']
|
||||
|
||||
print('Container: {}'.format(name))
|
||||
print('Image: {} '.format(image_id))
|
||||
print('Container: {}'.format(name))
|
||||
print('Image: {} '.format(image_id))
|
||||
|
||||
# Not using the API here for simplicity (for now)
|
||||
subprocess.call(['docker', 'run', '-t', '--rm',
|
||||
image_id,
|
||||
'/bin/bash', '-c',
|
||||
'dnf -q check-update; if [ $? == 100 ]; then echo "Updates available"; fi'])
|
||||
# Not using the API here for simplicity (for now)
|
||||
subprocess.call(['docker', 'run', '-t', '--rm',
|
||||
image_id,
|
||||
'/bin/bash', '-c',
|
||||
|
||||
'dnf -q check-update;' +
|
||||
'if [ $? == 100 ]; then echo "Updates available"; fi'])
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue