/usr/lib/python3/dist-packages/provisioningserver/pserv_services/image.py is in python3-maas-provisioningserver 2.0.0~beta3+bzr4941-0ubuntu1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 | # Copyright 2015 Canonical Ltd. This software is licensed under the
# GNU Affero General Public License version 3 (see the file LICENSE).
"""Twisted Application Plugin for the MAAS Boot Image server"""
__all__ = [
"BootImageEndpointService",
]
from twisted.application.internet import StreamServerEndpointService
from twisted.web.resource import Resource
from twisted.web.server import Site
from twisted.web.static import File
class BootImageEndpointService(StreamServerEndpointService):
"""Service for serving images to the TFTP server via HTTP
:ivar site: The twisted site resource
"""
def __init__(self, resource_root, endpoint):
"""
:param resource_root: The root directory for the Image server.
:param endpoint: The endpoint on which the server should listen.
"""
resource = Resource()
resource.putChild(b'images', File(resource_root))
self.site = Site(resource)
super(BootImageEndpointService, self).__init__(endpoint, self.site)
|