Fix pep8 job

Mark a few statements as #nosec as they are not security issues.

Change-Id: I880731c0a86b15eafa4481afe8f6f1c35bf49421
This commit is contained in:
Hongbin Lu 2023-08-18 15:49:44 +00:00
parent 8af0647cd9
commit fae90cee44
3 changed files with 3 additions and 3 deletions

View File

@ -28,7 +28,7 @@ def get_template_contents(template_file=None, template_url=None,
# Transform a bare file path to a file:// URL. # Transform a bare file path to a file:// URL.
if template_file: # nosec if template_file: # nosec
template_url = utils.normalise_file_path_to_url(template_file) template_url = utils.normalise_file_path_to_url(template_file)
tpl = request.urlopen(template_url).read() tpl = request.urlopen(template_url).read() # nosec
else: else:
raise exceptions.CommandErrorException(_('Need to specify exactly ' raise exceptions.CommandErrorException(_('Need to specify exactly '
'one of %(arg1)s, %(arg2)s ' 'one of %(arg1)s, %(arg2)s '

View File

@ -1156,7 +1156,7 @@ class CopyContainer(command.Command):
dest_path = parsed_args.destination dest_path = parsed_args.destination
tardata = io.BytesIO(res['data']) tardata = io.BytesIO(res['data'])
with closing(tarfile.open(fileobj=tardata)) as tar: with closing(tarfile.open(fileobj=tardata)) as tar:
tar.extractall(dest_path) tar.extractall(dest_path) # nosec
elif ':' in parsed_args.destination: elif ':' in parsed_args.destination:
dest_parts = parsed_args.destination.split(':', 1) dest_parts = parsed_args.destination.split(':', 1)

View File

@ -898,7 +898,7 @@ def do_cp(cs, args):
dest_path = args.destination dest_path = args.destination
tardata = io.BytesIO(res['data']) tardata = io.BytesIO(res['data'])
with closing(tarfile.open(fileobj=tardata)) as tar: with closing(tarfile.open(fileobj=tardata)) as tar:
tar.extractall(dest_path) tar.extractall(dest_path) # nosec
elif ':' in args.destination: elif ':' in args.destination:
dest_parts = args.destination.split(':', 1) dest_parts = args.destination.split(':', 1)