'Ensure we can\'t copy from swift+config'

@skip_if_disabled
def test_copy_from_swift_config(self):

    self.cleanup()
    self.start_servers(**self.__dict__.copy())
    headers = {'X-Image-Meta-Name': 'copied', 'X-Image-Meta-disk_format': 'raw', 'X-Image-Meta-container_format': 'ovf', 'X-Image-Meta-Is-Public': 'True', 'X-Glance-API-Copy-From': 'swift+config://xxx'}
    path = ('http://%s:%d/v1/images' % ('127.0.0.1', self.api_port))
    http = httplib2.Http()
    (response, content) = http.request(path, 'POST', headers=headers)
    self.assertEqual(http_client.BAD_REQUEST, response.status, content)
    expected = "External    sources    are    not    supported:    'swift+config://xxx'"
    msg = ('expected    "%s"    in    "%s"' % (expected, content))
    self.assertIn(expected, content.decode(), msg)
    self.stop_servers()
