cloudmesh / cloudmesh-pi-burn

Burns many SD cards so we can build a Raspberry PI cluster
Other
18 stars 12 forks source link

enabling git bash compatibility #26

Closed jpfleischer closed 2 years ago

jpfleischer commented 2 years ago

when there is no wifi password provided, then burn hangs (when run on windows 10 git bash). tested with cms burn raspberry "red,red0[1-4]" --password=cludmesh4me --disk=1 --new

this is because git bash does not support getpass proof: https://stackoverflow.com/a/58277159

thus we implement a fix:

if not wifipasswd and not ssid == "":
                        if os_is_windows():
                            os.system("stty -echo")
                            wifipasswd = input(f"Using --SSID={ssid}, please "
                                             f"enter wifi password:")
                            os.system("stty echo")
                            print("")
                        else:
                            wifipasswd = getpass(f"Using --SSID={ssid}, please "
                                                f"enter wifi password:")

this still accomplishes purpose of hiding password, which is the very same purpose that getpass() is for.

we also check to see if arguments.tag is NoneType. if it is not provided (then it is NoneType) then tag is set as latest. i have made the proper changes in this pull request.

laszewsk commented 2 years ago

finally back on real computer. goot explenation. Interesting that get pass is not supporeted.

On Apr 28, 2022, at 3:25 AM, J.P. @.***> wrote:

when there is no wifi password provided, then burn hangs (when run on windows 10 git bash). tested with cms burn raspberry "red,red0[1-4]" --password=cludmesh4me --disk=1 --new

this is because git bash does not support getpass proof: https://stackoverflow.com/a/58277159 https://stackoverflow.com/a/58277159 thus we implement a fix:

if not wifipasswd and not ssid == "": if os_is_windows(): os.system("stty -echo") wifipasswd = input(f"Using --SSID={ssid}, please " f"enter wifi password:") os.system("stty echo") print("") else: wifipasswd = getpass(f"Using --SSID={ssid}, please " f"enter wifi password:") this still accomplishes purpose of hiding password, which is the very same purpose that getpass() is for.

we also check to see if arguments.tag is NoneType. if it is not provided (then it is NoneType) then tag is set as latest. i have made the proper changes in this pull request.

You can view, comment on, or merge this pull request online at:

https://github.com/cloudmesh/cloudmesh-pi-burn/pull/26 https://github.com/cloudmesh/cloudmesh-pi-burn/pull/26 Commit Summary

b2c9507 https://github.com/cloudmesh/cloudmesh-pi-burn/pull/26/commits/b2c950701a9206474bb108c026a1fa4eb0c41471 Update burn.py 4061c84 https://github.com/cloudmesh/cloudmesh-pi-burn/pull/26/commits/4061c84838aa24203833e1f2fc57f6c6090b9469 Update burn.py bf3e257 https://github.com/cloudmesh/cloudmesh-pi-burn/pull/26/commits/bf3e2577e9d9740dcfa7c9d60fc5d0bfd6083637 Update burn.py File Changes (1 file https://github.com/cloudmesh/cloudmesh-pi-burn/pull/26/files) M cloudmesh/burn/command/burn.py https://github.com/cloudmesh/cloudmesh-pi-burn/pull/26/files#diff-9c2a96b66f2da55d7c95482db96d1cccd9d00dc5f4e627a4bdcbec4340f2760f (26) Patch Links:

https://github.com/cloudmesh/cloudmesh-pi-burn/pull/26.patch https://github.com/cloudmesh/cloudmesh-pi-burn/pull/26.patch https://github.com/cloudmesh/cloudmesh-pi-burn/pull/26.diff https://github.com/cloudmesh/cloudmesh-pi-burn/pull/26.diff — Reply to this email directly, view it on GitHub https://github.com/cloudmesh/cloudmesh-pi-burn/pull/26, or unsubscribe https://github.com/notifications/unsubscribe-auth/AADHYVLZ4I6PEAAN7FRNKUTVHI4ORANCNFSM5URNZPOQ. You are receiving this because you are subscribed to this thread.