From e7bc4f732812e2e5a7c291b63a71e16df18b2338 Mon Sep 17 00:00:00 2001 From: "Joshua M. Boniface" Date: Sun, 5 Jan 2020 22:46:56 -0500 Subject: [PATCH] Handle empty None-type hostname --- node-daemon/pvcd/dnsmasq-zookeeper-leases.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/node-daemon/pvcd/dnsmasq-zookeeper-leases.py b/node-daemon/pvcd/dnsmasq-zookeeper-leases.py index aa122aef..d147f770 100755 --- a/node-daemon/pvcd/dnsmasq-zookeeper-leases.py +++ b/node-daemon/pvcd/dnsmasq-zookeeper-leases.py @@ -108,6 +108,8 @@ def read_lease_database(zk_conn, zk_leases_key): print('\n'.join(output_list)) def add_lease(zk_conn, zk_leases_key, expiry, macaddr, ipaddr, hostname, clientid): + if not hostname: + hostname = '' transaction = zk_conn.transaction() transaction.create('{}/{}'.format(zk_leases_key, macaddr), ''.encode('ascii')) transaction.create('{}/{}/expiry'.format(zk_leases_key, macaddr), expiry.encode('ascii'))