aboutsummaryrefslogtreecommitdiffstats
path: root/catalog-be/src/main/resources/scripts/sdcBePy/users/run.py
diff options
context:
space:
mode:
authork.kedron <k.kedron@partner.samsung.com>2020-06-05 14:51:01 +0200
committerKrystian Kedron <k.kedron@partner.samsung.com>2020-06-24 09:21:00 +0000
commit16fe29ac226610f79c8da1f691437ec7fe6e79c4 (patch)
tree5b73d8f1724c561609c05fd2802ad80b7acfb4c0 /catalog-be/src/main/resources/scripts/sdcBePy/users/run.py
parentfca8a0b1af32083b8ea025135b120091aec9714f (diff)
Improvement sdc-BE-init python scripts
- Implemented retries when request fail - Moved configuration variables to the Properties file - Extended sdcBeProxy - Implemented script to run import/update (should fix deployment glitch) - Updated the import_Normatives recipes to use new script Issue-ID: SDC-2784 Signed-off-by: Krystian Kedron <k.kedron@partner.samsung.com> Change-Id: I83fab898783ad8d3b3d532af43d75bc54d033c33
Diffstat (limited to 'catalog-be/src/main/resources/scripts/sdcBePy/users/run.py')
-rwxr-xr-xcatalog-be/src/main/resources/scripts/sdcBePy/users/run.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/catalog-be/src/main/resources/scripts/sdcBePy/users/run.py b/catalog-be/src/main/resources/scripts/sdcBePy/users/run.py
index b933afe7ca..1518c2f673 100755
--- a/catalog-be/src/main/resources/scripts/sdcBePy/users/run.py
+++ b/catalog-be/src/main/resources/scripts/sdcBePy/users/run.py
@@ -5,8 +5,10 @@ import os
import time
from argparse import ArgumentParser
+from sdcBePy import properties
from sdcBePy.common.bColors import BColors
-from sdcBePy.common.healthCheck import check_backend, RETRY_ATTEMPTS
+from sdcBePy.common.healthCheck import check_backend
+from sdcBePy.common.properties import init_properties
from sdcBePy.common.sdcBeProxy import SdcBeProxy
colors = BColors()
@@ -19,7 +21,7 @@ def load_users(conf_path):
def be_user_init(be_ip, be_port, protocol, conf_path):
sdc_be_proxy = SdcBeProxy(be_ip, be_port, protocol)
- if check_backend(sdc_be_proxy, RETRY_ATTEMPTS):
+ if check_backend(sdc_be_proxy, properties.retry_attempts):
users = load_users(conf_path)
for user in users:
if sdc_be_proxy.check_user(user['userId']) != 200:
@@ -53,6 +55,7 @@ def get_args():
args = parser.parse_args()
+ init_properties(10, 10)
return [args.ip, args.port, 'https' if args.https else 'http', args.conf]