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

Add HAS_REQUIRED_CRYPTO var for m2crypto in joyent #53161

Merged
merged 1 commit into from May 22, 2019

Conversation

Ch3LL
Copy link
Contributor

@Ch3LL Ch3LL commented May 21, 2019

What does this PR do?

The variable HAS_REQUIRED_CRYPTO was missing if m2crypto was importable and the joyent cloud was not loading. Now that the variable is loaded the skipIf check in the unit.cloud.clouds.test_joyent test does not fail anymore and the test passes

What issues does this PR fix or reference?

Fixes #53067

Previous Behavior

The test unit.cloud.clouds.test_joyent was failing on m2crypto with:

Failed to import test module: unit.cloud.clouds.test_joyent Traceback (most recent call last):   File "/usr/lib64/python2.7/unittest/loader.py", line 252, in _find_tests     module = self._get_module_from_name(name)   File "/usr/lib64/python2.7/unittest/loader.py", line 230, in _get_module_from_name     __import__(name)   File "/tmp/kitchen/testing/tests/unit/cloud/clouds/test_joyent.py", line 38, in <module>     @skipIf(joyent.HAS_REQUIRED_CRYPTO is False, reason='PyCrypto or Cryptodome not installed') AttributeError: 'module' object has no attribute 'HAS_REQUIRED_CRYPTO' 

New Behavior

[root@ip-10-27-30-248 ~]# python2.7 /tmp/kitchen/testing/tests/runtests.py -n unit.cloud.clouds.test_joyent
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 * Python Version: 2.7.5 (default, Apr 9 2019, 14:30:50) [GCC 4.8.5 20150623 (Red Hat 4.8.5-36)]
 * Transplanting configuration files to '/tmp/salt-tests-tmpdir/config'
 * Current Directory: /tmp/kitchen/testing
 * Test suite is running under PID 15587
 * Logging tests on /tmp/salt-runtests.log
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Starting unit.cloud.clouds.test_joyent Tests
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
...
----------------------------------------------------------------------
Ran 3 tests in 0.006s

OK

===============================================================  Overall Tests Report  ================================================================
***  No Problems Found While Running Tests  ***********************************************************************************************************
=======================================================================================================================================================
OK (total=3, skipped=0, passed=3, failures=0, errors=0) 
===============================================================  Overall Tests Report  ================================================================

Tests written?

No - Fixes failing test

Commits signed with GPG?

Yes

@Ch3LL Ch3LL requested a review from s0undt3ch May 21, 2019 20:04
@s0undt3ch
Copy link
Member

And the other cloud drivers which also try to import m2crypto?

@Ch3LL
Copy link
Contributor Author

Ch3LL commented May 21, 2019

I'm not seeing any other clouds that are using HAS_REQUIRED_CRYPTO just joyent. The other clouds tend to only use the HAS_M2, HAS_P2CRYPTO only.

@s0undt3ch
Copy link
Member

My bad then, sorry :)

@Ch3LL
Copy link
Contributor Author

Ch3LL commented May 21, 2019

no worries, always better to check :)

@Ch3LL Ch3LL merged commit fb29512 into saltstack:2019.2.1 May 22, 2019
@Ch3LL Ch3LL added the bugfix-bckport will be be back-ported to an older release branch by creating a PR against that branch label May 22, 2019
@Ch3LL Ch3LL added ZZZ[Done]-back-ported-bf RETIRED The pull request has been back-ported to an older branch. and removed bugfix-bckport will be be back-ported to an older release branch by creating a PR against that branch labels May 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ZZZ[Done]-back-ported-bf RETIRED The pull request has been back-ported to an older branch.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants