From mboxrd@z Thu Jan 1 00:00:00 1970 From: Scott Parish Subject: [PATCH] warn when iproute2 or bridge-utils are missing Date: Fri, 25 Feb 2005 19:08:56 +0000 Message-ID: <20050225190856.GA11704@us.ibm.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="k+w/mQv8wyuph6w0" Content-Disposition: inline Sender: xen-devel-admin@lists.sourceforge.net Errors-To: xen-devel-admin@lists.sourceforge.net List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , List-Archive: To: xen-devel@lists.sourceforge.net List-Id: xen-devel@lists.xenproject.org --k+w/mQv8wyuph6w0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline The attached patch checks for "ip" and "brctl" in the path, and warns the user if they are not found. sRp -- Scott Parish --k+w/mQv8wyuph6w0 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="check_network_packages.patch" diff -rN -u xen-2.0.4-old/tools/misc/xend xen-2.0.4-new/tools/misc/xend --- xen-2.0.4-old/tools/misc/xend 2005-02-04 13:38:37.000000000 +0000 +++ xen-2.0.4-new/tools/misc/xend 2005-02-25 19:00:55.000000000 +0000 @@ -89,12 +89,30 @@ msg("Xend must be run as root.") hline() raise CheckError("invalid user") + +def check_network_packages(): + """Check that iproute2 and bridge-utils are installed. + """ + def file_in_path(file): + return reduce(lambda a, b: a or b, + [os.path.isfile(os.path.join(dir, file)) for + dir in os.getenv("PATH").split(os.path.pathsep)], 0) + if not file_in_path("ip"): + hline() + msg("Warning: 'ip' not found in path: verify iproute2 is installed") + hline() + if not file_in_path("brctl"): + hline() + msg("Warning: 'brctl' not found in path: verify bridge-utils is installed") + hline() + def main(): try: check_logging() check_twisted_version() check_user() + check_network_packages() except CheckError: sys.exit(1) daemon = SrvDaemon.instance() --k+w/mQv8wyuph6w0-- ------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click