Пример #1
0
    def remote(self, server='localhost:8000'):
        ''' 
        Establishes identities for GUS and Code collab for proxy ticket update
        and code review creation.  Code collab client cannot activate review for
        remote.
        '''
        gus = BacklogClient()
        session_id = gus.session_id()
        cc = CodeCollabClient()
        author = cc.get_current_user()
        mrhat = MrHat()
        creds = mrhat.get_current_creds()
        commit = self.buildCommit()
        commit['gus_session'] = session_id
        commit['collab_user'] = author
        commit['jenkins_user'] = creds[0]
        commit['jenkins_token'] = creds[1]

        conn = httplib.HTTPConnection(server)
        head = {
            'Content-Type': 'application/json',
            'Accept': 'application/json'
        }
        conn.request('POST', '/service/post', json.dumps(commit), head)
        response = conn.getresponse()
        data = response.read()
        conn.close()

        print data
Пример #2
0
 def remote(self, server='localhost:8000'):
     ''' 
     Establishes identities for GUS and Code collab for proxy ticket update
     and code review creation.  Code collab client cannot activate review for
     remote.
     '''
     gus = BacklogClient()
     session_id = gus.session_id()
     cc = CodeCollabClient()
     author = cc.get_current_user()
     mrhat = MrHat()
     creds = mrhat.get_current_creds()
     commit = self.buildCommit()
     commit['gus_session'] = session_id
     commit['collab_user'] = author
     commit['jenkins_user'] = creds[0]
     commit['jenkins_token'] = creds[1]
     
     conn = httplib.HTTPConnection(server)
     head = {
         'Content-Type' : 'application/json',
         'Accept'       : 'application/json'
     }
     conn.request('POST','/service/post', json.dumps(commit), head)
     response = conn.getresponse()
     data = response.read()
     conn.close()
     
     print data