If release-notes-sles is existed then it is not openSUSE Factory but SLE, hence do not check totest and openSUSE-release.rpm on it. And add try/except protection in get_binary_version otherwise it will crashes in case the package is not existed.