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

All Samples(3)  |  Call(1)  |  Derive(0)  |  Import(2)

        def get_dom_type(domain):
    from karesansui.lib.const import VIRT_XML_CONFIG_DIR
    retval = None
    _path = os.path.join(VIRT_XML_CONFIG_DIR, domain+".xml")
    if os.path.exists(_path):
        doc = get_xml_parse(_path)
        retval = get_xml_xpath(doc,'/domain/@type')
    return retval
        


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, \
 
        if obj.input.domain_name in get_dom_list():
            dom_type = get_dom_type(obj.input.domain_name)
            checker.add_error(_("The same domain name already exists for hypervisor '%s'.") % dom_type.upper())
            check = False

src/k/a/karesansui-HEAD/karesansui/gadget/guestimport.py   karesansui(Download)
from karesansui.lib.rest import Rest, auth
 
from karesansui.lib.utils import chk_create_disk, json_dumps, is_param, \
  base64_encode, base64_decode, get_dom_list, get_dom_type, \
  string_from_uuid, generate_uuid, comma_split, uniq_sort, get_partition_info