WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] This patch adds a check to make sure the config file pas

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] This patch adds a check to make sure the config file passed to
From: Xen patchbot -unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Fri, 04 Nov 2005 12:14:06 +0000
Delivery-date: Fri, 04 Nov 2005 12:14:14 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User kaf24@xxxxxxxxxxxxxxxxxxxx
# Node ID 1a5861311b04698744fb426c18a0af48bbdad4c7
# Parent  d9d88dd713ba8f95c2fe717be36c64c31605913b
This patch adds a check to make sure the config file passed to
vnet-create is correct.  This is better than throwing IOError, because
IOError's are currently reported as xend communication failures.
Also, fix the IOError handling at the end of the file so we don't get
a stack dump if that path is taken.

Signed-off-by: Dan Smith <danms@xxxxxxxxxx>

diff -r d9d88dd713ba -r 1a5861311b04 tools/python/xen/xm/main.py
--- a/tools/python/xen/xm/main.py       Fri Nov  4 10:05:10 2005
+++ b/tools/python/xen/xm/main.py       Fri Nov  4 10:06:41 2005
@@ -666,6 +666,10 @@
 def xm_vnet_create(args):
     arg_check(args, 1, "vnet-create")
     conf = args[0]
+    if not os.access(conf, os.R_OK):
+        print "File not found: %s" % conf
+        sys.exit(1)
+
     from xen.xend.XendClient import server
     server.xend_vnet_create(conf)
 
@@ -800,7 +804,7 @@
         except KeyboardInterrupt:
             print "Interrupted."
             sys.exit(1)
-        except IOError:
+        except IOError, ex:
             if os.geteuid() != 0:
                 err("Most commands need root access.  Please try again as 
root.")
             else:

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] This patch adds a check to make sure the config file passed to, Xen patchbot -unstable <=