Just use shutil.rmtree in build.py
Turns out there's a stdlib function for this. Change-Id: I38885c4b6d973b2a7083a04acb3f5cea9ad78ad9
This commit is contained in:
parent
86670bcec9
commit
4df2fdb4fe
@ -22,7 +22,7 @@ import pbr.version
|
|||||||
|
|
||||||
from ruamel.yaml import YAML
|
from ruamel.yaml import YAML
|
||||||
|
|
||||||
import os
|
import shutil
|
||||||
|
|
||||||
|
|
||||||
def generate_version_info():
|
def generate_version_info():
|
||||||
@ -41,16 +41,9 @@ def generate_version_info():
|
|||||||
yaml.dump(config, fp)
|
yaml.dump(config, fp)
|
||||||
|
|
||||||
|
|
||||||
def clean_build():
|
|
||||||
if not os.path.exists('build_artifact'):
|
|
||||||
return
|
|
||||||
for tarball in os.listdir('build_artifact'):
|
|
||||||
os.unlink('build_artifact/{tarball}'.format(tarball=tarball))
|
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
generate_version_info()
|
generate_version_info()
|
||||||
clean_build()
|
shutil.rmtree('build_artifact', ignore_errors=True)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
Loading…
x
Reference in New Issue
Block a user