From: Marc Fiuczynski Date: Mon, 11 Feb 2008 20:44:51 +0000 (+0000) Subject: combine node-preview and node-floppy X-Git-Tag: PLCAPI-4.2-3~5 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=468bc0104f3810a91e66b565485bc93ebfc23033;p=plcapi.git combine node-preview and node-floppy --- diff --git a/PLC/Methods/GetBootMedium.py b/PLC/Methods/GetBootMedium.py index 708b851..157858f 100644 --- a/PLC/Methods/GetBootMedium.py +++ b/PLC/Methods/GetBootMedium.py @@ -327,28 +327,19 @@ class GetBootMedium(Method): ### return the generic medium content as-is, just base64 encoded return base64.b64encode(file(generic_path).read()) - ### floppy preview - if action == 'node-preview': - floppy = self.floppy_contents (node,False) - if filename: - try: - file(filename,'w').write(floppy) - except: - raise PLCPermissionDenied, "Could not write into %s"%filename - return filename - else: - return floppy - - if action == 'node-floppy': - floppy = self.floppy_contents (node,True) - if filename: - try: - file(filename,'w').write(floppy) - except: - raise PLCPermissionDenied, "Could not write into %s"%filename - return filename - else: - return floppy + ### config file preview or regenerated + if action == 'node-preview' or action == 'node-floppy': + if action == 'node-preview': bo=False + else bo=True + floppy = self.floppy_contents (node,bo) + if filename: + try: + file(filename,'w').write(floppy) + except: + raise PLCPermissionDenied, "Could not write into %s"%filename + return filename + else: + return floppy ### we're left with node-iso and node-usb if action == 'node-iso' or action == 'node-usb':