当前位置: 首页>>代码示例>>Python>>正文


Python Util.run_text_step方法代码示例

本文整理汇总了Python中lib.util.Util.run_text_step方法的典型用法代码示例。如果您正苦于以下问题:Python Util.run_text_step方法的具体用法?Python Util.run_text_step怎么用?Python Util.run_text_step使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在lib.util.Util的用法示例。


在下文中一共展示了Util.run_text_step方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: create_eth_if_in_service_profile

# 需要导入模块: from lib.util import Util [as 别名]
# 或者: from lib.util.Util import run_text_step [as 别名]
def create_eth_if_in_service_profile(ucsm_ssh, param, eth_cnt):
    test_bed = str(param['test_bed_id'])
    chassis = str(param['chassis_id'])
    cartridge = str(param['cartridge_id'])
    server = str(param['server_id'])
    
    param['tag_service_profile_name'] = get_service_profile_name(chassis, cartridge, server)
    
    current_eth_cnt = 0
    data_vlan_start = int(test_bed) * 100 + 20 + 3
    data_vlan_end   = data_vlan_start + eth_cnt
    eth_vlan_list = range(data_vlan_start, data_vlan_end)
    eth_vlan_list.insert(0, VLAN_ISCSI)
    eth_vlan_list.insert(0, VLAN_MEDUSA)
    eth_vlan_list.insert(0, VLAN_PXE)
    for eth_vlan in eth_vlan_list: 
        eth_id = str(current_eth_cnt).zfill(2) 
        param['tag_mac_address'] = get_mac_address(test_bed, chassis, cartridge, server, eth_id)
        param["tag_eth_name"] = ''.join([param["eth_pxe_name_prefix"], str(eth_vlan)])
        param["tag_eth_vlan"] = 'vlan' + str(eth_vlan)
        param['tag_eth_order'] = str(int(current_eth_cnt) + 1)
        if current_eth_cnt % 2 == 0:
            param["tag_eth_fabric"] = 'a'
        else:
            param["tag_eth_fabric"] = 'b'
        #pprint.pprint(param)
        file_text_step = Define.PATH_SNIC_TEXT_UCSM + "service_profile_eth_vlan.txt"   
        Util.run_text_step(ucsm_ssh, file_text_step, param)
        current_eth_cnt += 1
        if current_eth_cnt >= eth_cnt: 
            break
开发者ID:huhe56,项目名称:nj-snic,代码行数:33,代码来源:__init__.py

示例2: create_iscsi_in_service_profile

# 需要导入模块: from lib.util import Util [as 别名]
# 或者: from lib.util.Util import run_text_step [as 别名]
def create_iscsi_in_service_profile(ucsm_ssh, param):
    test_bed = str(param['test_bed_id'])
    chassis = str(param['chassis_id'])
    cartridge = str(param['cartridge_id'])
    server = str(param['server_id'])
    param['tag_service_profile_name'] = get_service_profile_name(chassis, cartridge, server)
    file_text_step = Define.PATH_SNIC_TEXT_UCSM + "service_profile_iscsi.txt"   
    Util.run_text_step(ucsm_ssh, file_text_step, param)
开发者ID:huhe56,项目名称:nj-snic,代码行数:10,代码来源:__init__.py

示例3: execute_cmd

# 需要导入模块: from lib.util import Util [as 别名]
# 或者: from lib.util.Util import run_text_step [as 别名]
def execute_cmd(ucsm_ssh, param):
    chassis = str(param['chassis_id'])
    cartridge = str(param['cartridge_id'])
    server = str(param['server_id'])
    
    param['tag_service_profile_name'] = get_service_profile_name(chassis, cartridge, server)
    file_text_step = Define.PATH_SNIC_TEXT_UCSM + "service_profile_deletion.txt"   
    Util.run_text_step(ucsm_ssh, file_text_step, param)
开发者ID:huhe56,项目名称:nj-snic,代码行数:10,代码来源:__init__.py

示例4: reuse_local_lun

# 需要导入模块: from lib.util import Util [as 别名]
# 或者: from lib.util.Util import run_text_step [as 别名]
def reuse_local_lun(ucsm_ssh, param):
    chassis = str(param['chassis_id'])
    cartridge = str(param['cartridge_id'])
    server = str(param['server_id'])
    
    param['tag_service_profile_name'] = get_service_profile_name(chassis, cartridge, server)
    file_text_step = Define.PATH_SNIC_TEXT_UCSM + "local_lun_reuse.txt"   
    Util.run_text_step(ucsm_ssh, file_text_step, param)
开发者ID:huhe56,项目名称:nj-snic,代码行数:10,代码来源:__init__.py

示例5: power_cycle_service_profile

# 需要导入模块: from lib.util import Util [as 别名]
# 或者: from lib.util.Util import run_text_step [as 别名]
def power_cycle_service_profile(ucsm_ssh, param, wait=False):
    chassis = str(param['chassis_id'])
    cartridge = str(param['cartridge_id'])
    server = str(param['server_id'])
    
    param['tag_service_profile_name'] = get_service_profile_name(chassis, cartridge, server)
    param['tag_power_cycle_timing'] = 'immediate'
    if wait:
        param['tag_power_cycle_timing'] = 'wait'
    file_text_step = Define.PATH_SNIC_TEXT_UCSM + "service_profile_power_cycle.txt"   
    Util.run_text_step(ucsm_ssh, file_text_step, param)
开发者ID:huhe56,项目名称:nj-snic,代码行数:13,代码来源:__init__.py

示例6: create_ipmi_in_service_profile

# 需要导入模块: from lib.util import Util [as 别名]
# 或者: from lib.util.Util import run_text_step [as 别名]
def create_ipmi_in_service_profile(ucsm_ssh, param):
    chassis = str(param['chassis_id'])
    cartridge = str(param['cartridge_id'])
    server = str(param['server_id'])
    
    server_full_list = [chassis, cartridge, server]
    param['tag_service_profile_name'] = get_service_profile_name(chassis, cartridge, server)
    param['tag_server_full_id'] = '/'.join(server_full_list)
    
    file_text_step = Define.PATH_SNIC_TEXT_UCSM + "service_profile_ipmi.txt"   
    Util.run_text_step(ucsm_ssh, file_text_step, param)
开发者ID:huhe56,项目名称:nj-snic,代码行数:13,代码来源:__init__.py

示例7: set_vnic_no_vlan_in_service_profile

# 需要导入模块: from lib.util import Util [as 别名]
# 或者: from lib.util.Util import run_text_step [as 别名]
def set_vnic_no_vlan_in_service_profile(ucsm_ssh, param, vlan_number_list):
    test_bed = str(param['test_bed_id'])
    chassis = str(param['chassis_id'])
    cartridge = str(param['cartridge_id'])
    server = str(param['server_id'])
    param['tag_service_profile_name'] = get_service_profile_name(chassis, cartridge, server)
    
    for vlan_number in vlan_number_list:
        param['tag_eth_name'] = 'eth' + str(vlan_number)
        param['tag_vlan_name'] = 'vlan' + str(vlan_number)
        file_text_step = Define.PATH_SNIC_TEXT_UCSM + "service_profile_vnic_no_vlan.txt"   
        Util.run_text_step(ucsm_ssh, file_text_step, param)
开发者ID:huhe56,项目名称:nj-snic,代码行数:14,代码来源:__init__.py

示例8: set_vnic_adapter_policy_in_service_profile

# 需要导入模块: from lib.util import Util [as 别名]
# 或者: from lib.util.Util import run_text_step [as 别名]
def set_vnic_adapter_policy_in_service_profile(ucsm_ssh, param, adapter_policy_dict):
    test_bed = str(param['test_bed_id'])
    chassis = str(param['chassis_id'])
    cartridge = str(param['cartridge_id'])
    server = str(param['server_id'])
    param['tag_service_profile_name'] = get_service_profile_name(chassis, cartridge, server)
    
    for eth_name, adapter_policy in adapter_policy_dict.iteritems():
        param['tag_eth_name'] = eth_name
        param['tag_adapter_policy'] = adapter_policy
        file_text_step = Define.PATH_SNIC_TEXT_UCSM + "service_profile_vnic_adapter_policy.txt"   
        Util.run_text_step(ucsm_ssh, file_text_step, param)
开发者ID:huhe56,项目名称:nj-snic,代码行数:14,代码来源:__init__.py

示例9: set_server_ext_mgmt_ip

# 需要导入模块: from lib.util import Util [as 别名]
# 或者: from lib.util.Util import run_text_step [as 别名]
def set_server_ext_mgmt_ip(ucsm_ssh, param):
    file_text_step = Define.PATH_SNIC_TEXT_UCSM + "server_ext_mgmt_ip.txt"   
    ip_list = get_ip_list(param['tag_kvm_ip_start'], 16)
    for chassis_id, chassis in config.iteritems():
        if chassis_id != 1: continue
        for cartridge_id, cartridge in chassis.iteritems():
            for server_id, server in cartridge.iteritems():
                param['tag_server_id']   = '/'.join([str(chassis_id), str(cartridge_id), str(server_id)])
                param['tag_addr']        = ip_list.pop()
                param['tag_default_gw']  = param['tag_kvm_ip_gateway']
                param['tag_subnet']      = param['tag_kvm_ip_netmask']
                Util.run_text_step(ucsm_ssh, file_text_step, param)
开发者ID:huhe56,项目名称:nj-snic,代码行数:14,代码来源:__init__.py

示例10: create_boot_policy

# 需要导入模块: from lib.util import Util [as 别名]
# 或者: from lib.util.Util import run_text_step [as 别名]
def create_boot_policy(ucsm_ssh, param):
    
    param['tag_boot_policy'] = 'disk-pxe-legacy'
    param['tag_boot_mode'] = 'legacy'
    
    file_text_step = Define.PATH_SNIC_TEXT_UCSM + "boot_policy_order_disk_pxe.txt"   
    Util.run_text_step(ucsm_ssh, file_text_step, param)
    
    param['tag_boot_policy'] = 'disk-pxe-uefi'
    param['tag_boot_mode'] = 'uefi'
    
    file_text_step = Define.PATH_SNIC_TEXT_UCSM + "boot_policy_order_disk_pxe.txt"   
    Util.run_text_step(ucsm_ssh, file_text_step, param)
    
    param['tag_boot_policy'] = 'iscsi-pxe-legacy'
    param['tag_boot_mode'] = 'legacy'
    
    file_text_step = Define.PATH_SNIC_TEXT_UCSM + "boot_policy_order_iscsi_pxe.txt"   
    Util.run_text_step(ucsm_ssh, file_text_step, param)
    
    param['tag_boot_policy'] = 'iscsi-pxe-uefi'
    param['tag_boot_mode'] = 'uefi'
    
    file_text_step = Define.PATH_SNIC_TEXT_UCSM + "boot_policy_order_iscsi_pxe.txt"   
    Util.run_text_step(ucsm_ssh, file_text_step, param)
开发者ID:huhe56,项目名称:nj-snic,代码行数:27,代码来源:__init__.py

示例11: create_lun_in_service_profile

# 需要导入模块: from lib.util import Util [as 别名]
# 或者: from lib.util.Util import run_text_step [as 别名]
def create_lun_in_service_profile(ucsm_ssh, param, lun):
    test_bed = str(param['test_bed_id'])
    chassis = str(param['chassis_id'])
    cartridge = str(param['cartridge_id'])
    server = str(param['server_id'])
    param['tag_service_profile_name'] = get_service_profile_name(chassis, cartridge, server)
    
    for lun_order, lun_detail in lun.iteritems():
        param['tag_lun_order'] = str(lun_order)
        param['tag_disk_size'] = str(lun_detail['disk_size'])
        raid_level = lun_detail['raid_level']
        param['tag_disk_group_config_policy_name'] = raid_level_disk_group_config_policy_dict[raid_level]['policy_name']
        param['tag_local_lun'] = ''.join(['lun', chassis, cartridge, server]) + '_' + str(lun_order)    
        file_text_step = Define.PATH_SNIC_TEXT_UCSM + "service_profile_storage_lun.txt"   
        Util.run_text_step(ucsm_ssh, file_text_step, param)
开发者ID:huhe56,项目名称:nj-snic,代码行数:17,代码来源:__init__.py

示例12: create_service_profile

# 需要导入模块: from lib.util import Util [as 别名]
# 或者: from lib.util.Util import run_text_step [as 别名]
def create_service_profile(ucsm_ssh, param):
    test_bed    = str(param['test_bed_id'])
    chassis     = str(param['chassis_id'])
    cartridge   = str(param['cartridge_id'])
    server      = str(param['server_id'])
    
    chassis_id = str(chassis).zfill(2)
    cartridge_id = str(cartridge).zfill(2)
    server_id = str(server).zfill(2)
    
    server_full_id_list = [chassis_id, cartridge_id, server_id]
    server_full_id = ''.join(server_full_id_list)
    
    param['tag_service_profile_name'] = get_service_profile_name(chassis, cartridge, server)
    param['tag_uuid'] = ''.join([param['uuid_prefix'], server_full_id])
    
    # pprint.pprint(param)
    
    file_text_step = Define.PATH_SNIC_TEXT_UCSM + "service_profile.txt"   
    Util.run_text_step(ucsm_ssh, file_text_step, param)
开发者ID:huhe56,项目名称:nj-snic,代码行数:22,代码来源:__init__.py

示例13: create_eth_if_in_service_profile

# 需要导入模块: from lib.util import Util [as 别名]
# 或者: from lib.util.Util import run_text_step [as 别名]
def create_eth_if_in_service_profile(ucsm_ssh, param, eth_cnt):
    test_bed = str(param['test_bed_id'])
    chassis = str(param['chassis_id'])
    cartridge = str(param['cartridge_id'])
    server = str(param['server_id'])
    
    param['tag_service_profile_name'] = get_service_profile_name(chassis, cartridge, server)
    
    for eth_index in range(1, eth_cnt+1): 
        eth_id = str(eth_index).zfill(2) 
        param['tag_mac_address'] = get_mac_address(test_bed, chassis, cartridge, server, eth_id)
        param["tag_eth_name"] = ''.join([param["eth_pxe_name_prefix"], eth_id])
        param["tag_eth_vlan"] = 'default'
        param['tag_eth_order'] = eth_id
        if eth_index % 2 == 1:
            param["tag_eth_fabric"] = 'a'
        else:
            param["tag_eth_fabric"] = 'b'
        #pprint.pprint(param)
        file_text_step = Define.PATH_SNIC_TEXT_UCSM + "service_profile_eth_vlan.txt"   
        Util.run_text_step(ucsm_ssh, file_text_step, param)
开发者ID:huhe56,项目名称:nj-snic,代码行数:23,代码来源:__init__.py

示例14: str

# 需要导入模块: from lib.util import Util [as 别名]
# 或者: from lib.util.Util import run_text_step [as 别名]
    server      = str(param['server_id'])
    
    chassis_id      = str(chassis).zfill(2)
    cartridge_id    = str(cartridge).zfill(2)
    server_id       = str(server).zfill(2)
    eth_id          = str(param['eth_pxe_name_index']).zfill(2)
    
    server_full_id_list = [chassis_id, cartridge_id, server_id]
    server_full_id  = ''.join(server_full_id_list)
    
    eth_full_id_list = [chassis_id, cartridge_id, server_id, eth_id]
    eth_full_id = ''.join(eth_full_id_list)
    
    param['tag_service_profile_name'] = '-'.join(['sp', chassis, cartridge, server])
    param['tag_local_lun'] = ''.join(['lun', server_full_id])
    param['tag_volumn_name'] = ''.join(['volumn', server_full_id])
    param['tag_mac_address'] = ':'.join([param['mac_prefix'], ':'.join(eth_full_id_list)])
    param["tag_eth_name"] = ''.join([param["eth_pxe_name_prefix"], str(param["eth_pxe_name_index"])])
    param['tag_uuid'] = ''.join([param['uuid_prefix'], server_full_id])
    
    pprint.pprint(param)
    
    ucsm = UCSM(Define.UCSM_HOSTNAME);
    file_text_step = Define.PATH_SNIC_TEXT_UCSM + "service_profile.txt"   
    Util.run_text_step(ucsm.get_ssh(), file_text_step, param)
    ucsm.exit()
    

    
    
        
开发者ID:huhe56,项目名称:nj-snic,代码行数:28,代码来源:service_profile.py

示例15: run_in_service_profile

# 需要导入模块: from lib.util import Util [as 别名]
# 或者: from lib.util.Util import run_text_step [as 别名]
def run_in_service_profile(ucsm_ssh, param):
    param['tag_service_profile_name'] = get_service_profile_name_from_param(param)
    file_text_step = Define.PATH_SNIC_TEXT_UCSM + "local_lun_reuse.txt"   
    Util.run_text_step(ucsm_ssh, file_text_step, param)
开发者ID:huhe56,项目名称:nj-snic,代码行数:6,代码来源:__init__.py


注:本文中的lib.util.Util.run_text_step方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。