def nexus7ksliceandice(filename, prodname, supcode, debug1): if debug1: print("\tSubroutine#\tnexus7ksliceandice") splitbydot = filename.split(".") if splitbydot[0] == "n7000-s1-kickstart-npe" or splitbydot[ 0] == "n7000-s2-kickstart-npe" or splitbydot[ 0] == "n7700-s2-kickstart-npe" or splitbydot[ 0] == "n7700-s3-kickstart-npe": prodname = prodname + "/" + supcode imagecode = imagelookup("kickstart-npe") if splitbydot[1] == "7": fileprocnxosfivedigit(filename, prodname, imagecode, debug1) else: fileprocnxosthreedigit(filename, prodname, imagecode, debug1) elif splitbydot[0] == "n7000-s1-kickstart" or splitbydot[ 0] == "n7000-s2-kickstart" or splitbydot[ 0] == "n7700-s2-kickstart" or splitbydot[ 0] == "n7700-s3-kickstart": prodname = prodname + "/" + supcode imagecode = imagelookup("kickstart") if splitbydot[1] == "7": fileprocnxosfivedigit(filename, prodname, imagecode, debug1) else: fileprocnxosthreedigit(filename, prodname, imagecode, debug1) elif splitbydot[0] == "n7000-s1-dk9-npe" or splitbydot[ 0] == "n7000-s2-dk9-npe" or splitbydot[ 0] == "n7700-s2-dk9-npe" or splitbydot[0] == "n7700-s3-dk9-npe": prodname = prodname + "/" + supcode imagecode = imagelookup("system-npe") if splitbydot[1] == "7": fileprocnxosfivedigit(filename, prodname, imagecode, debug1) else: fileprocnxosthreedigit(filename, prodname, imagecode, debug1) elif (splitbydot[0] == "n7000-s1-dk9" or splitbydot[0] == "n7000-s2-dk9" or splitbydot[0] == "n7700-s2-dk9" or splitbydot[0] == "n7700-s3-dk9" or splitbydot[0] == "n7000-s1-epld" or splitbydot[0] == "n7000-s2-epld" or splitbydot[0] == "n7700-s2-epld" or splitbydot[0] == "n7700-s3-epld"): prodname = prodname + "/" + supcode if splitbydot[1] == "7": if splitbydot[6].startswith("CSC"): imagecode = imagelookup("smu") fileprocnxosfivedigit(filename, prodname, imagecode, debug1) elif splitbydot[0].endswith("epld"): imagecode = imagelookup("epld") fileprocnxosfivedigit(filename, prodname, imagecode, debug1) else: imagecode = imagelookup("system") fileprocnxosfivedigit(filename, prodname, imagecode, debug1) else: if splitbydot[4].startswith("CSC"): imagecode = imagelookup("smu") fileprocnxosthreedigit(filename, prodname, imagecode, debug1) elif splitbydot[0].endswith("epld"): imagecode = imagelookup("epld") fileprocnxosthreedigit(filename, prodname, imagecode, debug1) else: imagecode = imagelookup("system") fileprocnxosthreedigit(filename, prodname, imagecode, debug1)
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 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 fileproc_iosxe_controller(debug1, filename, prodname): if debug1: print("\tSubroutine#\tfileproc_iosxe_controller") if filename.endswith(".iso"): imagecode = imagelookup("universalk9") fileproc_iosxe(debug1, filename, prodname, imagecode) elif filename.endswith(".ova"): imagecode = imagelookup("universalk9") fileproc_iosxe(debug1, filename, prodname, imagecode) elif filename.endswith(".bin"): imagecode = imagelookup("universalk9") fileproc_iosxe(debug1, filename, prodname, imagecode) elif filename.endswith(".run"): if "nfvis" in filename: imagecode = imagelookup("universal_google_nfvis") fileproc_iosxe(debug1, filename, prodname, imagecode) elif "esxi" in filename: imagecode = imagelookup("universal_google_esxi") fileproc_iosxe(debug1, filename, prodname, imagecode) elif "kvm" in filename: imagecode = imagelookup("universal_google_kvm") fileproc_iosxe(debug1, filename, prodname, imagecode) elif filename.endswith(".tar.gz"): imagecode = imagelookup("universalk9_cloud") fileproc_iosxe(debug1, filename, prodname, imagecode) elif filename.endswith(".qcow2"): imagecode = imagelookup("universal_kvm") fileproc_iosxe(debug1, filename, prodname, imagecode) elif (filename.startswith("C9800-80-universalk9_wlc.") or filename.startswith("C9800-40-universalk9_wlc.") or filename.startswith("C9800-L-universalk9_wlc.")): imagecode = imagelookup("universalk9") fileproc_iosxe(debug1, filename, prodname, imagecode) elif (filename.startswith("C9800-80-universalk9_kvm.") or filename.startswith("C9800-40-universalk9_kvm.") or filename.startswith("C9800-CL-universalk9_kvm.") or filename.startswith("C9800-L-universalk9_kvm.")): imagecode = imagelookup("universalk9_kvm") fileproc_iosxe(debug1, filename, prodname, 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 fileprocessor_iosxr(debug1, filename): if debug1: print("\tModule#\t\tios_iosxr") if debug1: print("\tSubroutine#\tfileprocessor_iosxr") splitbydot = filename.split(".") if (filename.startswith("asr9k-px-") and splitbydot[3].startswith("CSC") or filename.startswith("asr9k-x64-") and splitbydot[3].startswith("CSC") or filename.startswith("asr9k-sysadmin-") and splitbydot[3].startswith("CSC")): iosxr_asr9ksmu(debug1, filename) elif (filename.startswith("ASR9K") or filename.startswith("ASR9k") or filename.startswith("ASR9000") or filename.startswith("asr9k")): iosxr_asr9k(debug1, filename) elif (filename.startswith("fullk9")): iosxr_asr9kv(debug1, filename) elif (filename.startswith("xrv9k")): iosxr_asr9kvsmu(debug1, filename) elif (filename == "XRV9K-docs-7.4.1.tar" or filename == "XRV9000-docs-623.tar" or filename == "XRV9000-docs-6225.tar"): prodname = product("iosxrvfull") imagecode = imagelookup("docs") filepath = filepath2(prodname, imagecode) filemove(filepath, filename) elif (filename == "xrvr-full-4.3.2.vmdk" or filename == "xrvr-fullk9-4.3.2.vmdk"): prodname = product("iosxrvdemo") filepath = filepath2(prodname, "4.3.2") filemove(filepath, filename) elif (filename.startswith("iosxrv-demo") or filename.startswith("iosxrv-k9-demo")): iosxr_iosxrv_demo(debug1, filename) else: # if prodname == "UNKNOWN": # messageunknowndev() # elif imagecode == "UNKNOWN": # messageunknownfeat() messageunknowndev()
def fileprocessorvoice(debug1, filename): if debug1: print("\tModule#\t\tios_voice") if debug1: print("\tSubroutine#\tfileprocessorvoice") if filename.startswith("cmterm"): fileprocphone(debug1, filename) elif (filename == "vgc-main.1-3-1ES8-2.tar" or filename == "vgc-main.1-3-2.tar" or filename == "vgc-main.1-3-2ES3.tar" or filename == "vgc-main_1-3-1es8-2_Readme.txt" or filename == "vgc-main_1-3-2es3_Readme.txt"): prodname = product("vg248") utilssingleprodname(debug1, filename, prodname) elif (filename.startswith("cme") or filename.startswith("CME")): prodname = product("voice") imagecode = imagelookup("cme") utilssinglemove(debug1, filename, prodname, imagecode) else: messageunknownfile()
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 file_proc_servers(filename, debug1): if debug1: print("\tModule#\t\tios_servers") if debug1: print("\tSubroutine#\tfile_proc_servers") if (filename == "B57BCMCD_v15.2.4.1.tgz" or filename == "B57CiscoCD_T6.4.4.3-57712.zip" or filename == "Intel_Windows_drv_MR_6.714.18.00_pv.zip" or filename == "LSI_x64_Signed_Driver_5.2.116.64.zip" or filename == "MR_WINDOWS_DRIVER-6.506.02.00-WHQL.zip" or filename == "intel9.2.3.1023.tar" or filename == "rste_4.5.0.1335_install.zip"): prodname = product("ucseseries") imagecode = imagelookup("driverseseries") utilssinglemove(debug1, filename, prodname, imagecode) elif filename.startswith("DNAC") or filename.startswith("dnac"): prodname = product("dnac") if filename == "dnac1307_cisco_image_verification_key.pub": v2 = "1.3" vf = "1.3.0.7" prodpath = prodname + "/" + v2 + "/" + vf filemove(prodpath, filename) elif filename == "dnac1314_cisco_image_verification_key.pub": v2 = "1.3" vf = "1.3.1.4" prodpath = prodname + "/" + v2 + "/" + vf filemove(prodpath, filename) elif filename == "dnac1317_cisco_image_verification_key.pub": v2 = "1.3" vf = "1.3.1.7" prodpath = prodname + "/" + v2 + "/" + vf filemove(prodpath, filename) elif filename == "dnac1331_cisco_image_verification_key.pub": v2 = "1.3" vf = "1.3.3.1" prodpath = prodname + "/" + v2 + "/" + vf filemove(prodpath, filename) elif filename == "dnac1333_cisco_image_verification_key.pub": v2 = "1.3" vf = "1.3.3.3" prodpath = prodname + "/" + v2 + "/" + vf filemove(prodpath, filename) elif filename == "dnac1334_cisco_image_verification_key.pub": v2 = "1.3" vf = "1.3.3.4" prodpath = prodname + "/" + v2 + "/" + vf filemove(prodpath, filename) elif filename == "dnac1335_cisco_image_verification_key.pub": v2 = "1.3" vf = "1.3.3.5" prodpath = prodname + "/" + v2 + "/" + vf filemove(prodpath, filename) elif filename == "dnac1336_cisco_image_verification_key.pub": v2 = "1.3" vf = "1.3.3.6" prodpath = prodname + "/" + v2 + "/" + vf filemove(prodpath, filename) elif filename.startswith("DNAC-witness"): workname = filename.replace("DNAC-witness-", "") workname = workname.replace(".ova", "") imagecode = imagelookup("witness") utils_dev_imagecode_v2_vf(debug1, filename, prodname, imagecode, workname) else: workname = filename.replace("DNAC-SW-", "") workname = workname.replace("dnac", "") workname = workname.replace(".sig", "") workname = workname.replace(".iso", "") workname = workname.replace("_cisco_image_verification_key.pub", "") utils_dev_v2_vf(debug1, filename, prodname, workname) elif filename.startswith("ucs-catalog"): prodname = product("ucsgeneric") imagecode = imagelookup("catalog") utilssinglemove(debug1, filename, prodname, imagecode) elif filename.startswith("pid-ctlg"): prodname = product("c2xxm3") imagecode = imagelookup("catalog") utilssinglemove(debug1, filename, prodname, imagecode) elif (filename.startswith("delnorte") or filename.startswith("delnorte2")): prodname = product("c2xxm4") imagecode = imagelookup("catalog") utilssinglemove(debug1, filename, prodname, imagecode) elif (filename.startswith("plumas1") or filename.startswith("plumas2") or filename.startswith("UCSC-C220-M5-") or filename.startswith("UCSC-C240-M5-")): prodname = product("c2xxm5") imagecode = imagelookup("catalog") utilssinglemove(debug1, filename, prodname, imagecode) elif (filename.startswith("Collector") or filename.startswith("collector") or filename == "JeOS_Patch_To_Enable_ASD.zip" or filename == "cspc28backupscript.zip"): prodname = product("cspc") utilssingleprodname(debug1, filename, prodname) elif (filename == "efi-obd-v12-07-18.diag" or filename == "efi-obd-v13-10-15.diag" or filename == "efi-obd-v13-7-3.diag"): prodname = product("ucseseries") imagecode = imagelookup("hdiag") utilssinglemove(debug1, filename, prodname, imagecode) elif (filename.startswith("ucs-cxx-diag")): prodname = product("ucscseries") imagecode = imagelookup("hdiag") utilssinglemove(debug1, filename, prodname, imagecode) elif (filename.startswith("ucs-cxxx-scu") or filename.startswith("ucs-cxx-scu")): prodname = product("ucscseries") imagecode = imagelookup("scu") workname = filename.replace("ucs-cxxx-scu-", "") workname = workname.replace("ucs-cxx-scu-", "") workname = workname.replace(".iso", "") utils_dev_imagecode_v2_vf(debug1, filename, prodname, imagecode, workname) elif (filename.startswith("ucs-blade-diags") or filename.startswith("ucs-blade-server-diags")): prodname = product("ucsbseries") imagecode = imagelookup("hdiag") utilssinglemove(debug1, filename, prodname, imagecode) elif (filename == "huu-2.3.1.iso" or filename == "huu-2.3.2.iso" or filename == "huu-2.3.3.iso" or filename == "huu-2.4.1.iso" or filename == "huu-3.0.1.iso" or filename == "huu-3.1.1.iso" or filename == "huu_3.1.2.iso" or filename == "huu_3.1.3.iso" or filename == "huu_3.1.4.iso" or filename == "huu_3.2.6.v3.iso" or filename == "ucse-huu-2.1.1.iso" or filename == "ucs-e100-huu-2.2.1.iso"): prodname = product("ucseseries") imagecode = imagelookup("huu") utilssinglemove(debug1, filename, prodname, imagecode) elif (filename == "DW_16MB_release_1029.bin" or filename == "DW_BIOS.bin.SPA" or filename == "DW_Signed_Bios_Image.bin.SPA" or filename == "1X0DBIOSv4.8" or filename == "1X0SBIOSv4.8" or filename == "Signed_EN_BIOS_1.5.0.4.bin.SPA" or filename.startswith("CIMC_") and filename.endswith(".bin") or filename == "Signed_DW_M1M2_BIOS_2.5.0.4.bin.SPA" or filename == "Signed_DW_M1M2_BIOS_2.5.0.5.bin.SPA" or filename == "Signed_DW_M1M2_BIOS_2.5.0.6.bin.SPA" or filename == "Signed_DW_M1M2_Bios_Image_041015.bin.SPA" or filename == "Signed_EN_BIOS_1.5.0.5.bin.SPA" or filename == "Signed_EN_BIOS_1.5.0.6.bin.SPA" or filename == "Signed_SW_M2_BIOS_1.5.0.6.bin.SPA" or filename == "Signed_SW_M2_BIOS_1.5.0.7.bin.SPA" or filename == "Signed_SW_M2_BIOS_1.5.0.8.bin.SPA" or filename == "Signed_SW_M2_Bios_1.5.0.5.bin.SPA" or filename == "UCSEDM3_BIOS_2.4.SPA" or filename == "UCSEDM3_BIOS_2.5.SPA" or filename == "UCSEDM3_BIOS_2.6.SPA" or filename == "UCSE_CIMC_2.3.1.bin" or filename == "UCSE_CIMC_2.3.2.bin" or filename == "UCSE_CIMC_2.3.3.bin" or filename == "UCSE_CIMC_2.3.5.bin" or filename == "update_pkg-Mar-22-MR-rebuild.bin" or filename == "update_pkg-ucse.combined.120808.bin" or filename == "update_pkg-ucse.combined.REL.2.2.2.bin" or filename == "update_pkg-ucse.combined.REL.2.2.1.bin" or filename == "update_pkg-ucse.combined.REL.bin" or filename == "SW_16MB_release_1102.bin" or filename == "SW_Signed_Bios_Image.bin.SPA"): prodname = product("ucseseries") imagecode = imagelookup("firmwareeseries") utilssinglemove(debug1, filename, prodname, imagecode) elif (filename == "UCS_docs_20110510.iso"): prodname = product("ucsgeneric") imagecode = imagelookup("docs") utilssinglemove(debug1, filename, prodname, imagecode) elif (filename.startswith("ucs") or filename == "b2xx-m1-drivers-1.1.1j.iso" or filename == "c2xx-m1-utils-1.0.2.iso"): file_proc_servers_ucs(debug1, filename) elif (filename == "BashFix-update-0-x86_64.tar.gz" or filename == "Datacenter_Technology_Pack-1.0.53.ubf" or filename == "Datacenter_Technology_Pack_Update_1_Patch-1.0.58.ubf" or filename == "GlibcFix-pi22-update-0-x86_64.tar.gz" or filename == "PrimeInfra.pem" or filename == "ca_technology_package-2.1.0.0.41.ubf" or filename == "operations_center_pi_2_1_2_enable_update.ubf" or filename == "rhel-vulnerability-patch-pnp-2.2.0.14.tar.gz" or filename == "InstallerUpdateBE-1.0.5.tar.gz" or filename.startswith("CiscoPI") or filename.startswith("Device-Pack") or filename.startswith("PI") or filename.startswith("pi") or filename.startswith("PNP-GATEWAY-VM-") or filename.startswith("cisco-prime-pnp") or filename.startswith("pnp-") or filename.startswith("DnacPreCheckASSESMENTUbf")): file_proc_servers_primeinfra(debug1, filename) elif (filename.startswith("Cisco_ACI") or filename.startswith("acisim") or filename.startswith("aci-simulator") or filename.startswith("aci-apic") or filename.startswith("aci-msft-pkg") or filename.startswith("aci-n9000-dk9") or filename.startswith("apic-vrealize") or filename.startswith("esx-msc") or filename.startswith("msc") or filename.startswith("vcenter-plugin") or filename.startswith("tools-msc")): prodname = product("aci") file_proc_servers_aci(debug1, filename, prodname) elif (filename.startswith("storfs-packages") or filename.startswith("HX-ESXi") or filename.startswith("HX-Kubernetes") or filename.startswith("Cisco-HX-Data-Platform-Installer") or filename.startswith("cisco-HX-Data-Platform-Installer") or filename.startswith("HyperFlex-VC-HTML") or filename.startswith("hxcsi") or filename.startswith("HyperFlex-Witness-") or filename.startswith("HxClone-HyperV")): prodname = product("hyperflex") file_proc_servers_hyperflex(debug1, filename, prodname) elif (filename.startswith("DCNM") or filename.startswith("dcnm")): prodname = product("dcnm") file_proc_servers_dcnm(debug1, filename, prodname) elif filename == "readme_10.2.1.ST.1": prodname = product("dcnm") filepath = filepath3(prodname, "10.2", "10.2.1") filemove(filepath, filename) elif (filename.startswith("apic_em_update-apic-") or filename.startswith("APIC-EM-")): file_proc_servers_apicem(debug1, filename) else: messageunknownfile()
def file_proc_servers_ucs(debug1, filename): if debug1: print("\tSubroutine#\tfile_proc_servers_ucs") splitbydash = filename.split("-") if filename.startswith("ucs-utils"): prodname = product("ucsgeneric") imagecode = imagelookup("utils") elif (filename.startswith("ucs-drivers") or filename.startswith("ucs-b2xx-drivers") or filename.startswith("ucs-bxxx-drivers") or filename.startswith("ucs-c2xx-drivers") or filename.startswith("ucs-cxxx-drivers") or filename.startswith("ucs-cxxx-fw") or filename == "b2xx-m1-drivers-1.1.1j.iso"): if filename == "ucs-drivers.1.0.2.iso": prodname = product("ucsgeneric") imagecode = imagelookup("driversucsb") file_proc_servers_p2_d3(debug1, filename, prodname, imagecode) elif filename == "b2xx-m1-drivers-1.1.1j.iso": prodname = product("ucsgeneric") imagecode = imagelookup("driversucsc") file_proc_servers_p3_d3(filename, prodname, imagecode) elif filename.startswith("ucs-cxxx-drivers") or filename.startswith( "ucs-c2xx-drivers"): prodname = product("ucsgeneric") imagecode = imagelookup("driversucsc") file_proc_servers_p2_d3(debug1, filename, prodname, imagecode) elif filename.startswith("ucs-cxxx-fw"): prodname = product("ucsgeneric") imagecode = imagelookup("driversucsc") file_proc_servers_p2_d3(debug1, filename, prodname, imagecode) elif filename.startswith("ucs-bxxx-drivers"): prodname = product("ucsgeneric") imagecode = imagelookup("driversucsb") file_proc_servers_p2_d3(debug1, filename, prodname, imagecode) elif filename.startswith("ucs-b2xx-drivers"): prodname = product("ucsgeneric") imagecode = imagelookup("driversucsb") file_proc_servers_p2_d3(debug1, filename, prodname, imagecode) elif (filename.startswith("ucs_k9_bundle") or filename.startswith("ucs-k9-bundle") or filename.startswith("ucs-k9-bundle-b-series") or filename.startswith("ucs-k9-bundle-c-series") or filename.startswith("ucs-k9-bundle-infra") or filename.startswith("ucs-k9-bundle-m-series") or filename.startswith("ucs-mini-k9-bundle-infra") or filename.startswith("ucs-6300-k9-bundle-infra") or filename.startswith("ucs-6400-k9-bundle-infra")): prodname = product("ucsgeneric") imagecode = imagelookup("ucsbundle") file_proc_servers_p2_d3(debug1, filename, prodname, imagecode) elif (filename.startswith("ucs-b2xx-utils") or filename.startswith("ucs-bxxx-utils") or filename.startswith("ucs-c2xx-utils") or filename.startswith("ucs-cxxx-utils") or filename == "c2xx-m1-utils-1.0.2.iso"): if (filename.startswith("ucs-b2xx-utils-") and filename.endswith("-vmware.iso")): prodname = product("ucsgeneric") imagecode = imagelookup("utilsbseries") imagecode2 = imagelookup("vmware") file_proc_servers_p3_d3_utils(debug1, filename, prodname, imagecode, imagecode2) elif (filename == "c2xx-m1-utils-1.0.2.iso"): prodname = product("ucsgeneric") imagecode = imagelookup("utilscseries") utilssinglemove(debug1, filename, prodname, imagecode) elif (filename.startswith("ucs-b2xx-utils-") and filename.endswith("-windows.iso")): prodname = product("ucsgeneric") imagecode = imagelookup("utilsbseries") imagecode2 = imagelookup("windows") file_proc_servers_p3_d3_utils(debug1, filename, prodname, imagecode, imagecode2) elif (filename.startswith("ucs-b2xx-utils-") and filename.endswith("-linux.iso")): prodname = product("ucsgeneric") imagecode = imagelookup("utilsbseries") imagecode2 = imagelookup("ucslinux") file_proc_servers_p3_d3_utils(debug1, filename, prodname, imagecode, imagecode2) elif (filename.startswith("ucs-c2xx-utils-") and filename.endswith("-vmware.iso")): prodname = product("ucsgeneric") imagecode = imagelookup("utilscseries") imagecode2 = imagelookup("vmware") file_proc_servers_p3_d3_utils(debug1, filename, prodname, imagecode, imagecode2) elif (filename.startswith("ucs-c2xx-utils-") and filename.endswith("-windows.iso")): prodname = product("ucsgeneric") imagecode = imagelookup("utilscseries") imagecode2 = imagelookup("windows") file_proc_servers_p3_d3_utils(debug1, filename, prodname, imagecode, imagecode2) elif (filename.startswith("ucs-c2xx-utils-") and filename.endswith("-linux.iso")): prodname = product("ucsgeneric") imagecode = imagelookup("utilscseries") imagecode2 = imagelookup("ucslinux") file_proc_servers_p3_d3_utils(debug1, filename, prodname, imagecode, imagecode2) elif (filename.startswith("ucs-c2xx-utils-") and filename.endswith("-efi.iso")): prodname = product("ucsgeneric") imagecode = imagelookup("utilscseries") imagecode2 = imagelookup("efi") file_proc_servers_p3_d3_utils(debug1, filename, prodname, imagecode, imagecode2) elif (filename.startswith("ucs-bxxx-utils-vmware") or filename.startswith("ucs-b2xx-utils-vmware")): prodname = product("ucsgeneric") imagecode = imagelookup("utilsbseries") imagecode2 = imagelookup("vmware") file_proc_servers_p2_d3_utils(debug1, filename, prodname, imagecode, imagecode2) elif (filename.startswith("ucs-cxxx-utils-vmware") or filename.startswith("ucs-c2xx-utils-vmware")): prodname = product("ucsgeneric") imagecode = imagelookup("utilscseries") imagecode2 = imagelookup("vmware") file_proc_servers_p2_d3_utils(debug1, filename, prodname, imagecode, imagecode2) elif (filename.startswith("ucs-bxxx-utils-windows") or filename.startswith("ucs-b2xx-utils-windows")): prodname = product("ucsgeneric") imagecode = imagelookup("utilsbseries") imagecode2 = imagelookup("windows") file_proc_servers_p2_d3_utils(debug1, filename, prodname, imagecode, imagecode2) elif (filename.startswith("ucs-cxxx-utils-windows") or filename.startswith("ucs-c2xx-utils-windows")): prodname = product("ucsgeneric") imagecode = imagelookup("utilscseries") imagecode2 = imagelookup("windows") file_proc_servers_p2_d3_utils(debug1, filename, prodname, imagecode, imagecode2) elif (filename.startswith("ucs-bxxx-utils-linux") or filename.startswith("ucs-b2xx-utils-linux")): prodname = product("ucsgeneric") imagecode = imagelookup("utilsbseries") imagecode2 = imagelookup("ucslinux") file_proc_servers_p2_d3_utils(debug1, filename, prodname, imagecode, imagecode2) elif (filename.startswith("ucs-cxxx-utils-linux") or filename.startswith("ucs-c2xx-utils-linux")): prodname = product("ucsgeneric") imagecode = imagelookup("utilscseries") imagecode2 = imagelookup("ucslinux") file_proc_servers_p2_d3_utils(debug1, filename, prodname, imagecode, imagecode2) elif (filename.startswith("ucs-cxxx-utils-efi") or filename.startswith("ucs-c2xx-utils-efi")): prodname = product("ucsgeneric") imagecode = imagelookup("utilscseries") imagecode2 = imagelookup("efi") file_proc_servers_p2_d3_utils(debug1, filename, prodname, imagecode, imagecode2) elif splitbydash[0] == "ucs" and splitbydash[2] == "huu": prodname = product(splitbydash[1]) imagecode = imagelookup(splitbydash[2]) file_proc_servers_p3_d3(debug1, filename, prodname, imagecode)
def file_proc_servers_aci(debug1, filename, prodname): if debug1: print("\tSubroutine#\tfile_proc_servers_aci") if (filename.startswith("tools-msc-") or filename.startswith("esx-msc-") or filename.startswith("msc-")): imagecode = imagelookup("mso") workname = filename.replace("tools-msc-", "") workname = workname.replace("esx-msc-", "") workname = workname.replace("msc-", "") workname = workname.replace(".ova", "") workname = workname.replace(".tar.gz", "") utils_dev_imagecode_v2_vf(debug1, filename, prodname, imagecode, workname) elif (filename.startswith("Cisco_ACI_Virtual_Edge_")): imagecode = imagelookup("acive") workname = filename.replace("Cisco_ACI_Virtual_Edge_", "") workname = workname.replace("-pkg.zip", "") utils_dev_imagecode_v2_vf(debug1, filename, prodname, imagecode, workname) elif (filename.startswith("aci-apic-dk9.")): imagecode = imagelookup("apic") workname = filename.replace("aci-apic-dk9.", "") workname = workname.replace(".iso", "") workname = workname.replace(".ova", "") utils_dev_imagecode_v2_vf(debug1, filename, prodname, imagecode, workname) elif (filename.startswith("aci-msft-pkg-")): imagecode = imagelookup("aciplgms") workname = filename.replace("aci-msft-pkg-", "") workname = workname.replace(".zip", "") utils_dev_imagecode_v2_vf(debug1, filename, prodname, imagecode, workname) elif (filename.startswith("vcenter-plugin-")): imagecode = imagelookup("aciplgvc") workname = filename.replace("vcenter-plugin-", "") workname = workname.replace(".tgz", "") utils_dev_imagecode_v2_vf(debug1, filename, prodname, imagecode, workname) elif (filename.startswith("apic-vrealize-")): imagecode = imagelookup("aciplgvs") workname = filename.replace("apic-vrealize-", "") workname = workname.replace(".tgz", "") utils_dev_imagecode_v2_vf(debug1, filename, prodname, imagecode, workname) elif (filename.startswith("aci-n9000-dk9.")): imagecode = imagelookup("n9kacim") workname = filename.replace("aci-n9000-dk9.", "") workname = workname.replace(".bin", "") utils_dev_imagecode_v2_vf(debug1, filename, prodname, imagecode, workname) elif (filename.startswith("acisim-")): imagecode = imagelookup("acisim") workname = filename.replace("acisim-", "") workname = workname.replace("_part1.ova", "") workname = workname.replace("_part2.ova", "") workname = workname.replace("_part3.ova", "") workname = workname.replace("_part4.ova", "") workname = workname.replace("_part5.ova", "") workname = workname.replace("_part6.ova", "") workname = workname.replace("_part7.ova", "") workname = workname.replace("_part8.ova", "") workname = workname.replace("_part9.ova", "") workname = workname.replace("-", ".") splitbydot = workname.split(".") utils_dev_imagecode_v2_vf(debug1, filename, prodname, imagecode, workname) elif (filename.startswith("aci-simulator-dk9.")): imagecode = imagelookup("acisim") workname = filename.replace("aci-simulator-dk9.", "") utils_dev_imagecode_v2_vf(debug1, filename, prodname, imagecode, workname) else: messageunknownfile()
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)
def fileprocessornxos(filename, debug1): if debug1: print("\tModule#\t\tios_nexus") if debug1: print("\tSubroutine#\tfileprocessornxos") splitbydash = filename.split("-") splitbydot = filename.split(".") if (filename.startswith("ssd_c400_upgrade") or filename == "upgrade_m500_firmware.tar.gz"): prodname = product("nxos") imagecode = imagelookup("firmware") utilssinglemove(debug1, filename, prodname, imagecode) elif filename == "n9000-epld-secure-boot-update.img": prodname = product("nxos") imagecode = imagelookup("epld") utilssinglemove(debug1, filename, prodname, imagecode) elif (filename == "poap_script.py" or filename == "poap_script.tcl"): prodname = product("n3500") imagecode = imagelookup("poap") utilssinglemove(debug1, filename, prodname, imagecode) elif filename == "L2-L3_CT.zip": prodname = product("n1000v") imagecode = imagelookup("l2l3cvt") utilssinglemove(debug1, filename, prodname, imagecode) elif (filename == "nxos-n3kbios.bin" or filename == "n3k_bios_release_rn.pdf"): prodname = product("n3000") imagecode = imagelookup("bios") utilssinglemove(debug1, filename, prodname, imagecode) elif filename == "nxos.9.3.4-capacity-emulator.tgz": prodname = product("nxos") imagecode = imagelookup("capacity-emulator") workname = filename.replace("-capacity-emulator.tgz", "") workname = workname.replace("nxos.", "") utils_dev_imagecode_v2_vf(debug1, filename, prodname, imagecode, workname) elif filename == "ntp-1.0.1-7.0.3.I2.2d.lib32_n9000.rpm": prodname = product("nxos") imagecode = imagelookup("smu") imagecode = imagecode + "/7.0/7.0.3.I2.2d/NTP" utilssinglemove(debug1, filename, prodname, imagecode) elif filename == "ntp-1.0.1-7.0.3.I2.2e.lib32_n9000.rpm": prodname = product("nxos") imagecode = imagelookup("smu") imagecode = imagecode + "/7.0/7.0.3.I2.2e/NTP" utilssinglemove(debug1, filename, prodname, imagecode) elif filename == "ntp-1.0.2-7.0.3.I2.2e.lib32_n9000.rpm": prodname = product("nxos") imagecode = imagelookup("smu") imagecode = imagecode + "/7.0/7.0.3.I2.2e/NTP" utilssinglemove(debug1, filename, prodname, imagecode) elif filename == "nxos.nsqos_lc_tor-n9k_TOR-1.0.0-7.0.3.I2.2e.lib32_n9000.rpm": prodname = product("nxos") imagecode = imagelookup("smu") imagecode = imagecode + "/7.0/7.0.3.I2.2e/QoS" utilssinglemove(debug1, filename, prodname, imagecode) elif filename == "nxos.nsqos_sup_tor-n9k_TOR-1.0.0-7.0.3.I2.2e.lib32_n9000.rpm": prodname = product("nxos") imagecode = imagelookup("smu") imagecode = imagecode + "/7.0/7.0.3.I2.2e/QoS" utilssinglemove(debug1, filename, prodname, imagecode) elif filename == "snmp-1.0.1-7.0.3.I2.2e.lib32_n9000.rpm": prodname = product("nxos") imagecode = imagelookup("smu") imagecode = imagecode + "/7.0/7.0.3.I2.2e/SNMP" utilssinglemove(debug1, filename, prodname, imagecode) elif filename == "vxlan-2.0.1.0-9.2.3.lib32_n9000.rpm": prodname = product("nxos") imagecode = imagelookup("smu") imagecode = imagecode + "/9.2/9.2.3/VXLAN" utilssinglemove(debug1, filename, prodname, imagecode) elif filename.startswith("n6000_poap_script"): prodname = product("n6000") imagecode = imagelookup("poap") utilssinglemove(debug1, filename, prodname, imagecode) elif filename.startswith("poap_ng"): prodname = product("Nexus") imagecode = imagelookup("poap_ng") workname = filename.replace(".py", "") workname = workname.replace("poap_ng.", "") utils_dev_imagecode_v2_vf(debug1, filename, prodname, imagecode, workname) elif (filename.startswith("Nexus1000v") or filename.startswith("Nexus1000V")): prodname = product("n1000v") fileprocnxos1000v(debug1, filename, prodname) elif splitbydot[0] == "n9000-epld": prodname = product("nxos") imagecode = imagelookup("epld") if splitbydot[1] == "6" or splitbydot[1] == "7": fileprocnxosfivedigit(filename, prodname, imagecode, debug1) else: fileprocnxosthreedigit(filename, prodname, imagecode, debug1) elif splitbydot[0] == "n9000-dk9": prodname = product("n9000") if splitbydot[1] == "6" or splitbydot[1] == "7": if splitbydot[6].startswith("CSC"): imagecode = imagelookup("smu") fileprocnxosfivedigit(filename, prodname, imagecode, debug1) else: imagecode = imagelookup("system") fileprocnxosfivedigit(filename, prodname, imagecode, debug1) elif splitbydot[0] == "n7000-s1-epld" or splitbydot[0] == "n7000-s2-epld": prodname = product("n7000") imagecode = imagelookup("epld") if splitbydot[1] == "7": fileprocnxosfivedigit(filename, prodname, imagecode, debug1) else: fileprocnxosthreedigit(filename, prodname, imagecode, debug1) elif (splitbydot[0] == "nxos" or splitbydot[0] == "nxos64"): prodname = product("nxos") if len(splitbydot) == 5: imagecode = imagelookup("system") fileprocnxosthreedigit(filename, prodname, imagecode, debug1) elif len(splitbydot) == 6: imagecode = imagelookup("system") fileprocnxosthreedigit(filename, prodname, imagecode, debug1) elif len(splitbydot) == 7: imagecode = imagelookup("system") fileprocnxosfivedigit(filename, prodname, imagecode, debug1) elif len(splitbydot) == 7: imagecode = imagelookup("system") fileprocnxosfivedigit(filename, prodname, imagecode, debug1) elif splitbydot[1].startswith("CSC"): imagecode = imagelookup("smu") fileprocessornxos9ksmu(filename, prodname, imagecode, debug1) elif splitbydash[0] == "n6000": prodname = product(splitbydash[0]) if splitbydot[0] == "n6000-uk9-kickstart": imagecode = imagelookup("kickstart") fileprocnxosfivedigit(filename, prodname, imagecode, debug1) elif splitbydot[0] == "n6000-uk9": imagecode = imagelookup("system") fileprocnxosfivedigit(filename, prodname, imagecode, debug1) elif splitbydash[0] == "n7000": prodname = product(splitbydash[0]) if splitbydash[1] == "s1": imagecode = imagelookup("s1") nexus7ksliceandice(filename, prodname, imagecode, debug1) elif splitbydash[1] == "s2": imagecode = imagelookup("s2") nexus7ksliceandice(filename, prodname, imagecode, debug1) elif splitbydash[0] == "n7700": prodname = product(splitbydash[0]) if splitbydash[1] == "s2": imagecode = imagelookup("s2") nexus7ksliceandice(filename, prodname, imagecode, debug1) elif splitbydash[1] == "s3": imagecode = imagelookup("s3") nexus7ksliceandice(filename, prodname, imagecode, debug1) elif filename.startswith("n3000"): prodname = product("n3000") if filename.startswith("n3000-uk9-kickstart."): imagecode = imagelookup("kickstart") workname = filename.replace(".bin", "") workname = workname.replace("n3000-uk9-kickstart.", "") utils_dev_v2_vf_imagecode(debug1, filename, prodname, imagecode, workname) elif filename.startswith("n3000-compact"): imagecode = imagelookup("system") workname = filename.replace(".bin", "") workname = workname.replace("n3000-compact.", "") utils_dev_v2_vf_imagecode(debug1, filename, prodname, imagecode, workname) elif filename.startswith("n3000_xsd."): imagecode = imagelookup("xsd") workname = filename.replace(".tar.gz", "") workname = workname.replace("n3000_xsd.", "") utils_dev_imagecode_v2_vf(debug1, filename, prodname, imagecode, workname) else: imagecode = imagelookup("system") workname = filename.replace(".bin", "") workname = workname.replace("n3000-uk9.", "") utils_dev_v2_vf_imagecode(debug1, filename, prodname, imagecode, workname) elif filename.startswith("guestshell"): prodname = product("Nexus") imagecode = imagelookup("guestshell") workname = filename.replace(".ova", "") workname = workname.replace("guestshell.", "") utils_dev_imagecode_v2_vf(debug1, filename, prodname, imagecode, workname) elif filename.startswith("oac"): prodname = product("Nexus") imagecode = imagelookup("oac") workname = filename.replace(".ova", "") workname = workname.replace("oac.", "") utils_dev_imagecode_v2_vf(debug1, filename, prodname, imagecode, workname) elif (filename.startswith("nxosv-final") or filename.startswith("nxosv") or filename.startswith("nexus9300v") or filename.startswith("nexus9500v")): prodname = product("nxosv") imagecode = imagelookup("system") workname = filename.replace(".box", "") workname = workname.replace(".ova", "") workname = workname.replace(".qcow2", "") workname = workname.replace(".vmdk", "") workname = workname.replace("nxosv-final.", "") workname = workname.replace("nxosv.", "") workname = workname.replace("nexus9300v.", "") workname = workname.replace("nexus9500v64.", "") workname = workname.replace("nexus9500v.", "") utils_dev_v2_vf_imagecode(debug1, filename, prodname, imagecode, workname) elif (filename.startswith("n3500") or filename.startswith("poap_script.6") or filename.startswith("poap_script_n3k.")): prodname = product("n3500") if filename.startswith("n3500-uk9-kickstart."): imagecode = imagelookup("kickstart") workname = filename.replace(".bin", "") workname = workname.replace("n3500-uk9-kickstart.", "") utils_dev_v2_vf_imagecode(debug1, filename, prodname, imagecode, workname) elif (filename.startswith("poap_script.") or filename.startswith("poap_script_n3k.")): imagecode = imagelookup("poap") workname = filename.replace(".py", "") workname = workname.replace(".tcl", "") workname = workname.replace("poap_script_n3k.", "") workname = workname.replace("poap_script.", "") utils_dev_imagecode_v2_vf(debug1, filename, prodname, imagecode, workname) else: imagecode = imagelookup("system") workname = filename.replace(".bin", "") workname = workname.replace("n3500-uk9.", "") utils_dev_v2_vf_imagecode(debug1, filename, prodname, imagecode, workname) elif splitbydash[0] == "n4000": prodname = product("n4000") workname = filename.replace(".bin", "") workname = workname.replace("n4000-bk9-kickstart.", "") workname = workname.replace("n4000-bk9.", "") if filename.startswith("n4000-bk9-kickstart."): imagecode = imagelookup("kickstart") else: imagecode = imagelookup("system") utils_dev_v2_vf_imagecode(debug1, filename, prodname, imagecode, workname) elif (filename.startswith("n5000") or filename.startswith("poap_script")): prodname = product("n5000") if filename.startswith("n5000-uk9-kickstart."): imagecode = imagelookup("kickstart") workname = filename.replace(".bin", "") workname = workname.replace("n5000-uk9-kickstart.", "") utils_dev_v2_vf_imagecode(debug1, filename, prodname, imagecode, workname) elif (filename.startswith("n5000_poap_script.") or filename.startswith("poap_script.")): imagecode = imagelookup("poap") workname = filename.replace(".py", "") workname = workname.replace(".tcl", "") workname = workname.replace("n5000_poap_script.", "") workname = workname.replace("poap_script.", "") utils_dev_imagecode_v2_vf(debug1, filename, prodname, imagecode, workname) elif filename.startswith("n5000_xsd."): imagecode = imagelookup("xsd") workname = filename.replace(".tar.gz", "") workname = workname.replace("n5000_xsd.", "") utils_dev_imagecode_v2_vf(debug1, filename, prodname, imagecode, workname) else: imagecode = imagelookup("system") workname = filename.replace(".bin", "") workname = workname.replace("n5000-uk9.", "") utils_dev_v2_vf_imagecode(debug1, filename, prodname, imagecode, workname) elif (splitbydash[0] == "m9000" or splitbydash[0] == "m9500"): prodname = product("m9500") if filename.startswith("m9000-pkg1.") and filename.endswith(".epld"): imagecode = imagelookup("epld") workname = filename.replace(".epld", "") workname = workname.replace("m9000-pkg1.", "") utils_dev_imagecode_v2_vf(debug1, filename, prodname, imagecode, workname) elif filename.startswith("m9000-epld-") and filename.endswith(".img"): imagecode = imagelookup("epld") workname = filename.replace(".img", "") workname = workname.replace("m9000-epld-", "") utils_dev_imagecode_v2_vf(debug1, filename, prodname, imagecode, workname) elif filename.startswith("m9000-ek9-ssi-mz.") and filename.endswith( ".bin"): imagecode = imagelookup("ssi") workname = filename.replace(".bin", "") workname = workname.replace("m9000-ek9-ssi-mz.", "") utils_dev_imagecode_v2_vf(debug1, filename, prodname, imagecode, workname) elif filename.startswith("m9500-sf1ek9-kickstart-mz."): imagecode = imagelookup("s1ek9") workname = filename.replace(".bin", "") workname = workname.replace("m9500-sf1ek9-kickstart-mz.", "") utils_dev_imagecode_v2_vf(debug1, filename, prodname, imagecode, workname) elif filename.startswith("m9500-sf1ek9-mz."): imagecode = imagelookup("s1ek9") workname = filename.replace(".bin", "") workname = workname.replace("m9500-sf1ek9-mz.", "") utils_dev_imagecode_v2_vf(debug1, filename, prodname, imagecode, workname) elif filename.startswith("m9500-sf2ek9-kickstart-mz."): imagecode = imagelookup("s2ek9") workname = filename.replace(".bin", "") workname = workname.replace("m9500-sf2ek9-kickstart-mz.", "") utils_dev_imagecode_v2_vf(debug1, filename, prodname, imagecode, workname) elif filename.startswith("m9500-sf2ek9-mz."): imagecode = imagelookup("s2ek9") workname = filename.replace(".bin", "") workname = workname.replace("m9500-sf2ek9-mz.", "") utils_dev_imagecode_v2_vf(debug1, filename, prodname, imagecode, workname) elif filename.startswith("m9000-cd-npe-"): imagecode = imagelookup("fabman") workname = filename.replace(".zip", "") workname = workname.replace("m9000-cd-npe-", "") utils_dev_imagecode_v2_vf(debug1, filename, prodname, imagecode, workname) elif filename.startswith("m9000-cd-"): imagecode = imagelookup("fabman") workname = filename.replace(".zip", "") workname = workname.replace("m9000-cd-", "") utils_dev_imagecode_v2_vf(debug1, filename, prodname, imagecode, workname) elif filename.startswith("m9000-fm-update-"): imagecode = imagelookup("fabman") workname = filename.replace(".jar", "") workname = workname.replace("m9000-fm-update-", "") utils_dev_imagecode_v2_vf(debug1, filename, prodname, imagecode, workname) elif filename.startswith("m9000-fm-"): imagecode = imagelookup("fabman") workname = filename.replace(".jar", "") workname = workname.replace("m9000-fm-", "") utils_dev_imagecode_v2_vf(debug1, filename, prodname, imagecode, workname) elif filename.startswith("m9000-sha-"): imagecode = imagelookup("fabman") workname = filename.replace(".npe.jar", "") workname = workname.replace("m9000-sha-", "") utils_dev_imagecode_v2_vf(debug1, filename, prodname, imagecode, workname) elif splitbydash[0] == "m9100": prodname = product("m9100") workname = filename.replace(".bin", "") workname = workname.replace("m9100-", "") if workname.startswith("s1ek9-"): imagecode = imagelookup("s1ek9") workname = workname.replace("s1ek9-", "") elif workname.startswith("s2ek9-"): imagecode = imagelookup("s2ek9") workname = workname.replace("s2ek9-", "") elif workname.startswith("s3ek9-"): imagecode = imagelookup("s3ek9") workname = workname.replace("s3ek9-", "") elif workname.startswith("s5ek9-"): imagecode = imagelookup("s5ek9") workname = workname.replace("s5ek9-", "") else: messageunknowndev() workname = workname.replace("kickstart-mz.", "") workname = workname.replace("kickstart-mz-npe.", "") workname = workname.replace("mz.", "") workname = workname.replace("mz-npe.", "") utils_dev_imagecode_v2_vf(debug1, filename, prodname, imagecode, workname) elif splitbydash[0] == "m9200": prodname = product("m9200") workname = filename.replace(".bin", "") workname = workname.replace("m9200-", "") if workname.startswith("s1ek9-"): imagecode = imagelookup("s1ek9") workname = workname.replace("s1ek9-", "") elif workname.startswith("s2ek9-"): imagecode = imagelookup("s2ek9") workname = workname.replace("s2ek9-", "") elif workname.startswith("s3ek9-"): imagecode = imagelookup("s3ek9") workname = workname.replace("s3ek9-", "") elif workname.startswith("s5ek9-"): imagecode = imagelookup("s5ek9") workname = workname.replace("s5ek9-", "") else: messageunknowndev() workname = workname.replace("kickstart-mz.", "") workname = workname.replace("kickstart-mz-npe.", "") workname = workname.replace("mz.", "") workname = workname.replace("mz-npe.", "") utils_dev_imagecode_v2_vf(debug1, filename, prodname, imagecode, workname) elif splitbydash[0] == "m9250": prodname = product("m9250") workname = filename.replace(".bin", "") workname = workname.replace("m9250-", "") if workname.startswith("s5ek9-"): imagecode = imagelookup("s5ek9") workname = workname.replace("s5ek9-", "") else: messageunknowndev() workname = workname.replace("kickstart-mz.", "") workname = workname.replace("kickstart-mz-npe.", "") workname = workname.replace("mz.", "") workname = workname.replace("mz-npe.", "") utils_dev_imagecode_v2_vf(debug1, filename, prodname, imagecode, workname) elif splitbydash[0] == "m9700": prodname = product("m9700") workname = filename.replace(".bin", "") workname = workname.replace("m9700-", "") if workname.startswith("s3ek9-"): imagecode = imagelookup("s3ek9") workname = workname.replace("s3ek9-", "") elif workname.startswith("s4ek9-"): imagecode = imagelookup("s4ek9") workname = workname.replace("s4ek9-", "") else: messageunknowndev() workname = workname.replace("kickstart-mz.", "") workname = workname.replace("kickstart-mz-npe.", "") workname = workname.replace("mz.", "") workname = workname.replace("mz-npe.", "") utils_dev_imagecode_v2_vf(debug1, filename, prodname, imagecode, workname) else: messageunknownfile()
def iosxr_asr9k(debug1, filename): if debug1: print("\tSubroutine#\tiosxr_asr9k") prodname = product("asr9k") if (filename.startswith("ASR9K-iosxr-px") and filename.endswith("turboboot.tar") or filename.startswith("ASR9K-iosxr-px") and filename.endswith("Turboboot.tar")): imagecode = imagelookup("turboboot") iosxr_tab3_ver3(debug1, filename, prodname, imagecode) elif (filename.startswith("ASR9K-iosxr-px") and filename.endswith("bridge_smus.tar") or filename.startswith("ASR9k-iosxr-px") and filename.endswith("bridge_smus.tar")): imagecode = imagelookup("bridge_smus") iosxr_tab3_ver3(debug1, filename, prodname, imagecode) elif (filename.startswith("ASR9K-iosxr-") and filename.endswith("bridge_smus.tar")): imagecode = imagelookup("bridge_smus") iosxr_tab2_ver3(debug1, filename, prodname, imagecode) elif (filename.startswith("ASR9K-px-docs-") or filename.startswith("ASR9K-x64-docs")): imagecode = imagelookup("docs") iosxr_tab3_ver3(debug1, filename, prodname, imagecode) elif (filename.startswith("asr9k-") and filename.endswith("sp-1.0.0.tar") or filename.startswith("asr9k-") and filename.endswith("sp1.tar") or filename.startswith("asr9k-") and filename.endswith("sp2.tar") or filename.startswith("asr9k-") and filename.endswith("sp3.tar") or filename.startswith("asr9k-") and filename.endswith("sp4.tar") or filename.startswith("asr9k-") and filename.endswith("sp5.tar") or filename.startswith("asr9k-") and filename.endswith("sp6.tar") or filename.startswith("asr9k-") and filename.endswith("sp7.tar") or filename.startswith("asr9k-") and filename.endswith("sp8.tar") or filename.startswith("asr9k-") and filename.endswith("sp9.tar") or filename.startswith("asr9k-") and filename.endswith("sp10.tar") or filename.startswith("asr9k-") and filename.endswith("sp11.tar") or filename.startswith("asr9k-") and filename.endswith("sp12.tar")): iosxr_service_pack(debug1, filename, prodname) elif filename.startswith("asr9k-mini-x64-migrate_to_eXR.tar"): imagecode = imagelookup("migrate_to_eXR") iosxr_tab4_ver3(debug1, filename, prodname, imagecode) elif filename.startswith("asr9k-mini-x64-migrate_to_eXR"): imagecode = imagelookup("migrate_to_eXR") iosxr_dot1_ver3(debug1, filename, prodname, imagecode) elif filename.startswith("asr9k-full-x64-migrate_to_eXR.tar"): imagecode = imagelookup("migrate_to_eXR") iosxr_dot1_ver3(debug1, filename, prodname, imagecode) elif filename.startswith("asr9k-mini-x64-"): imagecode = imagelookup("mini-x64") iosxr_tab3_ver3(debug1, filename, prodname, imagecode) elif filename.startswith("asr9k-vsm-cgv6"): imagecode = imagelookup("cgv6") iosxr_tab3_ver3(debug1, filename, prodname, imagecode) elif filename.startswith("ASR9K-x64-iosxr-px-k9"): imagecode = imagelookup("core64k9") iosxr_tab5_ver3(debug1, filename, prodname, imagecode) elif filename.startswith("ASR9K-x64-iosxr-px"): imagecode = imagelookup("core64") iosxr_tab4_ver3(debug1, filename, prodname, imagecode) elif filename.startswith("ASR9K-iosxr-px-k9"): imagecode = imagelookup("corek9") iosxr_tab4_ver3(debug1, filename, prodname, imagecode) elif filename.startswith("ASR9K-iosxr-p-k9"): imagecode = imagelookup("corek9") iosxr_tab4_ver3(debug1, filename, prodname, imagecode) elif filename.startswith("ASR9K-iosxr-px-"): imagecode = imagelookup("core") iosxr_tab3_ver3(debug1, filename, prodname, imagecode) elif filename.startswith("ASR9K-iosxr-p-"): imagecode = imagelookup("core") iosxr_tab3_ver3(debug1, filename, prodname, imagecode) elif filename.startswith("ASR9000-iosxr-k9"): imagecode = imagelookup("corek9") iosxr_tab3_ver3(debug1, filename, prodname, imagecode) elif filename.startswith("ASR9K-iosxr-k9"): imagecode = imagelookup("corek9") iosxr_tab3_ver3(debug1, filename, prodname, imagecode) elif filename.startswith("asr9k-ncs500x-nV-px"): imagecode = imagelookup("nvsat") iosxr_tab4_ver3(debug1, filename, prodname, imagecode) elif filename.startswith("asr9k-9000v-nV-x64"): imagecode = imagelookup("nvsat") iosxr_nv_x64(debug1, filename, prodname, imagecode) elif filename.startswith("asr9k-x64-usb_boot"): imagecode = imagelookup("usb_boot") iosxr_tab3_ver3(debug1, filename, prodname, imagecode) elif filename.startswith("asr9k-goldenk9-x64-"): imagecode = imagelookup("goldenk9") iosxr_tab3_ver3(debug1, filename, prodname, imagecode)
def fileprocphone(debug1, filename): if filename.startswith("cmterm-3905"): prodname = product("ipp3905") workname = file_proc_strip(debug1, filename) workname = workname.replace("cmterm-3905.", "") file_proc_phone_noimage(debug1, filename, prodname, workname) elif filename.startswith("cmterm-7911_7906-sccp"): prodname = product("ipp7911_7906") imagecode = imagelookup("sccp") fileprocphone3digittype(debug1, filename, prodname, imagecode) elif filename.startswith("cmterm-7911_7906-sip"): prodname = product("ipp7911_7906") imagecode = imagelookup("sip") fileprocphone3digittype(debug1, filename, prodname, imagecode) elif filename.startswith("cmterm-7914-sccp"): prodname = product("ipp7914") imagecode = imagelookup("sccp") fileprocphone3digittype(debug1, filename, prodname, imagecode) elif filename.startswith("cmterm-7914-sip"): prodname = product("ipp7914") imagecode = imagelookup("sip") fileprocphone3digittype(debug1, filename, prodname, imagecode) elif filename.startswith("cmterm-7915"): prodname = product("ipp7915") fileprocphone3digit(debug1, filename, prodname) elif filename.startswith("cmterm-7916"): prodname = product("ipp7916") fileprocphone3digit(debug1, filename, prodname) elif filename.startswith("cmterm-7921-sccp"): prodname = product("ipp7921") imagecode = imagelookup("sccp") fileprocphone3digittype(debug1, filename, prodname, imagecode) elif filename.startswith("cmterm-7921-sip"): prodname = product("ipp7921") imagecode = imagelookup("sip") fileprocphone3digittype(debug1, filename, prodname, imagecode) elif filename.startswith("cmterm-7931-sccp"): prodname = product("ipp7931") imagecode = imagelookup("sccp") fileprocphone3digittype(debug1, filename, prodname, imagecode) elif filename.startswith("cmterm-7931-sip"): prodname = product("ipp7931") imagecode = imagelookup("sip") fileprocphone3digittype(debug1, filename, prodname, imagecode) elif filename.startswith("cmterm-7940_7960-sccp"): prodname = product("ipp7940_7960") imagecode = imagelookup("sccp") fileprocphone3digittype(debug1, filename, prodname, imagecode) elif filename.startswith("cmterm-7940_7960-sip"): prodname = product("ipp7940_7960") imagecode = imagelookup("sip") fileprocphone3digittype(debug1, filename, prodname, imagecode) elif filename.startswith("cmterm-7940-7960"): prodname = product("ipp7940_7960") fileprocphone3digittwo(debug1, filename, prodname) elif filename.startswith("cmterm-7941_7961-sccp"): prodname = product("ipp7941_7961") imagecode = imagelookup("sccp") fileprocphone3digittype(debug1, filename, prodname, imagecode) elif filename.startswith("cmterm-7941_7961-sip"): prodname = product("ipp7941_7961") imagecode = imagelookup("sip") fileprocphone3digittype(debug1, filename, prodname, imagecode) elif filename.startswith("cmterm-7942_7962-sccp"): prodname = product("ipp7942_7962") imagecode = imagelookup("sccp") fileprocphone3digittype(debug1, filename, prodname, imagecode) elif filename.startswith("cmterm-7942_7962-sip"): prodname = product("ipp7942_7962") imagecode = imagelookup("sip") fileprocphone3digittype(debug1, filename, prodname, imagecode) elif filename.startswith("cmterm-7970_7971-sccp"): prodname = product("ipp7970_7971") imagecode = imagelookup("sccp") workname = file_proc_strip(debug1, filename) workname = workname.replace("cmterm-7970_7971-sccp.", "") file_proc_phone_dash(debug1, filename, prodname, imagecode, workname) elif filename.startswith("cmterm-7970_7971-sip"): prodname = product("ipp7970_7971") imagecode = imagelookup("sip") workname = file_proc_strip(debug1, filename) workname = workname.replace("cmterm-7970_7971-sip.", "") file_proc_phone_dash(debug1, filename, prodname, imagecode, workname) elif filename.startswith("cmterm-7975-sccp"): prodname = product("ipp7975") imagecode = imagelookup("sccp") workname = file_proc_strip(debug1, filename) workname = workname.replace("cmterm-7975-sccp.", "") file_proc_phone_dash(debug1, filename, prodname, imagecode, workname) elif filename.startswith("cmterm-7975-sip"): prodname = product("ipp7975") imagecode = imagelookup("sip") workname = file_proc_strip(debug1, filename) workname = workname.replace("cmterm-7975-sip.", "") file_proc_phone_dash(debug1, filename, prodname, imagecode, workname) elif filename.startswith("cmterm-8845_65-sip"): prodname = product("ipp8845_65") imagecode = imagelookup("sip") workname = file_proc_strip(debug1, filename) workname = workname.replace("cmterm-8845_65-sip.", "") file_proc_phone_dash(debug1, filename, prodname, imagecode, workname) elif filename.startswith("cmterm-8845_65"): prodname = product("ipp8845_65") imagecode = imagelookup("sip") workname = file_proc_strip(debug1, filename) workname = workname.replace("cmterm-8845_65.", "") file_proc_phone_dash(debug1, filename, prodname, imagecode, workname) elif filename.startswith("cmterm-7937-sccp"): prodname = product("ipp7937") imagecode = imagelookup("sccp") workname = file_proc_strip(debug1, filename) workname = workname.replace("cmterm-7937-sccp.", "") file_proc_phone_dash(debug1, filename, prodname, imagecode, workname) elif filename.startswith("cmterm-7937-QED"): prodname = product("ipp7937") imagecode = imagelookup("qed") workname = file_proc_strip(debug1, filename) workname = workname.replace("cmterm-7937-QED-", "") workname = workname.replace("-SCCP", "") file_proc_phone_dash(debug1, filename, prodname, imagecode, workname) elif filename.startswith("cmterm-7937-"): prodname = product("ipp7937") imagecode = imagelookup("sccp") workname = file_proc_strip(debug1, filename) workname = workname.replace("cmterm-7937-", "") workname = workname.replace("-SCCP", "") workname = workname.replace("-sccp", "") file_proc_phone_dash(debug1, filename, prodname, imagecode, workname) elif filename.startswith("cmterm-7945_7965-sccp"): prodname = product("ipp7945_7965") imagecode = imagelookup("sccp") workname = file_proc_strip(debug1, filename) workname = workname.replace("cmterm-7945_7965-sccp.", "") file_proc_phone_dash(debug1, filename, prodname, imagecode, workname) elif filename.startswith("cmterm-7945_7965-sip"): prodname = product("ipp7945_7965") imagecode = imagelookup("sip") workname = file_proc_strip(debug1, filename) workname = workname.replace("cmterm-7945_7965-sip.", "") file_proc_phone_dash(debug1, filename, prodname, imagecode, workname) elif filename.startswith("cmterm-894x-sccp"): prodname = product("ipp894x") imagecode = imagelookup("sccp") workname = file_proc_strip(debug1, filename) workname = workname.replace("cmterm-894x-sccp.", "") file_proc_phone_dash(debug1, filename, prodname, imagecode, workname) elif filename.startswith("cmterm-8941_8945-sccp"): prodname = product("ipp894x") imagecode = imagelookup("sccp") workname = file_proc_strip(debug1, filename) workname = workname.replace("cmterm-8941_8945-sccp.", "") file_proc_phone_dash(debug1, filename, prodname, imagecode, workname) elif filename.startswith("cmterm-894x-sip"): prodname = product("ipp894x") imagecode = imagelookup("sip") workname = file_proc_strip(debug1, filename) workname = workname.replace("cmterm-894x-sip.", "") file_proc_phone_dash(debug1, filename, prodname, imagecode, workname) elif filename.startswith("cmterm-8941_8945-sip"): prodname = product("ipp894x") imagecode = imagelookup("sip") workname = file_proc_strip(debug1, filename) workname = workname.replace("cmterm-8941_8945-sip.", "") file_proc_phone_dash(debug1, filename, prodname, imagecode, workname) elif filename.startswith("cmterm-SIP8941_8945."): prodname = product("ipp894x") imagecode = imagelookup("sip") workname = file_proc_strip(debug1, filename) workname = workname.replace("cmterm-SIP8941_8945.", "") file_proc_phone_dash(debug1, filename, prodname, imagecode, workname) elif filename.startswith("cmterm-SIP894x"): prodname = product("ipp894x") imagecode = imagelookup("sip") workname = file_proc_strip(debug1, filename) workname = workname.replace("cmterm-SIP894x.", "") file_proc_phone_dash(debug1, filename, prodname, imagecode, workname) elif filename.startswith("cmterm-SCCP894x."): prodname = product("ipp894x") imagecode = imagelookup("sccp") workname = file_proc_strip(debug1, filename) workname = workname.replace("cmterm-SCCP894x.", "") file_proc_phone_dash(debug1, filename, prodname, imagecode, workname) elif filename.startswith("cmterm-SCCP8941_8945."): prodname = product("ipp894x") imagecode = imagelookup("sccp") workname = file_proc_strip(debug1, filename) workname = workname.replace("cmterm-SCCP8941_8945.", "") file_proc_phone_dash(debug1, filename, prodname, imagecode, workname) elif filename.startswith("cmterm-ata187-qed."): prodname = product("ata187") imagecode = imagelookup("qed") workname = file_proc_strip(debug1, filename) workname = workname.replace("cmterm-ata187-qed.", "") file_proc_phone_dash(debug1, filename, prodname, imagecode, workname) elif filename.startswith("cmterm-ata187."): prodname = product("ata187") workname = file_proc_strip(debug1, filename) workname = workname.replace("cmterm-ata187.", "") file_proc_phone_noimage(debug1, filename, prodname, workname) elif filename.startswith("cmterm-ata190-qed."): prodname = product("ata190") imagecode = imagelookup("qed") workname = file_proc_strip(debug1, filename) workname = workname.replace("cmterm-ata190-qed.", "") file_proc_phone_dash(debug1, filename, prodname, imagecode, workname) elif filename.startswith("cmterm-ata190."): prodname = product("ata187") imagecode = imagelookup("qed") workname = file_proc_strip(debug1, filename) workname = workname.replace("cmterm-ata190.", "") file_proc_phone_noimage(debug1, filename, prodname, workname) else: messageunknownfile()
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 fileprocessor_wireless(debug1, filename): if debug1: print("\tModule#\t\tios_wireless") if debug1: print("\tSubroutine#\tfileprocessor_wireless") if (filename.startswith("AIR_CTVM_LARGE-K9_") or filename.startswith("AIR_CTVM_LARGE_") or filename.startswith("MFG_CTVM_SMALL_") or filename.startswith("AIR_CTVM-K9_") or filename.startswith("MFG_CTVM_")): prodname = product("CTVM") wireless_controller_virtual(debug1, filename, prodname) elif (filename.startswith("AIR-AP1815-K9-ME-")): prodname = product("AP1815") workname = filename.replace(".tar", "") workname = workname.replace(".zip", "") workname = workname.replace(".aes", "") workname = workname.replace("AIR-AP1815-K9-ME-", "") wireless_all_dash(debug1, filename, prodname, workname) elif (filename.startswith("AIR-AP1830-K9-")): newname = filename.split(".") prodname = product("AP1830") workname = filename.replace(".tar", "") workname = workname.replace(".zip", "") workname = workname.replace(".aes", "") workname = workname.replace("AIR-AP1830-K9-", "") if len(newname) > 2: wireless_all_dash_dot(debug1, filename, prodname, workname) else: wireless_all_dash(debug1, filename, prodname, workname) elif (filename.startswith("AIR-AP1850-K9-")): newname = filename.split(".") prodname = product("AP1850") workname = filename.replace(".tar", "") workname = workname.replace(".zip", "") workname = workname.replace(".aes", "") workname = workname.replace("AIR-AP1850-K9-", "") if len(newname) > 2: wireless_all_dash_dot(debug1, filename, prodname, workname) else: wireless_all_dash(debug1, filename, prodname, workname) elif (filename.startswith("SWISMK9-")): prodname = product("SWISMK9") workname = filename.replace(".tar", "") workname = workname.replace(".zip", "") workname = workname.replace(".aes", "") workname = workname.replace("SWISMK9-", "") wireless_all_dash(debug1, filename, prodname, workname) elif (filename.startswith("SWLC3750K9-")): prodname = product("SWLC3750K9") workname = filename.replace(".tar", "") workname = workname.replace(".zip", "") workname = workname.replace(".aes", "") workname = workname.replace("SWLC3750K9-", "") wireless_all_dash(debug1, filename, prodname, workname) elif (filename.startswith("AIR-CT5500-K9-")): prodname = product("CT5500") workname = filename.replace(".aes", "") workname = workname.replace("AIR-CT5500-K9-", "") wireless_all_dash(debug1, filename, prodname, workname) elif (filename.startswith("AIR-CT5500-LDPE-K9-")): prodname = product("CT5500") workname = filename.replace(".aes", "") workname = workname.replace("AIR-CT5500-LDPE-K9-", "") wireless_all_dash(debug1, filename, prodname, workname) elif (filename.startswith("AIR-CTVM-")): prodname = product("CTVM") workname = filename.replace(".aes", "") workname = workname.replace(".ova", "") workname = workname.replace("AIR-CTVM-K9-", "") workname = workname.replace("AIR-CTVM-", "") wireless_all_dash(debug1, filename, prodname, workname) elif (filename.startswith("AIR-CT2500-K9-")): prodname = product("CT2500") workname = filename.replace(".aes", "") workname = workname.replace("AIR-CT2500-K9-", "") wireless_all_dash(debug1, filename, prodname, workname) elif (filename.startswith("AIR-WLC4400-K9-")): prodname = product("WLC4400") workname = filename.replace(".aes", "") workname = workname.replace("AIR-WLC4400-K9-", "") wireless_all_dash(debug1, filename, prodname, workname) elif (filename.startswith("AIR-WLC4100-K9-")): prodname = product("WLC4100") workname = filename.replace(".aes", "") workname = workname.replace("AIR-WLC4100-K9-", "") newname = filename.split(".") if len(newname) > 2: wireless_all_dash_dot(debug1, filename, prodname, workname) else: wireless_all_dash(debug1, filename, prodname, workname) elif (filename.startswith("AIR-WLC2100-K9-")): prodname = product("WLC2100") workname = filename.replace(".aes", "") workname = workname.replace("AIR-WLC2100-K9-", "") wireless_all_dash(debug1, filename, prodname, workname) elif (filename.startswith("AIR-WLC2006-K9-")): prodname = product("WLC2006") workname = filename.replace(".aes", "") workname = workname.replace("AIR-WLC2006-K9-", "") newname = filename.split(".") if len(newname) > 2: wireless_all_dash_dot(debug1, filename, prodname, workname) else: wireless_all_dash(debug1, filename, prodname, workname) elif (filename.startswith("AIR-CT5520-K9-")): prodname = product("CT5520") workname = filename.replace(".aes", "") workname = workname.replace("AIR-CT5520-K9-", "") wireless_all_dash(debug1, filename, prodname, workname) elif (filename.startswith("AIR-CT3504-K9-")): prodname = product("CT3504") workname = filename.replace(".aes", "") workname = workname.replace("AIR-CT3504-K9-", "") wireless_all_dash(debug1, filename, prodname, workname) elif (filename.startswith("AIR-CT7500-K9-")): prodname = product("CT7500") workname = filename.replace(".aes", "") workname = workname.replace("AIR-CT7500-K9-", "") wireless_all_dash(debug1, filename, prodname, workname) elif (filename.startswith("AIR-CT8500-K9-")): prodname = product("CT8500") workname = filename.replace(".aes", "") workname = workname.replace("AIR-CT8500-K9-", "") wireless_all_dash(debug1, filename, prodname, workname) elif (filename.startswith("AIR-WLCM-K9-")): prodname = product("WLCM") workname = filename.replace(".aes", "") workname = workname.replace("AIR-WLCM-K9-", "") wireless_all_dash(debug1, filename, prodname, workname) elif (filename.startswith("AIR-CT8540-K9-")): prodname = product("CT8540") workname = filename.replace(".aes", "") workname = workname.replace("AIR-CT8540-K9-", "") wireless_all_dash(debug1, filename, prodname, workname) elif (filename.startswith("AIR-WISM2-K9-")): prodname = product("WISM2") workname = filename.replace(".aes", "") workname = workname.replace("AIR-WISM2-K9-", "") wireless_all_dash(debug1, filename, prodname, workname) elif (filename.startswith("AIR-AP1840-K9-ME-")): prodname = product("AP1840") workname = filename.replace(".aes", "") workname = workname.replace(".zip", "") workname = workname.replace("AIR-AP1840-K9-ME-", "") wireless_all_dash(debug1, filename, prodname, workname) elif (filename.startswith("AIR-AP1540-K9-ME-")): prodname = product("AP1540") workname = filename.replace(".aes", "") workname = workname.replace(".zip", "") workname = workname.replace("AIR-AP1540-K9-ME-", "") wireless_all_dash(debug1, filename, prodname, workname) elif (filename.startswith("AIR-AP1560-K9-ME-")): prodname = product("AP1560") workname = filename.replace(".aes", "") workname = workname.replace(".zip", "") workname = workname.replace("AIR-AP1560-K9-ME-", "") wireless_all_dash(debug1, filename, prodname, workname) elif (filename.startswith("AIR-AP2800-K9-ME-")): prodname = product("AP2800") workname = filename.replace(".aes", "") workname = workname.replace(".zip", "") workname = workname.replace("AIR-AP2800-K9-ME-", "") wireless_all_dash(debug1, filename, prodname, workname) elif (filename.startswith("AIR-AP3800-K9-ME-")): prodname = product("AP3800") workname = filename.replace(".aes", "") workname = workname.replace(".zip", "") workname = workname.replace("AIR-AP3800-K9-ME-", "") wireless_all_dash(debug1, filename, prodname, workname) elif (filename.startswith("AIR-AP4800-K9-ME-")): prodname = product("AP4800") workname = filename.replace(".aes", "") workname = workname.replace(".zip", "") workname = workname.replace("AIR-AP4800-K9-ME-", "") wireless_all_dash(debug1, filename, prodname, workname) elif (filename.startswith("AIR-AP4800-K9-ME-")): prodname = product("AP4800") workname = filename.replace(".aes", "") workname = workname.replace(".zip", "") workname = workname.replace("AIR-AP4800-K9-ME-", "") wireless_all_dash(debug1, filename, prodname, workname) elif (filename.startswith("AIR-WLC-SRE-K9-")): prodname = product("SRE") workname = filename.replace(".aes", "") workname = workname.replace(".zip", "") workname = workname.replace("AIR-WLC-SRE-K9-", "") wireless_all_dash(debug1, filename, prodname, workname) elif (filename.startswith("AIR-6300-K9-ME-") or filename.startswith("AIR-AP6300-K9-ME-")): prodname = product("AP6300") workname = filename.replace(".aes", "") workname = workname.replace(".zip", "") workname = workname.replace(".tar", "") workname = workname.replace("AIR-6300-K9-ME-", "") workname = workname.replace("AIR-AP6300-K9-ME-", "") wireless_all_dash(debug1, filename, prodname, workname) elif (filename.startswith("AIR-LOC2700-L-K9-")): prodname = product("LOC2700") workname = filename.replace(".bin.gz", "") workname = workname.replace(".bin", "") workname = workname.replace("AIR-LOC2700-L-K9-", "") wireless_all_dash(debug1, filename, prodname, workname) elif (filename.startswith("AP_BUNDLE_3500_")): prodname = product("CT3504") workname = filename.replace(".aes", "") workname = workname.replace(".zip", "") workname = workname.replace("AP_BUNDLE_3500_", "") wireless_all_underscore(debug1, filename, prodname, workname) elif (filename.startswith("AIR-CT2500-AP_BUNDLE-K9-")): prodname = product("CT2500") workname = filename.replace(".aes", "") workname = workname.replace(".zip", "") workname = workname.replace("AIR-CT2500-AP_BUNDLE-K9-", "") wireless_all_dash(debug1, filename, prodname, workname) elif (filename.startswith("AIR-CT5500-LDPE-AP_BUNDLE-K9-")): prodname = product("CT5500") workname = filename.replace(".aes", "") workname = workname.replace(".zip", "") workname = workname.replace("AIR-CT5500-LDPE-AP_BUNDLE-K9-", "") wireless_all_dash(debug1, filename, prodname, workname) elif (filename.startswith("AIR-CT5500-AP_BUNDLE-K9-")): prodname = product("CT5500") workname = filename.replace(".aes", "") workname = workname.replace(".zip", "") workname = workname.replace("AIR-CT5500-AP_BUNDLE-K9-", "") wireless_all_dash(debug1, filename, prodname, workname) elif (filename.startswith("AIR-WISM2-AP_BUNDLE-K9-")): prodname = product("CT5500") workname = filename.replace(".aes", "") workname = workname.replace("AIR-WISM2-AP_BUNDLE-K9-", "") wireless_all_dash(debug1, filename, prodname, workname) elif (filename.startswith("WGB350") and filename.endswith("exe")): prodname = product("c350") imagecode = imagelookup("WKGBDG") utilssinglemove(debug1, filename, prodname, imagecode) elif (filename.startswith("BR350") and filename.endswith("exe")): prodname = product("c350") imagecode = imagelookup("WRLBDG") utilssinglemove(debug1, filename, prodname, imagecode) elif (filename == "AP350-Cisco-IOS-Upgrade-Image-v2.img"): prodname = product("c350") imagecode = imagelookup("vxworks") utilssinglemove(debug1, filename, prodname, imagecode) elif (filename == "AP1200-Cisco-IOS-Upgrade-Image-v3.img"): prodname = product("c1200") imagecode = imagelookup("vxworks") utilssinglemove(debug1, filename, prodname, imagecode) elif (filename == "webauth_bundle.zip" or filename == "webauth_bundle-1.0.2.zip"): prodname = product("wireless") imagecode = imagelookup("webauth") utilssinglemove(debug1, filename, prodname, imagecode) elif (filename.startswith("CiscoAironet-AP-to-LWAPP-Upgrade-Tool-")): prodname = product("wireless") imagecode = imagelookup("aptolwapp") utilssinglemove(debug1, filename, prodname, imagecode) elif (filename == "Aironet-AP-Cisco-IOS-Conversion-Tool-v2.1.exe"): prodname = product("wireless") imagecode = imagelookup("vxworkstoios") utilssinglemove(debug1, filename, prodname, imagecode) elif (filename.startswith("WCS-STANDARD-K9-")): prodname = product("wcs") workname = filename.replace(".bin", "") workname = workname.replace(".exe", "") workname = workname.replace("WCS-STANDARD-K9-", "") wireless_all_dash_dot(debug1, filename, prodname, workname)