Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • osm/nbi
1 result
Show changes
Commits on Source (2)
......@@ -15,7 +15,6 @@
import logging
import yaml
import tarfile
import shutil
import os
from http import HTTPStatus
......@@ -1100,12 +1099,11 @@ class OkaTopic(DescriptorTopic):
storage = self.fs.get_params()
storage["folder"] = proposed_revision_path
storage["zipfile"] = filename
file_path = (proposed_revision_path, filename)
file_pkg = self.fs.file_open(file_path, "a+b")
filename = indata.filename
if isinstance(indata, dict):
indata_text = yaml.safe_dump(indata, indent=4, default_flow_style=False)
file_pkg.write(indata_text.encode(encoding="utf-8"))
......@@ -1119,22 +1117,6 @@ class OkaTopic(DescriptorTopic):
break
file_pkg.write(indata_text)
# PACKAGE UPLOADED
file_pkg.seek(0, 0)
if compressed == "gzip":
tar = tarfile.open(mode="r", fileobj=file_pkg)
for tarinfo in tar:
tarname = tarinfo.name
tarname_path = tarname.split("/")
self.logger.debug(
"Tarname: {} Tarname Path: {}".format(tarname, tarname_path)
)
storage["zipfile"] = filename
self.fs.file_extract(tar, proposed_revision_path)
else:
content = file_pkg.read()
self.logger.debug("Content: {}".format(content))
# Need to close the file package here so it can be copied from the
# revision to the current, unrevisioned record
if file_pkg:
......@@ -1147,6 +1129,7 @@ class OkaTopic(DescriptorTopic):
self.fs.sync(from_path=current_revision_path)
self.fs.sync(from_path=proposed_revision_path)
# Is this required?
if revision > 1:
try:
self._validate_descriptor_changes(
......