Skip to content

Commit

Permalink
Workaround rmtree bug on non-ascii filenames in python2 (sonic-net#239)
Browse files Browse the repository at this point in the history
ref: https://bugs.python.org/issue24672

Signed-off-by: Qi Luo <qiluo-msft@users.noreply.github.com>
  • Loading branch information
qiluo-msft authored and lguohan committed Apr 12, 2018
1 parent ca11c15 commit a489871
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions sonic_installer/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import time
import click
import urllib
import shutil
import subprocess

HOST_PATH = '/host'
Expand Down Expand Up @@ -126,7 +125,7 @@ def remove_image(image):

image_dir = image.replace(IMAGE_PREFIX, IMAGE_DIR_PREFIX)
click.echo('Removing image root filesystem...')
shutil.rmtree(HOST_PATH + '/' + image_dir)
subprocess.call(['rm','-rf', HOST_PATH + '/' + image_dir])
click.echo('Image removed')
else:
click.echo('Updating GRUB...')
Expand All @@ -142,7 +141,7 @@ def remove_image(image):

image_dir = image.replace(IMAGE_PREFIX, IMAGE_DIR_PREFIX)
click.echo('Removing image root filesystem...')
shutil.rmtree(HOST_PATH + '/' + image_dir)
subprocess.call(['rm','-rf', HOST_PATH + '/' + image_dir])
click.echo('Done')

run_command('grub-set-default --boot-directory=' + HOST_PATH + ' 0')
Expand Down

0 comments on commit a489871

Please sign in to comment.