Use range rather than xrange

Use range rather than xrange to improve python3
compatibiltiy.

Change-Id: I5a4434bbd2e5d509f84c3aa668eea8e46262816f
Signed-off-by: Chuck Short <chuck.short@canonical.com>