mirror of
https://opendev.org/openstack/ansible-collections-openstack.git
synced 2026-05-07 13:53:15 +00:00
Remove old artifacts when building new ones
For local dev, multiple iterations can wind up with multiple files in the build_artifact dir. Remove them when building so that the ls command works. Change-Id: Id309c34679d2c0b6d9380665a381af4b52495d19
This commit is contained in:
@@ -22,6 +22,8 @@ import pbr.version
|
||||
|
||||
from ruamel.yaml import YAML
|
||||
|
||||
import os
|
||||
|
||||
|
||||
def generate_version_info():
|
||||
version_info = pbr.version.VersionInfo('openstack-cloud')
|
||||
@@ -39,8 +41,16 @@ def generate_version_info():
|
||||
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():
|
||||
generate_version_info()
|
||||
clean_build()
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
||||
Reference in New Issue
Block a user