search for: object_get_string

Displaying 20 results from an estimated 51 matches for "object_get_string".

2015 Aug 12
0
[PATCH 2/2] builder: support Simple Streams v1.0 as index metadata
...'%s'") key) + | _ -> error (f_"the value of the key '%s' is not an object") key + +let object_find key yv = + (match object_find_optional key yv with + | None -> error (f_"missing value for the key '%s'") key + | Some v -> v + ) + +let object_get_string key yv = + (match object_find key yv with + | Yajl_string s -> s + | _ -> error (f_"the value for the key '%s' is not a string") key + ) + +let object_find_object key yv = + (match object_find key yv with + | Yajl_object _ as o -> o + | _ -> error (f_"the v...
2017 Jan 03
0
[PATCH 1/5] builder: extract Yajl helper functions to yajl.ml
...he key '%s'") key) - | _ -> error (f_"the value of the key '%s' is not an object") key - -let object_find key yv = - match object_find_optional key yv with - | None -> error (f_"missing value for the key '%s'") key - | Some v -> v - -let object_get_string key yv = - match object_find key yv with - | Yajl_string s -> s - | _ -> error (f_"the value for the key '%s' is not a string") key - -let object_find_object key yv = - match object_find key yv with - | Yajl_object _ as o -> o - | _ -> error (f_"the value fo...
2020 Jan 28
0
[v2v PATCH 2/2] -o rhv-upload: check guest arch with cluster
...l mutable rhv_cluster_uuid = None + (* The cluster CPU architecture *) + val mutable rhv_cluster_cpu_architecture = None (* List of disk UUIDs. *) val mutable disks_uuids = [] (* If we didn't finish successfully, delete on exit. *) @@ -272,6 +274,8 @@ object Some (JSON_parser.object_get_string "rhv_storagedomain_uuid" json); rhv_cluster_uuid <- Some (JSON_parser.object_get_string "rhv_cluster_uuid" json); + rhv_cluster_cpu_architecture <- + Some (JSON_parser.object_get_string "rhv_cluster_cpu_architecture" json); if have_seli...
2020 Jan 28
2
[v2v PATCH 1/2] Add back guestcaps as parameter of output#prepare_targets
It will be used to do extra checks in the output before copying the disks. Partially revert commit 3bafec4e693a25ef1c84abc0fd1bc3251862c7de. --- v2v/output_glance.ml | 2 +- v2v/output_json.ml | 2 +- v2v/output_libvirt.ml | 2 +- v2v/output_local.ml | 2 +- v2v/output_null.ml | 2 +- v2v/output_openstack.ml | 2 +- v2v/output_qemu.ml | 2 +- v2v/output_rhv.ml
2018 Aug 20
0
[PATCH 4/4] mltools: JSON: unify JSON_parser type with JSON.json_t.
...is not a Simple Streams (index) v1.0 JSON file (format: %s)") uri format; - let index = Array.to_list (object_get_object "index" tree) in + let index = object_get_object "index" tree in List.filter_map ( fun (_, desc) -> let format = object_get_string "format" desc in @@ -78,13 +78,12 @@ let get_index ~downloader ~sigchecker { Sources.uri; proxy } = error (f_"%s is not a Simple Streams (products) v1.0 JSON file (format: %s)") uri format; - let products_node = object_get_object "products" tree in...
2015 Sep 07
0
[PATCH 4/4] builder: support Simple Streams v1.0 as index metadata
...he key '%s'") key) + | _ -> error (f_"the value of the key '%s' is not an object") key + +let object_find key yv = + match object_find_optional key yv with + | None -> error (f_"missing value for the key '%s'") key + | Some v -> v + +let object_get_string key yv = + match object_find key yv with + | Yajl_string s -> s + | _ -> error (f_"the value for the key '%s' is not a string") key + +let object_find_object key yv = + match object_find key yv with + | Yajl_object _ as o -> o + | _ -> error (f_"the value fo...
2018 Aug 22
3
[PATCH v2 0/2] mltools: JSON: unify JSON & JSON parser.
v2: - Added back the null value. - Reran the tests. Rich.
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
2018 Aug 23
2
[PATCH 1/2] mltools: JSON: add json_parser_tree_parse_file
...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_t (** Parse the JSON string. *) +val json_parser_tree_parse_file : string -> JSON.json_t +(** Parse the JSON in the specified file. *) + val object_get_string : string -> JSON.json_t -> string (** [object_get_string key yv] gets the value of the [key] field as a string in the [yv] structure *) diff --git a/common/mltools/JSON_parser_tests.ml b/common/mltools/JSON_parser_tests.ml index 024817711..286724616 100644 --- a/common/mltools/JSON_pars...
2018 Aug 20
6
[PATCH 0/4] mltools: JSON unification
An evolution of: https://www.redhat.com/archives/libguestfs/2018-August/msg00155.html
2019 Sep 16
0
[PATCH 3/8] v2v: -o rhv-upload: improve lookup of specified resources (RHBZ#1612653)
..._available (); @@ -237,6 +242,10 @@ object let json = JSON_parser.json_parser_tree_parse_file precheck_fn in debug "precheck output parsed as: %s" (JSON.string_of_doc ~fmt:JSON.Indented ["", json]); + rhv_storagedomain_uuid <- + Some (JSON_parser.object_get_string "rhv_storagedomain_uuid" json); + rhv_cluster_uuid <- + Some (JSON_parser.object_get_string "rhv_cluster_uuid" json); if have_selinux then error_unless_nbdkit_compiled_with_selinux () @@ -383,11 +392,11 @@ If the messages above are not sufficient to dia...
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
0
[PATCH v3 1/4] mltools: Rename Yajl module as JSON_parser and move to common/mltools.
...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 yv with - | Yajl_string s -> s + | JSON_parser_string s -> s | _ -> error (f_"the value for the key ā€˜%sā€™ is not a string") key let object_find_object key yv = match object_find key yv with - | Yajl_object _ as o -> o + | JSON_pars...
2017 Oct 27
0
[PATCH v11 3/8] builder: change arch type to (string, string option) maybe.
.....10721e49c 100644 --- a/builder/simplestreams_parser.ml +++ b/builder/simplestreams_parser.ml @@ -83,7 +83,7 @@ let get_index ~downloader ~sigchecker { Sources.uri; proxy } = let products = Array.to_list products_node in filter_map ( fun (prod, prod_desc) -> - let arch = object_get_string "arch" prod_desc in + let arch = Either (object_get_string "arch" prod_desc) in let prods = Array.to_list (object_get_object "versions" prod_desc) in let prods = filter_map ( fun (rel, rel_desc) -> -- 2.13.2
2017 Nov 21
0
[PATCH v13 1/3] builder: change arch type to distinguish guesses
.....996c334f5 100644 --- a/builder/simplestreams_parser.ml +++ b/builder/simplestreams_parser.ml @@ -83,7 +83,7 @@ let get_index ~downloader ~sigchecker { Sources.uri; proxy } = let products = Array.to_list products_node in filter_map ( fun (prod, prod_desc) -> - let arch = object_get_string "arch" prod_desc in + let arch = Index.Arch (object_get_string "arch" prod_desc) in let prods = Array.to_list (object_get_object "versions" prod_desc) in let prods = filter_map ( fun (rel, rel_desc) -> -- 2.15.0
2017 Nov 13
0
[PATCH v12 1/3] builder: change arch type to distinguish guesses
.....996c334f5 100644 --- a/builder/simplestreams_parser.ml +++ b/builder/simplestreams_parser.ml @@ -83,7 +83,7 @@ let get_index ~downloader ~sigchecker { Sources.uri; proxy } = let products = Array.to_list products_node in filter_map ( fun (prod, prod_desc) -> - let arch = object_get_string "arch" prod_desc in + let arch = Index.Arch (object_get_string "arch" prod_desc) in let prods = Array.to_list (object_get_object "versions" prod_desc) in let prods = filter_map ( fun (rel, rel_desc) -> -- 2.14.3
2018 Nov 20
1
[PATCH] v2v: -o openstack: Check openstack binary exists before running it.
...t;openstack" + (* Timeout waiting for new Cinder volumes to move to "available" state. * We assume this could be quite a long time on backends which want * to preallocate the storage. @@ -172,13 +175,20 @@ class output_openstack output_conn output_password output_storage object_get_string "uuid" json ) in + let error_unless_openstack_command_exists () = + try ignore (which openstack_binary) + with Executable_not_found _ -> + error (f_"no binary called ā€˜%sā€™ was found on the $PATH. We use this program to communicate with OpenStack so it must be inst...
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
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