Displaying 14 results from an estimated 14 matches for "object_find_optional".
2017 Jan 03
0
[PATCH 1/5] builder: extract Yajl helper functions to yajl.ml
....ml
index 81e70189a..8844d476b 100644
--- a/builder/simplestreams_parser.ml
+++ b/builder/simplestreams_parser.ml
@@ -28,58 +28,6 @@ let ensure_trailing_slash str =
if String.length str > 0 && str.[String.length str - 1] <> '/' then str ^ "/"
else str
-let object_find_optional key = function
- | Yajl_object o ->
- (match List.filter (fun (k, _) -> k = key) (Array.to_list o) with
- | [(k, v)] -> Some v
- | [] -> None
- | _ -> error (f_"more than value for the key '%s'") key)
- | _ -> error (f_"the value of the key ...
2015 Aug 12
0
[PATCH 2/2] builder: support Simple Streams v1.0 as index metadata
...Floor, Boston, MA 02110-1301 USA.
+ *)
+
+open Common_gettext.Gettext
+open Common_utils
+
+open Yajl
+open Utils
+
+open Printf
+
+let ensure_trailing_slash str =
+ if String.length str > 0 && str.[String.length str - 1] <> '/' then str ^ "/"
+ else str
+
+let object_find_optional key = function
+ | Yajl_object o ->
+ (match List.filter (fun (k, _) -> k = key) (Array.to_list o) with
+ | [(k, v)] -> Some v
+ | [] -> None
+ | _ -> error (f_"more than value for the key '%s'") key)
+ | _ -> error (f_"the value of the key ...
2015 Aug 12
4
[PATCH 0/2 v2] RFC: builder: support for Simple Streams metadata
Hi,
this series adds a basic support for Simple Streams v1.0 metadata
files. This makes it possible to create a repository .conf files with
[cirros]
uri=http://download.cirros-cloud.net
format=simplestreams
to read the latest version of each CirrOS image.
TODO items:
- check the pasted metadata: listing and creating images works,
so most of the current metadata is correct
- possibly wait
2015 Sep 07
0
[PATCH 4/4] builder: support Simple Streams v1.0 as index metadata
...Floor, Boston, MA 02110-1301 USA.
+ *)
+
+open Common_gettext.Gettext
+open Common_utils
+
+open Yajl
+open Utils
+
+open Printf
+
+let ensure_trailing_slash str =
+ if String.length str > 0 && str.[String.length str - 1] <> '/' then str ^ "/"
+ else str
+
+let object_find_optional key = function
+ | Yajl_object o ->
+ (match List.filter (fun (k, _) -> k = key) (Array.to_list o) with
+ | [(k, v)] -> Some v
+ | [] -> None
+ | _ -> error (f_"more than value for the key '%s'") key)
+ | _ -> error (f_"the value of the key ...
2018 Aug 23
2
[PATCH 1/2] mltools: JSON: add json_parser_tree_parse_file
...-21,6 +21,7 @@ open Tools_utils
open Common_gettext.Gettext
external json_parser_tree_parse : string -> JSON.json_t = "virt_builder_json_parser_tree_parse"
+external json_parser_tree_parse_file : string -> JSON.json_t = "virt_builder_json_parser_tree_parse_file"
let object_find_optional key = function
| JSON.Dict fields ->
diff --git a/common/mltools/JSON_parser.mli b/common/mltools/JSON_parser.mli
index 5ad0ef017..a62d387cd 100644
--- a/common/mltools/JSON_parser.mli
+++ b/common/mltools/JSON_parser.mli
@@ -19,6 +19,9 @@
val json_parser_tree_parse : string -> JSON.json_...
2018 Aug 20
0
[PATCH 4/4] mltools: JSON: unify JSON_parser type with JSON.json_t.
..._parser_array of json_parser_val array
-| JSON_parser_bool of bool
-
-external json_parser_tree_parse : string -> json_parser_val = "virt_builder_json_parser_tree_parse"
+external json_parser_tree_parse : string -> JSON.json_t = "virt_builder_json_parser_tree_parse"
let object_find_optional key = function
- | JSON_parser_object o ->
- (match List.filter (fun (k, _) -> k = key) (Array.to_list o) with
+ | JSON.Dict fields ->
+ (match List.filter (fun (k, _) -> k = key) fields with
| [(k, v)] -> Some v
| [] -> None
| _ -> error (f_"more th...
2018 Aug 22
3
[PATCH v2 0/2] mltools: JSON: unify JSON & JSON parser.
v2:
- Added back the null value.
- Reran the tests.
Rich.
2017 Jan 03
13
[PATCH 0/5] Introducing virt-builder-repository
Hi all,
I wanted to provide an easy way to create or update a virt-builder
repository out of a folder of template disk image files. This is what
virt-builder-repository aims at. Some of the data are computed from
the image file, others are asked the user or extracted from an existing
index file.
So far, virt-builder-repository doesn't run libguestfs on each image
to extract the architecture,
2018 Aug 17
0
[PATCH v3 1/4] mltools: Rename Yajl module as JSON_parser and move to common/mltools.
...al) array
+| JSON_parser_array of json_parser_val array
+| JSON_parser_bool of bool
-external yajl_tree_parse : string -> yajl_val = "virt_builder_yajl_tree_parse"
+external json_parser_tree_parse : string -> json_parser_val = "virt_builder_json_parser_tree_parse"
let object_find_optional key = function
- | Yajl_object o ->
+ | JSON_parser_object o ->
(match List.filter (fun (k, _) -> k = key) (Array.to_list o) with
| [(k, v)] -> Some v
| [] -> None
@@ -46,27 +46,27 @@ let object_find key yv =
let object_get_string key yv =
match object_find key...
2018 Aug 20
6
[PATCH 0/4] mltools: JSON unification
An evolution of:
https://www.redhat.com/archives/libguestfs/2018-August/msg00155.html
2015 Sep 07
5
[PATCH 0/4 v3] builder: support for Simple Streams metadata
Hi,
this series adds a basic support for Simple Streams v1.0 metadata
files. This makes it possible to create a repository .conf files with
[cirros]
uri=http://download.cirros-cloud.net
format=simplestreams
to read the latest version of each CirrOS image.
Thanks,
Pino Toscano (4):
builder: add non-int revisions
builder: add simple libyajl binding
build: expose HAVE_YAJL to automake
2018 Aug 17
8
[PATCH v3 4/4] v2v: Add --print-estimate option to print copy size
I rethought this again, as I think that it's a dangerous assumption to
bake qemu-img measure output into our API.
This patch series runs qemu-img measure behind the scenes, but then
parses the output and sums it to a single number which we print.
Doing that required a bit of reworking, moving the Jansson [JSON
parser] bindings from virt-builder into the common directory and
a couple of other
2015 Jul 28
19
[PATCH 00/10] RFC: builder: first support for Simple Streams metadata
Hi,
this series adds a basic support for Simple Streams v1.0 metadata
files. This makes it possible to create a repository .conf files with
[cirros]
uri=http://download.cirros-cloud.net
format=simplestreams
to read the latest version of each CirrOS image.
TODO items:
- a bit more testing: listing and creating images works, so the
current metadata is correct
- handle revisions, so newer
2017 Apr 04
1
[PATCH] Use Unicode single quotes ‘’ in place of short single quoted strings throughout.
...gnature> on the
command line. This prevents an attacker from replacing the signed
index file with an unsigned index file and having virt-builder
diff --git a/builder/yajl.ml b/builder/yajl.ml
index e53706abc..d933b5246 100644
--- a/builder/yajl.ml
+++ b/builder/yajl.ml
@@ -35,23 +35,23 @@ let object_find_optional key = function
(match List.filter (fun (k, _) -> k = key) (Array.to_list o) with
| [(k, v)] -> Some v
| [] -> None
- | _ -> error (f_"more than value for the key '%s'") key)
- | _ -> error (f_"the value of the key '%s' is not an objec...