#NEWLINE# def get_new_token( self ) : #NEWLINE# #INDENT# '\n        Get a new token from the internal metadata service.\n\n        :return:  Dictionary containing token information\n        :rtype:   ``dict``\n        ' #NEWLINE# path = '/instance/service-accounts/default/token' #NEWLINE# ( http_code , http_reason , token_info ) = _get_gce_metadata ( path ) #NEWLINE# if ( token_info == httplib . NOT_FOUND ) : #NEWLINE# #INDENT# raise ValueError ( 'Service Accounts are not enabled for this GCE instance.' ) #NEWLINE# #UNINDENT# if ( http_code != httplib . OK ) : #NEWLINE# #INDENT# raise ValueError ( ( "Internal GCE Authorization failed: '%s'" % str ( http_reason ) ) ) #NEWLINE# #UNINDENT# token_info = json . loads ( token_info ) #NEWLINE# if ( 'expires_in' in token_info ) : #NEWLINE# #INDENT# expire_time = ( _utcnow ( ) + datetime . timedelta ( seconds = token_info [ 'expires_in' ] ) ) #NEWLINE# token_info [ 'expire_time' ] = _utc_timestamp ( expire_time ) #NEWLINE# #UNINDENT# return token_info