Skip to content
This repository has been archived by the owner on Jul 25, 2024. It is now read-only.

Commit

Permalink
Change size parsing to string (#57)
Browse files Browse the repository at this point in the history
* Change size parsing to string

Change the encode / decode of pool size
to a string to not fail validation of
`Decode.int`.

Signed-off-by: Joe Grund <[email protected]>

* bump versions

Signed-off-by: Joe Grund <[email protected]>
  • Loading branch information
Joe Grund authored Apr 19, 2018
1 parent 07427b2 commit 72461a7
Show file tree
Hide file tree
Showing 9 changed files with 924 additions and 993 deletions.
6 changes: 3 additions & 3 deletions Fable.Import.NodeLibzfs/fable/NodeLibzfs.fs
Original file line number Diff line number Diff line change
Expand Up @@ -552,7 +552,7 @@ module Libzfs =
hostid: int option;
state: string;
readonly: bool;
size: int;
size: string;
vdev: VDev;
props: ZProp array;
datasets: Dataset array;
Expand Down Expand Up @@ -581,7 +581,7 @@ module Libzfs =
("hostid", Encode.option Encode.int hostid);
("state", Encode.string state);
("readonly", Encode.bool readonly);
("size", Encode.int size);
("size", Encode.string size);
("vdev", VDev.encode vdev);
("props", Encode.array (Array.map ZProp.encode props));
("datasets", Encode.array (Array.map Dataset.encode datasets));
Expand Down Expand Up @@ -612,7 +612,7 @@ module Libzfs =
|> (Decode.required "hostid" (Decode.option Decode.int))
|> (Decode.required "state" Decode.string)
|> (Decode.required "readonly" Decode.bool)
|> (Decode.required "size" Decode.int)
|> (Decode.required "size" Decode.string)
|> (Decode.required "vdev" VDev.decode)
|> (Decode.required "props" (Decode.array ZProp.decode))
|> (Decode.required "datasets" (Decode.array Dataset.decode))
Expand Down
2 changes: 1 addition & 1 deletion Fable.Import.NodeLibzfs/test/NodeLibzfs.Test.fs
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ test "decode / encode pool" <| fun () ->
"hostid": 3914625515,
"state": "ACTIVE",
"readonly": false,
"size": 83886080,
"size": "83886080",
"vdev": {
"Root": {
"children": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ exports[`decode / encode pool 1`] = `
\\"hostid\\": null,
\\"state\\": \\"ACTIVE\\",
\\"readonly\\": false,
\\"size\\": 83886080,
\\"size\\": \\"83886080\\",
\\"vdev\\": {
\\"Root\\": {
\\"children\\": [
Expand Down
6 changes: 5 additions & 1 deletion node-libzfs/iml-node-libzfs.spec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
%define base_name node-libzfs
Name: iml-%{base_name}
Version: 0.1.15
Version: 0.1.17
Release: 1%{?dist}
Summary: Implements a binding layer from node to rust-libzfs
License: MIT
Expand Down Expand Up @@ -52,6 +52,10 @@ rm -rf %{buildroot}
%{nodejs_sitearch}/@iml/node-libzfs/package.json

%changelog
* Thu Apr 19 2018 Joe Grund <[email protected]> - 0.1.17-1
- Change size parsing to string.
- Bump deps.

* Thu Mar 29 2018 Joe Grund <[email protected]> - 0.1.15.-1
- Add support for zfs props.

Expand Down
Loading

0 comments on commit 72461a7

Please sign in to comment.