{"action":"created","issue":{"url":"https://api.github.com/repos/SatelliteQE/nailgun/issues/79","labels_url":"https://api.github.com/repos/SatelliteQE/nailgun/issues/79/labels{/name}","comments_url":"https://api.github.com/repos/SatelliteQE/nailgun/issues/79/comments","events_url":"https://api.github.com/repos/SatelliteQE/nailgun/issues/79/events","html_url":"https://github.com/SatelliteQE/nailgun/pull/79","id":78244664,"number":79,"title":"Use method `ServerConfig.get_client_kwargs`","user":{"login":"Ichimonji10","id":1012989,"avatar_url":"https://avatars.githubusercontent.com/u/1012989?v=3","gravatar_id":"","url":"https://api.github.com/users/Ichimonji10","html_url":"https://github.com/Ichimonji10","followers_url":"https://api.github.com/users/Ichimonji10/followers","following_url":"https://api.github.com/users/Ichimonji10/following{/other_user}","gists_url":"https://api.github.com/users/Ichimonji10/gists{/gist_id}","starred_url":"https://api.github.com/users/Ichimonji10/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ichimonji10/subscriptions","organizations_url":"https://api.github.com/users/Ichimonji10/orgs","repos_url":"https://api.github.com/users/Ichimonji10/repos","events_url":"https://api.github.com/users/Ichimonji10/events{/privacy}","received_events_url":"https://api.github.com/users/Ichimonji10/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-05-19T20:45:43Z","updated_at":"2015-05-20T14:26:36Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/SatelliteQE/nailgun/pulls/79","html_url":"https://github.com/SatelliteQE/nailgun/pull/79","diff_url":"https://github.com/SatelliteQE/nailgun/pull/79.diff","patch_url":"https://github.com/SatelliteQE/nailgun/pull/79.patch"},"body":"Why use this method? From the method docstring:\r\n\r\n> This method returns a dict of attributes that can be unpacked and used as\r\n> kwargs via the ``**`` operator. For example::\r\n>\r\n>     cfg = ServerConfig.get()\r\n>     client.get(cfg.url + '/api/v2', **cfg.get_client_kwargs())\r\n>\r\n> This method is useful because client code may not know which attributes should\r\n> be passed from a ``ServerConfig`` object to one of the ``nailgun.client``\r\n> functions. Consider that the example above could also be written like this::\r\n>\r\n>     cfg = ServerConfig.get()\r\n>     client.get(cfg.url + '/api/v2', auth=cfg.auth, verify=cfg.verify)\r\n>\r\n> But this latter approach is more fragile. It will break if ``cfg`` does not\r\n> have an ``auth`` or ``verify`` attribute.\r\n\r\nIn other words, using `get_client_kwargs` is more robust than passing individual\r\n`ServerConfig` object attributes to the various functions in `nailgun.client`.\r\n\r\nTest results against a downstream system:\r\n\r\n    $ nosetests tests/foreman/api/test_multiple_paths.py\r\n    ...S...S......S...............................................................S...S..........................................................................................................................................SSS..S.S.SSSSSS.S..SS.SSSSSSSSSSSSSSSSSSSSSSSSSSSS\r\n    ----------------------------------------------------------------------\r\n    Ran 271 tests in 459.591s\r\n\r\n    OK (SKIP=47)"},"comment":{"url":"https://api.github.com/repos/SatelliteQE/nailgun/issues/comments/103904959","html_url":"https://github.com/SatelliteQE/nailgun/pull/79#issuecomment-103904959","issue_url":"https://api.github.com/repos/SatelliteQE/nailgun/issues/79","id":103904959,"user":{"login":"Ichimonji10","id":1012989,"avatar_url":"https://avatars.githubusercontent.com/u/1012989?v=3","gravatar_id":"","url":"https://api.github.com/users/Ichimonji10","html_url":"https://github.com/Ichimonji10","followers_url":"https://api.github.com/users/Ichimonji10/followers","following_url":"https://api.github.com/users/Ichimonji10/following{/other_user}","gists_url":"https://api.github.com/users/Ichimonji10/gists{/gist_id}","starred_url":"https://api.github.com/users/Ichimonji10/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ichimonji10/subscriptions","organizations_url":"https://api.github.com/users/Ichimonji10/orgs","repos_url":"https://api.github.com/users/Ichimonji10/repos","events_url":"https://api.github.com/users/Ichimonji10/events{/privacy}","received_events_url":"https://api.github.com/users/Ichimonji10/received_events","type":"User","site_admin":false},"created_at":"2015-05-20T14:26:36Z","updated_at":"2015-05-20T14:26:36Z","body":"Rebased."}}