Exemple #1
0
def file_proc_servers_hyperflex(debug1, filename, prodname):
    if debug1:
        print("\tSubroutine#\tfile_proc_servers_hyperflex")
    if filename.startswith("storfs-packages"):
        workname = filename.replace("storfs-packages-", "")
        workname = workname.replace(".tgz", "")
        splitbydot = workname.split(".")
        vertwo = util2digit(splitbydot[0], splitbydot[1])
        verthree = util3digit(splitbydot[0], splitbydot[1], splitbydot[2])
        imagecode = imagelookup("upgrade")
        filepath = filepath4(prodname, imagecode, vertwo, verthree)
        filemove(filepath, filename)
    elif filename.startswith("HX-ESXi"):
        workname = filename.replace("HX-ESXi-", "")
        splitbydash = workname.split("-")
        imagecode = imagelookup("vmware")
        filepath = filepath3(prodname, imagecode, splitbydash[0])
        filemove(filepath, filename)
    elif filename.startswith("HX-Kubernetes"):
        workname = filename.replace("HX-Kubernetes-", "")
        splitbydot = workname.split(".")
        vertwo = util2digit(splitbydot[0], splitbydot[1])
        verthree = util3digit(splitbydot[0], splitbydot[1], splitbydot[2])
        imagecode = imagelookup("kubernetes")
        filepath = filepath4(prodname, imagecode, vertwo, verthree)
        filemove(filepath, filename)
    elif (filename.startswith("Cisco-HX-Data-Platform-Installer")
          or filename.startswith("cisco-HX-Data-Platform-Installer")):
        workname = filename.replace("Cisco-HX-Data-Platform-Installer-v", "")
        workname = workname.replace("cisco-HX-Data-Platform-Installer-v", "")
        workname = workname.replace("p1-esx.ova", "")
        workname = workname.replace("-esx.ova", "")
        workname = workname.replace("-hyperv.vhdx.zip", "")
        splitbydot = workname.split(".")
        vertwo = util2digit(splitbydot[0], splitbydot[1])
        verthree = util3digit(splitbydot[0], splitbydot[1], splitbydot[2])
        imagecode = imagelookup("install")
        filepath = filepath4(prodname, imagecode, vertwo, verthree)
        filemove(filepath, filename)
    elif filename.startswith("HyperFlex-VC-HTML"):
        imagecode = imagelookup("vchtmlplug")
        filepath = filepath2(prodname, imagecode)
        filemove(filepath, filename)
    elif filename.startswith("hxcsi"):
        imagecode = imagelookup("kubernetes")
        filepath = filepath2(prodname, imagecode)
        filemove(filepath, filename)
    elif filename.startswith("HyperFlex-Witness-"):
        imagecode = imagelookup("witness")
        filepath = filepath2(prodname, imagecode)
        filemove(filepath, filename)
    elif filename.startswith("HxClone-HyperV"):
        workname = filename.replace("HxClone-HyperV-v", "")
        workname = workname.replace(".ps1", "")
        splitbydot = workname.split(".")
        vertwo = util2digit(splitbydot[0], splitbydot[1])
        verthree = util3digit(splitbydot[0], splitbydot[1], splitbydot[2])
        imagecode = imagelookup("install")
        filepath = filepath4(prodname, imagecode, vertwo, verthree)
        filemove(filepath, filename)
def fileproc_iosxe_3(debug1, filename, prodname, imagecode):
    if debug1:
        print("\tSubroutine#\tfileproc_iosxe_3")
    splitbydot = filename.split(".")
    if splitbydot[4].startswith("CSC") and splitbydot[6] == "smu":
        iosfull = util3digit(splitbydot[1], splitbydot[2], splitbydot[3])
        filepath = filepath4(prodname, "SMU", iosfull, splitbydot[4])
        filemove(filepath, filename)
    else:
        iosmain = util2digit(splitbydot[2], splitbydot[3])
        iosfull = util3digit(splitbydot[2], splitbydot[3], splitbydot[4])
        filepath = filepath4(prodname, iosmain, iosfull, imagecode)
        filemove(filepath, filename)
def fileprocnxosthreedigit(filename, prodname, imagecode, debug1):
    if debug1:
        print("\tSubroutine#\tfileprocnxosthreedigit")
    splitbydot = filename.split(".")
    nxosver = util2digit(splitbydot[1], splitbydot[2])
    nxosfull = util3digit(splitbydot[1], splitbydot[2], splitbydot[3])
    if imagecode == "FIRMWARE-EPLD":
        filepath = filepath4(prodname, imagecode, nxosver, nxosfull)
    elif imagecode == "SMU":
        filepath = filepath5(prodname, imagecode, nxosver, nxosfull,
                             splitbydot[4])
    else:
        filepath = filepath4(prodname, nxosver, nxosfull, imagecode)
    filemove(filepath, filename)
Exemple #4
0
def file_proc_servers_p2_d3(debug1, filename, prodname, imagecode):
    if debug1:
        print("\tSubroutine#\tfile_proc_servers_p2_d3")
    splitbydot = filename.split(".")
    ver2 = util2digit(splitbydot[1], splitbydot[2])
    ver3 = util3digit(splitbydot[1], splitbydot[2], splitbydot[3])
    filepath = filepath4(prodname, imagecode, ver2, ver3)
    filemove(filepath, filename)
Exemple #5
0
def iosxr_dot1_ver3(debug1, filename, prodname, imagecode):
    if debug1:
        print("\tSubroutine#\tiosxr_dot1_ver3")
    splitbydot = filename.split(".")
    ver2 = util2digit(splitbydot[1], splitbydot[2])
    ver3 = util3digit(splitbydot[1], splitbydot[2], splitbydot[3])
    filepath = filepath4(prodname, ver2, ver3, imagecode)
    filemove(filepath, filename)
def fileproc_iosxe(debug1, filename, prodname, imagecode):
    if debug1:
        print("\tSubroutine#\tfileproc_iosxe")
    splitbydot = filename.split(".")
    splitbydot[3] = splitbydot[3].replace("-serial", "")
    splitbydot[3] = splitbydot[3].replace("-nfvis", "")
    splitbydot[3] = splitbydot[3].replace("-esxi", "")
    splitbydot[3] = splitbydot[3].replace("-kvm", "")
    #Checks to make sure that it is a regular firmware image, not a SMU
    if splitbydot[4].startswith("CSC") and splitbydot[6] == "smu":
        iosfull = util3digit(splitbydot[1], splitbydot[2], splitbydot[3])
        filepath = filepath4(prodname, "SMU", iosfull, splitbydot[4])
        filemove(filepath, filename)
    else:
        iosmain = util2digit(splitbydot[1], splitbydot[2])
        iosfull = util3digit(splitbydot[1], splitbydot[2], splitbydot[3])
        filepath = filepath4(prodname, iosmain, iosfull, imagecode)
        filemove(filepath, filename)
Exemple #7
0
def iosxr_nv_x64(debug1, filename, prodname, imagecode):
    if debug1:
        print("\tSubroutine#\tiosxr_nv_x64")
    splitbydash = filename.split("-")
    splitbydot = list(splitbydash[5])
    ver2 = util2digit(splitbydot[1], splitbydot[2])
    ver3 = util3digit(splitbydot[1], splitbydot[2], splitbydot[3])
    filepath = filepath4(prodname, ver2, ver3, imagecode)
    filemove(filepath, filename)
def 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)
Exemple #9
0
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)
Exemple #10
0
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)
Exemple #12
0
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)