dell / iDRAC-Redfish-Scripting

Python and PowerShell scripting for Dell EMC PowerEdge iDRAC REST API with DMTF Redfish
GNU General Public License v2.0
606 stars 279 forks source link

'import getpass' missing from GetPCIeDeviceInventoryREDFISH.py #242

Closed jrumacias closed 1 year ago

jrumacias commented 1 year ago

When running GetPCIeDeviceInventoryREDFISH.py and no password is provided as -p, it does not prompt for a password. If 'import getpass' is added to the file, it works.

texroemer commented 1 year ago

@jrumacias

Thanks for the catch, i've updated the script and confirmed it prompts now when -p argument is not passed in (example below).

C:\Python310>python GetPCIeDeviceInventoryREDFISH.py -ip 192.168.0.120 -u root --get-devices

- Argument -p not detected, pass in iDRAC user root password:

- Getting PCIeDevices details for iDRAC 192.168.0.120 -

- Detailed information for /redfish/v1/Chassis/System.Embedded.1/PCIeDevices/4-0 -

{'@odata.context': '/redfish/v1/$metadata#PCIeDevice.PCIeDevice',
 '@odata.etag': '"1677160926"',
 '@odata.id': '/redfish/v1/Chassis/System.Embedded.1/PCIeDevices/4-0',
 '@odata.type': '#PCIeDevice.v1_9_0.PCIeDevice',
 'AssetTag': None,
 'Description': 'PowerEdge Rx5xx LOM Board',
 'DeviceType': 'MultiFunction',
 'FirmwareVersion': '22.00.6',
 'Id': '4-0',
 'Links': {'Chassis': [{'@odata.id': '/redfish/v1/Chassis/System.Embedded.1'}],
           'Chassis@odata.count': 1,
           'Oem': {'Dell': {'@odata.type': '#DellOem.v1_3_0.DellOemLinks',
                            'CPUAffinity': [],
                            'CPUAffinity@odata.count': 0}},
           'PCIeFunctions': [{'@odata.id': '/redfish/v1/Chassis/System.Embedded.1/PCIeDevices/4-0/PCIeFunctions/4-0-1'},
                             {'@odata.id': '/redfish/v1/Chassis/System.Embedded.1/PCIeDevices/4-0/PCIeFunctions/4-0-0'}],
           'PCIeFunctions@Redfish.Deprecated': 'Please migrate to '
                                               'PCIeFunctions property in the '
                                               'root resource.',
           'PCIeFunctions@odata.count': 2},
 'Manufacturer': 'Broadcom Inc. and subsidiaries',
 'Model': None,
 'Name': 'PowerEdge Rx5xx LOM Board',
 'PCIeFunctions': {'@odata.id': '/redfish/v1/Chassis/System.Embedded.1/PCIeDevices/4-0/PCIeFunctions'},
 'PartNumber': None,
 'SKU': None,
 'SerialNumber': None,
 'Slot': {},
 'Status': {'Health': 'OK', 'HealthRollup': 'OK', 'State': 'Enabled'}}

Thanks Tex