[Libosinfo] [libosinfo PATCH v2 2/2] tools, install-script: Deprecate --config

Daniel P. Berrangé berrange at redhat.com
Wed Jul 10 09:28:42 UTC 2019


On Tue, Jul 09, 2019 at 11:24:50AM +0200, Fabiano Fidêncio wrote:
> Let's deprecate --config and warn out whenever a user or admin password
> is passed to osinfo-install-script.
> 
> Signed-off-by: Fabiano Fidêncio <fidencio at redhat.com>
> ---
>  tools/osinfo-install-script.c | 7 +++++++
>  1 file changed, 7 insertions(+)

Reviewed-by: Daniel P. Berrangé <berrange at redhat.com>

> 
> diff --git a/tools/osinfo-install-script.c b/tools/osinfo-install-script.c
> index a525645..f756ba3 100644
> --- a/tools/osinfo-install-script.c
> +++ b/tools/osinfo-install-script.c
> @@ -85,6 +85,12 @@ static gboolean handle_config(const gchar *option_name G_GNUC_UNUSED,
>      val++;
>      key = g_strndup(value, len);
>  
> +    if (g_str_equal(key, OSINFO_INSTALL_CONFIG_PROP_USER_PASSWORD) ||
> +        g_str_equal(key, OSINFO_INSTALL_CONFIG_PROP_ADMIN_PASSWORD)) {
> +        g_warning("When setting user or admin password, use --config-file "
> +                  "instead.\n");
> +    }
> +
>      osinfo_entity_set_param(OSINFO_ENTITY(config),
>                              key,
>                              val);
> @@ -519,6 +525,7 @@ script. Defaults to C<media>, but can also be C<network>.
>  =item B<--config=key=value>
>  
>  Set the configuration parameter C<key> to C<value>.
> +This option has been deprecated in favour of B<--config-file>.

I forgot that it is possible to use --config and simply let libosinfo
auto-generate the passwords (which you can then see in the output
files). With that usage there's no need to deprecate the --config
option entirely, we could simply deprecate its use the password
parameters.

Regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|




More information about the Libosinfo mailing list