use openshift env to determine python version.
execfile() has been removed from python3 use exec instead for both py2 and py3.
env APPDIR not exist, use OPENSHIFT_REPO_DIR instead.