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

All Samples(6)  |  Call(0)  |  Derive(0)  |  Import(6)
str(object='') -> string

Return a nice string representation of the object.
If the argument is a string, the return value is the same object.

src/k/a/karesansui-HEAD/karesansui/lib/virt/virt.py   karesansui(Download)
import karesansui.lib.locale
 
from karesansui.lib.const import VIRT_LIBVIRT_DATA_DIR, VIRT_DOMAINS_DIR, \
     VIRT_XML_CONFIG_DIR, VIRT_NETWORK_CONFIG_DIR, VIRT_SNAPSHOT_DIR, \
     VIRT_XENDOMAINS_AUTO_DIR, VIRT_AUTOSTART_CONFIG_DIR, \
        """
        pools = self.search_kvn_storage_pools()
        rpath = "%s/%s" % (ISCSI_DEVICE_DIR, symlink)
        ret = None
        for pool in pools:
                vol_obj = pool_obj.vol_storageVolLookupByName(vol)
                vol_key = vol_obj.key()
                vol_key = vol_key.replace("%s/" % (ISCSI_DEVICE_DIR), "")
                regex = re.compile(r"^%s" % (re.escape(vol_key)))
                is_mount = False

src/k/a/karesansui-HEAD/karesansui/gadget/hostby1networkstorageby1.py   karesansui(Download)
from karesansui.lib.utils import is_param, generate_phrase, create_file, \
    get_filelist, symlink2real
from karesansui.lib.const import ISCSI_COMMAND_GET, ISCSI_COMMAND_UPDATE, \
    ISCSI_COMMAND_DELETE,     ISCSI_CONFIG_VALUE_AUTH_METHOD_CHAP, \
    PORT_MIN_NUMBER,          PORT_MAX_NUMBER, \
            }
 
        dev_symlink_list = get_filelist(ISCSI_DEVICE_DIR)
        if activity == '1':
            disk_list = []
            symlink_regexp = re.compile("^%s" % (re.escape(ISCSI_DEVICE_NAME_TPL % (host, port, iqn))))
            for sym_link in dev_symlink_list:
                if symlink_regexp.match(sym_link):
                    real_path = symlink2real("%s/%s" % (ISCSI_DEVICE_DIR, sym_link))
            kvc = KaresansuiVirtConnection()
            try:
                dev_symlink_list = get_filelist(ISCSI_DEVICE_DIR)
                dev_symlink_list.sort()
                symlink_regexp = re.compile("^%s/%s" % (re.escape(ISCSI_DEVICE_DIR), re.escape(ISCSI_DEVICE_NAME_TPL % (host, port, iqn))))

src/k/a/karesansui-HEAD/karesansui/gadget/hostby1networkstorage.py   karesansui(Download)
from karesansui.lib.utils import is_param, generate_phrase, create_file, \
    get_filelist, symlink2real
from karesansui.lib.const import ISCSI_COMMAND_GET, ISCSI_COMMAND_ADD, \
    ISCSI_CONFIG_VALUE_AUTH_METHOD_CHAP, PORT_MIN_NUMBER, PORT_MAX_NUMBER, \
    CHAP_USER_MIN_LENGTH,                CHAP_USER_MAX_LENGTH, \
def get_network_storages(data):
    network_storages = []
    dev_symlink_list = get_filelist(ISCSI_DEVICE_DIR)
    dev_symlink_list.sort()
    unmountable_regexp = re.compile("-part[0-9]+$")
            for sym_link in dev_symlink_list:
                if symlink_regexp.search(sym_link):
                    real_path = symlink2real("%s/%s" % (ISCSI_DEVICE_DIR, sym_link))
                    is_blockable = True
                    if unmountable_regexp.search(sym_link):

src/k/a/karesansui-HEAD/karesansui/gadget/hostby1storagepool.py   karesansui(Download)
from karesansui.lib.rest import Rest, auth
from karesansui.lib.virt.virt import KaresansuiVirtConnection
from karesansui.lib.const import STORAGE_POOL_TYPE, \
     VIRT_COMMAND_CREATE_STORAGE_POOL, STORAGE_VOLUME_FORMAT, \
     VIRT_COMMAND_DELETE_STORAGE_POOL, STORAGE_POOL_PWD, \
    for disk in automount_list:
        readymount_options = {}
        readymount_options["dev"] = "%s/%s" % (ISCSI_DEVICE_DIR, disk['symlink_name'])
        if "is_format" in disk:
            readymount_options["format"] = None
 
        automount_options["name"] = disk['symlink_name']
        automount_options["device_path"] = "%s/%s" % (ISCSI_DEVICE_DIR, disk['symlink_name'])

src/k/a/karesansui-HEAD/karesansui/gadget/hostby1networkstorageby1status.py   karesansui(Download)
from karesansui.lib.virt.virt import KaresansuiVirtConnection
from karesansui.lib.utils import is_param, get_filelist, uniq_sort
from karesansui.lib.const import ISCSI_COMMAND_START, ISCSI_COMMAND_STOP, \
    ISCSI_DEVICE_NAME_TPL, ISCSI_DEVICE_DIR, \
    VIRT_COMMAND_DESTROY_STORAGE_POOL, VIRT_COMMAND_START_STORAGE_POOL, \
        kvc = KaresansuiVirtConnection()
        try:
            dev_symlink_list = get_filelist(ISCSI_DEVICE_DIR)
            dev_symlink_list.sort()
            symlink_regexp = re.compile("^%s/%s" % (re.escape(ISCSI_DEVICE_DIR), re.escape(ISCSI_DEVICE_NAME_TPL % (host, port, iqn))))

src/k/a/karesansui-HEAD/bin/add_disk.py   karesansui(Download)
    from karesansui.lib.virt.virt import KaresansuiVirtConnection
    from karesansui.lib.utils import load_locale, get_disk_img_info
    from karesansui.lib.const import ISCSI_DEVICE_DIR, DISK_USES
 
except ImportError, e: