Skip to content

Commit

Permalink
Merge pull request #728 from douglasjacobsen/software-formatting
Browse files Browse the repository at this point in the history
Fix formatting of managed software
  • Loading branch information
linsword13 authored Oct 30, 2024
2 parents 74d55b0 + 745857a commit 6b1431d
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions lib/ramble/ramble/workspace/workspace.py
Original file line number Diff line number Diff line change
Expand Up @@ -928,6 +928,10 @@ def manage_environments(
software_dict = self.get_software_dict().copy()

environments = software_dict[namespace.environments]
# Ensure package dict is an syaml_dict, for formatting
if not environments:
software_dict[namespace.environments] = syaml.syaml_dict()
environments = software_dict[namespace.environments]

if remove:
if env_name in environments:
Expand Down Expand Up @@ -996,6 +1000,11 @@ def manage_packages(

packages = software_dict[namespace.packages]

# Ensure package dict is an syaml_dict, for formatting
if not packages:
software_dict[namespace.packages] = syaml.syaml_dict()
packages = software_dict[namespace.packages]

if remove:
if pkg_name in packages:
del packages[pkg_name]
Expand Down

0 comments on commit 6b1431d

Please sign in to comment.