dell / iDRAC-Redfish-Scripting

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

packaging of the scripts #245

Closed parmentelat closed 1 year ago

parmentelat commented 1 year ago

it would be helpful if all the Python scripts in the Redfish Python folder were installed in the PATH after a

pip install IdracRedfishSupport
texroemer commented 1 year ago

Hi @parmentelat

I've uploaded my changes, can you run "pip install IdracRedfishSupport" and confirm all standalone scripts get installed.

Thanks Tex

parmentelat commented 1 year ago

Hey @texroemer

I just tried that; the script do get installed - I can find them in my path - however :

$ GetSetPowerStateREDFISH.py --help
/usr/local/bin/GetSetPowerStateREDFISH.py: line 1: $'\r': command not found
/usr/local/bin/GetSetPowerStateREDFISH.py: line 16: $'\r': command not found
/usr/local/bin/GetSetPowerStateREDFISH.py: line 17: import: command not found
/usr/local/bin/GetSetPowerStateREDFISH.py: line 18: import: command not found
/usr/local/bin/GetSetPowerStateREDFISH.py: line 19: import: command not found
/usr/local/bin/GetSetPowerStateREDFISH.py: line 20: import: command not found
/usr/local/bin/GetSetPowerStateREDFISH.py: line 21: import: command not found
/usr/local/bin/GetSetPowerStateREDFISH.py: line 22: import: command not found
/usr/local/bin/GetSetPowerStateREDFISH.py: line 23: import: command not found
/usr/local/bin/GetSetPowerStateREDFISH.py: line 24: $'\r': command not found
/usr/local/bin/GetSetPowerStateREDFISH.py: line 25: syntax error near unexpected token `"ignore"'
'usr/local/bin/GetSetPowerStateREDFISH.py: line 25: `warnings.filterwarnings("ignore")

here's the beginning of the installed file, somehow the shebang seems to have gone, so the script is interpreted by my bash, hence the failures:

$ head -5 $(type -p GetSetPowerStateREDFISH.py)

# GetSetPowerStateREDFISH. Python script using Redfish API to change current server power state.
#
# _author_ = Texas Roemer <Texas_Roemer@Dell.com>
# _version_ = 8.0

let me know if I can be of more help with that

thanks for taking care of this :)

texroemer commented 1 year ago

Hi @parmentelat

I added the shebang to the standalone scripts, please try again and confirm it's working now for you.

Thanks Tex

parmentelat commented 1 year ago

indeed it all works fine now, closing this issue

thank you !