Port changes in PR #162 to python2
Michael Teo
3 years ago
43 | 43 | passwd = passwd or '' |
44 | 44 | myname = MACHINE_NAME or self.generateClientMachineName() |
45 | 45 | |
46 | n = NetBIOS() | |
47 | names = n.queryIPForName(host) | |
48 | if names: | |
49 | server_name = names[0] | |
50 | else: | |
51 | raise urllib2.URLError('SMB error: Hostname does not reply back with its machine name') | |
46 | server_name,host = host.split(',') if ',' in host else [None,host] | |
47 | ||
48 | if server_name is None: | |
49 | n = NetBIOS() | |
50 | names = n.queryIPForName(host) | |
51 | if names: | |
52 | server_name = names[0] | |
53 | else: | |
54 | raise urllib2.URLError('SMB error: Hostname does not reply back with its machine name') | |
52 | 55 | |
53 | 56 | path, attrs = splitattr(req.get_selector()) |
54 | 57 | if path.startswith('/'): |