Skip to content
Snippets Groups Projects
Commit c73b726a authored by Samuel GAIST's avatar Samuel GAIST
Browse files

[dock] Code cleanup

parent b04a3cdd
No related branches found
No related tags found
1 merge request!62Code cleanup
......@@ -49,7 +49,7 @@ import socket
import tempfile
import time
import docker
import subprocess as sp
import subprocess as sp # nosec
import logging
from beat.core import stats
......@@ -140,14 +140,14 @@ class Host(object):
self.processing_environments.keys(),
)
)[0]
except:
except IndexError:
try:
return list(
filter(
lambda x: x.startswith(name + " ("), self.db_environments.keys()
)
)[0]
except:
except IndexError:
return None
@property
......@@ -245,10 +245,10 @@ class Host(object):
replacement = True
else:
keep = True
except:
except Exception:
replacement = True
except:
except Exception:
keep = True
elif new_version is not None:
......@@ -493,7 +493,7 @@ class Host(object):
try:
return simplejson.loads(stdout)[0]["State"]["Status"]
except:
except Exception:
return None
def logs(self, container):
......@@ -569,7 +569,7 @@ class Host(object):
status = self.wait(container)
output = self.logs(container)
except Exception as e:
except Exception:
return 1, None
finally:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment