def fileprocphone3digittwo(debug1, filename, prodname):
    if debug1:
        print("\tSubroutine#\tfileprocphone3digittwo")
    if prodname == "UNKNOWN":
        messageunknownfile()
    else:
        splitbydash = filename.split("-")
def fileprocphone3digittype(debug1, filename, prodname, imagecode):
    if debug1:
        print("\tSubroutine#\tfileprocphone3digittype")
    if prodname == "UNKNOWN" or imagecode == "UNKNOWN":
        messageunknownfile()
    else:
        splitbydot = filename.split(".")
        splitbydash = splitbydot[1].split("-")
        ver2 = util2digit(splitbydash[0], splitbydash[1])
        ver3 = util3digit(splitbydash[0], splitbydash[1], splitbydash[2])
        filepath = filepath4(prodname, ver2, ver3, imagecode)
        filemove(filepath, filename)
def 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 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)
Exemplo n.º 5
0
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()
Exemplo n.º 6
0
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 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 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()