title: Replace value in JSON file for key which can be nested by n levels
body: <p>I have JSON that looks like this:</p>
  
  <pre><code>{
  "ROLE_NAME": {
      "FOO": {
          "download_url": "http: //something.staging/12345/buzz.zip"
      },
      "BAR": {
          "download_url": "http: //something.staging/12345/fizz.zip"
      },
      "download_url": "http: //something.staging/12345/fizzbuzz.zip",
      "db_name": "somedb",
      "db_server": "dbserver.staging.dmz",
      "plugin": {
          "server_url": "http: //lab.staging.corp/server/"
      }
  }
  }
  </code></pre>
  
  <p>I wrote a bit of python that replaces the "download_url" k:v with a new value (i.e. new download_url). Unfortunately it only replaces one of the three download_urls in that json snippet. I understand why, but am having a little difficulty getting the solution, and so I am here asking for help.</p>
  
  <p>The entire json object is "data"
  So I do something like this:</p>
  
  <pre><code>data["ROLE_NAME"]["download_url"] = download_url
  </code></pre>
  
  <p>Where download_url is a new value I have assigned to that variable
  What I need to do is for any key called ["download_url"] then update it, rather than the one I have specified at the layer I am going to.</p>
  
  <p>Some of my code to help:</p>
  
  <p>I take some values obtained earlier in my code and build a url which returns a response. I extract a value from the response which will be used to build the value of download_url</p>
  
  <pre><code>buildinfo_url = "http://something.staging/guestAuth/app/rest/builds/?locator=buildType:%s,tags:%s,branch:branched:any" % (
      bt_number,
      list_json_load[role_name][0]['tag']
  )
  </code></pre>
  
  <p>Send HTTP request</p>
  
  <pre><code>client = httplib2.Http()
  response, xml = client.request(buildinfo_url)
  </code></pre>
  
  <p>Extract some value from the response xml and set download_url variable</p>
  
  <pre><code>doc = ElementTree.fromstring(xml)
  for id in doc.findall('build'):
      build_id = "%s" % (id.attrib['id'])
  try:
      download_url = "http://something.staging/guestAuth/repository/download/%s/%s:id/%s" % (
          bt_number,
          build_id,
          build_artifact_zip
      )
      data[role_name]["download_url"] = download_url
  except NameError:
      print "something"
  </code></pre>
  
  <p>I think I should be recursively searching and updating</p>