DMTF / Redfishtool

A Python34 program that implements a command line tool for accessing the Redfish API.
Other
224 stars 68 forks source link

AssetTag is not a required field #76

Closed rdilip42 closed 4 years ago

rdilip42 commented 4 years ago

redfishtool systems is expecting "AssetTag" in Members list but it is not required filed actually. Due to this we are seeing script failures.

udock redfishtool -r -u -p --Secure=Always Systems list { "_Path": "/redfish/v1/Systems", "Name": "Computer System Collection", "Members@odata.count": 1, "Members": [] }

but in Systems.py we are seeing it is looking for AssetTag and etc.

def list(self,sc,op,rft, cmdTop=False, prop=None): rft.printVerbose(4,"{}:{}: in operation".format(rft.subcommand,sc.operation))

    # getCollection
    collName="Systems"
    rc,r,j,d=op.getCollection(sc,op, rft)
    if( rc != 0):  return(rc,r,False,None)
    #loop through the members and create the list sub-operation response
    rc,r,j,d=rft.listCollection(rft, r, d, prop="AssetTag")
    if(rc==0):
        rft.printVerbose(1," list {} Collection member info: Id, URI, AssetTag".format(collName,skip1=True, printV12=cmdTop))
    return(rc,r,j,d)

https://github.com/DMTF/Redfishtool/blob/master/redfishtool/Systems.py In redfish systems.py code they are looking for (“Id”, “URI” and “AssetTag”).

list -- list information about the Systems collection members("Id", URI, and AssetTag)