Skip to content

Commit

Permalink
Added directory creation check for cases where mcad=False
Browse files Browse the repository at this point in the history
  • Loading branch information
Bobbins228 authored and openshift-merge-bot[bot] committed Jan 22, 2024
1 parent 2a128da commit e7d5255
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/codeflare_sdk/utils/generate_yaml.py
Original file line number Diff line number Diff line change
Expand Up @@ -619,6 +619,11 @@ def _create_oauth_sidecar_object(


def write_components(user_yaml: dict, output_file_name: str):
# Create the directory if it doesn't exist
directory_path = os.path.dirname(output_file_name)
if not os.path.exists(directory_path):
os.makedirs(directory_path)

components = user_yaml.get("spec", "resources")["resources"].get("GenericItems")
open(output_file_name, "w").close()
with open(output_file_name, "a") as outfile:
Expand Down

0 comments on commit e7d5255

Please sign in to comment.