Skip to content

Commit

Permalink
delete password/login auth :(
Browse files Browse the repository at this point in the history
Signed-off-by: matthias.gatto <[email protected]>
  • Loading branch information
outscale-mgo committed Sep 13, 2024
1 parent 1820b29 commit 88e58ac
Showing 1 changed file with 0 additions and 30 deletions.
30 changes: 0 additions & 30 deletions osc_tui/popup.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,37 +90,7 @@ def readAKSK(form_color='STANDOUT'):
values=regions_list,
value=0,
)

retriver = F.add_widget(
osc_npyscreen.ButtonPress,
name="Fill Using Loggin/Password",
)
def retriver_cb():
F = ConfirmCancelPopup(name="Login/password", color=form_color)
F.preserve_selected_widget = True
log = F.add(osc_npyscreen.TitleText, name="login")
passwd = F.add(osc_npyscreen.TitlePassword, name="password")
F.edit()
if F.value is True:
gw = Gateway(email=log.value, password=passwd.value,
region=REGION.values[REGION.value])
try:
ret = gw.ReadAccessKeys()
acessKeys=ret["AccessKeys"]
ak.value=acessKeys[len(acessKeys) - 1]["AccessKeyId"]
ret = gw.ReadSecretAccessKey(AccessKeyId=ak.value)
sk.value=ret["AccessKey"]["SecretKey"]
if name.value == '':
name.value=log.value

except requests.exceptions.HTTPError as e:
osc_npyscreen.notify_confirm(
"Error while submitting the request, authentification fail ?")
else:
return None

retriver.whenPressed = retriver_cb
#ak.width = ak.width - 1
F.edit()
if F.value is True:
if name.value != '' and ak.value != '' and sk.value != '':
Expand Down

0 comments on commit 88e58ac

Please sign in to comment.