Uploaded image for project: 'Common Controller SDK'
  1. Common Controller SDK
  2. CCSDK-3521

dynamic properties not escaped correctly for python script executor

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Medium Medium
    • None
    • Honolulu Release
    • None
    • None

      the following line in command_executor_handler.py

      properties = " " + re.escape(MessageToJson(request.properties))

      serializes dynamic properties protobuf message to a json object, and escapes the json string using re.escape, which doesn't escape the double quotes, so it gives 

      2021-11-14 18:09:03,336|e5eb1f1e-3386-435d-b290-d49d8af8db4c|143748f9-3cd5-4910-81c9-a4601ff2ea58|SDNC_DG|ThreadPoolExecutor-0_0|CommandExecutorHandler|INFO|################################

        {\

      \ \ "network-address":\ "172\.20\.183\.176/28"\

      }

      which prevents python from parsing json input to dict 

       

      ==================================

       

      so, using this line

      properties = " " + re.escape(MessageToJson(request.properties)).replace('"','
      "')

      gives correct escaped string, and python can parse the json into dict properly

      2021-11-14 18:25:20,605|e5eb1f1e-3386-435d-b290-d49d8af8db4c|143748f9-3cd5-4910-81c9-a4601ff2ea58|SDNC_DG|ThreadPoolExecutor-0_2|CommandExecutorHandler|INFO|################################

        {\

      \ \ \"network-address\":\ \"172\.20\.183\.176/28\"\

      }

            djtimoney Dan Timoney
            abdelseaudi abdelseaudi
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: