예제 #1
0
파일: base.py 프로젝트: blkart/fuel-web
 def create_master_node_settings(self):
     self.master_node_settings = {
         'master_node_uid': str(uuid.uuid4()),
     }
     self.master_node_settings.update(self.master_node_settings_template)
     MasterNodeSettings.create(self.master_node_settings)
     self.db.commit()
예제 #2
0
파일: base.py 프로젝트: blkart/fuel-web
 def create_master_node_settings(self):
     self.master_node_settings = {
         'master_node_uid': str(uuid.uuid4()),
     }
     self.master_node_settings.update(self.master_node_settings_template)
     MasterNodeSettings.create(self.master_node_settings)
     self.db.commit()
예제 #3
0
    def test_master_node_in_headers(self, requests_post):
        requests_post.return_value = Mock(status_code=200)
        sender = StatsSender()
        url = ''
        data = {}
        master_node_uid = 'xxx'
        MasterNodeSettings.create({'master_node_uid': master_node_uid})

        sender.send_data_to_url(url=url, data={})
        requests_post.assert_called_once_with(
            url,
            headers={'content-type': 'application/json',
                     'master-node-uid': master_node_uid},
            data=json.dumps(data),
            timeout=settings.COLLECTOR_RESP_TIMEOUT)
예제 #4
0
    def test_master_node_in_headers(self, requests_post):
        requests_post.return_value = Mock(status_code=200)
        sender = StatsSender()
        url = ''
        data = {}
        master_node_uid = 'xxx'
        MasterNodeSettings.create({'master_node_uid': master_node_uid})

        sender.send_data_to_url(url=url, data={})
        requests_post.assert_called_once_with(
            url,
            headers={
                'content-type': 'application/json',
                'master-node-uid': master_node_uid
            },
            data=json.dumps(data),
            timeout=settings.COLLECTOR_RESP_TIMEOUT)