Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(9)  |  Call(5)  |  Derive(0)  |  Import(4)
<comment-ja>
</comment-ja>
<comment-en>
get list of usable virtualization mechanisms
</comment-en>

        def available_virt_mechs():
    """
    
    
    get list of usable virtualization mechanisms
    
    """
    ret = []
    if os.access("/proc/xen", os.R_OK):
        ret.append("XEN")
    if is_loaded_kernel_module("kvm"):
        ret.append("KVM")

    return sorted(ret)
        


src/k/a/karesansui-HEAD/karesansui/gadget/guest.py   karesansui(Download)
from karesansui.lib.const import XEN_KEYMAP_DIR, KVM_KEYMAP_DIR, KVM_BRIDGE_PREFIX
 
from karesansui.lib.utils import comma_split, \
     generate_mac_address, is_param, \
     next_number, generate_uuid, string_from_uuid, uniq_sort, \
 
                for k,v in MACHINE_HYPERVISOR.iteritems():
                    if k in available_virt_mechs():
                        self.view.hypervisors[k] = v
                        uri = uris[k]
                    for model in models:
                        for k,v in MACHINE_HYPERVISOR.iteritems():
                            if k in available_virt_mechs():
                                self.view.hypervisors[k] = v
                                uri = uris[k]

src/k/a/karesansui-HEAD/karesansui/gadget/hostby1networksettings.py   karesansui(Download)
from pysilhouette.command import dict2command
 
from karesansui.lib.utils import get_ifconfig_info, get_bonding_info, dict_ksort, available_virt_mechs, is_param
from karesansui.lib.const import BONDING_COMMAND_ADD, NETWORK_COMMAND_RESTART, BONDING_MODE
 
 
            self.view.bond_target_dev = dev_list
            self.view.hypervisors = available_virt_mechs()
            return True
 

src/k/a/karesansui-HEAD/bin/karesansui_sysinfo.py   karesansui(Download)
    from karesansui.lib.utils import is_executable, execute_command
    from karesansui.lib.utils import available_virt_uris
    from karesansui.lib.utils import available_virt_mechs
 
except ImportError, e:
            print ""
            print "## Available mechanisms"
            for mech in available_virt_mechs():
               print mech
 

src/k/a/karesansui-HEAD/karesansui/lib/collectd/config.py   karesansui(Download)
    dop.cdp_set("collectdplugin",keys,value,multiple_file=True)
 
    from karesansui.lib.utils import available_virt_mechs, available_virt_uris
    keys = _keys + ["Connection"]
    mech = available_virt_mechs()[0]