Skip to content

Commit f48fa35

Browse files
authored
Merge pull request #332 from dclong/dev
merge dev into main
2 parents 7144d32 + 251dde5 commit f48fa35

File tree

4 files changed

+11
-22
lines changed

4 files changed

+11
-22
lines changed

dsutil/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33
from . import git
44
from . import poetry
55

6-
__version__ = "0.70.0"
6+
__version__ = "0.71.0"

dsutil/hadoop/kerberos.py

Lines changed: 7 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -27,17 +27,6 @@
2727
PID = os.getpid()
2828

2929

30-
class ExceptionNoPassword(Exception):
31-
"""Exception due to no password specified.
32-
"""
33-
def __init__(self) -> None:
34-
super().__init__()
35-
self.value = "No password is specified."
36-
37-
def __str__(self):
38-
return repr(self.value)
39-
40-
4130
def save_passwd(passwd: str) -> None:
4231
"""Encrypt and save the password into a profile that is readable/writable only by the user.
4332
@@ -55,11 +44,13 @@ def read_passwd() -> str:
5544
5645
:return: Password in the profile file or empty string if the file does not exist.
5746
"""
58-
os.chmod(PROFILE, 0o600)
59-
if not os.path.isfile(PROFILE):
60-
return ""
61-
with open(PROFILE, "r", encoding="utf-8") as fin:
62-
return base64.b64decode(fin.read()).decode()
47+
if os.path.isfile(PROFILE):
48+
os.chmod(PROFILE, 0o600)
49+
with open(PROFILE, "r", encoding="utf-8") as fin:
50+
return base64.b64decode(fin.read()).decode()
51+
passwd = input("Please enter password for kinit: ")
52+
save_passwd(passwd)
53+
return passwd
6354

6455

6556
def _warn_passwd_expiration(process, email: Dict[str, str]):
@@ -183,8 +174,6 @@ def main() -> None:
183174
if args.password:
184175
save_passwd(args.password)
185176
password = read_passwd()
186-
if not password:
187-
raise ExceptionNoPassword()
188177
config = _read_config(args.config)
189178
if args.minute:
190179
while True:

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "dsutil"
3-
version = "0.70.0"
3+
version = "0.71.0"
44
description = "A utils Python package for data scientists."
55
authors = ["Benjamin Du <[email protected]>"]
66

readme.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ Currently, Python 3.7 and 3.8 are supported.
3838

3939
You can download a copy of the latest release and install it using pip.
4040
```bash
41-
pip3 install --user -U https://github.com/dclong/dsutil/releases/download/v0.70.0/dsutil-0.70.0-py3-none-any.whl
41+
pip3 install --user -U https://github.com/dclong/dsutil/releases/download/v0.71.0/dsutil-0.71.0-py3-none-any.whl
4242
```
4343
Or you can use the following command to install the latest master branch
4444
if you have pip 20.0+.
@@ -48,7 +48,7 @@ pip3 install --user -U git+https://github.com/dclong/dsutil@main
4848
Use one of the following commands if you want to install all components of dsutil.
4949
Available additional components are `cv`, `docker`, `pdf`, `jupyter`, `admin` and `all`.
5050
```bash
51-
pip3 install "dsutil[cv] @ https://github.com/dclong/dsutil/releases/download/v0.70.0/dsutil-0.70.0-py3-none-any.whl"
51+
pip3 install "dsutil[cv] @ https://github.com/dclong/dsutil/releases/download/v0.71.0/dsutil-0.71.0-py3-none-any.whl"
5252
# or
5353
pip3 install --user -U "dsutil[all] @ git+https://github.com/dclong/dsutil@main"
5454
```

0 commit comments

Comments
 (0)