@@ -126,10 +126,6 @@ def main():
126126 do_install ()
127127 elif arg == 'clean' :
128128 do_uninstall ()
129- elif arg == 'api' :
130- do_sonic_platform_install ()
131- elif arg == 'api_clean' :
132- do_sonic_platform_clean ()
133129 else :
134130 show_help ()
135131
@@ -285,45 +281,6 @@ def system_ready():
285281 return False
286282 return True
287283
288- PLATFORM_ROOT_PATH = '/usr/share/sonic/device'
289- PLATFORM_API2_WHL_FILE_PY3 = 'sonic_platform-1.0-py3-none-any.whl'
290- def do_sonic_platform_install ():
291- device_path = "{}{}{}{}" .format (PLATFORM_ROOT_PATH , '/x86_64-accton_' , PROJECT_NAME , '-r0' )
292- SONIC_PLATFORM_BSP_WHL_PKG_PY3 = "/" .join ([device_path , PLATFORM_API2_WHL_FILE_PY3 ])
293-
294- #Check API2.0 on py whl file
295- status , output = log_os_system ("pip3 show sonic-platform > /dev/null 2>&1" , 0 )
296- if status :
297- if os .path .exists (SONIC_PLATFORM_BSP_WHL_PKG_PY3 ):
298- status , output = log_os_system ("pip3 install " + SONIC_PLATFORM_BSP_WHL_PKG_PY3 , 1 )
299- if status :
300- print ("Error: Failed to install {}" .format (PLATFORM_API2_WHL_FILE_PY3 ))
301- return status
302- else :
303- print ("Successfully installed {} package" .format (PLATFORM_API2_WHL_FILE_PY3 ))
304- else :
305- print ('{} is not found' .format (PLATFORM_API2_WHL_FILE_PY3 ))
306- else :
307- print ('{} has installed' .format (PLATFORM_API2_WHL_FILE_PY3 ))
308-
309- return
310-
311- def do_sonic_platform_clean ():
312- status , output = log_os_system ("pip3 show sonic-platform > /dev/null 2>&1" , 0 )
313- if status :
314- print ('{} does not install, not need to uninstall' .format (PLATFORM_API2_WHL_FILE_PY3 ))
315-
316- else :
317- status , output = log_os_system ("pip3 uninstall sonic-platform -y" , 0 )
318- if status :
319- print ('Error: Failed to uninstall {}' .format (PLATFORM_API2_WHL_FILE_PY3 ))
320- return status
321- else :
322- print ('{} is uninstalled' .format (PLATFORM_API2_WHL_FILE_PY3 ))
323-
324-
325- return
326-
327284def do_install ():
328285 if driver_inserted () == False :
329286 status = driver_install ()
@@ -345,8 +302,6 @@ def do_install():
345302 if status :
346303 if FORCE == 0 :
347304 return status
348-
349- do_sonic_platform_install ()
350305 return
351306
352307def do_uninstall ():
@@ -368,8 +323,6 @@ def do_uninstall():
368323 if FORCE == 0 :
369324 return status
370325
371- do_sonic_platform_clean ()
372-
373326 return
374327
375328def device_exist ():
0 commit comments