Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #! /usr/bin/env python
- # -*- coding: utf-8 -*-
- import spur
- import spur.ssh
- shell = spur.SshShell(hostname=self.host,
- username=self.login,
- password=self.password,
- missing_host_key=spur.ssh.MissingHostKey.accept,
- shell_type=spur.ssh.ShellTypes.minimal)
- with shell:
- result = shell.run(["ifconfig" ,"br-wan" ,"hw", "ether",NewMac])
- PROBLEM OCCURS ONLY WHEN NOT CLICKED BUT USING schtasks /run /TN "reconnect" OR WINDOWS TASK SCHEDULER
- Traceback (most recent call last):
- File "C:\Users\sph\Desktop\pyload\pyload\reconnect.py", line 6, in <module>
- plop.NextRandomIp(maxretry=3,maxtotalretry=3)
- File "C:\Users\sph\Documents\MMEDIA\lib\NextIp.py", line 167, in NextRandomIp
- result = shell.run(["ifconfig" ,"br-wan" ,"hw", "ether",NewMac])#+NewMac.decode("utf-8").encode("ascii","ignore")])
- File "C:\Python27\lib\site-packages\spur\ssh.py", line 162, in run
- return self.spawn(*args, **kwargs).wait_for_result()
- File "C:\Python27\lib\site-packages\spur\ssh.py", line 173, in spawn
- channel = self._get_ssh_transport().open_session()
- File "C:\Python27\lib\site-packages\spur\ssh.py", line 251, in _get_ssh_transport
- raise self._connection_error(error)
- File "C:\Python27\lib\site-packages\spur\ssh.py", line 288, in _connection_error
- "Original error: {0}".format(error)
- UnicodeDecodeError: 'ascii' codec can't decode byte 0xe9 in position 20: ordinal not in range(128)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement