Misc changes to the python script

Fixed multiple errors/issues

Signed-off-by: Venkateswararao Jujjuri (JV) <jvrao@linux.vnet.ibm.com>
Reviewed-by: Malahal Naineni <malahal@us.ibm.com>