Make cleanup of os-refresh-config actually work

subprocess.check_output won't expand globs without shell=True. Not
desirable to use that, so use glob module instead to expand the wildcard
and pass that to the cleanup rm.

Change-Id: I392bf8a933f7aba282b61153e88a60eebfa0f5c9
(cherry picked from commit c6f54522ff)
This commit is contained in:
Brad P. Crochet 2016-02-19 09:42:52 -05:00
parent 239143cf05
commit 7087dbea03
1 changed files with 3 additions and 1 deletions

View File

@ -15,6 +15,7 @@
import copy
import errno
import getpass
import glob
import hashlib
import io
import logging
@ -736,7 +737,8 @@ def _copy_stackrc():
def _clean_os_refresh_config():
args = ['sudo', 'rm', '-rf', '/usr/libexec/os-refresh-config/*']
orc_dirs = glob.glob('/usr/libexec/os-refresh-config/*')
args = ['sudo', 'rm', '-rf'] + orc_dirs
_run_command(args, name='Clean os-refresh-config')