Exemplo n.º 1
0
ipaddr = get_args(argsinfo, 'ipaddr')
driver = get_optional(argsinfo, 'driver')
uname = get_optional(argsinfo, 'user.name')
upass = get_optional(argsinfo, 'user.password', '')
pref = get_optional(argsinfo, 'protocol', 'WSMAN')
nshare = get_optional(argsinfo, 'share')
nsharename = get_optional(argsinfo, 'share.user.name')
nsharepass = get_optional(argsinfo, 'share.user.password', '')
creds = UserCredentials(uname, upass)

@property
def not_implemented():
    print("===== not implemented ====")


myshare = LocalFile(local='C:\\Users\\vaideeswaran_ganesan\\Work\\omsdk', isFolder=True)
updshare = myshare.makedirs('DD')

UpdateManager.configure(updshare)
if updshare.IsValid:
    sd = sdkinfra()
    sd.importPath()
    idrac = sd.get_driver(sd.driver_enum.iDRAC, ipaddr, creds)
    UpdateHelper.save_firmware_inventory(idrac)
    idrac.disconnect()

    UpdateManager.update_catalog()
    print("Building repo....")
    UpdateHelper.build_repo_catalog('NIC')
Exemplo n.º 2
0
def RepoBuilder(arglist):
    parser = ArgumentParser(description='Local Repository Builder')
    parser.add_argument(
        '-C',
        '--catalog',
        action="store",
        dest="catalog",
        nargs='?',
        default='Catalog',
        type=str,
        help="Name of the Catalog file that contains the info about needed DUPs"
    )
    parser.add_argument('-f',
                        '--folder',
                        action="store",
                        dest="folder",
                        type=str,
                        help="folder from where repository is built")
    parser.add_argument('-c',
                        '--components',
                        action="store",
                        dest="component",
                        nargs='+',
                        help="components for which the DUPs are requested.")
    parser.add_argument('-s',
                        '--site',
                        action="store",
                        dest="site",
                        type=str,
                        nargs='?',
                        default='downloads.dell.com',
                        help="models for which the DUPs are requested.")
    parser.add_argument('-p',
                        '--protocol',
                        action="store",
                        dest="protocol",
                        nargs='?',
                        default='HTTP',
                        choices=['HTTP', 'FTP', 'NoOp', 'HashCheck'],
                        help="models for which the DUPs are requested.")
    parser.add_argument('-v',
                        '--verbose',
                        action="store_true",
                        help="verbose mode")
    parser.add_argument('-D',
                        '--download-dups',
                        action="store_true",
                        dest="dld_dups",
                        help="download DUPs")
    parser.add_argument('-l',
                        '--download-catalog',
                        action="store_true",
                        dest="dld_catalog",
                        help="download catalog")
    parser.add_argument('-b',
                        '--build-catalog',
                        action="store_true",
                        dest="build_catalog",
                        help="build catalog")
    parser.add_argument('-i',
                        '--download-index',
                        action="store_true",
                        dest="dld_index",
                        help="build index")

    options = parser.parse_args(arglist)
    if not options.component:
        options.component = []

    if options.folder is None:
        print("Folder must be provided")
        return -1

    if options.verbose is None:
        options.verbose = False

    if options.verbose:
        logging.basicConfig(level=logging.DEBUG)

    if not options.dld_dups and not options.build_catalog and \
       not options.dld_catalog:
        options.dld_catalog = True
        options.build_catalog = True
        options.dld_dups = True

    options.protocol = TypeHelper.convert_to_enum(options.protocol,
                                                  DownloadProtocolEnum)

    updshare = LocalFile(local=options.folder, isFolder=True)
    if not updshare.IsValid:
        print("Folder is not writable!")
        return -2

    if options.protocol != DownloadProtocolEnum.HashCheck:
        print("Configuring Update Share...")
    UpdateManager.configure(updshare,
                            site=options.site,
                            protocol=options.protocol)

    if options.dld_catalog:
        if options.protocol != DownloadProtocolEnum.HashCheck:
            print("Updating Catalog from downloads.dell.com...")
        UpdateManager.update_catalog()
    if options.build_catalog:
        if options.protocol != DownloadProtocolEnum.HashCheck:
            print("Building Repository Catalog ....")
            UpdateHelper.build_repo(options.catalog, True, *options.component)
    if options.dld_index:
        if options.protocol != DownloadProtocolEnum.HashCheck:
            print("Updating index from downloads.dell.com...")
        UpdateManager.update_index()

    if options.dld_dups:
        if options.protocol != DownloadProtocolEnum.HashCheck:
            print("Downloading DUPs ...")
        UpdateManager.update_cache(options.catalog)
Exemplo n.º 3
0
Passed = False
Failed = False

if True:
    dprint("Driver SDK", "1.03 Connect to " + ipaddr)
    idrac = sd.get_driver(sd.driver_enum.iDRAC, ipaddr, creds, protopref)
    if idrac is None:
        print("Error: Not found a device driver for: " + ipaddr)
        exit()
    else:
        print("Connected to " + ipaddr)
    idrac.config_mgr.set_liason_share(myshare)

if Passed:
    dprint("Driver SDK", "4.01.1 download catalog.xml.gz from ftp.dell.com")
    print(UpdateManager.update_catalog())
    dprint("Driver SDK", "4.01.2 build cache using idracs/models")
    print(UpdateManager.add_devices(idrac))
    dprint("Driver SDK", "4.01.3 Refresh the existing localstore")
    print(UpdateManager.update_cache())

if Passed:
    print(PrettyPrint.prettify_json(idrac.config_mgr.LCReady))
    print(PrettyPrint.prettify_json(idrac.config_mgr.LCStatus))
    print(PrettyPrint.prettify_json(idrac.config_mgr.ServerStatus))
    print(PrettyPrint.prettify_json(idrac.config_mgr.lc_status()))

if Passed:
    print(
        PrettyPrint.prettify_json(
            idrac.job_mgr.delete_job(jobid="JID_966529634181")))