Skip to content

Fix the 'configuration._' not defined error when not provide '_' parameter.

Boxiang Sun requested to merge Daetalus/slapos:jstestnode into master

There will be an error when we don't provide _ in webrunner. The instance-parameter:configuration is something like '''!py!{'full_address_list': [], '_': '{}'}'''

This commit process it by these steps:

  1. Remove the !py prefix by str[4:].
  2. Use double quotes replace single quotes within the str.
  3. Get the dict {'full_address_list': [], '_': '{}'}
  4. Get the value of the '_' key, in this case, it is a string "{}". Use json to convert it to a dict {}.

Notes:

Please let me know if there has trouble to hardcode the str[4:] or there has corner case that I didn't cover.

Merge request reports