cloud-init: adjust for python2/3 compatibility