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 1d90bbe commit fc71d72
Showing 1 changed file with 11 additions and 6 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", []):
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 = None
for value in request.arguments.get("values", []):
if value.get('name') and 'expectedValue' in value['name']:
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 fc71d72

Please sign in to comment.