added raise NoCredentialException, put common code in a function
added raise NoCredentialException, put common code in a function

bbockelm/glideinWMS,bbockelm/glideinWMS,bbockelm/glideinWMS,bbockelm/glideinWMS