Closed oortega closed 4 years ago
from routeros_api import api_structure
structure = collections.defaultdict(api_structure.StringField)
structure['dynamic'] = api_structure.BooleanField
ip_lease = dhcp_lease.get(address="192.168.3.219", structure=structure)
...
Hello,
I tried to set True value for existing record but I got this Error: AttributeError: 'bool' object has no attribute 'encode"
I do this:
This ouput of ip_lease
[{u'status': u'bound', u'client-id': u'1:8:d4:2b:1f:cf:4c', u'active-server': u'dhcp1', u'dhcp-option': u'', u'dynamic': u'false', u'active-mac-address': u'08:D4:2B:1F:CF:4C', u'server': u'dhcp1', u'disabled': u'false', u'address-lists': u'', u'host-name': u'android-9b69027d023f094f', u'active-client-id': u'1:8:d4:2b:1f:cf:4c', u'mac-address': u'08:D4:2B:1F:CF:4C', u'address': u'192.168.3.219', u'radius': u'false', u'active-address': u'192.168.3.219', u'last-seen': u'1m31s', u'expires-after': u'8m29s', u'id': u'*FF', u'blocked': u'false'}]
For the moment I delete old record and then add new record, is the best way?
Example:
Any idea about? "Error: AttributeError: 'bool' object has no attribute 'encode"
Many thanks for your project.