[libvirt] [libvirt-sandbox][PATCH 2/2] Raise clear error message if no legacy configuration

Daniel P. Berrange berrange at redhat.com
Fri Aug 9 10:30:45 UTC 2013


On Fri, Aug 09, 2013 at 06:26:47PM +0800, Alex Jia wrote:
> Signed-off-by: Alex Jia <ajia at redhat.com>
> ---
>  bin/virt-sandbox-service | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/bin/virt-sandbox-service b/bin/virt-sandbox-service
> index 26b4a40..cb40f6a 100755
> --- a/bin/virt-sandbox-service
> +++ b/bin/virt-sandbox-service
> @@ -965,6 +965,9 @@ def upgrade_config(args):
>      configfile = get_legacy_config_path(args.name)
>      if os.path.exists(configfile):
>          upgrade_config_legacy(configfile)
> +    else:
> +        sys.stderr.write("No legacy '%s' configuration\n" % args.name)
> +        sys.exit(1)

This isn't desired. This command is intended to be a no-op if nothing
needs changing. It is not just about upgrading from this legacy
config file layout. In the future I expet us to add more code here
as we make further changes. So it is right to silently exit with
success here, not report an error.

Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|




More information about the libvir-list mailing list