Commit 13684357 authored by Vincent Pelletier's avatar Vincent Pelletier

cauacase.{test,ca}: Silence pylint consider-using-with .

Because:
- Non-blocking lock acquisition does not work with a context manager.
- subprocess is not a context manager in python 2.7 .
parent 9e673d8e
...@@ -508,7 +508,9 @@ class CertificateAuthority(object): ...@@ -508,7 +508,9 @@ class CertificateAuthority(object):
self._ca_key_pairs_list[-1]['crt'].not_valid_after - self._ca_key_pairs_list[-1]['crt'].not_valid_after -
datetime.datetime.utcnow() datetime.datetime.utcnow()
).total_seconds() / self._crt_life_time.total_seconds() <= 2 ).total_seconds() / self._crt_life_time.total_seconds() <= 2
) and self._ca_renewal_lock.acquire(False): # pylint: disable=consider-using-with
) and self._ca_renewal_lock.acquire(False):
# pylint: enable=consider-using-with
try: try:
# No CA certificate at all or less than 2 certificate validity periods # No CA certificate at all or less than 2 certificate validity periods
# left with latest CA certificate. Prepare the next one so it starts # left with latest CA certificate. Prepare the next one so it starts
......
...@@ -3790,7 +3790,7 @@ def _runCaucaseSh(*args): ...@@ -3790,7 +3790,7 @@ def _runCaucaseSh(*args):
environ = os.environ.copy() environ = os.environ.copy()
environ['CAUCASE_PYTHON'] = sys.executable environ['CAUCASE_PYTHON'] = sys.executable
with open(os.devnull, 'rb') as devnull: with open(os.devnull, 'rb') as devnull:
process = subprocess.Popen( process = subprocess.Popen( # pylint: disable=consider-using-with
command, command,
stdin=devnull, stdin=devnull,
stdout=subprocess.PIPE, stdout=subprocess.PIPE,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment