Merge branch '2017.7' into fix-add-saltenv-pillarenv-to-pillar-item

This commit is contained in:
Daniel Ferenci 2018-03-15 21:57:06 +01:00 committed by GitHub
commit 164314a859
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 10 additions and 7 deletions

View file

@ -48,9 +48,11 @@ def _search(prefix="latest/"):
Recursively look up all grains in the metadata server
'''
ret = {}
linedata = http.query(os.path.join(HOST, prefix))
linedata = http.query(os.path.join(HOST, prefix), headers=True)
if 'body' not in linedata:
return ret
if linedata['headers'].get('Content-Type', 'text/plain') == 'application/octet-stream':
return linedata['body']
for line in linedata['body'].split('\n'):
if line.endswith('/'):
ret[line[:-1]] = _search(prefix=os.path.join(prefix, line))

View file

@ -45,7 +45,8 @@ def __virtual__():
'Void',
'Mint',
'Raspbian',
'XenServer'
'XenServer',
'Cumulus'
))
if __grains__.get('os', '') in disable:
return (False, 'Your OS is on the disabled list')

View file

@ -18,10 +18,6 @@ from tests.support.helpers import expensiveTest
from salt.config import cloud_providers_config
from salt.ext.six.moves import range # pylint: disable=import-error,redefined-builtin
# Create the cloud instance name to be used throughout the tests
INSTANCE_NAME = _random_name('CLOUD-TEST-')
PROVIDER_NAME = 'dimensiondata'
def _random_name(size=6):
'''
@ -32,6 +28,10 @@ def _random_name(size=6):
for x in range(size)
)
# Create the cloud instance name to be used throughout the tests
INSTANCE_NAME = _random_name()
PROVIDER_NAME = 'dimensiondata'
class DimensionDataTest(ShellCase):
'''

View file

@ -78,7 +78,7 @@ class ProfitBricksTest(ShellCase):
username = config[profile_str][DRIVER_NAME]['username']
password = config[profile_str][DRIVER_NAME]['password']
datacenter_id = config[profile_str][DRIVER_NAME]['datacenter_id']
if username == '' or password == '' or datacenter_id == '':
if username in ('' or 'foo') or password in ('' or 'bar') or datacenter_id == '':
self.skipTest(
'A username, password, and an datacenter must be provided to '
'run these tests. Check '