fix(fish): 改用 SourceError 处理 shell 查询失败
This commit is contained in:
+1
-2
@@ -37,8 +37,7 @@ class FishModule(Module):
|
|||||||
check=False,
|
check=False,
|
||||||
)
|
)
|
||||||
if result.returncode != 0:
|
if result.returncode != 0:
|
||||||
decman.error(f"无法读取用户 {self.user} 的 passwd 信息")
|
raise decman.SourceError(f"无法读取用户 {self.user} 的 passwd 信息")
|
||||||
return
|
|
||||||
# passwd 格式: name:x:uid:gid:gecos:home:shell
|
# passwd 格式: name:x:uid:gid:gecos:home:shell
|
||||||
shell = result.stdout.strip().split(":")[-1]
|
shell = result.stdout.strip().split(":")[-1]
|
||||||
if shell != "/usr/bin/fish":
|
if shell != "/usr/bin/fish":
|
||||||
|
|||||||
Reference in New Issue
Block a user