{"action":"created","comment":{"url":"https://api.github.com/repos/cisco/cisco-network-puppet-module/pulls/comments/52179825","id":52179825,"diff_hunk":"@@ -0,0 +1,143 @@\n+# The NXAPI provider for cisco fabricapth topology.\n+#\n+# January, 2016\n+#\n+# Copyright (c) 2014-2015 Cisco and/or its affiliates.\n+#\n+# Licensed under the Apache License, Version 2.0 (the \"License\");\n+# you may not use this file except in compliance with the License.\n+# You may obtain a copy of the License at\n+#\n+#     http://www.apache.org/licenses/LICENSE-2.0\n+#\n+# Unless required by applicable law or agreed to in writing, software\n+# distributed under the License is distributed on an \"AS IS\" BASIS,\n+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+# See the License for the specific language governing permissions and\n+# limitations under the License.\n+\n+require 'cisco_node_utils' if Puppet.features.cisco_node_utils?\n+begin\n+  require 'puppet_x/cisco/autogen'\n+rescue LoadError # seen on master, not on agent\n+  # See longstanding Puppet issues #4248, #7316, #14073, #14149, etc. Ugh.\n+  require File.expand_path(File.join(File.dirname(__FILE__), '..', '..', '..',\n+                                     'puppet_x', 'cisco', 'autogen.rb'))\n+end\n+\n+Puppet::Type.type(:cisco_fabricpath_topology).provide(:nxapi) do\n+  desc 'The new NXAPI provider.'\n+\n+  confine feature: :cisco_node_utils\n+  defaultfor operatingsystem: :nexus\n+\n+  mk_resource_methods\n+\n+  TOPO_NON_BOOL_PROPS = [:member_vlans, :topo_name]\n+  TOPO_ALL_PROPS = TOPO_NON_BOOL_PROPS\n+\n+  PuppetX::Cisco::AutoGen.mk_puppet_methods(:non_bool, self, '@topo',\n+                                            TOPO_NON_BOOL_PROPS)\n+\n+  def self.properties_get(topo_id, t)\n+    debug \"Checking instance, topo #{topo_id}\"\n+    current_state = {\n+      topo_id:      topo_id,\n+      name:         topo_id,\n+      member_vlans: [],\n+      ensure:       :present,\n+    }\n+\n+    # Call node_utils getter for each property\n+    TOPO_NON_BOOL_PROPS.each do |prop|\n+      current_state[prop] = t.send(prop)\n+    end\n+    new(current_state)\n+  end # self.properties_get\n+\n+  def self.instances\n+    topos = []\n+    Cisco::FabricpathTopo.topos.each do |topo_id, t|\n+      topos << properties_get(topo_id, t)\n+    end\n+    topos\n+  end\n+\n+  def self.prefetch(resources)\n+    topos = instances\n+\n+    resources.keys.each do |id|\n+      provider = topos.find { |topo| topo.instance_name == id }\n+      resources[id].provider = provider unless provider.nil?\n+    end\n+  end # self.prefetch\n+\n+  def initialize(value={})\n+    super(value)\n+    @topo = Cisco::FabricpathTopo.topos[@property_hash[:name]]\n+    @property_flush = {}\n+    debug 'Created provider instance of cisco_fabricpath_topology.'\n+    debug \"property hash #{@property_hash}\"\n+    debug \"resource hash #{@resource}\"","path":"lib/puppet/provider/cisco_fabricpath_topology/nxapi.rb","position":81,"original_position":81,"commit_id":"2bff220d71bf087035b0b4ba0e1a3b831f861ddd","original_commit_id":"2bff220d71bf087035b0b4ba0e1a3b831f861ddd","user":{"login":"chrisvanheuveln","id":12087548,"avatar_url":"https://avatars.githubusercontent.com/u/12087548?v=3","gravatar_id":"","url":"https://api.github.com/users/chrisvanheuveln","html_url":"https://github.com/chrisvanheuveln","followers_url":"https://api.github.com/users/chrisvanheuveln/followers","following_url":"https://api.github.com/users/chrisvanheuveln/following{/other_user}","gists_url":"https://api.github.com/users/chrisvanheuveln/gists{/gist_id}","starred_url":"https://api.github.com/users/chrisvanheuveln/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chrisvanheuveln/subscriptions","organizations_url":"https://api.github.com/users/chrisvanheuveln/orgs","repos_url":"https://api.github.com/users/chrisvanheuveln/repos","events_url":"https://api.github.com/users/chrisvanheuveln/events{/privacy}","received_events_url":"https://api.github.com/users/chrisvanheuveln/received_events","type":"User","site_admin":false},"body":"Are these debugs still needed for shipping code?","created_at":"2016-02-08T15:10:33Z","updated_at":"2016-02-08T15:10:33Z","html_url":"https://github.com/cisco/cisco-network-puppet-module/pull/177#discussion_r52179825","pull_request_url":"https://api.github.com/repos/cisco/cisco-network-puppet-module/pulls/177","_links":{"self":{"href":"https://api.github.com/repos/cisco/cisco-network-puppet-module/pulls/comments/52179825"},"html":{"href":"https://github.com/cisco/cisco-network-puppet-module/pull/177#discussion_r52179825"},"pull_request":{"href":"https://api.github.com/repos/cisco/cisco-network-puppet-module/pulls/177"}}},"pull_request":{"url":"https://api.github.com/repos/cisco/cisco-network-puppet-module/pulls/177","id":58440860,"html_url":"https://github.com/cisco/cisco-network-puppet-module/pull/177","diff_url":"https://github.com/cisco/cisco-network-puppet-module/pull/177.diff","patch_url":"https://github.com/cisco/cisco-network-puppet-module/pull/177.patch","issue_url":"https://api.github.com/repos/cisco/cisco-network-puppet-module/issues/177","number":177,"state":"open","locked":false,"title":"Feature/fabricpath","user":{"login":"dcheriancisco","id":14809324,"avatar_url":"https://avatars.githubusercontent.com/u/14809324?v=3","gravatar_id":"","url":"https://api.github.com/users/dcheriancisco","html_url":"https://github.com/dcheriancisco","followers_url":"https://api.github.com/users/dcheriancisco/followers","following_url":"https://api.github.com/users/dcheriancisco/following{/other_user}","gists_url":"https://api.github.com/users/dcheriancisco/gists{/gist_id}","starred_url":"https://api.github.com/users/dcheriancisco/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dcheriancisco/subscriptions","organizations_url":"https://api.github.com/users/dcheriancisco/orgs","repos_url":"https://api.github.com/users/dcheriancisco/repos","events_url":"https://api.github.com/users/dcheriancisco/events{/privacy}","received_events_url":"https://api.github.com/users/dcheriancisco/received_events","type":"User","site_admin":false},"body":"Refactoring changes to support cisco_fabricpath_global, cisco_fabricpath_topology, cisco_vlan and cisco_interface","created_at":"2016-02-05T15:14:32Z","updated_at":"2016-02-08T15:10:33Z","closed_at":null,"merged_at":null,"merge_commit_sha":"95941035a1e525f91f0a4c91e971f744be179cda","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/cisco/cisco-network-puppet-module/pulls/177/commits","review_comments_url":"https://api.github.com/repos/cisco/cisco-network-puppet-module/pulls/177/comments","review_comment_url":"https://api.github.com/repos/cisco/cisco-network-puppet-module/pulls/comments{/number}","comments_url":"https://api.github.com/repos/cisco/cisco-network-puppet-module/issues/177/comments","statuses_url":"https://api.github.com/repos/cisco/cisco-network-puppet-module/statuses/2bff220d71bf087035b0b4ba0e1a3b831f861ddd","head":{"label":"dcheriancisco:feature/fabricpath","ref":"feature/fabricpath","sha":"2bff220d71bf087035b0b4ba0e1a3b831f861ddd","user":{"login":"dcheriancisco","id":14809324,"avatar_url":"https://avatars.githubusercontent.com/u/14809324?v=3","gravatar_id":"","url":"https://api.github.com/users/dcheriancisco","html_url":"https://github.com/dcheriancisco","followers_url":"https://api.github.com/users/dcheriancisco/followers","following_url":"https://api.github.com/users/dcheriancisco/following{/other_user}","gists_url":"https://api.github.com/users/dcheriancisco/gists{/gist_id}","starred_url":"https://api.github.com/users/dcheriancisco/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dcheriancisco/subscriptions","organizations_url":"https://api.github.com/users/dcheriancisco/orgs","repos_url":"https://api.github.com/users/dcheriancisco/repos","events_url":"https://api.github.com/users/dcheriancisco/events{/privacy}","received_events_url":"https://api.github.com/users/dcheriancisco/received_events","type":"User","site_admin":false},"repo":{"id":49244921,"name":"cisco-network-puppet-module","full_name":"dcheriancisco/cisco-network-puppet-module","owner":{"login":"dcheriancisco","id":14809324,"avatar_url":"https://avatars.githubusercontent.com/u/14809324?v=3","gravatar_id":"","url":"https://api.github.com/users/dcheriancisco","html_url":"https://github.com/dcheriancisco","followers_url":"https://api.github.com/users/dcheriancisco/followers","following_url":"https://api.github.com/users/dcheriancisco/following{/other_user}","gists_url":"https://api.github.com/users/dcheriancisco/gists{/gist_id}","starred_url":"https://api.github.com/users/dcheriancisco/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dcheriancisco/subscriptions","organizations_url":"https://api.github.com/users/dcheriancisco/orgs","repos_url":"https://api.github.com/users/dcheriancisco/repos","events_url":"https://api.github.com/users/dcheriancisco/events{/privacy}","received_events_url":"https://api.github.com/users/dcheriancisco/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/dcheriancisco/cisco-network-puppet-module","description":"","fork":true,"url":"https://api.github.com/repos/dcheriancisco/cisco-network-puppet-module","forks_url":"https://api.github.com/repos/dcheriancisco/cisco-network-puppet-module/forks","keys_url":"https://api.github.com/repos/dcheriancisco/cisco-network-puppet-module/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dcheriancisco/cisco-network-puppet-module/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dcheriancisco/cisco-network-puppet-module/teams","hooks_url":"https://api.github.com/repos/dcheriancisco/cisco-network-puppet-module/hooks","issue_events_url":"https://api.github.com/repos/dcheriancisco/cisco-network-puppet-module/issues/events{/number}","events_url":"https://api.github.com/repos/dcheriancisco/cisco-network-puppet-module/events","assignees_url":"https://api.github.com/repos/dcheriancisco/cisco-network-puppet-module/assignees{/user}","branches_url":"https://api.github.com/repos/dcheriancisco/cisco-network-puppet-module/branches{/branch}","tags_url":"https://api.github.com/repos/dcheriancisco/cisco-network-puppet-module/tags","blobs_url":"https://api.github.com/repos/dcheriancisco/cisco-network-puppet-module/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dcheriancisco/cisco-network-puppet-module/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dcheriancisco/cisco-network-puppet-module/git/refs{/sha}","trees_url":"https://api.github.com/repos/dcheriancisco/cisco-network-puppet-module/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dcheriancisco/cisco-network-puppet-module/statuses/{sha}","languages_url":"https://api.github.com/repos/dcheriancisco/cisco-network-puppet-module/languages","stargazers_url":"https://api.github.com/repos/dcheriancisco/cisco-network-puppet-module/stargazers","contributors_url":"https://api.github.com/repos/dcheriancisco/cisco-network-puppet-module/contributors","subscribers_url":"https://api.github.com/repos/dcheriancisco/cisco-network-puppet-module/subscribers","subscription_url":"https://api.github.com/repos/dcheriancisco/cisco-network-puppet-module/subscription","commits_url":"https://api.github.com/repos/dcheriancisco/cisco-network-puppet-module/commits{/sha}","git_commits_url":"https://api.github.com/repos/dcheriancisco/cisco-network-puppet-module/git/commits{/sha}","comments_url":"https://api.github.com/repos/dcheriancisco/cisco-network-puppet-module/comments{/number}","issue_comment_url":"https://api.github.com/repos/dcheriancisco/cisco-network-puppet-module/issues/comments{/number}","contents_url":"https://api.github.com/repos/dcheriancisco/cisco-network-puppet-module/contents/{+path}","compare_url":"https://api.github.com/repos/dcheriancisco/cisco-network-puppet-module/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dcheriancisco/cisco-network-puppet-module/merges","archive_url":"https://api.github.com/repos/dcheriancisco/cisco-network-puppet-module/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dcheriancisco/cisco-network-puppet-module/downloads","issues_url":"https://api.github.com/repos/dcheriancisco/cisco-network-puppet-module/issues{/number}","pulls_url":"https://api.github.com/repos/dcheriancisco/cisco-network-puppet-module/pulls{/number}","milestones_url":"https://api.github.com/repos/dcheriancisco/cisco-network-puppet-module/milestones{/number}","notifications_url":"https://api.github.com/repos/dcheriancisco/cisco-network-puppet-module/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dcheriancisco/cisco-network-puppet-module/labels{/name}","releases_url":"https://api.github.com/repos/dcheriancisco/cisco-network-puppet-module/releases{/id}","deployments_url":"https://api.github.com/repos/dcheriancisco/cisco-network-puppet-module/deployments","created_at":"2016-01-08T02:45:42Z","updated_at":"2016-01-14T15:42:41Z","pushed_at":"2016-02-05T16:43:55Z","git_url":"git://github.com/dcheriancisco/cisco-network-puppet-module.git","ssh_url":"git@github.com:dcheriancisco/cisco-network-puppet-module.git","clone_url":"https://github.com/dcheriancisco/cisco-network-puppet-module.git","svn_url":"https://github.com/dcheriancisco/cisco-network-puppet-module","homepage":null,"size":1827,"stargazers_count":0,"watchers_count":0,"language":"Ruby","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":"develop"}},"base":{"label":"cisco:develop","ref":"develop","sha":"59fbd3dbb0ce53a7be2ebf4ea93aa50e91e9f1d9","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":39565139,"name":"cisco-network-puppet-module","full_name":"cisco/cisco-network-puppet-module","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-puppet-module","description":"","fork":false,"url":"https://api.github.com/repos/cisco/cisco-network-puppet-module","forks_url":"https://api.github.com/repos/cisco/cisco-network-puppet-module/forks","keys_url":"https://api.github.com/repos/cisco/cisco-network-puppet-module/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cisco/cisco-network-puppet-module/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cisco/cisco-network-puppet-module/teams","hooks_url":"https://api.github.com/repos/cisco/cisco-network-puppet-module/hooks","issue_events_url":"https://api.github.com/repos/cisco/cisco-network-puppet-module/issues/events{/number}","events_url":"https://api.github.com/repos/cisco/cisco-network-puppet-module/events","assignees_url":"https://api.github.com/repos/cisco/cisco-network-puppet-module/assignees{/user}","branches_url":"https://api.github.com/repos/cisco/cisco-network-puppet-module/branches{/branch}","tags_url":"https://api.github.com/repos/cisco/cisco-network-puppet-module/tags","blobs_url":"https://api.github.com/repos/cisco/cisco-network-puppet-module/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cisco/cisco-network-puppet-module/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cisco/cisco-network-puppet-module/git/refs{/sha}","trees_url":"https://api.github.com/repos/cisco/cisco-network-puppet-module/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cisco/cisco-network-puppet-module/statuses/{sha}","languages_url":"https://api.github.com/repos/cisco/cisco-network-puppet-module/languages","stargazers_url":"https://api.github.com/repos/cisco/cisco-network-puppet-module/stargazers","contributors_url":"https://api.github.com/repos/cisco/cisco-network-puppet-module/contributors","subscribers_url":"https://api.github.com/repos/cisco/cisco-network-puppet-module/subscribers","subscription_url":"https://api.github.com/repos/cisco/cisco-network-puppet-module/subscription","commits_url":"https://api.github.com/repos/cisco/cisco-network-puppet-module/commits{/sha}","git_commits_url":"https://api.github.com/repos/cisco/cisco-network-puppet-module/git/commits{/sha}","comments_url":"https://api.github.com/repos/cisco/cisco-network-puppet-module/comments{/number}","issue_comment_url":"https://api.github.com/repos/cisco/cisco-network-puppet-module/issues/comments{/number}","contents_url":"https://api.github.com/repos/cisco/cisco-network-puppet-module/contents/{+path}","compare_url":"https://api.github.com/repos/cisco/cisco-network-puppet-module/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cisco/cisco-network-puppet-module/merges","archive_url":"https://api.github.com/repos/cisco/cisco-network-puppet-module/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cisco/cisco-network-puppet-module/downloads","issues_url":"https://api.github.com/repos/cisco/cisco-network-puppet-module/issues{/number}","pulls_url":"https://api.github.com/repos/cisco/cisco-network-puppet-module/pulls{/number}","milestones_url":"https://api.github.com/repos/cisco/cisco-network-puppet-module/milestones{/number}","notifications_url":"https://api.github.com/repos/cisco/cisco-network-puppet-module/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cisco/cisco-network-puppet-module/labels{/name}","releases_url":"https://api.github.com/repos/cisco/cisco-network-puppet-module/releases{/id}","deployments_url":"https://api.github.com/repos/cisco/cisco-network-puppet-module/deployments","created_at":"2015-07-23T12:06:48Z","updated_at":"2016-02-04T20:25:20Z","pushed_at":"2016-02-08T14:52:34Z","git_url":"git://github.com/cisco/cisco-network-puppet-module.git","ssh_url":"git@github.com:cisco/cisco-network-puppet-module.git","clone_url":"https://github.com/cisco/cisco-network-puppet-module.git","svn_url":"https://github.com/cisco/cisco-network-puppet-module","homepage":null,"size":2574,"stargazers_count":11,"watchers_count":11,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":28,"mirror_url":null,"open_issues_count":4,"forks":28,"open_issues":4,"watchers":11,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/cisco/cisco-network-puppet-module/pulls/177"},"html":{"href":"https://github.com/cisco/cisco-network-puppet-module/pull/177"},"issue":{"href":"https://api.github.com/repos/cisco/cisco-network-puppet-module/issues/177"},"comments":{"href":"https://api.github.com/repos/cisco/cisco-network-puppet-module/issues/177/comments"},"review_comments":{"href":"https://api.github.com/repos/cisco/cisco-network-puppet-module/pulls/177/comments"},"review_comment":{"href":"https://api.github.com/repos/cisco/cisco-network-puppet-module/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/cisco/cisco-network-puppet-module/pulls/177/commits"},"statuses":{"href":"https://api.github.com/repos/cisco/cisco-network-puppet-module/statuses/2bff220d71bf087035b0b4ba0e1a3b831f861ddd"}}}}