Skip to content

Commit

Permalink
Use correct attribute
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Wurster <miwurster@googlemail.com>
  • Loading branch information
miwurster committed Jan 18, 2021
1 parent b766774 commit 63a3dc3
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
Expand Up @@ -21,7 +21,8 @@ public class TOSCAMetaFileAttributes {
// of block 0
final public static String TOSCA_META_VERSION = "TOSCA-Meta-Version";
final public static String TOSCA_META_VERSION_VALUE = "1.0";
final public static String TOSCA_META_VERSION_VALUE_FOR_YAML = "1.1";
final public static String TOSCA_META_FILE_VERSION = "TOSCA-Meta-File-Version";
final public static String TOSCA_META_FILE_VERSION_VALUE = "1.1";
final public static String CSAR_VERSION = "CSAR-Version";
final public static String CSAR_VERSION_VALUE = "1.0";
final public static String CSAR_VERSION_VALUE_FOR_YAML = "1.1";
Expand Down
Expand Up @@ -23,10 +23,10 @@ protected int validateMetaVersion(String metaFileVersion) {
int errors = 0;

if (metaFileVersion == null) {
this.logAttrMissing(TOSCAMetaFileAttributes.TOSCA_META_VERSION, 0);
this.logAttrMissing(TOSCAMetaFileAttributes.TOSCA_META_FILE_VERSION, 0);
errors++;
} else if (!metaFileVersion.trim().equals(TOSCAMetaFileAttributes.TOSCA_META_VERSION_VALUE_FOR_YAML)) {
this.logAttrWrongVal(TOSCAMetaFileAttributes.TOSCA_META_VERSION, 0, TOSCAMetaFileAttributes.TOSCA_META_VERSION_VALUE_FOR_YAML);
} else if (!metaFileVersion.trim().equals(TOSCAMetaFileAttributes.TOSCA_META_FILE_VERSION_VALUE)) {
this.logAttrWrongVal(TOSCAMetaFileAttributes.TOSCA_META_FILE_VERSION, 0, TOSCAMetaFileAttributes.TOSCA_META_FILE_VERSION_VALUE);
errors++;
}
return errors;
Expand Down
Expand Up @@ -53,8 +53,8 @@
import static org.eclipse.winery.model.csar.toscametafile.TOSCAMetaFileAttributes.CSAR_VERSION_VALUE_FOR_YAML;
import static org.eclipse.winery.model.csar.toscametafile.TOSCAMetaFileAttributes.ENTRY_DEFINITIONS;
import static org.eclipse.winery.model.csar.toscametafile.TOSCAMetaFileAttributes.NAME;
import static org.eclipse.winery.model.csar.toscametafile.TOSCAMetaFileAttributes.TOSCA_META_VERSION;
import static org.eclipse.winery.model.csar.toscametafile.TOSCAMetaFileAttributes.TOSCA_META_VERSION_VALUE_FOR_YAML;
import static org.eclipse.winery.model.csar.toscametafile.TOSCAMetaFileAttributes.TOSCA_META_FILE_VERSION;
import static org.eclipse.winery.model.csar.toscametafile.TOSCAMetaFileAttributes.TOSCA_META_FILE_VERSION_VALUE;

public class YamlExporter extends CsarExporter {

Expand Down Expand Up @@ -163,7 +163,7 @@ private String addManifest(IRepository repository, DefinitionsChildId id, Map<Cs
StringBuilder stringBuilder = new StringBuilder();

// Setting Versions
stringBuilder.append(TOSCA_META_VERSION).append(": ").append(TOSCA_META_VERSION_VALUE_FOR_YAML).append("\n");
stringBuilder.append(TOSCA_META_FILE_VERSION).append(": ").append(TOSCA_META_FILE_VERSION_VALUE).append("\n");
stringBuilder.append(CSAR_VERSION).append(": ").append(CSAR_VERSION_VALUE_FOR_YAML).append("\n");
stringBuilder.append(CREATED_BY).append(": Winery ").append(Environments.getInstance().getVersion()).append("\n");

Expand Down

0 comments on commit 63a3dc3

Please sign in to comment.