Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ Fixed
Changed
~~~~~~~
* Removed Python 3.8 and 3.9 from testing and CI/CD.
* Use the existing `st2common.constants.meta` safe YAML helpers in `clone_action_files`
* Removed mongodb 7.0, rabbitmq 3.13 and redis 8.0
* Replaced deprecated `pkg_resources` module with `importlib-metadata` and `importlib-resources`.
* Replaced abandoned `flex` module by `openapi-spec-validator`
Expand Down
7 changes: 4 additions & 3 deletions st2common/st2common/services/packs.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,10 @@
from six.moves import range
from oslo_config import cfg
import shutil
import yaml

from st2common import log as logging
from st2common.constants.meta import yaml_safe_dump
from st2common.constants.meta import yaml_safe_load
from st2common.content.utils import get_pack_base_path
from st2common.exceptions.content import ResourceDiskFilesRemovalError
from st2common.models.db.stormbase import UIDFieldMixin
Expand Down Expand Up @@ -385,15 +386,15 @@ def clone_action_files(source_action_db, dest_action_db, dest_pack_base_path):
)

with open(dest_metadata_file_path) as df:
doc = yaml.load(df, Loader=yaml.FullLoader)
doc = yaml_safe_load(df)

doc["name"] = dest_action_db["name"]
if "pack" in doc:
doc["pack"] = dest_action_db["pack"]
doc["entry_point"] = dest_entry_point

with open(dest_metadata_file_path, "w") as df:
yaml.dump(doc, df, default_flow_style=False, sort_keys=False)
yaml_safe_dump(doc, stream=df, default_flow_style=False, sort_keys=False)


def clone_action_db(source_action_db, dest_pack, dest_action):
Expand Down
Loading