red-hat-storage / rhcephcompose

A tool to compose releases of Red Hat Ceph Storage for Ubuntu
MIT License
1 stars 1 forks source link

compose: validate files exist before running #54

Closed ktdreyer closed 7 years ago

ktdreyer commented 7 years ago

We should bail out immediately if any files that are specified in the kobo config (eg ceph-2-ubuntu.conf) are missing, instead of running half-way through the compose for one distro, or downloading any builds, etc.

Fixes https://github.com/red-hat-storage/rhcephcompose/issues/9

ktdreyer commented 7 years ago

Yeah, Pungi has a lot more validation, but I didn't want to go there today :(

ktdreyer commented 7 years ago

Whoops, this breaks with eng-rhel-6's py 1.4.15.

    def test_create_repo(self, conf, tmpdir, monkeypatch):
        monkeypatch.chdir(tmpdir)
        c = Compose(conf)
        # TODO: use real list of binaries here
        c.create_repo(str(tmpdir), 'xenial', [])
        distributions_path = tmpdir.join('conf/distributions')
>       assert distributions_path.exists()
E       AttributeError: 'LocalPath' object has no attribute 'exists'

The exists() method was introduced in py's next release, v1.4.16 (specifically 1ae2262846357c6baa38093c6ea6e68203565db8)

ktdreyer commented 7 years ago

Fix for that regression is https://github.com/red-hat-storage/rhcephcompose/pull/56