示例#1
0
 def _prepareHttpServer(self):
     if config.getboolean('vars', 'http_enable'):
         try:
             from vdsm.rpc.http import Server
             from vdsm.rpc.http import HttpDetector
         except ImportError:
             self.log.error('Unable to load the http server module. '
                            'Please make sure it is installed.')
         else:
             http_server = Server(self, self.log)
             self.servers['http'] = http_server
             http_detector = HttpDetector(http_server)
             self._acceptor.add_detector(http_detector)
示例#2
0
def test_http_detector_should_reject_stomp_commands(data):
    assert not HttpDetector(server=None).detect(data)
示例#3
0
def test_http_detector_should_reject_non_http_protocol(data):
    assert not HttpDetector(server=None).detect(data)