2727def print_run_plan (
2828 run_plan : RunPlan , max_offers : Optional [int ] = None , include_run_properties : bool = True
2929):
30+ run_spec = run_plan .get_effective_run_spec ()
3031 job_plan = run_plan .job_plans [0 ]
3132
3233 props = Table (box = None , show_header = False )
@@ -43,18 +44,18 @@ def print_run_plan(
4344 )
4445 if include_run_properties :
4546 inactivity_duration = None
46- if isinstance (run_plan . run_spec .configuration , DevEnvironmentConfiguration ):
47+ if isinstance (run_spec .configuration , DevEnvironmentConfiguration ):
4748 inactivity_duration = "-"
48- if isinstance (run_plan . run_spec .configuration .inactivity_duration , int ):
49+ if isinstance (run_spec .configuration .inactivity_duration , int ):
4950 inactivity_duration = format_pretty_duration (
50- run_plan . run_spec .configuration .inactivity_duration
51+ run_spec .configuration .inactivity_duration
5152 )
5253 if job_plan .job_spec .retry is None :
5354 retry = "-"
5455 else :
5556 retry = escape (job_plan .job_spec .retry .pretty_format ())
5657
57- profile = run_plan . run_spec .merged_profile
58+ profile = run_spec .merged_profile
5859 creation_policy = profile .creation_policy
5960 # FIXME: This assumes the default idle_duration is the same for client and server.
6061 # If the server changes idle_duration, old clients will see incorrect value.
@@ -79,8 +80,8 @@ def th(s: str) -> str:
7980 props .add_row (th ("Project" ), run_plan .project_name )
8081 props .add_row (th ("User" ), run_plan .user )
8182 if include_run_properties :
82- props .add_row (th ("Configuration" ), run_plan . run_spec .configuration_path )
83- props .add_row (th ("Type" ), run_plan . run_spec .configuration .type )
83+ props .add_row (th ("Configuration" ), run_spec .configuration_path )
84+ props .add_row (th ("Type" ), run_spec .configuration .type )
8485 props .add_row (th ("Resources" ), pretty_req )
8586 props .add_row (th ("Spot policy" ), spot_policy )
8687 props .add_row (th ("Max price" ), max_price )
@@ -91,7 +92,7 @@ def th(s: str) -> str:
9192 props .add_row (th ("Max duration" ), max_duration )
9293 if inactivity_duration is not None : # None means n/a
9394 props .add_row (th ("Inactivity duration" ), inactivity_duration )
94- props .add_row (th ("Reservation" ), run_plan . run_spec .configuration .reservation or "-" )
95+ props .add_row (th ("Reservation" ), run_spec .configuration .reservation or "-" )
9596
9697 offers = Table (box = None )
9798 offers .add_column ("#" )
0 commit comments