Skip to content
This repository has been archived by the owner on Apr 26, 2023. It is now read-only.

Commit

Permalink
Add nosec in get_free_segmentation_id function
Browse files Browse the repository at this point in the history
pep8 job fails due to bandit check with an error:
    [B311:blacklist] Standard pseudo-random generators are not suitable 
    for security/cryptographic purposes.

But using the standard random function in the get_free_segmentation_id 
function is suitable, so adding #nosec comment should unbblock the gate.

Change-Id: Iad8e376c503a32300b3e0b504f47a0c81e53a7a8
  • Loading branch information
SVilgelm committed May 16, 2019
1 parent 35062ad commit 4ae79ba
Showing 1 changed file with 1 addition and 1 deletion.
Expand Up @@ -46,7 +46,7 @@ def get_free_segmentation_id(cls):
# With 2+ concurrency, tests that ran in the same moment may fail due
# to usage conflict. To prevent it we select segmentation to start
# randomly.
segmentation_id = random.randint(1000, 5000)
segmentation_id = random.randint(1000, 5000) # nosec
while segmentation_id in segmentation_ids:
segmentation_id += 1

Expand Down

0 comments on commit 4ae79ba

Please sign in to comment.