{"action":"created","issue":{"url":"https://api.github.com/repos/mininet/mininet/issues/503","labels_url":"https://api.github.com/repos/mininet/mininet/issues/503/labels{/name}","comments_url":"https://api.github.com/repos/mininet/mininet/issues/503/comments","events_url":"https://api.github.com/repos/mininet/mininet/issues/503/events","html_url":"https://github.com/mininet/mininet/issues/503","id":68805307,"number":503,"title":"Bug in getNodeByName()/get() in net.py","user":{"login":"5hizzle","id":2471238,"avatar_url":"https://avatars.githubusercontent.com/u/2471238?v=3","gravatar_id":"","url":"https://api.github.com/users/5hizzle","html_url":"https://github.com/5hizzle","followers_url":"https://api.github.com/users/5hizzle/followers","following_url":"https://api.github.com/users/5hizzle/following{/other_user}","gists_url":"https://api.github.com/users/5hizzle/gists{/gist_id}","starred_url":"https://api.github.com/users/5hizzle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/5hizzle/subscriptions","organizations_url":"https://api.github.com/users/5hizzle/orgs","repos_url":"https://api.github.com/users/5hizzle/repos","events_url":"https://api.github.com/users/5hizzle/events{/privacy}","received_events_url":"https://api.github.com/users/5hizzle/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-04-15T23:00:30Z","updated_at":"2015-04-16T00:49:34Z","closed_at":null,"body":"Hi\r\nI have been getting KeyErrors when retrieving Node objects from my Mininet instance 'net'.\r\nHere is the code passage of interest\r\n\r\n    def _makeRouter(self):\r\n        info('*** Adding Router\\n')\r\n        router = self.net.addSwitch('s%d' % self.sitePrefix, cls=OVSSwitch, protocols='OpenFlow13')\r\n        print self.net.nameToNode\r\n        print router\r\n        print 's1'\r\n        print self.net.nameToNode['s1'].IP()\r\n        print self.net.nameToNode[router].IP()\r\n\r\nand here is the console output for these lines\r\n\r\n*** Adding Router\r\n{'e99': &#60;OVSSwitch e99: lo:127.0.0.1 pid=11133&#62; , 'h11': &#60;Host h11:  pid=11138&#62; , 's1': &#60;OVSSwitch s1: lo:127.0.0.1 pid=11141&#62; , 'floodlight_controller': &#60;RemoteController floodlight_controller: 192.168.56.1:6653 pid=11125&#62; }\r\ns1\r\ns1\r\n127.0.0.1\r\nTraceback (most recent call last):\r\n...\r\n  File \"./autonaas_topo.py\", line 72, in _makeRouter\r\n    print self.net.nameToNode[router].IP()\r\nKeyError: &#60;OVSSwitch s1: lo:127.0.0.1 pid=11141&#62; \r\n\r\nApparently I can only use self.net.nameToNode['s1'] to retrieve Switch s1 while the methods in the title are failing...\r\n\r\nCan this be fixed?\r\n\r\nBest,\r\nDamo"},"comment":{"url":"https://api.github.com/repos/mininet/mininet/issues/comments/93607849","html_url":"https://github.com/mininet/mininet/issues/503#issuecomment-93607849","issue_url":"https://api.github.com/repos/mininet/mininet/issues/503","id":93607849,"user":{"login":"lantz","id":744379,"avatar_url":"https://avatars.githubusercontent.com/u/744379?v=3","gravatar_id":"","url":"https://api.github.com/users/lantz","html_url":"https://github.com/lantz","followers_url":"https://api.github.com/users/lantz/followers","following_url":"https://api.github.com/users/lantz/following{/other_user}","gists_url":"https://api.github.com/users/lantz/gists{/gist_id}","starred_url":"https://api.github.com/users/lantz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lantz/subscriptions","organizations_url":"https://api.github.com/users/lantz/orgs","repos_url":"https://api.github.com/users/lantz/repos","events_url":"https://api.github.com/users/lantz/events{/privacy}","received_events_url":"https://api.github.com/users/lantz/received_events","type":"User","site_admin":false},"created_at":"2015-04-16T00:49:34Z","updated_at":"2015-04-16T00:49:34Z","body":"p.s. Recall that `print x` is the same as `print str(x)` if `x` is an object."}}