Jamie- / openvpn-api

A Python API for the OpenVPN management interface.
MIT License
60 stars 18 forks source link

help #31

Open PoleStarQ opened 1 year ago

PoleStarQ commented 1 year ago

If you want to use the openvpn api interface to test the performance of the device sslvpn, can this import package do this?

pwnmeow commented 1 year ago

status = v.get_status() Traceback (most recent call last): File "/usr/local/lib/python3.10/dist-packages/openvpn_status/descriptors.py", line 31, in set value = self.input_type(value) File "/usr/local/lib/python3.10/dist-packages/openvpn_status/utils.py", line 24, in parse_time return datetime.datetime.strptime(time, DATETIME_FORMAT_OPENVPN) File "/usr/lib/python3.10/_strptime.py", line 568, in _strptime_datetime tt, fraction, gmtoff_fraction = _strptime(data_string, format) File "/usr/lib/python3.10/_strptime.py", line 349, in _strptime raise ValueError("time data %r does not match format %r" % ValueError: time data '2023-04-29 23:17:10' does not match format '%a %b %d %H:%M:%S %Y'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/usr/local/lib/python3.10/dist-packages/openvpn_status/parser.py", line 84, in parse return self._parse() File "/usr/local/lib/python3.10/dist-packages/openvpn_status/parser.py", line 95, in _parse status.updated_at = self.expect_tuple(Status.updated_at.label) File "/usr/local/lib/python3.10/dist-packages/openvpn_status/descriptors.py", line 33, in set raise AssignmentValueError(e) openvpn_status.descriptors.AssignmentValueError: time data '2023-04-29 23:17:10' does not match format '%a %b %d %H:%M:%S %Y'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "", line 1, in File "/usr/local/lib/python3.10/dist-packages/openvpn_api/vpn.py", line 241, in get_status return openvpn_status.parse_status(raw) File "/usr/local/lib/python3.10/dist-packages/openvpn_status/shortcuts.py", line 18, in parse_status return parser.parse() File "/usr/local/lib/python3.10/dist-packages/openvpn_status/parser.py", line 89, in parse raise ParsingError('expected valid format: %s' % msg) openvpn_status.parser.ParsingError: expected valid format: time data '2023-04-29 23:17:10' does not match format '%a %b %d %H:%M:%S %Y'