Skip to content

Commit d00db0b

Browse files
Fix interpretated password
This workaround avoid using value parsed by Fire library. fixes #238 Signed-off-by: Jérôme Jutteau <jerome.jutteau@outscale.com>
1 parent 2eceb02 commit d00db0b

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

osc_sdk/sdk.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,9 @@
4646
CallParameters = Dict[str, Any]
4747
EncodedCallParameters = Optional[str]
4848
Headers = Tuple[str, str, Dict[str, str]]
49+
# This is a workaround avoiding Fire to parse password option as python
50+
# See #238
51+
PASSWORD_ARG = None
4952

5053
NO_AUTH_CALLS: Dict[str, Set[str]] = {
5154
"api": {
@@ -761,7 +764,7 @@ def api_connect(
761764
}
762765

763766
handler = calls[service](
764-
profile, login, password, authentication_method, **get_conf(profile)
767+
profile, login, PASSWORD_ARG, authentication_method, **get_conf(profile)
765768
)
766769
handler.make_request(call, **kwargs)
767770
if handler.response:
@@ -775,7 +778,10 @@ def main():
775778
if argc > 1:
776779
for i in range(1, argc):
777780
a = argv[i]
778-
if a == "--bash_completion":
781+
if a == "--password" and i + 1 < argc:
782+
global PASSWORD_ARG
783+
PASSWORD_ARG = argv[i + 1]
784+
elif a == "--bash_completion":
779785
f = open(BASH_COMPLETION_PATH, "r")
780786
print(f.read())
781787
sys.exit()

0 commit comments

Comments
 (0)