【发布时间】:2021-12-26 23:46:53
【问题描述】:
我正在开发一种工具来自动生成一些文档并将它们存储在文件共享中。我有一个具有所需访问权限的服务帐户,我正在尝试了解如何最好地指定我想在访问文件共享时使用该帐户。
这是我尝试访问我的测试文件的相关测试代码:
database_path = "\\\\testserver\\testfile.txt"
try:
with open(database_path, "r") as testfile:
lines = testfile.readlines()
print(lines)
testfile.close()
except FileNotFoundError:
print("Couldn't access the test file.")
我通过 gitlab 通过 linux 运行程序运行此程序,因此捎带现有的域用户帐户并不是一个理想的解决方案。
有什么想法吗?
【问题讨论】:
标签: python active-directory gitlab gitlab-ci