fix(cgi-bin): transform FS total size to int in get_shared_storage

main
Tsu-ba-me 4 years ago
parent 8bcff7a038
commit 78f50e424c
  1. 3
      cgi-bin/get_shared_storage

@ -157,7 +157,8 @@ ORDER BY
host_name => $anvil->data->{raw}{file_systems}{$mount_point}{nodes}{$host_uuid}{host_name}, host_name => $anvil->data->{raw}{file_systems}{$mount_point}{nodes}{$host_uuid}{host_name},
# \1 will be transformed to the JSON boolean "true" by the JSON module. # \1 will be transformed to the JSON boolean "true" by the JSON module.
is_mounted => \1, is_mounted => \1,
total => $anvil->data->{raw}{file_systems}{$mount_point}{nodes}{$host_uuid}{total}, # FS total size is required by the spec to be an JSON number rather than string.
total => int($anvil->data->{raw}{file_systems}{$mount_point}{nodes}{$host_uuid}{total}),
free => $anvil->data->{raw}{file_systems}{$mount_point}{nodes}{$host_uuid}{free}, free => $anvil->data->{raw}{file_systems}{$mount_point}{nodes}{$host_uuid}{free},
} }
} }

Loading…
Cancel
Save