def get_openshift_secret_key():
 token = os.getenv('OPENSHIFT_SECRET_TOKEN')
 if (token is not None):
  return token
 name = os.getenv('OPENSHIFT_APP_NAME')
 uuid = os.getenv('OPENSHIFT_APP_UUID')
 if ((name is not None) and (uuid is not None)):
  nameuuid = '-'.join((name, uuid))
  return hashlib.sha256(nameuuid.encode('utf-8')).hexdigest()
 sys.stderr.write(('OPENSHIFT WARNING: Using default values for secure variables, ' + 'please set OPENSHIFT_SECRET_TOKEN!'))
 raise ValueError('No key available')

def get_openshift_secret_key ( ) : token = os . getenv ( 'OPENSHIFT_SECRET_TOKEN' ) if ( token is not None ) : return token name = os . getenv ( 'OPENSHIFT_APP_NAME' ) uuid = os . getenv ( 'OPENSHIFT_APP_UUID' ) if ( ( name is not None ) and ( uuid is not None ) ) : nameuuid = '-' . join ( ( name , uuid ) ) return hashlib . sha256 ( nameuuid . encode ( 'utf-8' ) ) . hexdigest ( ) sys . stderr . write ( ( 'OPENSHIFT WARNING: Using default values for secure variables, ' + 'please set OPENSHIFT_SECRET_TOKEN!' ) ) raise ValueError ( 'No key available' )
tries to get secred token from openshift environment .