If you need to keep repository in some specific version.
i.e. if the latest is 2013.09, and you want to stay in 2013.03, you can change the repository file to some specific version.
#yum clean metadata
#yum search kernel-devel --showduplicates
Another tips regarding Amazon Linux is: if you use python platform.dist() to check distribution information. You will get empty string. However, I think you can use os.path.exists("/etc/image") to check if it is a AmazonLinux. That file contains detail information and it should only exists in AmazonLinux.