Merge pull request #50743 from dwoz/kub_conf

Older MacOS versions won't have TMPDIR environment
This commit is contained in:
Daniel Wozniak 2018-12-04 10:09:42 -07:00 committed by GitHub
commit 730bbde800
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -181,7 +181,7 @@ class KubernetesTestCase(TestCase, LoaderModuleMockMixin):
if salt.utils.platform.is_windows():
check_path = os.path.join(os.environ.get('TMP'), 'salt-kubeconfig-')
elif salt.utils.platform.is_darwin():
check_path = os.path.join(os.environ.get('TMPDIR'), 'salt-kubeconfig-')
check_path = os.path.join(os.environ.get('TMPDIR', '/tmp'), 'salt-kubeconfig-')
self.assertTrue(config['kubeconfig'].lower().startswith(check_path.lower()))
self.assertTrue(os.path.exists(config['kubeconfig']))
with salt.utils.files.fopen(config['kubeconfig'], 'r') as kcfg: