{"action":"created","comment":{"url":"https://api.github.com/repos/SatelliteQE/nailgun/pulls/comments/77992417","id":77992417,"diff_hunk":"@@ -2166,6 +2200,59 @@ def update_payload(self, fields=None):\n         \"\"\"Wrap submitted data within an extra dict.\"\"\"\n         return {u'hostgroup': super(HostGroup, self).update_payload(fields)}\n \n+    def path(self, which=None):\n+        \"\"\"Extend ``nailgun.entity_mixins.Entity.path``.\n+        The format of the returned path depends on the value of ``which``:\n+\n+        puppetclass_ids\n+            /api/hostgroups/:hostgroup_id/puppetclass_ids\n+        smart_class_parameters\n+            /api/puppetclasses/:puppetclass_id/smart_class_parameters\n+\n+        Otherwise, call ``super``.\n+\n+        \"\"\"\n+        if which in ('puppetclass_ids', 'smart_class_parameters'):\n+            return '{0}/{1}'.format(\n+                super(HostGroup, self).path(which='self'),\n+                which\n+            )","path":"nailgun/entities.py","position":61,"original_position":61,"commit_id":"81a499f3962451822aaefb133a9870f850539ffb","original_commit_id":"81a499f3962451822aaefb133a9870f850539ffb","user":{"login":"svtkachenko","id":2845814,"avatar_url":"https://avatars.githubusercontent.com/u/2845814?v=3","gravatar_id":"","url":"https://api.github.com/users/svtkachenko","html_url":"https://github.com/svtkachenko","followers_url":"https://api.github.com/users/svtkachenko/followers","following_url":"https://api.github.com/users/svtkachenko/following{/other_user}","gists_url":"https://api.github.com/users/svtkachenko/gists{/gist_id}","starred_url":"https://api.github.com/users/svtkachenko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/svtkachenko/subscriptions","organizations_url":"https://api.github.com/users/svtkachenko/orgs","repos_url":"https://api.github.com/users/svtkachenko/repos","events_url":"https://api.github.com/users/svtkachenko/events{/privacy}","received_events_url":"https://api.github.com/users/svtkachenko/received_events","type":"User","site_admin":false},"body":"Another \"oops\", he-he. Wrong copypaste from a bunch of similar paths.","created_at":"2016-09-08T12:02:08Z","updated_at":"2016-09-08T12:02:08Z","html_url":"https://github.com/SatelliteQE/nailgun/pull/313#discussion_r77992417","pull_request_url":"https://api.github.com/repos/SatelliteQE/nailgun/pulls/313","_links":{"self":{"href":"https://api.github.com/repos/SatelliteQE/nailgun/pulls/comments/77992417"},"html":{"href":"https://github.com/SatelliteQE/nailgun/pull/313#discussion_r77992417"},"pull_request":{"href":"https://api.github.com/repos/SatelliteQE/nailgun/pulls/313"}}},"pull_request":{"url":"https://api.github.com/repos/SatelliteQE/nailgun/pulls/313","id":83763580,"html_url":"https://github.com/SatelliteQE/nailgun/pull/313","diff_url":"https://github.com/SatelliteQE/nailgun/pull/313.diff","patch_url":"https://github.com/SatelliteQE/nailgun/pull/313.patch","issue_url":"https://api.github.com/repos/SatelliteQE/nailgun/issues/313","number":313,"state":"open","locked":false,"title":"Added Smart Class Parameters entity and helpers needed for SCP.","user":{"login":"svtkachenko","id":2845814,"avatar_url":"https://avatars.githubusercontent.com/u/2845814?v=3","gravatar_id":"","url":"https://api.github.com/users/svtkachenko","html_url":"https://github.com/svtkachenko","followers_url":"https://api.github.com/users/svtkachenko/followers","following_url":"https://api.github.com/users/svtkachenko/following{/other_user}","gists_url":"https://api.github.com/users/svtkachenko/gists{/gist_id}","starred_url":"https://api.github.com/users/svtkachenko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/svtkachenko/subscriptions","organizations_url":"https://api.github.com/users/svtkachenko/orgs","repos_url":"https://api.github.com/users/svtkachenko/repos","events_url":"https://api.github.com/users/svtkachenko/events{/privacy}","received_events_url":"https://api.github.com/users/svtkachenko/received_events","type":"User","site_admin":false},"body":"This is my first PR for nailgun so I would be appreciate for any comments and suggestions. Especially about what unit-tests should be added.\r\n\r\n```python\r\nentities.SmartClassParameters().search(query={'search': 'puppetclass=\"ntp\"', 'per_page': 100})\r\n2016-09-02 11:15:47 - nailgun.client - DEBUG - Making HTTP GET request to https://example.com/api/v2/smart_class_parameters\r\n2016-09-02 11:15:48 - nailgun.client - DEBUG - Received HTTP 200 response:\r\n[nailgun.entities.SmartClassParameters(nailgun.config.ServerConfig(url='https://example.com', verify=False, auth=('admin', 'changeme')), description=None, puppetclass=nailgun.entities.PuppetClass(nailgun.config.ServerConfig(url='example.com', verify=False, auth=('admin', 'changeme')), id=12), hidden_value=u'*****', validator_type=None, id=120, merge_overrides=False, default_value=u'${$ntp::params::authprov}', validator_rule=None, use_puppet_default=None, avoid_duplicates=False, required=False, merge_default=False, parameter_type=u'string', override=False, hidden_value?=False)]\r\n```\r\n\r\n```python\r\nproxy = entities.SmartProxy(name=cls.host_name).search()[0]\r\nproxy.import_puppetclasses(data={'environment_id': cls.env.id})\r\n2016-09-02 11:18:52 - nailgun.client - DEBUG - Making HTTP POST request to https://example.com/api/v2/smart_proxies/1/environments/1/import_puppetclasses with options {'verify': False, 'auth': ('admin', 'changeme'), 'headers': {'content-type': 'application/json'}} and data {}.\r\n2016-09-02 11:18:56 - nailgun.client - DEBUG - Received HTTP 200 response: {\r\n  \"message\": \"Successfully updated environment and puppetclasses from the on-disk puppet installation\",\r\n  \"results\": {\"name\":\"production\",\"actions\":[\"new\"],\"new_puppetclasses\":[\"ntp::config\",\"ntp\",\"ntp::install\",\"ntp::params\",\"ntp::service\"]}\r\n}\r\n```\r\n\r\n```python\r\npuppet = entities.PuppetClass().search(query={'search': 'name=\"ntp\"'})[0]\r\npuppet.list_scparams()\r\n2016-09-02 11:23:04 - nailgun.client - DEBUG - Making HTTP GET request to https://example.com/api/v2/puppetclasses/12/smart_class_parameters with options {'verify': False, 'auth': ('admin', 'changeme'), 'headers': {'content-type': 'application/json'}} and no data.\r\n2016-09-02 11:23:05 - nailgun.client - DEBUG - Received HTTP 200 response: {\r\n  \"results\": [{\"description\":null,\"override\":false,\"parameter_type\":\"string\",\"default_value\":\"${$ntp::params::authprov}\",\"hidden_value?\":false,\"hidden_value\":\"*****\",\"use_puppet_default\":null,\"required\":false,\"validator_type\":null,\"validator_rule\":null,\"merge_overrides\":false,\"merge_default\":false,\"avoid_duplicates\":false,\"override_value_order\":\"fqdn\\nhostgroup\\nos\\ndomain\",\"override_values_count\":0,\"created_at\":\"2016-09-02 08:18:56 UTC\",\"updated_at\":\"2016-09-02 08:18:56 UTC\",\"puppetclass_name\":\"ntp\",\"parameter\":\"authprov\",\"id\":120,\"puppetclass_id\":12},]\r\n}\r\n```\r\n```python\r\nentities.OverrideValue(\r\n     smart_class_parameter=sc_param,  match='domain=example.com', value=value,\r\n).create()\r\n\r\n2016-09-02 11:27:29 - nailgun.client - DEBUG - Making HTTP POST request to https://example.com/api/v2/smart_class_parameters/118/override_values with options {'verify': False, 'auth': ('admin', 'changeme'), 'headers': {'content-type': 'application/json'}} and data {\"smart_class_parameter_id\": 118, \"value\": \"kZylGAGNPC\", \"match\": \"domain=example.com\"}.\r\n2016-09-02 11:27:30 - nailgun.client - DEBUG - Received HTTP 201 response: {\"created_at\":\"2016-09-02 08:27:30 UTC\",\"updated_at\":\"2016-09-02 08:27:30 UTC\",\"id\":2,\"match\":\"domain=example.com\",\"value\":\"kZylGAGNPC\",\"use_puppet_default\":false}\r\nnailgun.entities.OverrideValue(nailgun.config.ServerConfig(url='example.com', verify=False, auth=('admin', 'changeme')), use_puppet_default=False, value=u'kZylGAGNPC', id=2, match=u'domain=example.com', smart_class_parameter=nailgun.entities.SmartClassParameters(nailgun.config.ServerConfig(url='https://example.com', verify=False, auth=('admin', 'changeme')), description=None, puppetclass=nailgun.entities.PuppetClass(nailgun.config.ServerConfig(url='https://example.com', verify=False, auth=('admin', 'changeme')), id=12), hidden_value=u'*****', validator_type=None, id=118, merge_overrides=False, default_value=u'${$ntp::params::udlc_stratum}', validator_rule=None, use_puppet_default=None, avoid_duplicates=False, required=False, merge_default=False, parameter_type=u'string', override=False, hidden_value?=False))","created_at":"2016-09-02T08:30:10Z","updated_at":"2016-09-08T12:02:08Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0ca5a33258ca9a65db36304e9084a28b26b05b3f","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/SatelliteQE/nailgun/pulls/313/commits","review_comments_url":"https://api.github.com/repos/SatelliteQE/nailgun/pulls/313/comments","review_comment_url":"https://api.github.com/repos/SatelliteQE/nailgun/pulls/comments{/number}","comments_url":"https://api.github.com/repos/SatelliteQE/nailgun/issues/313/comments","statuses_url":"https://api.github.com/repos/SatelliteQE/nailgun/statuses/81a499f3962451822aaefb133a9870f850539ffb","head":{"label":"svtkachenko:add_cp_helper","ref":"add_cp_helper","sha":"81a499f3962451822aaefb133a9870f850539ffb","user":{"login":"svtkachenko","id":2845814,"avatar_url":"https://avatars.githubusercontent.com/u/2845814?v=3","gravatar_id":"","url":"https://api.github.com/users/svtkachenko","html_url":"https://github.com/svtkachenko","followers_url":"https://api.github.com/users/svtkachenko/followers","following_url":"https://api.github.com/users/svtkachenko/following{/other_user}","gists_url":"https://api.github.com/users/svtkachenko/gists{/gist_id}","starred_url":"https://api.github.com/users/svtkachenko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/svtkachenko/subscriptions","organizations_url":"https://api.github.com/users/svtkachenko/orgs","repos_url":"https://api.github.com/users/svtkachenko/repos","events_url":"https://api.github.com/users/svtkachenko/events{/privacy}","received_events_url":"https://api.github.com/users/svtkachenko/received_events","type":"User","site_admin":false},"repo":{"id":62543059,"name":"nailgun","full_name":"svtkachenko/nailgun","owner":{"login":"svtkachenko","id":2845814,"avatar_url":"https://avatars.githubusercontent.com/u/2845814?v=3","gravatar_id":"","url":"https://api.github.com/users/svtkachenko","html_url":"https://github.com/svtkachenko","followers_url":"https://api.github.com/users/svtkachenko/followers","following_url":"https://api.github.com/users/svtkachenko/following{/other_user}","gists_url":"https://api.github.com/users/svtkachenko/gists{/gist_id}","starred_url":"https://api.github.com/users/svtkachenko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/svtkachenko/subscriptions","organizations_url":"https://api.github.com/users/svtkachenko/orgs","repos_url":"https://api.github.com/users/svtkachenko/repos","events_url":"https://api.github.com/users/svtkachenko/events{/privacy}","received_events_url":"https://api.github.com/users/svtkachenko/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/svtkachenko/nailgun","description":"Why use a hammer when you can use a nailgun.","fork":true,"url":"https://api.github.com/repos/svtkachenko/nailgun","forks_url":"https://api.github.com/repos/svtkachenko/nailgun/forks","keys_url":"https://api.github.com/repos/svtkachenko/nailgun/keys{/key_id}","collaborators_url":"https://api.github.com/repos/svtkachenko/nailgun/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/svtkachenko/nailgun/teams","hooks_url":"https://api.github.com/repos/svtkachenko/nailgun/hooks","issue_events_url":"https://api.github.com/repos/svtkachenko/nailgun/issues/events{/number}","events_url":"https://api.github.com/repos/svtkachenko/nailgun/events","assignees_url":"https://api.github.com/repos/svtkachenko/nailgun/assignees{/user}","branches_url":"https://api.github.com/repos/svtkachenko/nailgun/branches{/branch}","tags_url":"https://api.github.com/repos/svtkachenko/nailgun/tags","blobs_url":"https://api.github.com/repos/svtkachenko/nailgun/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/svtkachenko/nailgun/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/svtkachenko/nailgun/git/refs{/sha}","trees_url":"https://api.github.com/repos/svtkachenko/nailgun/git/trees{/sha}","statuses_url":"https://api.github.com/repos/svtkachenko/nailgun/statuses/{sha}","languages_url":"https://api.github.com/repos/svtkachenko/nailgun/languages","stargazers_url":"https://api.github.com/repos/svtkachenko/nailgun/stargazers","contributors_url":"https://api.github.com/repos/svtkachenko/nailgun/contributors","subscribers_url":"https://api.github.com/repos/svtkachenko/nailgun/subscribers","subscription_url":"https://api.github.com/repos/svtkachenko/nailgun/subscription","commits_url":"https://api.github.com/repos/svtkachenko/nailgun/commits{/sha}","git_commits_url":"https://api.github.com/repos/svtkachenko/nailgun/git/commits{/sha}","comments_url":"https://api.github.com/repos/svtkachenko/nailgun/comments{/number}","issue_comment_url":"https://api.github.com/repos/svtkachenko/nailgun/issues/comments{/number}","contents_url":"https://api.github.com/repos/svtkachenko/nailgun/contents/{+path}","compare_url":"https://api.github.com/repos/svtkachenko/nailgun/compare/{base}...{head}","merges_url":"https://api.github.com/repos/svtkachenko/nailgun/merges","archive_url":"https://api.github.com/repos/svtkachenko/nailgun/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/svtkachenko/nailgun/downloads","issues_url":"https://api.github.com/repos/svtkachenko/nailgun/issues{/number}","pulls_url":"https://api.github.com/repos/svtkachenko/nailgun/pulls{/number}","milestones_url":"https://api.github.com/repos/svtkachenko/nailgun/milestones{/number}","notifications_url":"https://api.github.com/repos/svtkachenko/nailgun/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/svtkachenko/nailgun/labels{/name}","releases_url":"https://api.github.com/repos/svtkachenko/nailgun/releases{/id}","deployments_url":"https://api.github.com/repos/svtkachenko/nailgun/deployments","created_at":"2016-07-04T08:01:42Z","updated_at":"2016-07-04T08:01:44Z","pushed_at":"2016-09-05T20:25:00Z","git_url":"git://github.com/svtkachenko/nailgun.git","ssh_url":"git@github.com:svtkachenko/nailgun.git","clone_url":"https://github.com/svtkachenko/nailgun.git","svn_url":"https://github.com/svtkachenko/nailgun","homepage":null,"size":1380,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"SatelliteQE:master","ref":"master","sha":"d71fa986e0344f0839a27f7f3485950ee1aeb9f0","user":{"login":"SatelliteQE","id":8754276,"avatar_url":"https://avatars.githubusercontent.com/u/8754276?v=3","gravatar_id":"","url":"https://api.github.com/users/SatelliteQE","html_url":"https://github.com/SatelliteQE","followers_url":"https://api.github.com/users/SatelliteQE/followers","following_url":"https://api.github.com/users/SatelliteQE/following{/other_user}","gists_url":"https://api.github.com/users/SatelliteQE/gists{/gist_id}","starred_url":"https://api.github.com/users/SatelliteQE/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SatelliteQE/subscriptions","organizations_url":"https://api.github.com/users/SatelliteQE/orgs","repos_url":"https://api.github.com/users/SatelliteQE/repos","events_url":"https://api.github.com/users/SatelliteQE/events{/privacy}","received_events_url":"https://api.github.com/users/SatelliteQE/received_events","type":"Organization","site_admin":false},"repo":{"id":27888295,"name":"nailgun","full_name":"SatelliteQE/nailgun","owner":{"login":"SatelliteQE","id":8754276,"avatar_url":"https://avatars.githubusercontent.com/u/8754276?v=3","gravatar_id":"","url":"https://api.github.com/users/SatelliteQE","html_url":"https://github.com/SatelliteQE","followers_url":"https://api.github.com/users/SatelliteQE/followers","following_url":"https://api.github.com/users/SatelliteQE/following{/other_user}","gists_url":"https://api.github.com/users/SatelliteQE/gists{/gist_id}","starred_url":"https://api.github.com/users/SatelliteQE/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SatelliteQE/subscriptions","organizations_url":"https://api.github.com/users/SatelliteQE/orgs","repos_url":"https://api.github.com/users/SatelliteQE/repos","events_url":"https://api.github.com/users/SatelliteQE/events{/privacy}","received_events_url":"https://api.github.com/users/SatelliteQE/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/SatelliteQE/nailgun","description":"Why use a hammer when you can use a nailgun.","fork":false,"url":"https://api.github.com/repos/SatelliteQE/nailgun","forks_url":"https://api.github.com/repos/SatelliteQE/nailgun/forks","keys_url":"https://api.github.com/repos/SatelliteQE/nailgun/keys{/key_id}","collaborators_url":"https://api.github.com/repos/SatelliteQE/nailgun/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/SatelliteQE/nailgun/teams","hooks_url":"https://api.github.com/repos/SatelliteQE/nailgun/hooks","issue_events_url":"https://api.github.com/repos/SatelliteQE/nailgun/issues/events{/number}","events_url":"https://api.github.com/repos/SatelliteQE/nailgun/events","assignees_url":"https://api.github.com/repos/SatelliteQE/nailgun/assignees{/user}","branches_url":"https://api.github.com/repos/SatelliteQE/nailgun/branches{/branch}","tags_url":"https://api.github.com/repos/SatelliteQE/nailgun/tags","blobs_url":"https://api.github.com/repos/SatelliteQE/nailgun/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/SatelliteQE/nailgun/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/SatelliteQE/nailgun/git/refs{/sha}","trees_url":"https://api.github.com/repos/SatelliteQE/nailgun/git/trees{/sha}","statuses_url":"https://api.github.com/repos/SatelliteQE/nailgun/statuses/{sha}","languages_url":"https://api.github.com/repos/SatelliteQE/nailgun/languages","stargazers_url":"https://api.github.com/repos/SatelliteQE/nailgun/stargazers","contributors_url":"https://api.github.com/repos/SatelliteQE/nailgun/contributors","subscribers_url":"https://api.github.com/repos/SatelliteQE/nailgun/subscribers","subscription_url":"https://api.github.com/repos/SatelliteQE/nailgun/subscription","commits_url":"https://api.github.com/repos/SatelliteQE/nailgun/commits{/sha}","git_commits_url":"https://api.github.com/repos/SatelliteQE/nailgun/git/commits{/sha}","comments_url":"https://api.github.com/repos/SatelliteQE/nailgun/comments{/number}","issue_comment_url":"https://api.github.com/repos/SatelliteQE/nailgun/issues/comments{/number}","contents_url":"https://api.github.com/repos/SatelliteQE/nailgun/contents/{+path}","compare_url":"https://api.github.com/repos/SatelliteQE/nailgun/compare/{base}...{head}","merges_url":"https://api.github.com/repos/SatelliteQE/nailgun/merges","archive_url":"https://api.github.com/repos/SatelliteQE/nailgun/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/SatelliteQE/nailgun/downloads","issues_url":"https://api.github.com/repos/SatelliteQE/nailgun/issues{/number}","pulls_url":"https://api.github.com/repos/SatelliteQE/nailgun/pulls{/number}","milestones_url":"https://api.github.com/repos/SatelliteQE/nailgun/milestones{/number}","notifications_url":"https://api.github.com/repos/SatelliteQE/nailgun/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/SatelliteQE/nailgun/labels{/name}","releases_url":"https://api.github.com/repos/SatelliteQE/nailgun/releases{/id}","deployments_url":"https://api.github.com/repos/SatelliteQE/nailgun/deployments","created_at":"2014-12-11T19:39:59Z","updated_at":"2016-07-01T00:33:34Z","pushed_at":"2016-09-05T20:25:00Z","git_url":"git://github.com/SatelliteQE/nailgun.git","ssh_url":"git@github.com:SatelliteQE/nailgun.git","clone_url":"https://github.com/SatelliteQE/nailgun.git","svn_url":"https://github.com/SatelliteQE/nailgun","homepage":null,"size":1480,"stargazers_count":18,"watchers_count":18,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":21,"mirror_url":null,"open_issues_count":32,"forks":21,"open_issues":32,"watchers":18,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/SatelliteQE/nailgun/pulls/313"},"html":{"href":"https://github.com/SatelliteQE/nailgun/pull/313"},"issue":{"href":"https://api.github.com/repos/SatelliteQE/nailgun/issues/313"},"comments":{"href":"https://api.github.com/repos/SatelliteQE/nailgun/issues/313/comments"},"review_comments":{"href":"https://api.github.com/repos/SatelliteQE/nailgun/pulls/313/comments"},"review_comment":{"href":"https://api.github.com/repos/SatelliteQE/nailgun/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/SatelliteQE/nailgun/pulls/313/commits"},"statuses":{"href":"https://api.github.com/repos/SatelliteQE/nailgun/statuses/81a499f3962451822aaefb133a9870f850539ffb"}}}}
{"actor":{"display_login":"svtkachenko"}}