From 468bc0104f3810a91e66b565485bc93ebfc23033 Mon Sep 17 00:00:00 2001 From: Marc Fiuczynski Date: Mon, 11 Feb 2008 20:44:51 +0000 Subject: [PATCH] combine node-preview and node-floppy --- PLC/Methods/GetBootMedium.py | 35 +++++++++++++---------------------- 1 file changed, 13 insertions(+), 22 deletions(-) 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': -- 2.43.0