{"action":"created","comment":{"url":"https://api.github.com/repos/cisco/cisco-network-node-utils/pulls/comments/44306515","id":44306515,"diff_hunk":"@@ -264,8 +258,7 @@ def default_advertise_l2vpn_evpn\n \n     # dampen_igp_metric\n     def dampen_igp_metric\n-      result = config_get('bgp_af', 'dampen_igp_metric', @get_args)\n-      result ? result.first.to_i : nil\n+      config_get('bgp_af', 'dampen_igp_metric', @get_args)","path":"lib/cisco_node_utils/bgp_af.rb","position":48,"original_position":48,"commit_id":"6009bd72808886ec78d7f534667ba055c68a5c22","original_commit_id":"6009bd72808886ec78d7f534667ba055c68a5c22","user":{"login":"glennmatthews","id":5603551,"avatar_url":"https://avatars.githubusercontent.com/u/5603551?v=3","gravatar_id":"","url":"https://api.github.com/users/glennmatthews","html_url":"https://github.com/glennmatthews","followers_url":"https://api.github.com/users/glennmatthews/followers","following_url":"https://api.github.com/users/glennmatthews/following{/other_user}","gists_url":"https://api.github.com/users/glennmatthews/gists{/gist_id}","starred_url":"https://api.github.com/users/glennmatthews/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/glennmatthews/subscriptions","organizations_url":"https://api.github.com/users/glennmatthews/orgs","repos_url":"https://api.github.com/users/glennmatthews/repos","events_url":"https://api.github.com/users/glennmatthews/events{/privacy}","received_events_url":"https://api.github.com/users/glennmatthews/received_events","type":"User","site_admin":false},"body":"Hm, need to take another look at this one.\r\n\r\n`auto_default` is used specifically for cases where we have a defined `default_value` but do NOT want the getter to automatically return the `default_value` in the case where the `config_get_token` fails to find a match (and would otherwise return `nil`). \r\n\r\nIn this case, from the baseline code, the `default_value` is 600 seconds, but if the regexp fails to match, we want to return `nil` (dampen-igp-metric disabled, I guess?) rather than `600`. I'm not enough of an expert in this feature to understand why this asymmetry.","created_at":"2015-11-09T17:58:10Z","updated_at":"2015-11-09T17:58:10Z","html_url":"https://github.com/cisco/cisco-network-node-utils/pull/67#discussion_r44306515","pull_request_url":"https://api.github.com/repos/cisco/cisco-network-node-utils/pulls/67","_links":{"self":{"href":"https://api.github.com/repos/cisco/cisco-network-node-utils/pulls/comments/44306515"},"html":{"href":"https://github.com/cisco/cisco-network-node-utils/pull/67#discussion_r44306515"},"pull_request":{"href":"https://api.github.com/repos/cisco/cisco-network-node-utils/pulls/67"}}},"pull_request":{"url":"https://api.github.com/repos/cisco/cisco-network-node-utils/pulls/67","id":49970997,"html_url":"https://github.com/cisco/cisco-network-node-utils/pull/67","diff_url":"https://github.com/cisco/cisco-network-node-utils/pull/67.diff","patch_url":"https://github.com/cisco/cisco-network-node-utils/pull/67.patch","issue_url":"https://api.github.com/repos/cisco/cisco-network-node-utils/issues/67","number":67,"state":"open","locked":false,"title":"Feature/yaml enhancements","user":{"login":"glennmatthews","id":5603551,"avatar_url":"https://avatars.githubusercontent.com/u/5603551?v=3","gravatar_id":"","url":"https://api.github.com/users/glennmatthews","html_url":"https://github.com/glennmatthews","followers_url":"https://api.github.com/users/glennmatthews/followers","following_url":"https://api.github.com/users/glennmatthews/following{/other_user}","gists_url":"https://api.github.com/users/glennmatthews/gists{/gist_id}","starred_url":"https://api.github.com/users/glennmatthews/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/glennmatthews/subscriptions","organizations_url":"https://api.github.com/users/glennmatthews/orgs","repos_url":"https://api.github.com/users/glennmatthews/repos","events_url":"https://api.github.com/users/glennmatthews/events{/privacy}","received_events_url":"https://api.github.com/users/glennmatthews/received_events","type":"User","site_admin":false},"body":"YAML usability enhancements (based on work in feature/grpc branch, but separate from the gRPC work now):\r\n\r\n- Split monolithic YAML files (command_reference_common.yaml) into per-feature files (cmd_ref/bgp.yaml, cmd_ref/bgp_af.yaml, etc.). Per-platform logic for a feature is now defined in the same feature YAML file, rather than having separate YAML per platform.\r\n  - `cli_nexus` tag is added to identify YAML entries that are exclusive to NXOS CLI clients like NXAPI. Currently this is the only supported API but this is the groundwork needed to let us add `cli_ios_xr` as part of the gRPC work.\r\n  - Properties can branch by product-id regexp, including an `else` clause:\r\n\r\n    ```yaml\r\n    negotiate_auto_ethernet:\r\n      kind: boolean\r\n      cli_nexus:\r\n        /(N7K|C3064)/:\r\n          config_get: ~\r\n          config_set: ~\r\n          config_get_token: ~\r\n          default_value: false\r\n        else:\r\n          config_get_token_append: '/^negotiate auto$/'\r\n          config_set_append: \"%s negotiate auto\"\r\n          default_value: true\r\n    ```\r\n  - Features and properties can be marked as not applicable to a platform or product-id by using the new `_exclude` tag: `_exclude: [/N7K/, /N5K/]`.\r\n- By default, feature attributes are assumed to be single in quantity (and will raise an error if config_get finds more than one match), and will return a single value rather than an array, reducing the need to do `value = value[0]`, `value = value.first`, `value.shift`, etc. in every.single.getter.function. For the small number of attributes that really do want to get multiple matches (`all_interfaces`, `vrfs`, etc.), a new YAML tag `multiple: true` is introduced.\r\n- By default, `config_get()` will now return the defined `default_value` (if any) rather than `nil` if no match is found. This reduces the need to do things like `value = value.nil? config_get_default(...) : value` all over the place. For the small number of attributes that don't want this behavior (and want to get an explicit `nil` if no match is found), a new YAML tag `auto_default: false` is introduced.\r\n- Added an optional `kind` YAML tag (recognized values: `boolean`, `int`, `string`) which will automatically convert the `config_get()` result into the desired data type, avoiding the need to do `value = value.to_i`, `value ? true : false`, and `value = value.strip` all over the place. If this tag is not specified, the previous behavior (return a string and let the caller sort it out) is still supported.\r\n\r\nMinitest and rubocop are passing.","created_at":"2015-11-06T16:03:03Z","updated_at":"2015-11-09T17:58:10Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8d45e3e467bfd7b59ee73b9901800f7816abca52","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/cisco/cisco-network-node-utils/pulls/67/commits","review_comments_url":"https://api.github.com/repos/cisco/cisco-network-node-utils/pulls/67/comments","review_comment_url":"https://api.github.com/repos/cisco/cisco-network-node-utils/pulls/comments{/number}","comments_url":"https://api.github.com/repos/cisco/cisco-network-node-utils/issues/67/comments","statuses_url":"https://api.github.com/repos/cisco/cisco-network-node-utils/statuses/6009bd72808886ec78d7f534667ba055c68a5c22","head":{"label":"cisco:feature/yaml_enhancements","ref":"feature/yaml_enhancements","sha":"6009bd72808886ec78d7f534667ba055c68a5c22","user":{"login":"cisco","id":1376999,"avatar_url":"https://avatars.githubusercontent.com/u/1376999?v=3","gravatar_id":"","url":"https://api.github.com/users/cisco","html_url":"https://github.com/cisco","followers_url":"https://api.github.com/users/cisco/followers","following_url":"https://api.github.com/users/cisco/following{/other_user}","gists_url":"https://api.github.com/users/cisco/gists{/gist_id}","starred_url":"https://api.github.com/users/cisco/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cisco/subscriptions","organizations_url":"https://api.github.com/users/cisco/orgs","repos_url":"https://api.github.com/users/cisco/repos","events_url":"https://api.github.com/users/cisco/events{/privacy}","received_events_url":"https://api.github.com/users/cisco/received_events","type":"Organization","site_admin":false},"repo":{"id":39565196,"name":"cisco-network-node-utils","full_name":"cisco/cisco-network-node-utils","owner":{"login":"cisco","id":1376999,"avatar_url":"https://avatars.githubusercontent.com/u/1376999?v=3","gravatar_id":"","url":"https://api.github.com/users/cisco","html_url":"https://github.com/cisco","followers_url":"https://api.github.com/users/cisco/followers","following_url":"https://api.github.com/users/cisco/following{/other_user}","gists_url":"https://api.github.com/users/cisco/gists{/gist_id}","starred_url":"https://api.github.com/users/cisco/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cisco/subscriptions","organizations_url":"https://api.github.com/users/cisco/orgs","repos_url":"https://api.github.com/users/cisco/repos","events_url":"https://api.github.com/users/cisco/events{/privacy}","received_events_url":"https://api.github.com/users/cisco/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/cisco/cisco-network-node-utils","description":"","fork":false,"url":"https://api.github.com/repos/cisco/cisco-network-node-utils","forks_url":"https://api.github.com/repos/cisco/cisco-network-node-utils/forks","keys_url":"https://api.github.com/repos/cisco/cisco-network-node-utils/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cisco/cisco-network-node-utils/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cisco/cisco-network-node-utils/teams","hooks_url":"https://api.github.com/repos/cisco/cisco-network-node-utils/hooks","issue_events_url":"https://api.github.com/repos/cisco/cisco-network-node-utils/issues/events{/number}","events_url":"https://api.github.com/repos/cisco/cisco-network-node-utils/events","assignees_url":"https://api.github.com/repos/cisco/cisco-network-node-utils/assignees{/user}","branches_url":"https://api.github.com/repos/cisco/cisco-network-node-utils/branches{/branch}","tags_url":"https://api.github.com/repos/cisco/cisco-network-node-utils/tags","blobs_url":"https://api.github.com/repos/cisco/cisco-network-node-utils/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cisco/cisco-network-node-utils/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cisco/cisco-network-node-utils/git/refs{/sha}","trees_url":"https://api.github.com/repos/cisco/cisco-network-node-utils/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cisco/cisco-network-node-utils/statuses/{sha}","languages_url":"https://api.github.com/repos/cisco/cisco-network-node-utils/languages","stargazers_url":"https://api.github.com/repos/cisco/cisco-network-node-utils/stargazers","contributors_url":"https://api.github.com/repos/cisco/cisco-network-node-utils/contributors","subscribers_url":"https://api.github.com/repos/cisco/cisco-network-node-utils/subscribers","subscription_url":"https://api.github.com/repos/cisco/cisco-network-node-utils/subscription","commits_url":"https://api.github.com/repos/cisco/cisco-network-node-utils/commits{/sha}","git_commits_url":"https://api.github.com/repos/cisco/cisco-network-node-utils/git/commits{/sha}","comments_url":"https://api.github.com/repos/cisco/cisco-network-node-utils/comments{/number}","issue_comment_url":"https://api.github.com/repos/cisco/cisco-network-node-utils/issues/comments{/number}","contents_url":"https://api.github.com/repos/cisco/cisco-network-node-utils/contents/{+path}","compare_url":"https://api.github.com/repos/cisco/cisco-network-node-utils/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cisco/cisco-network-node-utils/merges","archive_url":"https://api.github.com/repos/cisco/cisco-network-node-utils/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cisco/cisco-network-node-utils/downloads","issues_url":"https://api.github.com/repos/cisco/cisco-network-node-utils/issues{/number}","pulls_url":"https://api.github.com/repos/cisco/cisco-network-node-utils/pulls{/number}","milestones_url":"https://api.github.com/repos/cisco/cisco-network-node-utils/milestones{/number}","notifications_url":"https://api.github.com/repos/cisco/cisco-network-node-utils/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cisco/cisco-network-node-utils/labels{/name}","releases_url":"https://api.github.com/repos/cisco/cisco-network-node-utils/releases{/id}","created_at":"2015-07-23T12:07:39Z","updated_at":"2015-11-08T06:38:49Z","pushed_at":"2015-11-09T17:54:47Z","git_url":"git://github.com/cisco/cisco-network-node-utils.git","ssh_url":"git@github.com:cisco/cisco-network-node-utils.git","clone_url":"https://github.com/cisco/cisco-network-node-utils.git","svn_url":"https://github.com/cisco/cisco-network-node-utils","homepage":null,"size":2272,"stargazers_count":6,"watchers_count":6,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":21,"mirror_url":null,"open_issues_count":2,"forks":21,"open_issues":2,"watchers":6,"default_branch":"develop"}},"base":{"label":"cisco:develop","ref":"develop","sha":"4d90c4b42ffe65d0e8f536d5c2016896309a1e13","user":{"login":"cisco","id":1376999,"avatar_url":"https://avatars.githubusercontent.com/u/1376999?v=3","gravatar_id":"","url":"https://api.github.com/users/cisco","html_url":"https://github.com/cisco","followers_url":"https://api.github.com/users/cisco/followers","following_url":"https://api.github.com/users/cisco/following{/other_user}","gists_url":"https://api.github.com/users/cisco/gists{/gist_id}","starred_url":"https://api.github.com/users/cisco/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cisco/subscriptions","organizations_url":"https://api.github.com/users/cisco/orgs","repos_url":"https://api.github.com/users/cisco/repos","events_url":"https://api.github.com/users/cisco/events{/privacy}","received_events_url":"https://api.github.com/users/cisco/received_events","type":"Organization","site_admin":false},"repo":{"id":39565196,"name":"cisco-network-node-utils","full_name":"cisco/cisco-network-node-utils","owner":{"login":"cisco","id":1376999,"avatar_url":"https://avatars.githubusercontent.com/u/1376999?v=3","gravatar_id":"","url":"https://api.github.com/users/cisco","html_url":"https://github.com/cisco","followers_url":"https://api.github.com/users/cisco/followers","following_url":"https://api.github.com/users/cisco/following{/other_user}","gists_url":"https://api.github.com/users/cisco/gists{/gist_id}","starred_url":"https://api.github.com/users/cisco/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cisco/subscriptions","organizations_url":"https://api.github.com/users/cisco/orgs","repos_url":"https://api.github.com/users/cisco/repos","events_url":"https://api.github.com/users/cisco/events{/privacy}","received_events_url":"https://api.github.com/users/cisco/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/cisco/cisco-network-node-utils","description":"","fork":false,"url":"https://api.github.com/repos/cisco/cisco-network-node-utils","forks_url":"https://api.github.com/repos/cisco/cisco-network-node-utils/forks","keys_url":"https://api.github.com/repos/cisco/cisco-network-node-utils/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cisco/cisco-network-node-utils/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cisco/cisco-network-node-utils/teams","hooks_url":"https://api.github.com/repos/cisco/cisco-network-node-utils/hooks","issue_events_url":"https://api.github.com/repos/cisco/cisco-network-node-utils/issues/events{/number}","events_url":"https://api.github.com/repos/cisco/cisco-network-node-utils/events","assignees_url":"https://api.github.com/repos/cisco/cisco-network-node-utils/assignees{/user}","branches_url":"https://api.github.com/repos/cisco/cisco-network-node-utils/branches{/branch}","tags_url":"https://api.github.com/repos/cisco/cisco-network-node-utils/tags","blobs_url":"https://api.github.com/repos/cisco/cisco-network-node-utils/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cisco/cisco-network-node-utils/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cisco/cisco-network-node-utils/git/refs{/sha}","trees_url":"https://api.github.com/repos/cisco/cisco-network-node-utils/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cisco/cisco-network-node-utils/statuses/{sha}","languages_url":"https://api.github.com/repos/cisco/cisco-network-node-utils/languages","stargazers_url":"https://api.github.com/repos/cisco/cisco-network-node-utils/stargazers","contributors_url":"https://api.github.com/repos/cisco/cisco-network-node-utils/contributors","subscribers_url":"https://api.github.com/repos/cisco/cisco-network-node-utils/subscribers","subscription_url":"https://api.github.com/repos/cisco/cisco-network-node-utils/subscription","commits_url":"https://api.github.com/repos/cisco/cisco-network-node-utils/commits{/sha}","git_commits_url":"https://api.github.com/repos/cisco/cisco-network-node-utils/git/commits{/sha}","comments_url":"https://api.github.com/repos/cisco/cisco-network-node-utils/comments{/number}","issue_comment_url":"https://api.github.com/repos/cisco/cisco-network-node-utils/issues/comments{/number}","contents_url":"https://api.github.com/repos/cisco/cisco-network-node-utils/contents/{+path}","compare_url":"https://api.github.com/repos/cisco/cisco-network-node-utils/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cisco/cisco-network-node-utils/merges","archive_url":"https://api.github.com/repos/cisco/cisco-network-node-utils/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cisco/cisco-network-node-utils/downloads","issues_url":"https://api.github.com/repos/cisco/cisco-network-node-utils/issues{/number}","pulls_url":"https://api.github.com/repos/cisco/cisco-network-node-utils/pulls{/number}","milestones_url":"https://api.github.com/repos/cisco/cisco-network-node-utils/milestones{/number}","notifications_url":"https://api.github.com/repos/cisco/cisco-network-node-utils/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cisco/cisco-network-node-utils/labels{/name}","releases_url":"https://api.github.com/repos/cisco/cisco-network-node-utils/releases{/id}","created_at":"2015-07-23T12:07:39Z","updated_at":"2015-11-08T06:38:49Z","pushed_at":"2015-11-09T17:54:47Z","git_url":"git://github.com/cisco/cisco-network-node-utils.git","ssh_url":"git@github.com:cisco/cisco-network-node-utils.git","clone_url":"https://github.com/cisco/cisco-network-node-utils.git","svn_url":"https://github.com/cisco/cisco-network-node-utils","homepage":null,"size":2272,"stargazers_count":6,"watchers_count":6,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":21,"mirror_url":null,"open_issues_count":2,"forks":21,"open_issues":2,"watchers":6,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/cisco/cisco-network-node-utils/pulls/67"},"html":{"href":"https://github.com/cisco/cisco-network-node-utils/pull/67"},"issue":{"href":"https://api.github.com/repos/cisco/cisco-network-node-utils/issues/67"},"comments":{"href":"https://api.github.com/repos/cisco/cisco-network-node-utils/issues/67/comments"},"review_comments":{"href":"https://api.github.com/repos/cisco/cisco-network-node-utils/pulls/67/comments"},"review_comment":{"href":"https://api.github.com/repos/cisco/cisco-network-node-utils/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/cisco/cisco-network-node-utils/pulls/67/commits"},"statuses":{"href":"https://api.github.com/repos/cisco/cisco-network-node-utils/statuses/6009bd72808886ec78d7f534667ba055c68a5c22"}}}}