我正在尝试使用以下脚本进行 smb 挂载,但面临“TypeError”问题,有人可以帮我解决这个问题。我要执行的实际命令是 mount -t cifs //111.11.111.111/SMBShare /mnt -o username=admin,password=admin,vers=3.0
蟒蛇代码:
#!/usr/bin/env python
def setup_env(self, get_xyz_share):
share = get_xyz_share.name
dx_ip = co.data_sols[0].address
co.clients[0].execute(['mount' ,'-t' ,'cifs' ,'//%s','/','%s' ,'/mnt', '-o' ,'username=admin,password=admin,vers=3.0' %(dx_ip, share)])
脚本输出如下所示:---
co.clients[0].execute(['mount' ,'-t' ,'cifs' ,'//%s','/','%s' ,'/mnt', '-o' ,'username=admin,password=admin,vers=3.0' %(dx_ip, share)]) TypeError: not all arguments converted during string formatting dx_ip = '111.11.111.111' get_xyz_share = <cx.models.Share.Shareobject at 0x4d53248 | name SMBShare>) self = TestMySMB share = 'SMBShare'