From 1eac1c9cdb5d684e21694138ca26157bda6d2494 Mon Sep 17 00:00:00 2001 From: Stephan Schwär Date: Thu, 29 Oct 2020 14:06:50 +0900 Subject: Cleanup debug code --- src/main/java/org/openslx/util/vm/OvfConfig.java | 16 +++------------- src/main/java/org/openslx/util/vm/OvfMetaData.java | 12 ++---------- src/main/java/org/openslx/util/vm/VmMetaData.java | 2 +- 3 files changed, 6 insertions(+), 24 deletions(-) diff --git a/src/main/java/org/openslx/util/vm/OvfConfig.java b/src/main/java/org/openslx/util/vm/OvfConfig.java index a7a5c75..e48caa8 100644 --- a/src/main/java/org/openslx/util/vm/OvfConfig.java +++ b/src/main/java/org/openslx/util/vm/OvfConfig.java @@ -21,9 +21,9 @@ import org.w3c.dom.Document; import org.xml.sax.SAXException; /** - * Class handling the parsing of a .ovf machine description file - * For now only a dummy for conversion and will be replaced in - * the image upload flow after converting the ovf to vmx. + * Class handling the parsing of a .ovf machine description file For now only a + * dummy for conversion and will be replaced in the image upload flow after + * converting the ovf to vmx. */ public class OvfConfig { private static final Logger LOGGER = Logger.getLogger(OvfConfig.class); @@ -36,13 +36,11 @@ public class OvfConfig { private Document doc = null; public OvfConfig(File file) throws IOException, UnsupportedVirtualizerFormatException { - LOGGER.debug("Entering OvfConfig class creation"); doc = XmlHelper.parseDocumentFromStream(new FileInputStream(file)); doc = XmlHelper.removeFormattingNodes(doc); if (doc == null) throw new UnsupportedVirtualizerFormatException( "Could not create DOM from given ovf machine configuration file!"); - LOGGER.debug("DOM creation worked"); init(); } @@ -53,17 +51,9 @@ public class OvfConfig { * @throws UnsupportedVirtualizerFormatException */ private void init() throws UnsupportedVirtualizerFormatException { - LOGGER.debug("Entering OvfConfig init"); if (Util.isEmptyString(getDisplayName())) { throw new UnsupportedVirtualizerFormatException("Machine doesn't have a name"); } - LOGGER.debug(getDisplayName()); - // try { - // setHdds(); - // } catch ( XPathExpressionException e ) { - // LOGGER.debug( "Could not initialize VBoxConfig", e ); - // return; - // } } /** diff --git a/src/main/java/org/openslx/util/vm/OvfMetaData.java b/src/main/java/org/openslx/util/vm/OvfMetaData.java index e331184..4647cab 100644 --- a/src/main/java/org/openslx/util/vm/OvfMetaData.java +++ b/src/main/java/org/openslx/util/vm/OvfMetaData.java @@ -21,8 +21,8 @@ import org.w3c.dom.Node; import org.w3c.dom.NodeList; /** - * Class handling the metadata of ovf images. Only needed - * until the ovf has been converted into a vmx. + * Class handling the metadata of ovf images. Only needed until the ovf has been + * converted into a vmx. */ public class OvfMetaData extends VmMetaData { @@ -33,21 +33,13 @@ public class OvfMetaData extends VmMetaData { public OvfMetaData(List osList, File file) throws IOException, UnsupportedVirtualizerFormatException { super(osList); - LOGGER.debug("Constructor worked"); this.config = new OvfConfig(file); - LOGGER.debug("Creating config worked"); init(); - LOGGER.debug("Init worked"); } private void init() { registerVirtualHW(); displayName = config.getDisplayName(); - // setOs( config.getOsName() ); - // this.isMachineSnapshot = config.isMachineSnapshot(); - // for ( HardDisk hardDisk : config.getHdds() ) { - // hdds.add( hardDisk ); - // } } @Override diff --git a/src/main/java/org/openslx/util/vm/VmMetaData.java b/src/main/java/org/openslx/util/vm/VmMetaData.java index e3b78c8..1b9aff9 100644 --- a/src/main/java/org/openslx/util/vm/VmMetaData.java +++ b/src/main/java/org/openslx/util/vm/VmMetaData.java @@ -315,7 +315,7 @@ public abstract class VmMetaData try { return new OvfMetaData( osList, file ); } catch ( Exception e ) { - LOGGER.info( "Not an ovf file", e ); + LOGGER.info( "Not an OVF file", e ); } try { // TODO This will work for each file because simple read as byte array -- cgit v1.2.3-55-g7522