{"action":"created","issue":{"url":"https://api.github.com/repos/CCI-MOC/hil/issues/625","repository_url":"https://api.github.com/repos/CCI-MOC/hil","labels_url":"https://api.github.com/repos/CCI-MOC/hil/issues/625/labels{/name}","comments_url":"https://api.github.com/repos/CCI-MOC/hil/issues/625/comments","events_url":"https://api.github.com/repos/CCI-MOC/hil/issues/625/events","html_url":"https://github.com/CCI-MOC/hil/pull/625","id":164968339,"number":625,"title":"Check port","user":{"login":"shwsun","id":15823053,"avatar_url":"https://avatars.githubusercontent.com/u/15823053?v=3","gravatar_id":"","url":"https://api.github.com/users/shwsun","html_url":"https://github.com/shwsun","followers_url":"https://api.github.com/users/shwsun/followers","following_url":"https://api.github.com/users/shwsun/following{/other_user}","gists_url":"https://api.github.com/users/shwsun/gists{/gist_id}","starred_url":"https://api.github.com/users/shwsun/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shwsun/subscriptions","organizations_url":"https://api.github.com/users/shwsun/orgs","repos_url":"https://api.github.com/users/shwsun/repos","events_url":"https://api.github.com/users/shwsun/events{/privacy}","received_events_url":"https://api.github.com/users/shwsun/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/CCI-MOC/hil/labels/Waiting%20on%20submitter","name":"Waiting on submitter","color":"207de5"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":15,"created_at":"2016-07-12T00:21:21Z","updated_at":"2016-08-04T21:28:49Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/CCI-MOC/hil/pulls/625","html_url":"https://github.com/CCI-MOC/hil/pull/625","diff_url":"https://github.com/CCI-MOC/hil/pull/625.diff","patch_url":"https://github.com/CCI-MOC/hil/pull/625.patch"},"body":"This PR solves #474 . Basically it does a check port action before every ``node_connect_network``. This behavior is useful cause  when using HIL in real life it is hard to debug whether a port is already attached to the node's nic.\r\n\r\nIt also did ``tests/unit/api/`` adjustments since check port is not taken into consideration before.\r\n\r\n- [x] The commits are consistent with our contribution guidelines\r\n- [x] You've added tests (if possible) to cover your change(s)\r\n- [x] All tests are passing (tests/unit, pep8)\r\n- [ ] You've updated the documentation (if adding/changing api calls)"},"comment":{"url":"https://api.github.com/repos/CCI-MOC/hil/issues/comments/237689213","html_url":"https://github.com/CCI-MOC/hil/pull/625#issuecomment-237689213","issue_url":"https://api.github.com/repos/CCI-MOC/hil/issues/625","id":237689213,"user":{"login":"shwsun","id":15823053,"avatar_url":"https://avatars.githubusercontent.com/u/15823053?v=3","gravatar_id":"","url":"https://api.github.com/users/shwsun","html_url":"https://github.com/shwsun","followers_url":"https://api.github.com/users/shwsun/followers","following_url":"https://api.github.com/users/shwsun/following{/other_user}","gists_url":"https://api.github.com/users/shwsun/gists{/gist_id}","starred_url":"https://api.github.com/users/shwsun/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shwsun/subscriptions","organizations_url":"https://api.github.com/users/shwsun/orgs","repos_url":"https://api.github.com/users/shwsun/repos","events_url":"https://api.github.com/users/shwsun/events{/privacy}","received_events_url":"https://api.github.com/users/shwsun/received_events","type":"User","site_admin":false},"created_at":"2016-08-04T21:28:49Z","updated_at":"2016-08-04T21:28:49Z","body":"To solve the identical lines problem, I think it is possible to do a shorthand and put sth like this in it.\r\n```\r\ndef register_switch_port_simple(switch, port):\r\n    api.switch_register(switch,\r\n                        type=MOCK_SWITCH_TYPE,\r\n                        username=\"switch_user\",\r\n                        password=\"switch_pass\",\r\n                        hostname=\"switchname\")\r\n    api.switch_register_port(switch, port)\r\n```\r\n\r\nHowever, this kind of shorthand will reduce the readability of ``tests/unit/api/main.py``. The ``switch_register`` and ``switch_register_port`` are there because they should be registered per function. \r\n\r\nAnythoughts? @zenhack @gsilvis "}}
{"actor":{"display_login":"shwsun"}}