metadata: Fix parsing of JSON
`ok` was not assigned when type casting to `map[string]interface{}` so the
subsequent check was testing a stale value.
Also, the error message upon failure had the wrong sense.
@@ -167,9 +167,9 @@ func processUserData(data []byte) error {
continue
}
for f, i := range files {
- fi := i.(map[string]interface{})
+ fi, ok := i.(map[string]interface{})
if !ok {
- log.Printf("Could convert JSON for items: %s", i)
+ log.Printf("Couldn't convert JSON for items: %s", i)
continue
}
if _, ok := fi["perm"]; !ok {
