You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There are requests for non-standard formats, e.g. Terraform (#140). Instead of providing custom formatting functions, it may be easier and more flexible to print outputs using user-supplied Template strings.
Examples:
The outputs of the commands are dicts (JSON formats), e.g.
User provides template string "The selected flavor is $Name", via option --output-template
The output from the command will be the result of output_template.safe_substitute(results), which replaces $Name in the template with value m1.medium from results and print "The selected flavor is m1.medium".
Custom delimiters can be used for distinguishing different outputs with the same names. For examples different $Names likes $Network.Name, $Flavor.Name, $Image.Name may be used in the same template.
safe_substitute() only replaces valid values it can find, and leaves the rest intact. For example, the first run may be fedcloud select network with custom delimiter $Network. and replaces only the $Network.Name in the template, the next run will be fedcloud select image with delimiter $Image. for substituting $Image.Name, ...
So for generating something like CESNET-MCC.tfvars, we can use single template and execute fedcloud select commands 3x, each command replaces a parameter without conflicts.
The text was updated successfully, but these errors were encountered:
There are requests for non-standard formats, e.g. Terraform (#140). Instead of providing custom formatting functions, it may be easier and more flexible to print outputs using user-supplied Template strings.
Examples:
User provides template string
"The selected flavor is $Name"
, via option--output-template
The output from the command will be the result of
output_template.safe_substitute(results)
, which replaces$Name
in the template with valuem1.medium
fromresults
and print"The selected flavor is m1.medium"
.Custom delimiters can be used for distinguishing different outputs with the same names. For examples different
$Names
likes$Network.Name
,$Flavor.Name
,$Image.Name
may be used in the same template.safe_substitute()
only replaces valid values it can find, and leaves the rest intact. For example, the first run may befedcloud select network
with custom delimiter$Network.
and replaces only the$Network.Name
in the template, the next run will befedcloud select image
with delimiter$Image.
for substituting$Image.Name
, ...So for generating something like CESNET-MCC.tfvars, we can use single template and execute
fedcloud select
commands 3x, each command replaces a parameter without conflicts.The text was updated successfully, but these errors were encountered: