<s> from core . models import * <EOL> def get_creds ( user = None , slice = None , site = None , deployment = None ) : <EOL> if ( not user or not site ) : <EOL> raise Exception ( '<STR_LIT>' ) <EOL> cred = UserCredential . objects . filter ( user = user ) <EOL> if ( not cred ) : <EOL> cred = SiteCredential . objects . filter ( site = site ) <EOL> if ( cred ) : <EOL> env = '<STR_LIT>' % ( cred . key_id , cred . enc_value ) <EOL> else : <EOL> env = '<STR_LIT>' <EOL> return env </s>
