Skip to content

Commit aba83f3

Browse files
committed
Remove docker ping test
OscapDockerScan will throw an error if docker isn't running; there's no need to create a separate docker client in a different way just to do this ping test.
1 parent 4ae0e01 commit aba83f3

File tree

1 file changed

+0
-18
lines changed

1 file changed

+0
-18
lines changed

utils/oscap-docker.in

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -29,17 +29,6 @@ import sys
2929
from requests import exceptions
3030

3131

32-
def ping_docker():
33-
''' Simple check if the docker daemon is running '''
34-
# Class docker.Client was renamed to docker.APIClient in
35-
# python-docker-py 2.0.0.
36-
try:
37-
client = docker.APIClient()
38-
except AttributeError:
39-
client = docker.Client()
40-
client.ping()
41-
42-
4332
if __name__ == '__main__':
4433
parser = argparse.ArgumentParser(description='oscap docker',
4534
epilog='See `man oscap` to learn \
@@ -82,13 +71,6 @@ if __name__ == '__main__':
8271
parser.print_help()
8372
sys.exit(2)
8473

85-
try:
86-
ping_docker()
87-
88-
except exceptions.ConnectionError:
89-
print("The docker daemon does not appear to be running")
90-
sys.exit(1)
91-
9274
try:
9375
ODS = OscapDockerScan(args.scan_target, args.is_image, args.oscap_binary)
9476
if args.action == "scan":

0 commit comments

Comments
 (0)