Issue #1853
closed
pulp-puppet-module-builder should not overwrite existing module files
Status:
CLOSED - CURRENTRELEASE
Description
From the downstream report:
Issue:
pulp-puppet-module-builder will overwrite existing module files in my --output-dir.
There is no option to disable this behaviour or emit a warning when it happens.
Steps to Reproduce:
1. mkdir -p /tmp/example-output
2. cd /tmp/
3. puppet module generate support-example
take the default responses to all questions
4. cd /tmp/support-example
5. pulp-puppet-module-builder --output-dir=/tmp/example-output
6. sha1sum /tmp/example-output/support-example-0.1.0.tar.gz
Alter the content of /tmp/support-example/manifests/init.pp in some valid way
7. cd /tmp/support-example
8. pulp-puppet-module-builder --output-dir=/tmp/example-output
9. sha1sum /tmp/example-output/support-example-0.1.0.tar.gz
Actual results:
The content of /tmp/example-output/support-example-0.1.0.tar.gz from Step 5 was replaced by Step 8 but no notice was provided.
Expected results:
It would be helpful if there was notice provided and a switch added to prevent overwriting existing module files.
We may need some discussion to decide what the right behavior is.
- Priority changed from Normal to Low
- Severity changed from 2. Medium to 1. Low
- Triaged changed from No to Yes
If the resolution to this is to add an option, someone please notify katello.
- Sprint/Milestone set to 31
- Status changed from NEW to ASSIGNED
- Assignee set to daviddavis
- Status changed from ASSIGNED to POST
- Status changed from POST to MODIFIED
- Platform Release set to 2.11.1
- Status changed from MODIFIED to 5
- Status changed from 5 to 6
verified
[root@qe-blade-05 support-example]# rpm -qa pulp-puppet-tools
pulp-puppet-tools-2.11.1-0.1.beta.el7.noarch
[root@qe-blade-05 support-example]#
[root@qe-blade-05 support-example]# pulp-puppet-module-builder --output-dir=/tmp/example-output
cd /tmp/support-example
git status
find . -name Modulefile -o -name metadata.json
puppet module build .
mkdir -p /tmp/example-output
Skipping support-example-0.1.0.tar.gz as the file exists
cd /tmp/example-output
cd /tmp/support-example
cd /tmp/support-example
[root@qe-blade-05 support-example]# ls -l /tmp/example-output/
total 8
-rw-r--r-- 1 root root 99 Jan 13 15:00 PULP_MANIFEST
-rw-r--r-- 1 root root 3490 Jan 13 14:49 support-example-0.1.0.tar.gz
[root@qe-blade-05 support-example]#
[root@qe-blade-05 support-example]#
[root@qe-blade-05 support-example]# sha1sum /tmp/example-output/support-example-0.1.0.tar.gz
bb934cfd2fd17a3d03beafd1846379baf1a4cabf /tmp/example-output/support-example-0.1.0.tar.gz
[root@qe-blade-05 support-example]#
[root@qe-blade-05 support-example]#
[root@qe-blade-05 support-example]# pulp-puppet-module-builder --output-dir=/tmp/example-output -f
cd /tmp/support-example
git status
find . -name Modulefile -o -name metadata.json
puppet module build .
mkdir -p /tmp/example-output
cp ./pkg/support-example-0.1.0.tar.gz /tmp/example-output
cd /tmp/example-output
cd /tmp/support-example
cd /tmp/support-example
[root@qe-blade-05 support-example]#
[root@qe-blade-05 support-example]#
[root@qe-blade-05 support-example]#
[root@qe-blade-05 support-example]# ls -l /tmp/example-output/
total 8
-rw-r--r-- 1 root root 99 Jan 13 15:01 PULP_MANIFEST
-rw-r--r-- 1 root root 3497 Jan 13 15:01 support-example-0.1.0.tar.gz
[root@qe-blade-05 support-example]# sha1sum /tmp/example-output/support-example-0.1.0.tar.gz
e330d939af48408bfd6c02e9fc2aebc240748856 /tmp/example-output/support-example-0.1.0.tar.gz
[root@qe-blade-05 support-example]#
- Status changed from 6 to CLOSED - CURRENTRELEASE
- Sprint/Milestone deleted (
31)
Also available in: Atom
PDF
Don't ovewrite modules unless force flag is passed
By default, no longer overwriting modules in the output dir. Also, added a force flag which can override this behavior.
fixes #1853 https://pulp.plan.io/issues/1853