(s string)
| 13 | ) |
| 14 | |
| 15 | func ParseExtras(s string) (map[string]string, error) { |
| 16 | rv := map[string]string{} |
| 17 | |
| 18 | err := json.Unmarshal([]byte(s), &rv) |
| 19 | if err != nil { |
| 20 | // Early versions of cbft-to-ns_server integration had a |
| 21 | // simple, non-JSON "host:port" format for the nodeDef.Extras, |
| 22 | // so fall back to that. |
| 23 | rv["nsHostPort"] = s |
| 24 | } |
| 25 | |
| 26 | return rv, nil |
| 27 | } |
no test coverage detected