Merge "Address static analysis issues"
This commit is contained in:
@@ -11,6 +11,7 @@
|
|||||||
# under the License.
|
# under the License.
|
||||||
#
|
#
|
||||||
|
|
||||||
|
import errno
|
||||||
import re
|
import re
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
@@ -73,12 +74,14 @@ class Purge(n_purge.Purge):
|
|||||||
sys.stdout.write("\rPurging resources: %d%% complete." %
|
sys.stdout.write("\rPurging resources: %d%% complete." %
|
||||||
percent_complete)
|
percent_complete)
|
||||||
sys.stdout.flush()
|
sys.stdout.flush()
|
||||||
except Exception:
|
except IOError as e:
|
||||||
# A broken pipe IOError exception might get thrown if
|
# A broken pipe IOError exception might get thrown if
|
||||||
# invoked from our MD's keystone tenant delete handler
|
# invoked from our MD's keystone tenant delete handler
|
||||||
# code. We should just ignore that then continue to
|
# code. We should just ignore that then continue to
|
||||||
# purge the rest of the resources.
|
# purge the rest of the resources.
|
||||||
continue
|
if e.errno == errno.EPIPE:
|
||||||
|
continue
|
||||||
|
|
||||||
return (deleted, failed, failures)
|
return (deleted, failed, failures)
|
||||||
|
|
||||||
def take_action(self, parsed_args):
|
def take_action(self, parsed_args):
|
||||||
|
@@ -26,7 +26,7 @@ from __future__ import print_function
|
|||||||
|
|
||||||
import optparse
|
import optparse
|
||||||
import os
|
import os
|
||||||
import subprocess
|
import subprocess # nosec
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
|
|
||||||
@@ -61,7 +61,7 @@ class InstallVenv(object):
|
|||||||
else:
|
else:
|
||||||
stdout = None
|
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]
|
output = proc.communicate()[0]
|
||||||
if check_exit_code and proc.returncode != 0:
|
if check_exit_code and proc.returncode != 0:
|
||||||
self.die('Command "%s" failed.\n%s', ' '.join(cmd), output)
|
self.die('Command "%s" failed.\n%s', ' '.join(cmd), output)
|
||||||
|
Reference in New Issue
Block a user