From: Marta Carbone Date: Wed, 22 Apr 2009 15:41:05 +0000 (+0000) Subject: Return base64 encoded image. X-Git-Tag: PLCAPI-4.3-11~4 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=99e3061f7bad73db49c2917986e7f97ee38bfb53;p=plcapi.git Return base64 encoded image. --- diff --git a/PLC/Methods/GetDummyBoxMedium.py b/PLC/Methods/GetDummyBoxMedium.py index 2fb4e55f..785c0654 100644 --- a/PLC/Methods/GetDummyBoxMedium.py +++ b/PLC/Methods/GetDummyBoxMedium.py @@ -109,6 +109,7 @@ class GetDummyBoxMedium(Method): raise PLCInvalidArgument, "No primary network configured on %s" % dummybox_hostname dummybox = interface_info + dummybox['hostname']=dummybox_hostname # Select the base image, default to bin image if type != 'iso': @@ -120,10 +121,6 @@ class GetDummyBoxMedium(Method): # Permission checks assert self.caller is not None - if 'admin' not in self.caller['roles']: - if dummybox['site_id'] not in self.caller['site_ids']: - raise PLCPermissionDenied, "Not allowed to generate an iso image for %s %s" % \ - (dummybox['hostname'], dummybox_id) # Start the generation of the image # Generate a new key @@ -164,5 +161,5 @@ class GetDummyBoxMedium(Method): dummybox.sync() # return the file - return IMAGE_NAME + #return IMAGE_NAME return base64.b64encode(file(IMAGE_NAME).read())