aboutsummaryrefslogtreecommitdiffstats
path: root/src/onapsdk/utils
diff options
context:
space:
mode:
authorpaweldenst <pawel.denst@external.t-mobile.pl>2022-10-25 11:37:03 +0000
committerpaweldenst <pawel.denst@external.t-mobile.pl>2022-11-25 08:14:07 +0000
commit1b6a93d93fe6ac41eb221dc59c2171e9bdd578e3 (patch)
tree426764fe83cf6313f7b04e94afdc892ff1056df4 /src/onapsdk/utils
parent25cafb994c9ba3b874cd973a1e1d440fb0b98bf0 (diff)
Run Python 3.11 tests
This commit deletes unnecessary comments Issue-ID: INT-2168 Signed-off-by: paweldenst <pawel.denst@external.t-mobile.pl> Change-Id: I08b738d3a9aebbdf5d305a118a4d7b7e64d686a5
Diffstat (limited to 'src/onapsdk/utils')
-rw-r--r--src/onapsdk/utils/configuration.py5
-rw-r--r--src/onapsdk/utils/headers_creator.py2
-rw-r--r--src/onapsdk/utils/tosca_file_handler.py4
3 files changed, 3 insertions, 8 deletions
diff --git a/src/onapsdk/utils/configuration.py b/src/onapsdk/utils/configuration.py
index 89bee5a..487a472 100644
--- a/src/onapsdk/utils/configuration.py
+++ b/src/onapsdk/utils/configuration.py
@@ -15,11 +15,6 @@
from typing import List
-def tosca_path() -> str:
- """Return tosca file paths."""
- return '/tmp/tosca_files/'
-
-
def components_needing_distribution() -> List[str]:
"""Return the list of components needing distribution."""
return ["SO", "sdnc", "aai"]
diff --git a/src/onapsdk/utils/headers_creator.py b/src/onapsdk/utils/headers_creator.py
index adb0609..ae03a38 100644
--- a/src/onapsdk/utils/headers_creator.py
+++ b/src/onapsdk/utils/headers_creator.py
@@ -223,7 +223,7 @@ def headers_sdc_artifact_upload(base_header: Dict[str, str], data: str):
headers["Accept"] = "application/json, text/plain, */*"
headers["Accept-Encoding"] = "gzip, deflate, br"
headers["Content-Type"] = "application/json; charset=UTF-8"
- md5_content = hashlib.md5(data.encode('UTF-8')).hexdigest()
+ md5_content = hashlib.new('md5', data.encode('UTF-8'), usedforsecurity=False).hexdigest()
content = base64.b64encode(md5_content.encode('ascii')).decode('UTF-8')
headers["Content-MD5"] = content
return headers
diff --git a/src/onapsdk/utils/tosca_file_handler.py b/src/onapsdk/utils/tosca_file_handler.py
index 921b868..1d1918b 100644
--- a/src/onapsdk/utils/tosca_file_handler.py
+++ b/src/onapsdk/utils/tosca_file_handler.py
@@ -14,7 +14,7 @@
# limitations under the License.
import json
import string
-import random
+import secrets
from typing import Dict, List
from onapsdk.exceptions import ValidationError
@@ -103,4 +103,4 @@ def random_string_generator(size=6,
str: a sequence of random characters
"""
- return ''.join(random.choice(chars) for _ in range(size))
+ return ''.join(secrets.choice(chars) for _ in range(size))