def rename_key(pki_dir, id_, new_id):
 oldkey = os.path.join(pki_dir, 'minions', id_)
 newkey = os.path.join(pki_dir, 'minions', new_id)
 if os.path.isfile(oldkey):
  os.rename(oldkey, newkey)

def rename_key ( pki_dir , id_ , new_id ) : oldkey = os . path . join ( pki_dir , 'minions' , id_ ) newkey = os . path . join ( pki_dir , 'minions' , new_id ) if os . path . isfile ( oldkey ) : os . rename ( oldkey , newkey )
rename a key .