From: Scott Parish <srparish@us.ibm.com>
To: xen-devel@lists.sourceforge.net
Subject: [PATCH] warn when iproute2 or bridge-utils are missing
Date: Fri, 25 Feb 2005 19:08:56 +0000 [thread overview]
Message-ID: <20050225190856.GA11704@us.ibm.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 126 bytes --]
The attached patch checks for "ip" and "brctl" in the path, and warns
the user if they are not found.
sRp
--
Scott Parish
[-- Attachment #2: check_network_packages.patch --]
[-- Type: text/plain, Size: 1181 bytes --]
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()
next reply other threads:[~2005-02-25 19:08 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-02-25 19:08 Scott Parish [this message]
2005-02-25 20:22 ` [PATCH] warn when iproute2 or bridge-utils are missing Matt Ayres
2005-02-25 21:21 ` Scott Parish
2005-02-25 21:48 ` Anthony Liguori
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20050225190856.GA11704@us.ibm.com \
--to=srparish@us.ibm.com \
--cc=xen-devel@lists.sourceforge.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.