Merge "Address static analysis issues"

This commit is contained in:
Zuul 2024-05-25 14:33:56 +00:00 committed by Gerrit Code Review
commit 70276afb9b
2 changed files with 7 additions and 4 deletions

View File

@ -11,6 +11,7 @@
# under the License.
#
import errno
import re
import sys
@ -73,12 +74,14 @@ class Purge(n_purge.Purge):
sys.stdout.write("\rPurging resources: %d%% complete." %
percent_complete)
sys.stdout.flush()
except Exception:
except IOError as e:
# A broken pipe IOError exception might get thrown if
# invoked from our MD's keystone tenant delete handler
# code. We should just ignore that then continue to
# purge the rest of the resources.
continue
if e.errno == errno.EPIPE:
continue
return (deleted, failed, failures)
def take_action(self, parsed_args):

View File

@ -26,7 +26,7 @@ from __future__ import print_function
import optparse
import os
import subprocess
import subprocess # nosec
import sys
@ -61,7 +61,7 @@ class InstallVenv(object):
else:
stdout = None
proc = subprocess.Popen(cmd, cwd=self.root, stdout=stdout)
proc = subprocess.Popen(cmd, cwd=self.root, stdout=stdout) # nosec
output = proc.communicate()[0]
if check_exit_code and proc.returncode != 0:
self.die('Command "%s" failed.\n%s', ' '.join(cmd), output)