1111import sys
1212import os
1313import logging
14- import common
15- from common import parse_profile
16- from pprint import pprint
14+ import lib .common
1715
1816# These imports are required because they need to be added to the symbol table
1917# so the parse_menu method can find them in globals()
20- import job
21- import dataset
22- import workflow
23- import history
24- import library
25- import folder
26- import config
27- import benchmark
28- import helm
29- import kubectl
18+ from lib import job , dataset , workflow , history , library , folder , benchmark , helm , kubectl , config
3019
3120log = logging .getLogger ('abm' )
3221log .setLevel (logging .ERROR )
3322
34- VERSION = '1.3 .0'
23+ VERSION = '1.4 .0'
3524
3625BOLD = '\033 [1m'
3726CLEAR = '\033 [0m'
@@ -129,7 +118,7 @@ def alias(shortcut, fullname):
129118
130119def parse_menu ():
131120 log .debug ('parse_menu' )
132- menu_config = f'{ os .path .dirname (__file__ )} /menu.yml'
121+ menu_config = f'{ os .path .dirname (__file__ )} /lib/ menu.yml'
133122 if not os .path .exists (menu_config ):
134123 print (f"ERROR: Unable to load the menu configuration from { menu_config } " )
135124 sys .exit (1 )
@@ -164,7 +153,7 @@ def version():
164153 print (f" Copyright 2021 The Galaxy Project. All Rights Reserved.\n " )
165154
166155
167- def main ():
156+ def entrypoint ():
168157 menu_data = parse_menu ()
169158
170159 if len (sys .argv ) < 2 or sys .argv [1 ] in help_args :
@@ -213,8 +202,12 @@ def main():
213202 return
214203
215204 if profile is not None :
216- common .GALAXY_SERVER , common .API_KEY , common .KUBECONFIG = parse_profile (profile )
217- if common .GALAXY_SERVER is None :
205+ # common.GALAXY_SERVER, common.API_KEY, common.KUBECONFIG = parse_profile(profile)
206+ if not lib .common .set_active_profile (profile ):
207+ print (f"ERROR: Unable to set the active profile. No GALAXY_SERVER defined." )
208+ return
209+ if lib .GALAXY_SERVER is None :
210+ print ("ERROR: GALAXY_SERVER was not set in the profile." )
218211 return
219212 if command in all_commands :
220213 subcommands = all_commands [command ]
@@ -230,4 +223,4 @@ def main():
230223
231224
232225if __name__ == '__main__' :
233- main ()
226+ entrypoint ()
0 commit comments