Fix logic statement and pep8 issue
Datasource: fix to provide local-hostname if not available in datasource