Commit 1891008e by Your Name

fix mount_smb()

parent 5ab1348f
...@@ -145,9 +145,15 @@ def mount_smb(url): ...@@ -145,9 +145,15 @@ def mount_smb(url):
data = urlsplit(url) data = urlsplit(url)
share = data.path.lstrip('/') share = data.path.lstrip('/')
subprocess.call(('net', 'use', 'Z:', '/delete')) subprocess.call(('net', 'use', 'Z:', '/delete'))
subprocess.check_output(( try:
p = subprocess.Popen((
'net', 'use', 'Z:', r'\\%s\%s' % (data.hostname, share), 'net', 'use', 'Z:', r'\\%s\%s' % (data.hostname, share),
data.password, '/user:%s' % data.username, '/PERSISTENT:YES')) data.password, '/user:%s' % data.username, '/PERSISTENT:YES'),
stderr=subprocess.PIPE, stdout=subprocess.PIPE,
stdin=subprocess.PIPE)
logger.info('mount_smb(): %s', p.communicate())
except:
logger.exception('Unhandled exception: ')
def file_already_exists(name, mode=0o644): def file_already_exists(name, mode=0o644):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment