git://git.onelab.eu
/
plcapi.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
9dee03e
)
Return base64 encoded image.
author
Marta Carbone
<marta@prova.iet.unipi.it>
Wed, 22 Apr 2009 15:41:05 +0000
(15:41 +0000)
committer
Marta Carbone
<marta@prova.iet.unipi.it>
Wed, 22 Apr 2009 15:41:05 +0000
(15:41 +0000)
PLC/Methods/GetDummyBoxMedium.py
patch
|
blob
|
history
diff --git
a/PLC/Methods/GetDummyBoxMedium.py
b/PLC/Methods/GetDummyBoxMedium.py
index
2fb4e55
..
785c065
100644
(file)
--- 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
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':
# 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
# 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
# Start the generation of the image
# Generate a new key
@@
-164,5
+161,5
@@
class GetDummyBoxMedium(Method):
dummybox.sync()
# return the file
dummybox.sync()
# return the file
- return IMAGE_NAME
+
#
return IMAGE_NAME
return base64.b64encode(file(IMAGE_NAME).read())
return base64.b64encode(file(IMAGE_NAME).read())