ia64/xen-unstable

changeset 12135:2732e3f94e2e

[SOLARIS] The hotplug scripts live in a different place on Solaris.

Add osdep.py module

Signed-off-by: John Levon <john.levon@sun.com>
author Alastair Tse <atse@xensource.com>
date Thu Oct 19 11:35:09 2006 +0100 (2006-10-19)
parents 6a4ac637d8db
children 0a1a5b2072a3
files tools/python/xen/xend/osdep.py
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/tools/python/xen/xend/osdep.py	Thu Oct 19 11:35:09 2006 +0100
     1.3 @@ -0,0 +1,36 @@
     1.4 +#!/usr/bin/env python
     1.5 +#
     1.6 +# This library is free software; you can redistribute it and/or
     1.7 +# modify it under the terms of version 2.1 of the GNU Lesser General Public
     1.8 +# License as published by the Free Software Foundation.
     1.9 +#
    1.10 +# This library is distributed in the hope that it will be useful,
    1.11 +# but WITHOUT ANY WARRANTY; without even the implied warranty of
    1.12 +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    1.13 +# Lesser General Public License for more details.
    1.14 +#
    1.15 +# You should have received a copy of the GNU Lesser General Public
    1.16 +# License along with this library; if not, write to the Free Software
    1.17 +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
    1.18 +#
    1.19 +
    1.20 +# Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
    1.21 +# Use is subject to license terms.
    1.22 +
    1.23 +import os
    1.24 +
    1.25 +_scripts_dir = {
    1.26 +    "Linux": "/etc/xen/scripts",
    1.27 +    "SunOS": "/usr/lib/xen/scripts",
    1.28 +}
    1.29 +
    1.30 +_xend_autorestart = {
    1.31 +    "Linux": True,
    1.32 +    "SunOS": False,
    1.33 +}
    1.34 +
    1.35 +def _get(var, default=None):
    1.36 +    return var.get(os.uname()[0], default)
    1.37 +
    1.38 +scripts_dir = _get(_scripts_dir, "/etc/xen/scripts")
    1.39 +xend_autorestart = _get(_xend_autorestart)