File tree 1 file changed +6
-0
lines changed
sonic_package_manager/service_creator
1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change 29
29
from sonic_package_manager .service_creator .sonic_db import SonicDB
30
30
from sonic_package_manager .service_creator .utils import in_chroot
31
31
32
+ from sonic_py_common import device_info
33
+
32
34
33
35
SERVICE_FILE_TEMPLATE = 'sonic.service.j2'
34
36
@@ -254,6 +256,9 @@ def generate_container_mgmt(self, package: Package):
254
256
script_path = os .path .join (DOCKER_CTL_SCRIPT_LOCATION , f'{ name } .sh' )
255
257
script_template = get_tmpl_path (DOCKER_CTL_SCRIPT_TEMPLATE )
256
258
run_opt = []
259
+ sonic_asic_platform = os .environ .get ("CONFIGURED_PLATFORM" )
260
+ if sonic_asic_platform is None :
261
+ sonic_asic_platform = device_info .get_platform_info ().get ('asic_type' , None )
257
262
258
263
if container_spec ['privileged' ]:
259
264
run_opt .append ('--privileged' )
@@ -278,6 +283,7 @@ def generate_container_mgmt(self, package: Package):
278
283
'docker_container_name' : name ,
279
284
'docker_image_id' : image_id ,
280
285
'docker_image_run_opt' : run_opt ,
286
+ 'sonic_asic_platform' : sonic_asic_platform
281
287
}
282
288
render_template (script_template , script_path , render_ctx , executable = True )
283
289
log .info (f'generated { script_path } ' )
You can’t perform that action at this time.
0 commit comments