Skip to content

Commit

Permalink
Update UserPrompt to match legacy behavior if not expected value is s…
Browse files Browse the repository at this point in the history
…et in YAML
  • Loading branch information
krypton36 committed May 31, 2023
1 parent 2cbc680 commit 4c44b79
Showing 1 changed file with 10 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,17 @@ class LogCommands(PseudoCluster):
definition = _DEFINITION

async def UserPrompt(self, request):
input_result = input("")
for value in request.arguments.get("values", []):
expected_value = None
for value in request.arguments.get("values", []):
if value.get('name') and 'expectedValue' in value['name']:
request.responses = [{"values": [{"name": "expectedValue", "value": value['value']}]}]
return {"value": {"expectedValue": input_result}}
return {}
expected_value = value['value']
request.responses = [{"values": [{"name": "expectedValue", "value": expected_value}]}]

if expected_value is not None:
input_result = input("")
return {"value": {"expectedValue": input_result}}

return {}

async def Log(self, request):
pass

0 comments on commit 4c44b79

Please sign in to comment.