FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > Fedora/Linux Management Tools

 
 
LinkBack Thread Tools
 
Old 07-25-2008, 03:53 PM
 
Default virt-convert: more error checking

# HG changeset patch
# User john.levon@sun.com
# Date 1217001163 25200
# Node ID c0bd4e747433ae4ab8ade954ed0b95c521661147
# Parent 9bf9f0bcb2bcc3d31b82dda7abb46ecc8f04dc8a
virt-convert: more error checking

Improve the error checking a little.

Signed-off-by: John Levon <john.levon@sun.com>

diff --git a/virt-convert b/virt-convert
--- a/virt-convert
+++ b/virt-convert
@@ -98,12 +98,16 @@ def parse_args():
opts.error(("No output handler for format "%s""
% options.output_format))

+ if not os.access(args[0], os.R_OK):
+ opts.error("Couldn't access input argument "%s"
" % args[0])
+ sys.exit(1)
+
if not options.input_format:
try:
(args[0], options.input_format) = formats.find_input(args[0])
except StandardError, e:
opts.error("Couldn't determine input format for "%s": %s" %
- (args[0], e.message))
+ (args[0], e))
sys.exit(1)

if options.input_format not in formats.formats():
@@ -166,7 +170,7 @@ def main():
sys.exit(1)
except Exception, e:
logging.error("Couldn't import file "%s": %s" %
- (options.input_file, e.message))
+ (options.input_file, e))
sys.exit(1)

if options.paravirt:
@@ -231,14 +235,14 @@ def main():
cleanup("Couldn't convert disks: %s" % e.strerror,
options, vmdef, clean)
except RuntimeError, e:
- cleanup("Couldn't convert disks: %s" % e.message, options, vmdef, clean)
+ cleanup("Couldn't convert disks: %s" % e, options, vmdef, clean)

try:
clean += [ options.output_file ]
outp.export_file(vmdef, options.output_file)
except ValueError, e:
cleanup("Couldn't export to file "%s": %s" %
- (options.output_file, e.message), options, vmdef, clean)
+ (options.output_file, e), options, vmdef, clean)

verbose(options, "Done.")


_______________________________________________
et-mgmt-tools mailing list
et-mgmt-tools@redhat.com
https://www.redhat.com/mailman/listinfo/et-mgmt-tools
 
Old 07-28-2008, 03:06 PM
Cole Robinson
 
Default virt-convert: more error checking

john.levon@sun.com wrote:
> # HG changeset patch
> # User john.levon@sun.com
> # Date 1217001163 25200
> # Node ID c0bd4e747433ae4ab8ade954ed0b95c521661147
> # Parent 9bf9f0bcb2bcc3d31b82dda7abb46ecc8f04dc8a
> virt-convert: more error checking
>
> Improve the error checking a little.
>
> Signed-off-by: John Levon <john.levon@sun.com>
>

Applied:

http://hg.et.redhat.com/virt/applications/virtinst--devel?cs=1f02236d9aee

Thanks,
Cole

_______________________________________________
et-mgmt-tools mailing list
et-mgmt-tools@redhat.com
https://www.redhat.com/mailman/listinfo/et-mgmt-tools
 

Thread Tools




All times are GMT. The time now is 02:37 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org