-
Couldn't load subscription status.
- Fork 293
CP-46377: Add env vars TRACEPARENT & OBSERVER_CONFIG_DIR to exec_xmlrpc calls
#5345
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
mg12
merged 6 commits into
xapi-project:master
from
GabrielBuica:private/dbuica/CP-46377
Feb 1, 2024
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
f0e95a5
CP-46377: Splitting `xapi_observer.ml` in separete files
GabrielBuica 8a50d99
CP-46477: Add helper function `is_component_enabled`
GabrielBuica eea6c14
CP-46377: Add env vars `TRACEPARENT` and `OBSERVER_CONFIG_DIR` to `sm…
GabrielBuica 829a608
CP-46377: Define default env var path in `forkhelpers.ml`
GabrielBuica 96e0642
CP-46377: Improve maintainabilty of `Dom0ObserverConfig`
GabrielBuica b5ce70d
CP-46377: Refactor `env_vars_of_observer`
GabrielBuica File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| (* | ||
| * Copyright (C) 2023 Cloud Software Group | ||
| * | ||
| * This program is free software; you can redistribute it and/or modify | ||
| * it under the terms of the GNU Lesser General Public License as published | ||
| * by the Free Software Foundation; version 2.1 only. with the special | ||
| * exception on linking described in file LICENSE. | ||
| * | ||
| * This program is distributed in the hope that it will be useful, | ||
| * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| * GNU Lesser General Public License for more details. | ||
| *) | ||
|
|
||
| type t = string | ||
|
|
||
| let str txt = txt | ||
|
|
||
| let option opt = Option.value ~default:"" opt | ||
|
|
||
| let list element lst = List.map element lst |> String.concat "," | ||
|
|
||
| let pair (key, value) = String.concat "=" [key; value] | ||
|
|
||
| let to_shell_string lst = | ||
| lst | ||
| |> List.map (fun (key, value) -> String.concat "=" [key; Filename.quote value]) | ||
| |> String.concat "\n" | ||
|
|
||
| let to_string_array = Array.of_list |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,51 @@ | ||
| (* | ||
| * Copyright (C) 2023 Cloud Software Group | ||
| * | ||
| * This program is free software; you can redistribute it and/or modify | ||
| * it under the terms of the GNU Lesser General Public License as published | ||
| * by the Free Software Foundation; version 2.1 only. with the special | ||
| * exception on linking described in file LICENSE. | ||
| * | ||
| * This program is distributed in the hope that it will be useful, | ||
| * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| * GNU Lesser General Public License for more details. | ||
| *) | ||
|
|
||
| (** A Unix environment variable is a pair of a name and a value, both of which | ||
| * are strings. This module helps to construct a complex environment value | ||
| * that follows specific conventions. | ||
| *) | ||
|
|
||
| (** A value of type [t] represents a value. | ||
| * It is constructed recursively from OCaml values using functions like [str], | ||
| * [option], or [list]. An environment value of type [t] can be observed using | ||
| * [to_shell_string] or [to_string_array]. | ||
| *) | ||
| type t | ||
|
|
||
GabrielBuica marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| val str : string -> t | ||
| (** Returns an environment variable value from a string. | ||
| *) | ||
|
|
||
| val option : string option -> t | ||
| (** Returns an environment variable value from a string option. | ||
| * If [None], returns an empty string value. | ||
| *) | ||
|
|
||
| val list : ('a -> t) -> 'a list -> t | ||
| (** [list element lst] is the list [lst] with elements converted by [element] | ||
| * and separated by [,]. | ||
| *) | ||
|
|
||
| val pair : string * string -> t | ||
| (** [pair (key, value)] is [key=value] pair. *) | ||
|
|
||
| val to_shell_string : (string * t) list -> string | ||
| (** [to_shell_string env_vars] is [env_vars] quoted as needed for use in a shell | ||
| * script. | ||
| *) | ||
|
|
||
| val to_string_array : t list -> string array | ||
| (** Transforms a list of environment variables to a string array of environment | ||
| * variables.*) | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -29,3 +29,5 @@ val with_dbg : | |
| -> dbg:string | ||
| -> (t -> 'a) | ||
| -> 'a | ||
|
|
||
| val traceparent_of_dbg : string -> string option | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.