{"action":"closed","issue":{"url":"https://api.github.com/repos/HewlettPackard/python-hpOneView/issues/177","repository_url":"https://api.github.com/repos/HewlettPackard/python-hpOneView","labels_url":"https://api.github.com/repos/HewlettPackard/python-hpOneView/issues/177/labels{/name}","comments_url":"https://api.github.com/repos/HewlettPackard/python-hpOneView/issues/177/comments","events_url":"https://api.github.com/repos/HewlettPackard/python-hpOneView/issues/177/events","html_url":"https://github.com/HewlettPackard/python-hpOneView/issues/177","id":172187321,"number":177,"title":"Program running twice when importing hpOneView","user":{"login":"andrefaranha","id":13080644,"avatar_url":"https://avatars.githubusercontent.com/u/13080644?v=3","gravatar_id":"","url":"https://api.github.com/users/andrefaranha","html_url":"https://github.com/andrefaranha","followers_url":"https://api.github.com/users/andrefaranha/followers","following_url":"https://api.github.com/users/andrefaranha/following{/other_user}","gists_url":"https://api.github.com/users/andrefaranha/gists{/gist_id}","starred_url":"https://api.github.com/users/andrefaranha/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andrefaranha/subscriptions","organizations_url":"https://api.github.com/users/andrefaranha/orgs","repos_url":"https://api.github.com/users/andrefaranha/repos","events_url":"https://api.github.com/users/andrefaranha/events{/privacy}","received_events_url":"https://api.github.com/users/andrefaranha/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":6,"created_at":"2016-08-19T18:04:34Z","updated_at":"2016-09-08T17:47:44Z","closed_at":"2016-09-08T17:47:44Z","body":"We are facing a weird problem when using python-hpOneView. All statements are running twice after adding the import.\r\n\r\nExample:\r\n\r\n**Before importing:**\r\n```\r\nprint 'hello'\r\n```\r\n\r\nOutput:\r\n```\r\n$ python test.py \r\nhello\r\n```\r\n\r\n**After importing:**\r\n```\r\nfrom hpOneView.oneview_client import OneViewClient\r\n\r\nprint 'hello'\r\n```\r\n\r\nExpected Output:\r\n```\r\n$ python test.py \r\nhello\r\n```\r\n\r\nActual Output:\r\n```\r\n$ python test.py \r\nhello\r\nhello\r\n```\r\n\r\nUPDATE:\r\n\r\nIt worked as expected after adding `if __name__ == '__main__'`:\r\n```\r\nfrom hpOneView.oneview_client import OneViewClient\r\n\r\nif __name__ == '__main__':\r\n    print 'hello'\r\n```\r\n\r\nOutput:\r\n```\r\n$ python test.py \r\nhello\r\n"}}
{"actor":{"display_login":"tiagomtotti"}}