def pub_change_slice_controller(self, slice_id, controller_url, **kwargs):
    slice_id   = slice_id.replace(":","_")
    slice_id   = slice_id.replace("name_","nam__")
    '''
    Changes the slice controller url.
    '''
    if slice_id not in self.slice_info_dict:
      self._log.info("Slice is probably not started yet, doing nothing...")
      return ""
      #raise Exception("Something went wrong with the fs recovery")
    #retrieve updated dict as a json file from foam db folder
    filedir = './opt/ofelia/ofam/local/db'
    filename = os.path.join(filedir, 'expedient_slices_info.json')
    if os.path.isfile(filename):
      f = open(filename, 'r')
      self.slice_info_dict = json.load(f)
      f.close()
    else:
      self._log.info("Slice is probably not started yet, doing nothing...")
      return ""
    slice_of_rspec = create_ofv3_rspec(slice_id, self.slice_info_dict[slice_id]['project_name'], 
                                       self.slice_info_dict[slice_id]['project_desc'],
                                       self.slice_info_dict[slice_id]['slice_name'],
                                       self.slice_info_dict[slice_id]['slice_desc'], controller_url,
                                       self.slice_info_dict[slice_id]['owner_email'],
                                       self.slice_info_dict[slice_id]['owner_password'],
                                       self.slice_info_dict[slice_id]['switch_slivers'],
                                       self.create_slice_fs(self.slice_info_dict[slice_id]['switch_slivers']))
    self.slice_info_dict[slice_id]['controller_url'] = controller_url
    slice_urn = "urn:publicid:IDN+openflow:foam:"+ str(THIS_SITE_TAG) +"+slice+" + "id_" + str(slice_id) + "name_" + str(self.slice_info_dict[slice_id]['slice_name'])
    creds = [] #creds are not needed at least for now: to be fixed
    user_info = {}
    user_info["urn"] = "urn:publicid:IDN+openflow:foam"+ str(THIS_SITE_TAG) +"+ch+" + "user+" + str(self.slice_info_dict[slice_id]['owner_email']) #temp hack
    user_info["email"] = str(self.slice_info_dict[slice_id]['owner_email'])
    if GeniDB.sliceExists(slice_urn):
      sliv_urn = GeniDB.getSliverURN(slice_urn)
    else:
      raise Exception("Something went wrong with the fs recovery, slice does not exist!")
    sliver = GeniDB.getSliverObj(sliv_urn) 
    is_allocated_by_FV = GeniDB.getEnabled(sliv_urn)
    was_allocated_by_FV = is_allocated_by_FV
    try:
      #old_exp_shutdown_success = legexpgapi2_apih.pub_Shutdown(slice_urn, creds, [])
      old_exp_shutdown_success = self.priv_DeleteSliver(slice_urn, creds, [])
    except Exception, e:
      import traceback
      traceback.print_exc()
      raise Exception("Exception while trying to shutdown old slice!")
    if old_exp_shutdown_success == False:
      raise Exception("Old slice could not be shutdown")
    if was_allocated_by_FV == True:
      #create new slice and automatically approve since already approved (only controller changes)
      creation_result = self.priv_CreateSliver(slice_urn, creds, slice_of_rspec, user_info, True, None)
    else:
      creation_result = self.priv_CreateSliver(slice_urn, creds, slice_of_rspec, user_info, False, None)

    #store updated dict as a json file in foam db folder
    filedir = './opt/ofelia/ofam/local/db'
    filename = os.path.join(filedir, 'expedient_slices_info.json')
    tempfilename = os.path.join(filedir, 'expedient_slices_info.json.temp.' + str(time.time()) + str(random.randint(1,10000)))
    f = open(tempfilename, 'w')
    json.dump(self.slice_info_dict, f)
    f.close()
    os.rename(tempfilename, filename)
    
    return ""

  #modified, to be checked
  #@check_user
  #@check_fv_set
  #@rpcmethod(signature=['array'])
dataset/ETHPy150Open fp7-ofelia/ocf/ofam/src/src/foam/api/legacyexpedientapi.py/AMLegExpAPI.pub_change_slice_controller/original