Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #9794: Malformed .gz inventory breaks upload process #1093

Conversation

armeniaca
Copy link
Contributor

No description provided.

if [ $UNZIP_COMMAND_RET -ne 0 ]
then
echo "ERROR: failed to decompress inventory in ${FILENAME} az gzip, putting it in the failed directory"
mv "${FILENAME}" "${FAILEDDIR}/`basename ${FILENAME}`-$(date --rfc-3339=date)"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do you mix `` and $() ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I coped that part from ~line 100 to that if-statement, to have the coding style as it was originally, and not to mix with my style. The question is, do you guys mix $() and `` :-)

then
echo "ERROR: failed to decompress inventory in ${FILENAME} az gzip, putting it in the failed directory"
mv "${FILENAME}" "${FAILEDDIR}/`basename ${FILENAME}`-$(date --rfc-3339=date)"
mv "${FILENAME_SIGN}" "${FAILEDDIR}/`basename ${FILENAME_SIGN}`-$(date --rfc-3339=date)"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is not always a signature file, you should avoid errors here with a [ -f ] &&

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same as above. will rework that part of code without using your logic, but as I see well suited.

@armeniaca armeniaca force-pushed the upstream/fix/9794_malformed_gz_breaks_upload branch from 555bf5e to c8f46b4 Compare December 18, 2016 15:16
@peckpeck
Copy link
Member

Sorry for the original mixed style and thank you for the PR.

@Normation-Quality-Assistant
Copy link
Contributor

OK, merging this PR

@Normation-Quality-Assistant Normation-Quality-Assistant merged commit c8f46b4 into Normation:branches/rudder/3.1 Dec 19, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants