@@ -50,6 +50,7 @@ <h1 class="title">Module <code>codeflare_sdk.utils.generate_yaml</code></h1>
50
50
51
51
import yaml
52
52
import sys
53
+ import os
53
54
import argparse
54
55
import uuid
55
56
from kubernetes import client, config
@@ -537,8 +538,14 @@ <h1 class="title">Module <code>codeflare_sdk.utils.generate_yaml</code></h1>
537
538
538
539
539
540
def write_user_appwrapper(user_yaml, output_file_name):
541
+ # Create the directory if it doesn't exist
542
+ directory_path = os.path.dirname(output_file_name)
543
+ if not os.path.exists(directory_path):
544
+ os.makedirs(directory_path)
545
+
540
546
with open(output_file_name, "w") as outfile:
541
547
yaml.dump(user_yaml, outfile, default_flow_style=False)
548
+
542
549
print(f"Written to: {output_file_name}")
543
550
544
551
@@ -706,7 +713,8 @@ <h1 class="title">Module <code>codeflare_sdk.utils.generate_yaml</code></h1>
706
713
if openshift_oauth:
707
714
enable_openshift_oauth(user_yaml, cluster_name, namespace)
708
715
709
- outfile = appwrapper_name + ".yaml"
716
+ directory_path = os.path.expanduser("~/.codeflare/appwrapper/")
717
+ outfile = os.path.join(directory_path, appwrapper_name + ".yaml")
710
718
if not mcad:
711
719
write_components(user_yaml, outfile)
712
720
else:
@@ -1019,7 +1027,8 @@ <h2 class="section-title" id="header-functions">Functions</h2>
1019
1027
if openshift_oauth:
1020
1028
enable_openshift_oauth(user_yaml, cluster_name, namespace)
1021
1029
1022
- outfile = appwrapper_name + ".yaml"
1030
+ directory_path = os.path.expanduser("~/.codeflare/appwrapper/")
1031
+ outfile = os.path.join(directory_path, appwrapper_name + ".yaml")
1023
1032
if not mcad:
1024
1033
write_components(user_yaml, outfile)
1025
1034
else:
@@ -1541,8 +1550,14 @@ <h2 class="section-title" id="header-functions">Functions</h2>
1541
1550
< span > Expand source code</ span >
1542
1551
</ summary >
1543
1552
< pre > < code class ="python "> def write_user_appwrapper(user_yaml, output_file_name):
1553
+ # Create the directory if it doesn't exist
1554
+ directory_path = os.path.dirname(output_file_name)
1555
+ if not os.path.exists(directory_path):
1556
+ os.makedirs(directory_path)
1557
+
1544
1558
with open(output_file_name, "w") as outfile:
1545
1559
yaml.dump(user_yaml, outfile, default_flow_style=False)
1560
+
1546
1561
print(f"Written to: {output_file_name}")</ code > </ pre >
1547
1562
</ details >
1548
1563
</ dd >
0 commit comments