import os
import sys
print os.environ["BUILD_USER"], "deploying to", os.environ["target_host"]
# only some users are allowed to deploy to servers "MMM"
mmm_users = ["UUU"]
if os.environ["target_host"] != "MMM" or os.environ["BUILD_USER"] in mmm_users:
print "access granted"
else:
print "access denied"
sys.exit(-1)