ansible / mazer

Experimental Ansible Galaxy Content Manager
GNU General Public License v3.0
114 stars 18 forks source link

Install --force does nothing, not even install #256

Closed ironfroggy closed 5 years ago

ironfroggy commented 5 years ago

Bug Report

MAZER VERSION
name = mazer
version = 0.5.0
config_file = /home/calvin/.ansible/mazer.yml
uname = Linux, willow-epsilon, 4.4.0-17134-Microsoft, #706-Microsoft Mon Apr 01 18:13:00 PST 2019, x86_64
executable_location = /mnt/c/Users/calvin/redhat/.virtualenvs/orion/bin/mazer
python_version = 3.7.1 (default, Oct 22 2018, 11:21:55) [GCC 8.2.0]
python_executable = /mnt/c/Users/calvin/redhat/.virtualenvs/orion/bin/python3.7
CONFIGURATION

Default configuration.

SUMMARY

Passing the --force option to install command fails to install anything at all, silently.

STEPS TO REPRODUCE

Install a properly published collection from Galaxy. Next, remove it and try to install it again, but passing the --force flag.

(orion) calvin@willow-epsilon:/mnt/c/Users/calvin/redhat/orion$ mazer install -vvvv  --server=http://galaxy-qa.ansible.com orionuser1.collection_simple_role
Installing orionuser1.collection_simple_role (version_spec: *)
- The repository orionuser1.collection_simple_role was successfully installed to /home/calvin/.ansible/collections
(orion) calvin@willow-epsilon:/mnt/c/Users/calvin/redhat/orion$ ls ~/.ansible/collections/ansible_collections/orionuser1/
collection_simple_role
(orion) calvin@willow-epsilon:/mnt/c/Users/calvin/redhat/orion$ rm -r ~/.ansible/collections/ansible_collections/orionuser1/
(orion) calvin@willow-epsilon:/mnt/c/Users/calvin/redhat/orion$ mazer install -vvvv  --server=http://galaxy-qa.ansible.com orionuser1.collection_simple_role  --force
Installing orionuser1.collection_simple_role (version_spec: *)
(orion) calvin@willow-epsilon:/mnt/c/Users/calvin/redhat/orion$ ls ~/.ansible/collections/ansible_collections/orionuser1/
ls: cannot access '/home/calvin/.ansible/collections/ansible_collections/orionuser1/': No such file or directory
EXPECTED RESULTS

I expect the collection to be installed, overwrite an existing version OR installing a new version.

ACTUAL RESULTS

The installation does nothing at all and gives no errors. This is the same if there was a pre-existing installation, of the same or a previous version, or if there was no collection by that name installed at all.

(orion) calvin@willow-epsilon:/mnt/c/Users/calvin/redhat/collection_simple_role$ mazer install -vvvv  --server=http://galaxy-qa.ansible.com orionuser1.collection_simple_role,0.0.20Installing orionuser1.collection_simple_role (version_spec: ==0.0.20)
- The repository orionuser1.collection_simple_role was successfully installed to /home/calvin/.ansible/collections
(orion) calvin@willow-epsilon:/mnt/c/Users/calvin/redhat/collection_simple_role$ cat ~/.ansible/collections/ansible_collections/orionuser1/collection_simple_role/galaxy.ymlnamespace: "orionuser1"
name: "collection_simple_role"
version: "0.0.20"
license:
  - MIT
readme: "README.md"
authors:
  - "Calvin Spealman <cspealma@redhat.com>"
description: "A simple collection with a single role for testing purposes"
dependencies:
repository:
documentation:
homepage:
issues:
(orion) calvin@willow-epsilon:/mnt/c/Users/calvin/redhat/collection_simple_role$ mazer install -vvvv  --server=http://galaxy-qa.ansible.com orionuser1.collection_simple_role,0.0.21Installing orionuser1.collection_simple_role (version_spec: ==0.0.21)
WARNING| - orionuser1.collection_simple_role was NOT installed successfully: The Galaxy content /home/calvin/.ansible/collections/ansible_collections/orionuser1/collection_simple_role/.gitignore appears to already exist.
The Galaxy content /home/calvin/.ansible/collections/ansible_collections/orionuser1/collection_simple_role/.gitignore appears to already exist.:
- you can use --ignore-errors to skip failed collections and finish processing the list.
(orion) calvin@willow-epsilon:/mnt/c/Users/calvin/redhat/collection_simple_role$ cat ~/.ansible/collections/ansible_collections/orionuser1/collection_simple_role/galaxy.yml
namespace: "orionuser1"
name: "collection_simple_role"
version: "0.0.20"
license:
  - MIT
readme: "README.md"
authors:
  - "Calvin Spealman <cspealma@redhat.com>"
description: "A simple collection with a single role for testing purposes"
dependencies:
repository:
documentation:
homepage:
issues:
(orion) calvin@willow-epsilon:/mnt/c/Users/calvin/redhat/collection_simple_role$ mazer install -vvvv  --server=http://galaxy-qa.ansible.com orionuser1.collection_simple_role,0.0.21 --force
Installing orionuser1.collection_simple_role (version_spec: ==0.0.21)
(orion) calvin@willow-epsilon:/mnt/c/Users/calvin/redhat/collection_simple_role$ cat ~/.ansible/collections/ansible_collections/orionuser1/collection_simple_role/galaxy.yml
namespace: "orionuser1"
name: "collection_simple_role"
version: "0.0.20"
license:
  - MIT
readme: "README.md"
authors:
  - "Calvin Spealman <cspealma@redhat.com>"
description: "A simple collection with a single role for testing purposes"
dependencies:
repository:
documentation:
homepage:
issues:
alikins commented 5 years ago

@ironfroggy Looks like I got the check for the 'if forced' conditional in the wrong place at some point.

https://github.com/ansible/mazer/pull/257 has a fix, though I need to add some unit tests for it.