def file_proc_servers_hyperflex(debug1, filename, prodname): if debug1: print("\tSubroutine#\tfile_proc_servers_hyperflex") if filename.startswith("storfs-packages"): workname = filename.replace("storfs-packages-", "") workname = workname.replace(".tgz", "") splitbydot = workname.split(".") vertwo = util2digit(splitbydot[0], splitbydot[1]) verthree = util3digit(splitbydot[0], splitbydot[1], splitbydot[2]) imagecode = imagelookup("upgrade") filepath = filepath4(prodname, imagecode, vertwo, verthree) filemove(filepath, filename) elif filename.startswith("HX-ESXi"): workname = filename.replace("HX-ESXi-", "") splitbydash = workname.split("-") imagecode = imagelookup("vmware") filepath = filepath3(prodname, imagecode, splitbydash[0]) filemove(filepath, filename) elif filename.startswith("HX-Kubernetes"): workname = filename.replace("HX-Kubernetes-", "") splitbydot = workname.split(".") vertwo = util2digit(splitbydot[0], splitbydot[1]) verthree = util3digit(splitbydot[0], splitbydot[1], splitbydot[2]) imagecode = imagelookup("kubernetes") filepath = filepath4(prodname, imagecode, vertwo, verthree) filemove(filepath, filename) elif (filename.startswith("Cisco-HX-Data-Platform-Installer") or filename.startswith("cisco-HX-Data-Platform-Installer")): workname = filename.replace("Cisco-HX-Data-Platform-Installer-v", "") workname = workname.replace("cisco-HX-Data-Platform-Installer-v", "") workname = workname.replace("p1-esx.ova", "") workname = workname.replace("-esx.ova", "") workname = workname.replace("-hyperv.vhdx.zip", "") splitbydot = workname.split(".") vertwo = util2digit(splitbydot[0], splitbydot[1]) verthree = util3digit(splitbydot[0], splitbydot[1], splitbydot[2]) imagecode = imagelookup("install") filepath = filepath4(prodname, imagecode, vertwo, verthree) filemove(filepath, filename) elif filename.startswith("HyperFlex-VC-HTML"): imagecode = imagelookup("vchtmlplug") filepath = filepath2(prodname, imagecode) filemove(filepath, filename) elif filename.startswith("hxcsi"): imagecode = imagelookup("kubernetes") filepath = filepath2(prodname, imagecode) filemove(filepath, filename) elif filename.startswith("HyperFlex-Witness-"): imagecode = imagelookup("witness") filepath = filepath2(prodname, imagecode) filemove(filepath, filename) elif filename.startswith("HxClone-HyperV"): workname = filename.replace("HxClone-HyperV-v", "") workname = workname.replace(".ps1", "") splitbydot = workname.split(".") vertwo = util2digit(splitbydot[0], splitbydot[1]) verthree = util3digit(splitbydot[0], splitbydot[1], splitbydot[2]) imagecode = imagelookup("install") filepath = filepath4(prodname, imagecode, vertwo, verthree) filemove(filepath, filename)
def fileproc_iosxe_3(debug1, filename, prodname, imagecode): if debug1: print("\tSubroutine#\tfileproc_iosxe_3") splitbydot = filename.split(".") if splitbydot[4].startswith("CSC") and splitbydot[6] == "smu": iosfull = util3digit(splitbydot[1], splitbydot[2], splitbydot[3]) filepath = filepath4(prodname, "SMU", iosfull, splitbydot[4]) filemove(filepath, filename) else: iosmain = util2digit(splitbydot[2], splitbydot[3]) iosfull = util3digit(splitbydot[2], splitbydot[3], splitbydot[4]) filepath = filepath4(prodname, iosmain, iosfull, imagecode) filemove(filepath, filename)
def fileprocessornxos9ksmu(filename, prodname, imagecode, debug1): if debug1: print("\tSubroutine#\tfileprocessornxos9ksmu") splitbydot = filename.split(".") csc = splitbydot[1].replace("-n9k_ALL-1", "") csc = csc.replace("_EOR-n9k_EOR-1", "") csc = csc.replace("_TOR-n9k_TOR-1", "") csc = csc.replace("_eth-n9k_TOR-1", "") csc = csc.replace("_eth-n9k_EOR-1", "") csc = csc.replace("-n9k_EOR-1", "") csc = csc.replace("-n9k_TOR-1", "") csc = csc.replace("_modular_lc-1", "") csc = csc.replace("_modular_sup-1", "") csc = csc.replace("01-1", "") csc = csc.replace("-1", "") if splitbydot[3] == "0-9": digitone = "9" elif splitbydot[3] == "0-10": digitone = "10" elif splitbydot[3] == "0-8": digitone = "8" elif splitbydot[3] == "0-7" or splitbydot[3] == "1-7": digitone = "7" if digitone == "9" or digitone == "10": nxosver = util2digit(digitone, splitbydot[4]) nxosfull = util3digit(digitone, splitbydot[4], splitbydot[5]) filepath = filepath5(prodname, imagecode, nxosver, nxosfull, csc) filemove(filepath, filename) elif digitone == "7": nxosver = util2digit(digitone, splitbydot[4]) nxosfull = util5digit(digitone, splitbydot[4], splitbydot[5], splitbydot[6], splitbydot[7]) filepath = filepath5(prodname, imagecode, nxosver, nxosfull, csc) filemove(filepath, filename)
def file_proc_phone_dash(debug1, filename, prodname, imagecode, workname): if debug1: print("\tSubroutine#\tfile_proc_phone_dash") if prodname == "UNKNOWN": messageunknowndev() elif imagecode == "UNKNOWN": messageunknownfeat() else: splitbydash = workname.split("-") if debug1: print(len(splitbydash), end="\n") if len(splitbydash) == 3: version = util3digit(splitbydash[0], splitbydash[1], splitbydash[2]) filepath = filepath3(prodname, version, imagecode) filemove(filepath, filename) elif len(splitbydash) == 4: version = util4digit(splitbydash[0], splitbydash[1], splitbydash[2], splitbydash[3]) filepath = filepath3(prodname, version, imagecode) filemove(filepath, filename) elif len(splitbydash) == 5: version = util5digit(splitbydash[0], splitbydash[1], splitbydash[2], splitbydash[3], splitbydash[4]) filepath = filepath3(prodname, version, imagecode) filemove(filepath, filename)
def file_proc_servers_p2_d3(debug1, filename, prodname, imagecode): if debug1: print("\tSubroutine#\tfile_proc_servers_p2_d3") splitbydot = filename.split(".") ver2 = util2digit(splitbydot[1], splitbydot[2]) ver3 = util3digit(splitbydot[1], splitbydot[2], splitbydot[3]) filepath = filepath4(prodname, imagecode, ver2, ver3) filemove(filepath, filename)
def iosxr_dot1_ver3(debug1, filename, prodname, imagecode): if debug1: print("\tSubroutine#\tiosxr_dot1_ver3") splitbydot = filename.split(".") ver2 = util2digit(splitbydot[1], splitbydot[2]) ver3 = util3digit(splitbydot[1], splitbydot[2], splitbydot[3]) filepath = filepath4(prodname, ver2, ver3, imagecode) filemove(filepath, filename)
def fileprocnxos1000v(debug1, filename, prodname): if debug1: print("\tSubroutine#\tfileprocnxos1000v") if (filename.startswith("Nexus1000v.5.2.1.SV") or filename.startswith("Nexus1000v.4.2.1.SV") or filename.startswith("nexus1000v.4.2.1.SV") or filename.startswith("Nexus1000v.4.0.4.SV")): workname = filename.replace("-pkg.zip", "") workname = workname.replace("zip", "") splitbydot = workname.split(".") imagecode = imagelookup("vmware") nxosfull = util3digit(splitbydot[4], splitbydot[5], splitbydot[6]) filepath = filepath3(prodname, imagecode, nxosfull) filemove(filepath, filename) elif filename == "Nexus1000v-4.0.4.SV1.1.zip": imagecode = imagelookup("vmware") nxosfull = util2digit("SV1", "1") filepath = filepath3(prodname, imagecode, nxosfull) filemove(filepath, filename) elif filename == "Nexus1000v-4.0.4.SV1.3.zip": imagecode = imagelookup("vmware") nxosfull = util2digit("SV1", "3") filepath = filepath3(prodname, imagecode, nxosfull) filemove(filepath, filename) elif (filename.startswith("Nexus1000v.5.2.1.SK")): workname = filename.replace("-pkg.zip", "") workname = workname.replace("zip", "") splitbydot = workname.split(".") imagecode = imagelookup("kvm") nxosfull = util3digit(splitbydot[4], splitbydot[5], splitbydot[6]) filepath = filepath3(prodname, imagecode, nxosfull) filemove(filepath, filename) elif (filename.startswith("Nexus1000V.5.2.1.SM")): workname = filename.replace("-pkg.zip", "") workname = workname.replace("zip", "") splitbydot = workname.split(".") imagecode = imagelookup("hyperv") nxosfull = util3digit(splitbydot[4], splitbydot[5], splitbydot[6]) filepath = filepath3(prodname, imagecode, nxosfull) filemove(filepath, filename) elif filename == "Nexus1000V5.2.1.SM1.5.2.zip": imagecode = imagelookup("hyperv") nxosfull = util3digit("SM1", "5", "2") filepath = filepath3(prodname, imagecode, nxosfull) filemove(filepath, filename)
def fileproc_iosxe(debug1, filename, prodname, imagecode): if debug1: print("\tSubroutine#\tfileproc_iosxe") splitbydot = filename.split(".") splitbydot[3] = splitbydot[3].replace("-serial", "") splitbydot[3] = splitbydot[3].replace("-nfvis", "") splitbydot[3] = splitbydot[3].replace("-esxi", "") splitbydot[3] = splitbydot[3].replace("-kvm", "") #Checks to make sure that it is a regular firmware image, not a SMU if splitbydot[4].startswith("CSC") and splitbydot[6] == "smu": iosfull = util3digit(splitbydot[1], splitbydot[2], splitbydot[3]) filepath = filepath4(prodname, "SMU", iosfull, splitbydot[4]) filemove(filepath, filename) else: iosmain = util2digit(splitbydot[1], splitbydot[2]) iosfull = util3digit(splitbydot[1], splitbydot[2], splitbydot[3]) filepath = filepath4(prodname, iosmain, iosfull, imagecode) filemove(filepath, filename)
def iosxr_nv_x64(debug1, filename, prodname, imagecode): if debug1: print("\tSubroutine#\tiosxr_nv_x64") splitbydash = filename.split("-") splitbydot = list(splitbydash[5]) ver2 = util2digit(splitbydot[1], splitbydot[2]) ver3 = util3digit(splitbydot[1], splitbydot[2], splitbydot[3]) filepath = filepath4(prodname, ver2, ver3, imagecode) filemove(filepath, filename)
def iosxr_asr9kvsmu(debug1, filename): if debug1: print("\tSubroutine#\tiosxr_asr9kvsmu") prodname = product("iosxrvfull") imagecode = imagelookup("smu") workname = filename.replace("xrv9k-sysadmin-", "") workname = workname.replace("xrv9k-", "") splitbydot = workname.split(".") vertwo = util2digit(splitbydot[0], splitbydot[1]) versmu = util3digit(splitbydot[0], splitbydot[1], splitbydot[2]) filepath = filepath5(prodname, vertwo, versmu, imagecode, splitbydot[3]) filemove(filepath, filename)
def fileprocphone3digittype(debug1, filename, prodname, imagecode): if debug1: print("\tSubroutine#\tfileprocphone3digittype") if prodname == "UNKNOWN" or imagecode == "UNKNOWN": messageunknownfile() else: splitbydot = filename.split(".") splitbydash = splitbydot[1].split("-") ver2 = util2digit(splitbydash[0], splitbydash[1]) ver3 = util3digit(splitbydash[0], splitbydash[1], splitbydash[2]) filepath = filepath4(prodname, ver2, ver3, imagecode) filemove(filepath, filename)
def file_proc_servers_p3_d3_utils(debug1, filename, prodname, imagecode, imagecode2): if debug1: print("\tSubroutine#\tfile_proc_servers_p3_d3_utils") splitbydash = filename.split("-", 3) splitbydot = splitbydash[3].split(".") workname = splitbydot[2].replace("-vmware.iso", "") workname = workname.replace("-efi.iso", "") workname = workname.replace("-linux.iso", "") workname = workname.replace("-windows.iso", "") ver2 = util2digit(splitbydot[0], splitbydot[1]) ver3 = util3digit(splitbydot[0], splitbydot[1], workname) filepath = filepath5(prodname, imagecode, ver2, ver3, imagecode2) filemove(filepath, filename)
def iosxr_iosxrv_demo(debug1, filename): if debug1: print("\tSubroutine#\tiosxr_iosxrv_demo") prodname = product("iosxrvdemo") workname = filename.replace("iosxrv-demo.ova-", "") workname = workname.replace("iosxrv-demo.vmdk-", "") workname = workname.replace(".vmdk", "") workname = workname.replace(".ova", "") workname = workname.replace("iosxrv-k9-demo-", "") workname = workname.replace("iosxrv-demo-", "") splitbydot = workname.split(".") verthree = util3digit(splitbydot[0], splitbydot[1], splitbydot[2]) filepath = filepath2(prodname, verthree) filemove(filepath, filename)
def fileprocnxosthreedigit(filename, prodname, imagecode, debug1): if debug1: print("\tSubroutine#\tfileprocnxosthreedigit") splitbydot = filename.split(".") nxosver = util2digit(splitbydot[1], splitbydot[2]) nxosfull = util3digit(splitbydot[1], splitbydot[2], splitbydot[3]) if imagecode == "FIRMWARE-EPLD": filepath = filepath4(prodname, imagecode, nxosver, nxosfull) elif imagecode == "SMU": filepath = filepath5(prodname, imagecode, nxosver, nxosfull, splitbydot[4]) else: filepath = filepath4(prodname, nxosver, nxosfull, imagecode) filemove(filepath, filename)
def file_proc_servers_apicem(debug1, filename): splitbydash = filename.split("-") if debug1: print("\tSubroutine#\tfile_proc_servers_apicem") prodname = product("apicem") if filename.startswith("apic_em_update-apic"): splitbydash = filename.split("-") splitbydot = splitbydash[3].split(".") elif filename.startswith("APIC-EM"): splitbydash = filename.split("-") splitbydot = splitbydash[2].split(".") vertwo = util2digit(splitbydot[0], splitbydot[1]) verthree = util3digit(splitbydot[0], splitbydot[1], splitbydot[2]) filepath = filepath3(prodname, vertwo, verthree) filemove(filepath, filename)
def fileprocessornxosplatform7700v8(filename): if debug1: print("\tSubroutine#\tfileprocessornxosplatform7700v8") splitbydash = filename.split("-") splitbydot = filename.split(".") if filename.startswith == "n7700-s2-kickstart-npe": imagecode = "KICKSTART-NPE" elif filename.startswith == "n7700-s2-kickstart": imagecode = "KICKSTART" elif filename.startswith == "n7700-s2-dk9-npe": imagecode = "SYSTEM-NPE" elif filename.startswith == "n7700-s2-dk9": imagecode = "SYSTEM" if splitbydash[0] == "n7700": prodname = product(splitbydash[0]) if splitbydash[1] == "s2": imagecode = "SUP-2" elif splitbydash[1] == "s3": imagecode = "SUP-3" iosmain = util2digit(splitbydot[1], splitbydot[2]) iosfull = util3digit(splitbydot[1], splitbydot[2], splitbydot[3]) filepath = prodname + "/" + iosmain + "/" + iosfull + "/" + imagecode
def iosxr_asr9kv(debug1, filename): if debug1: print("\tSubroutine#\tiosxr_asr9kv") prodname = product("iosxrvfull") workname = filename.replace(".tar", "") splitbydash = workname.split("-") if filename.endswith("-RRVG.tar"): imagecode = imagelookup("rrvga") elif filename.endswith("-RR.tar"): imagecode = imagelookup("rr") elif filename.endswith("-VG.tar"): imagecode = imagelookup("basevga") else: imagecode = imagelookup("base") verlist = list(splitbydash[3]) if len(verlist) == 4: verfull = util4digit(verlist[0], verlist[1], verlist[2], verlist[3]) vertwo = util2digit(verlist[0], verlist[1]) elif len(verlist) == 3: verfull = util3digit(verlist[0], verlist[1], verlist[2]) vertwo = util2digit(verlist[0], verlist[1]) filepath = filepath4(prodname, vertwo, verfull, imagecode) filemove(filepath, filename)
def iosxr_service_pack(debug1, filename, prodname): if debug1: print("\tSubroutine#\tiosxr_service_pack") if filename.endswith("sp1.tar"): imagecode = imagelookup("sp1") elif filename.endswith("sp2.tar"): imagecode = imagelookup("sp2") elif filename.endswith("sp3.tar"): imagecode = imagelookup("sp3") elif filename.endswith("sp4.tar"): imagecode = imagelookup("sp4") elif filename.endswith("sp5.tar"): imagecode = imagelookup("sp5") elif filename.endswith("sp6.tar"): imagecode = imagelookup("sp6") elif filename.endswith("sp7.tar"): imagecode = imagelookup("sp7") elif filename.endswith("sp8.tar"): imagecode = imagelookup("sp8") elif filename.endswith("sp9.tar"): imagecode = imagelookup("sp9") elif filename.endswith("sp10.tar"): imagecode = imagelookup("sp10") elif filename.endswith("sp11.tar"): imagecode = imagelookup("sp11") elif filename.endswith("sp12.tar"): imagecode = imagelookup("sp12") elif filename.endswith("sp-1.0.0.tar"): imagecode = imagelookup("sp1") splitbydash = filename.split("-") splitbydot = splitbydash[2].split(".") ver2 = util2digit(splitbydot[0], splitbydot[1]) ver3 = util3digit(splitbydot[0], splitbydot[1], splitbydot[2]) filepath = filepath4(prodname, ver2, ver3, imagecode) filemove(filepath, filename)
def fileprocessor_iosxe(debug1, filename): if debug1: print("\tModule#\t\tios_iosxe") if debug1: print("\tSubroutine#\tfileprocessor_iosxe") splitbydot = filename.split(".") splitbydash = filename.split("-") if (filename == "cat9k_iosxe.16.00.00fpgautility.SPA.bin" or filename == "cat9k_fpga_upgrade_utility.pdf"): prodname = product("cat9k") imagecode = imagelookup("fpga") utilssinglemove(debug1, filename, prodname, imagecode) elif filename == "asr1000rpx86-universalk9.V1612_1_CVE_2019_1649.SPA.bin": prodname = product("asr1000rpx86") imagecode = imagelookup("hardware") utilssingleprodname(debug1, filename, prodname) elif filename == "asr1000rp1-advipservicesk9.V152_1_S1_CSCTR15153_3.bin": prodname = product("asr1000rp1") utilssingleprodname(debug1, filename, prodname) elif filename == "asr903rsp1-universalk9_npe.V154_3_S3_SR637267017_1.bin": prodname = product("asr903rsp1") utilssingleprodname(debug1, filename, prodname) elif filename == "asr1000rp1-adventerprisek9.BLD_V122_33_XNC_ASR_RLS3_THROTTLE_LATEST_20090513_080032.bin": prodname = product("asr1000rp1") utilssingleprodname(debug1, filename, prodname) elif (filename.startswith("c1100_gfast") or filename.startswith("c1100_phy")): prodname = product("c1100router") imagecode = imagelookup("dslfirmware") utilssinglemove(debug1, filename, prodname, imagecode) elif (filename == "nim_vab_phy_fw_A39x3_B39x3_Bond39t.pkg" or filename == "nim_vab_phy_fw_A39t_B39g1_Bond39t.pkg" or filename == "nim_vab_phy_fw_A39t_B39g1_Bond39t.pkg" or filename.startswith("isr4300-firmware_nim_xdsl")): prodname = product("isr4300") imagecode = imagelookup("dslfirmware") utilssinglemove(debug1, filename, prodname, imagecode) elif (filename.startswith("iosxe-sd-avc")): prodname = product("iosxe-sd-avc") utilssingleprodname(debug1, filename, prodname) elif (filename.startswith("iosxe-remote-mgmt")): prodname = product("iosxe-remote-mgmt") utilssingleprodname(debug1, filename, prodname) elif (filename.startswith("CAT3650_WEBAUTH_BUNDLE") or filename.startswith("CAT3850_WEBAUTH_BUNDLE")): prodname = product("cat3k_caa") imagecode = imagelookup("webauth") utilssinglemove(debug1, filename, prodname, imagecode) elif filename.startswith("isr4200-firmware_nim_xdsl"): prodname = product("isr4200") imagecode = imagelookup("dslfirmware") utilssinglemove(debug1, filename, prodname, imagecode) elif filename.startswith("isr4400-firmware_nim_xdsl"): prodname = product("isr4400") imagecode = imagelookup("dslfirmware") utilssinglemove(debug1, filename, prodname, imagecode) elif filename.startswith("isr4400v2-firmware_nim_xdsl"): prodname = product("isr4400v2") imagecode = imagelookup("dslfirmware") utilssinglemove(debug1, filename, prodname, imagecode) elif filename.startswith("isr4300-hw-programmables"): prodname = product("isr4300") imagecode = imagelookup("hardware") utilssinglemove(debug1, filename, prodname, imagecode) elif filename.startswith("isr-hw-programmables"): prodname = product("isr4400") imagecode = imagelookup("hardware") utilssinglemove(debug1, filename, prodname, imagecode) elif filename.startswith("isr4200_cpld_update"): prodname = product("isr4200") imagecode = imagelookup("cpld_update") utilssinglemove(debug1, filename, prodname, imagecode) elif filename.startswith("isr4300_cpld_update"): prodname = product("isr4300") imagecode = imagelookup("cpld_update") utilssinglemove(debug1, filename, prodname, imagecode) elif filename.startswith("isr4400_cpld_update"): prodname = product("isr4400") imagecode = imagelookup("cpld_update") utilssinglemove(debug1, filename, prodname, imagecode) elif filename.startswith("isr4400v2_cpld_update"): prodname = product("isr4400v2") imagecode = imagelookup("cpld_update") utilssinglemove(debug1, filename, prodname, imagecode) elif (filename.startswith("asr1000-hw-programmables") or filename.startswith("asr1002x-hw-programmables") or filename == "ASR1K-fpga_prog.16.0.1.xe.bin"): prodname = product("asr1000") imagecode = imagelookup("hardware") utilssinglemove(debug1, filename, prodname, imagecode) elif (filename.startswith("asr1000rpx86-hw-programmables")): prodname = product("asr1000rpx86") imagecode = imagelookup("hardware") utilssinglemove(debug1, filename, prodname, imagecode) elif filename.startswith("cat9k_iosxe") or filename.startswith( "cat9k_lite"): if filename.startswith("cat9k_iosxe"): prodname = product("cat9k") elif filename.startswith("cat9k_lite"): prodname = product("cat9k_lite") if prodname == "UNKNOWN": messageunknownfile() else: if filename.endswith("smu.bin"): imagecode = imagelookup("smu") fileproc_iosxe(debug1, filename, prodname, imagecode) else: imagecode = imagelookup(splitbydot[0]) fileproc_iosxe(debug1, filename, prodname, imagecode) elif filename.startswith("cat3k_caa"): prodname = product(splitbydash[0]) mdash = splitbydot[0].split("-") imagecode = imagelookup(mdash[1]) if (filename.startswith("cat3k_caa-universalk9.SPA") or filename.startswith("cat3k_caa-universalk9ldpe.SPA")): fileproc_iosxe_3(debug1, filename, prodname, imagecode) else: fileproc_iosxe(debug1, filename, prodname, imagecode) elif filename.startswith("cat4500es8"): mdash = splitbydot[0].split("-") prodname = product(mdash[0]) imagecode = imagelookup(mdash[1]) fileproc_iosxe_3(debug1, filename, prodname, imagecode) elif filename.startswith("ct5760"): mdash = splitbydot[0].split("-") prodname = product(mdash[0]) imagecode = imagelookup(mdash[1]) fileproc_iosxe_3(debug1, filename, prodname, imagecode) elif filename.startswith("WP76xx"): prodname = product("isrg4moduleslte") utilssingleprodname(debug1, filename, prodname) elif filename.endswith("comp_matrix.xml"): prodname = product("iosxeissumatrix") utilssingleprodname(debug1, filename, prodname) elif filename.startswith("cat4500e"): prodname = product(splitbydash[0]) mdash = splitbydot[0].split("-") imagecode = imagelookup(mdash[1]) if (filename.startswith("cat4500e-universalk9") or filename.startswith("cat4500e-universal") or filename.startswith("cat4500e-universalk9_lite") or filename.startswith("cat4500e-universal_lite")): fileproc_iosxe_3(debug1, filename, prodname, imagecode) else: fileproc_iosxe(debug1, filename, prodname, imagecode) elif filename.startswith("C9800-"): fileproccontroller(debug1, filename) elif filename.startswith("ie9k_"): if filename.startswith("ie9k_iosxe"): prodname = product("ie9k") imagecode = imagelookup("iosxe") workname = filename.replace("ie9k_iosxe.", "") workname = workname.replace(".SPA.bin", "") # utils_dev_imagecode_v2_vf (debug1,filename,prodname,imagecode,workname) utils_dev_v2_vf_imagecode(debug1, filename, prodname, imagecode, workname) elif filename.startswith("c8000v"): if filename.startswith("c8000v-universalk9_16G_serial"): prodname = product("c8000v") imagecode = imagelookup("universalk9") elif filename.startswith("c8000v-universalk9_16G_serial_efi"): prodname = product("c8000v") imagecode = imagelookup("universalk9") elif filename.startswith("c8000v-universalk9_16G_vga"): prodname = product("c8000v") imagecode = imagelookup("universalk9") elif filename.startswith("c8000v-universalk9_16G_vga_efi"): prodname = product("c8000v") imagecode = imagelookup("universalk9") elif filename.startswith("c8000v-universalk9_8G_serial"): prodname = product("c8000v") imagecode = imagelookup("universalk9") elif filename.startswith("c8000v-universalk9_8G_serial_efi"): prodname = product("c8000v") imagecode = imagelookup("universalk9") elif filename.startswith("c8000v-universalk9_8G_vga"): prodname = product("c8000v") imagecode = imagelookup("universalk9") elif filename.startswith("c8000v-universalk9_8G_vga_efi"): prodname = product("c8000v") imagecode = imagelookup("universalk9") elif filename.startswith("c8000v-universalk9_vga"): prodname = product("c8000v") imagecode = imagelookup("universalk9") splitbydot = filename.split(".") iosmain = util2digit(splitbydot[1], splitbydot[2]) iosfull = util3digit(splitbydot[1], splitbydot[2], splitbydot[3]) filepath = filepath4(prodname, iosmain, iosfull, imagecode) filemove(filepath, filename) else: if splitbydash[0] == "c1100": prodname = product("c1100router") else: prodname = product(splitbydash[0]) mdash = splitbydot[0].split("-") imagecode = imagelookup(mdash[1]) if prodname == "UNKNOWN": messageunknowndev() elif imagecode == "UNKNOWN": messageunknownfeat() else: fileproc_iosxe(debug1, filename, prodname, imagecode)
def file_proc_servers_dcnm(debug1, filename, prodname): if debug1: print("\tSubroutine#\tfile_proc_servers_dcnm") splitbydot = filename.split(".") vertwo = util2digit(splitbydot[1], splitbydot[2]) verthree = util3digit(splitbydot[1], splitbydot[2], splitbydot[3]) if filename.startswith("dcnm-installer-x64-windows"): imagecode = imagelookup("installer") filepath = filepath4(prodname, vertwo, verthree, imagecode) filemove(filepath, filename) elif filename.startswith("dcnm-installer-windows"): imagecode = imagelookup("installer") filepath = filepath4(prodname, vertwo, verthree, imagecode) filemove(filepath, filename) elif filename.startswith("dcnm-installer-x64-linux"): imagecode = imagelookup("installer") filepath = filepath4(prodname, vertwo, verthree, imagecode) filemove(filepath, filename) elif filename.startswith("dcnm-installer-linux"): imagecode = imagelookup("installer") filepath = filepath4(prodname, vertwo, verthree, imagecode) filemove(filepath, filename) elif filename.startswith("dcnm-installer-solaris"): imagecode = imagelookup("installer") filepath = filepath4(prodname, vertwo, verthree, imagecode) filemove(filepath, filename) elif filename.startswith("DCNMUpgradeTool"): imagecode = imagelookup("upgrade") filepath = filepath4(prodname, vertwo, verthree, imagecode) filemove(filepath, filename) elif (filename.startswith("dcnm-va-templates") or filename.startswith("dcnm_fabricpath_fabric_templates") or filename.startswith("dcnm_deprecated_templates") or filename.startswith("dcnm_ip_vxlan_fabric_templates")): imagecode = imagelookup("templates") filepath = filepath4(prodname, vertwo, verthree, imagecode) filemove(filepath, filename) elif filename.startswith("dcnm-va"): imagecode = imagelookup("va") filepath = filepath4(prodname, vertwo, verthree, imagecode) filemove(filepath, filename) elif filename.startswith("dcnm-se"): imagecode = imagelookup("installer-ase") filepath = filepath4(prodname, vertwo, verthree, imagecode) filemove(filepath, filename) elif filename.startswith("dcnm-se"): imagecode = imagelookup("installer-ase") filepath = filepath4(prodname, vertwo, verthree, imagecode) filemove(filepath, filename) elif filename.startswith("dcnm-silent-installer-properties"): imagecode = imagelookup("silent-installer") filepath = filepath4(prodname, vertwo, verthree, imagecode) filemove(filepath, filename) elif filename.startswith("dcnm-san-client"): imagecode = imagelookup("san-client") filepath = filepath4(prodname, vertwo, verthree, imagecode) filemove(filepath, filename) elif filename.startswith("dcnm-device-pack"): imagecode = imagelookup("device-pack") filepath = filepath4(prodname, vertwo, verthree, imagecode) filemove(filepath, filename) elif filename.startswith("dcnm-va-ovf-kvm-files"): imagecode = imagelookup("virtual-ovf") filepath = filepath4(prodname, vertwo, verthree, imagecode) filemove(filepath, filename)