Skip to content

Instantly share code, notes, and snippets.

@UtahDave
Created September 2, 2014 21:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save UtahDave/eb64e806328e5ebab5b7 to your computer and use it in GitHub Desktop.
Save UtahDave/eb64e806328e5ebab5b7 to your computer and use it in GitHub Desktop.
Salt State to remove annoying warning on Amazon Linux. - WARNING - DOES NOT ACTUALLY FIX THE ISSUE. THIS JUST SUPPRESSES THE WARNING.
# TEMP: Disable warnings after installing apache-libcloud
# Try disabling this after future versions of apache-libcloud are released
disable_libgmp_warning:
file.replace:
- name: /usr/lib64/python2.6/site-packages/Crypto/Util/number.py
- pattern: 'if _fastmath is not None and not _fastmath.HAVE_DECL_MPZ_POWM_SEC:'
- repl: '#if _fastmath is not None and not _fastmath.HAVE_DECL_MPZ_POWM_SEC:'
disable_RandomPool_warning_line1:
file.replace:
- name: /usr/lib64/python2.6/site-packages/Crypto/Util/randpool.py
- pattern: 'warnings.warn\("This application uses RandomPool'
- repl: '#warnings.warn\("This application uses RandomPool'
disable_RandomPool_warning_line2:
file.replace:
- name: /usr/lib64/python2.6/site-packages/Crypto/Util/randpool.py
- pattern: 'RandomPool_DeprecationWarning\)'
- repl: '#RandomPool_DeprecationWarning\)'
@UtahDave
Copy link
Author

UtahDave commented Sep 2, 2014

Place this in /srv/salt/pycrypto.sls

Then run:

salt 'minion-id' state.sls pycrypto

or

salt -G 'os:Amazon' state.sls pycrypto

@UtahDave
Copy link
Author

UtahDave commented Sep 2, 2014

Again, this does NOT actually fix the problem being warned about here. Use at your own risk.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment