Skip to content
This repository was archived by the owner on Feb 13, 2024. It is now read-only.

Commit

Permalink
App subscriptions with parameters (#452)
Browse files Browse the repository at this point in the history
* remove array brackets for parameters

* add additional waiting time for plans

* update timings
  • Loading branch information
rui1610 authored Mar 7, 2023
1 parent e0a6d21 commit 90f53e8
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion libs/python/btp_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -1716,7 +1716,7 @@ def subscribe_app_to_subaccount(btpUsecase: BTPUSECASE, app, plan, parameters):

if parameters is not None:
# For custom apps a plan can be none - this is safeguarded when checking if account is capable of usecase
command = command + " --parameters '[" + dictToString(parameters) + "]'"
command = command + " --parameters '" + dictToString(parameters) + "'"

isAlreadySubscribed = checkIfAppIsSubscribed(btpUsecase, app, plan)
if isAlreadySubscribed is False:
Expand Down
4 changes: 2 additions & 2 deletions libs/python/helperEnvCF.py
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ def check_if_service_plan_supported_in_cloudfoundry(btpUsecase, service):
def check_if_service_plan_in_cf_marketplace(btpUsecase, service):
# Defines how often we should ask CF whether the plan is
# available or not
MAX_TRIES = 6
MAX_TRIES = 12
# Seconds after which we should try again
SEARCH_EVERY_X_SECONDS = 10

Expand All @@ -302,7 +302,7 @@ def check_if_service_plan_in_cf_marketplace(btpUsecase, service):

command = "cf marketplace -e " + service.name

for x in range(1, MAX_TRIES):
for x in range(1, MAX_TRIES + 1):
p = runShellCommand(btpUsecase, command, "INFO", message)
shellResult = p.stdout.decode()
jsonResult = convertCloudFoundryCommandOutputToJson(
Expand Down
6 changes: 3 additions & 3 deletions libs/python/helperEnvironments.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ def check_if_service_plan_supported_in_environment(btpUsecase, service, environm
result = False
# Defines how often we should ask sapbtp whether the plan is
# available or not
MAX_TRIES = 2
MAX_TRIES = 12
# Seconds after which we should try again
SEARCH_EVERY_X_SECONDS = 5
SEARCH_EVERY_X_SECONDS = 10

command = (
"btp --format json list services/plan"
Expand All @@ -33,7 +33,7 @@ def check_if_service_plan_supported_in_environment(btpUsecase, service, environm
+ "<"
)

for x in range(MAX_TRIES):
for x in range(1, MAX_TRIES + 1):
p = runShellCommand(btpUsecase, command, "INFO", message)
returnMessage = p.stdout.decode()
jsonResult = convertStringToJson(returnMessage)
Expand Down

0 comments on commit 90f53e8

Please sign in to comment.