Ejemplo n.º 1
0
def validateArguments( options, args ):
    if options.verbose:
        rootCMSYAAT = Logging.getLogger('CMSYAAT')
        rootCMSYAAT.setLevel( DEBUG ) 
    return True
Ejemplo n.º 2
0
"""
Internal helpers to talk to the request manager
"""

import json
import httplib
import urllib
import datetime
from httplib import HTTPException
from CMSYAAT.Utilities.Proxy import requireProxy
from CMSYAAT.Utilities import Logging
logging = Logging.getLogger('CMSYAAT.ReqMgrImpl')

from WMCore.Services.Requests import Requests, JSONRequests

class RequestManagerImpl:
    """
    Not a public interface, this is gross for now
    """
    def __init__(self):
        self.headers = {'User-agent':                                        
                            "CMSYAAT 1.0 github.com/PerilousApricot/CMSYAAT"}
        pass

    def checkStatusOrComplain( self, wantedStatus, retval, status, reason ):
        if status != wantedStatus:
            raise RuntimeError, ("Got HTTP code %s, expected %s \n" +
                                 "reason: %s \n" +
                                 "data: %s \n") % (status, wantedStatus,
                                                    reason, retval )