title: boto instance.__dict__['tags']['Name'] output issue
body: <p><strong>UPDATE:</strong></p>
  
  <hr>
  
  <p><strong>I did what was suggested below, however, I was still getting an KeyError:'Name' in the output, even though the output was correct.</strong></p>
  
  <p>This was the output:
  </p>
  
  <pre><code>us-west-1 EC2Connection:
  ec2.us-west-1.amazonaws.com 
  Showing all of your current instances 
  Proxy-44-1000-Enrollments 
  Proxy-45-1000-Enrollments 
  Proxy-48-1000-Enrollments 
  Proxy-49-1000-Enrollments 
  Proxy-59-1000-Enrollments 
  Proxy-67-1000-Enrollments 
  
  Traceback (most recent call last): File "/Users/xxxxx/xxxx/boto/instanceid.py", 
  line 43, in &lt;module&gt; print "\t%s" % (instance.tags['Name']) if instance.state ==
  'running' else instance.state KeyError: 'Name'
  </code></pre>
  
  <hr>
  
  <p><strong>Initial Question:</strong></p>
  
  <p>I'm trying to dump out a list of Instance ID's along with their "Name" tag from AWS using boto.  I found online a method that one can attach to the instance object, called <code>__dict__</code>, which seemed to work well, however, I wanted to pull out the "name" tag only when using this method, but I keep getting an error "Key Error:'Name'"</p>
  
  <p>Basically, this code works:</p>
  
  <pre class="lang-py prettyprint-override"><code># Creating connection object to EC2
  conn = boto.connect_ec2()
  
  regions = boto.ec2.regions()
  
  # the 5 element in the array is "us-west-1" and setting the object to connect
  us = regions[5]
  print us.name
  conn_us = us.connect()
  print conn_us
  
  filters = {'key-name' : 'misc-key'}
  
  all_inst = conn_us.get_all_instances(filters=filters)
  
  print "Showing all of your current instances" 
  for res in all_inst: 
      # each reservation have a instance: 
      for instance in res.instances: 
          print "\t%s: \t%s" % (instance.id, instance.__dict__['tags'])
  </code></pre>
  
  <p>The output is hoky tho:</p>
  
  <pre><code>us-west-1
  EC2Connection:ec2.us-west-1.amazonaws.com
  Showing all of your current instances
      i-xxxxxxxx:     {u'Name': u'Proxy-xx-1000-Enrollments'}
      i-xxxxxxxx:     {u'Name': u'Proxy-xx-1000-Enrollments'}
      i-xxxxxxxx:     {u'Name': u'Proxy-xx-1000-Enrollments'}
      i-xxxxxxxx:     {u'Name': u'Proxy-xx-1000-Enrollments'}
      i-xxxxxxxx:     {u'Name': u'Proxy-xx-1000-Enrollments'}
  </code></pre>
  
  <p>When I make a change to the <code>__dict__</code> method to "pull" out "name" only, it works (or seems to work, but throws an error:</p>
  
  <p>Here is the code change:</p>
  
  <pre class="lang-py prettyprint-override"><code>print "\t%s: \t%s" % (instance.id, instance.__dict__['tags']['Name'])
  </code></pre>
  
  <p>Here is the output:</p>
  
  <pre><code>us-west-1
  EC2Connection:ec2.us-west-1.amazonaws.com
  Showing all of your current instances
      i-xxxxxxxx:     Proxy-xx-1000-Enrollments
      i-xxxxxxxx:     Proxy-xx-1000-Enrollments
      i-xxxxxxxx:     Proxy-xx-1000-Enrollments
      i-xxxxxxxx:     Proxy-xx-1000-Enrollments
      i-xxxxxxxx:     Proxy-xx-1000-Enrollments
      i-xxxxxxxx:     Proxy-xx-1000-Enrollments
  
  Traceback (most recent call last):
    File "/Users/xxxxxx/xxx.xxx/boto/instanceid.py", line 43, in &lt;module&gt;
      print "\t%s: \t%s" % (instance.id, instance.__dict__['tags']["Name"])
  KeyError: 'Name'
  </code></pre>
  
  <p>I prefer this output, <strong>WITHOUT</strong> the error - can anyone tell me what I'm doing wrong here?</p>
  
  <p>Thanks</p>