Porting commons_link.py from compat to core

Change-Id: Ibfdc3e24b999611327a2d057422bc84e62c3144a
Merge "Porting commons_link.py from compat to core"