Fix for "os.getlogin()) OSError: [Errno 2] No such file or directory"
See
# limitations under the License.
import os
+import pwd
import json
import logging
import time
@@ -36,6 +37,9 @@ __all__ = [
'BaseCLIApp'
]
+# Fix for "os.getlogin()) OSError: [Errno 2] No such file or directory"
+os.getlogin = lambda: pwd.getpwuid(os.getuid())[0]
+
# How many seconds before the token actual expiration date we should consider the token as
# expired. This is used to prevent the operation from failing durig the API request because the
# token was just about to expire.
