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 wireless_controller_virtual(debug1, filename, prodname): if debug1: print("\tSubroutine#\twireless_controller_virtual") workname = filename.replace("AIR_CTVM_LARGE-K9_", "") workname = workname.replace("AIR_CTVM_LARGE_", "") workname = workname.replace("MFG_CTVM_SMALL_", "") workname = workname.replace("AIR_CTVM-K9_", "") workname = workname.replace("MFG_CTVM_LARGE_", "") workname = workname.replace("MFG_CTVM_", "") workname = workname.replace(".ova", "") workname = workname.replace(".iso", "") workname = workname.replace(".aes", "") splitbyuscore = workname.split("_") splitbydot = workname.split(".") if len(splitbyuscore) < len(splitbydot): vertwo = util2digit(splitbydot[0], splitbydot[1]) verfour = util4digit(splitbydot[0], splitbydot[1], splitbydot[2], splitbydot[3]) filepath = filepath3(prodname, vertwo, verfour) filemove(filepath, filename) elif len(splitbyuscore) > len(splitbydot): vertwo = util2digit(splitbyuscore[0], splitbyuscore[1]) verfour = util4digit(splitbyuscore[0], splitbyuscore[1], splitbyuscore[2], splitbyuscore[3]) filepath = filepath3(prodname, vertwo, verfour) filemove(filepath, filename)
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 wireless_all_dash(debug1, filename, prodname, workname): if debug1: print("\tSubroutine#\twireless_all_dash") splitbydash = workname.split("-") vertwo = util2digit(splitbydash[0], splitbydash[1]) verfour = util4digit(splitbydash[0], splitbydash[1], splitbydash[2], splitbydash[3]) filepath = filepath3(prodname, vertwo, verfour) filemove(filepath, filename)
def wireless_all_underscore(debug1, filename, prodname, workname): if debug1: print("\tSubroutine#\twireless_all_underscore") splitbyuscore = workname.split("_") vertwo = util2digit(splitbyuscore[0], splitbyuscore[1]) verfour = util4digit(splitbyuscore[0], splitbyuscore[1], splitbyuscore[2], splitbyuscore[3]) filepath = filepath3(prodname, vertwo, verfour) filemove(filepath, filename)
def fileprocphone3digit(debug1, filename, prodname): if debug1: print("\tSubroutine#\tfileprocphone3digit") if prodname == "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 = filepath3(prodname, ver2, ver3) 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 fileproc_iosxe_noimagecode(debug1, filename, prodname): if debug1: print("\tSubroutine#\tfileproc_iosxe_noimagecode") 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 = filepath3(prodname, iosmain, iosfull) 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 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()