mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Fixed salt.util import. Added status check to make sure external resource is available
This commit is contained in:
parent
400a71ec33
commit
2f36f34981
1 changed files with 13 additions and 2 deletions
|
@ -13,7 +13,8 @@ ensure_in_syspath('../../')
|
|||
|
||||
# Import salt libs
|
||||
import integration
|
||||
import salt.utils.which
|
||||
import salt.utils
|
||||
import salt.utils.http
|
||||
|
||||
GEM = 'rake'
|
||||
GEM_VER = '11.1.2'
|
||||
|
@ -21,9 +22,19 @@ OLD_GEM = 'thor'
|
|||
OLD_VERSION = '0.17.0'
|
||||
DEFAULT_GEMS = ['bigdecimal', 'rake', 'json', 'rdoc']
|
||||
|
||||
def check_status():
|
||||
'''
|
||||
Check the status of the rubygems source
|
||||
'''
|
||||
ret = salt.utils.http.query('https://rubygems.org', status=True)
|
||||
if ret['status'] == 200:
|
||||
return True
|
||||
return False
|
||||
|
||||
|
||||
@destructiveTest
|
||||
@skipIf(salt.utils.which('gem') is None, 'Gem is not available on the system')
|
||||
@skipIf(salt.utils.which('gem') is None, 'Gem is not available')
|
||||
@skipIf(check_status() is False, 'External source \'https://rubygems.org\' is not available')
|
||||
class GemModuleTest(integration.ModuleCase):
|
||||
'''
|
||||
Validate gem module
|
||||
|
|
Loading…
Add table
Reference in a new issue