mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 09:23:56 +00:00
Lint develop branch
This commit is contained in:
parent
6ac3f4d0b4
commit
a659c3be50
@ -32,9 +32,8 @@ In order to have the returner apply to all minions:
|
||||
ext_job_cache: elasticsearch
|
||||
'''
|
||||
|
||||
from __future__ import absolute_import
|
||||
|
||||
# Import Python libs
|
||||
from __future__ import absolute_import
|
||||
from datetime import tzinfo, datetime, timedelta
|
||||
import uuid
|
||||
import logging
|
||||
@ -51,6 +50,7 @@ log = logging.getLogger(__name__)
|
||||
def __virtual__():
|
||||
return __virtualname__
|
||||
|
||||
|
||||
def _ensure_index(index):
|
||||
index_exists = __salt__['elasticsearch.index_exists'](index)
|
||||
if not index_exists:
|
||||
@ -70,7 +70,6 @@ def _ensure_index(index):
|
||||
__salt__['elasticsearch.alias_create']('{0}-v1'.format(index), index)
|
||||
|
||||
|
||||
|
||||
def returner(ret):
|
||||
'''
|
||||
Process the return from Salt
|
||||
|
30
tests/unit/modules/k8s_test.py
Executable file → Normal file
30
tests/unit/modules/k8s_test.py
Executable file → Normal file
@ -1,21 +1,26 @@
|
||||
# Import pytohn libs
|
||||
from __future__ import absolute_import
|
||||
# Import Salt Testing libs
|
||||
from salttesting import skipIf, TestCase
|
||||
from salttesting.helpers import ensure_in_syspath, skip_if_binaries_missing
|
||||
ensure_in_syspath('../../')
|
||||
# from unittest import TestCase
|
||||
# -*- coding: utf-8 -*-
|
||||
'''
|
||||
Unit Tests for the k8s execution module.
|
||||
'''
|
||||
|
||||
# Import Salt execution module to test
|
||||
# from salt.modules import k8s
|
||||
# FIXME
|
||||
import salt.modules.k8s as k8s
|
||||
# Import Python libs
|
||||
from __future__ import absolute_import
|
||||
import json
|
||||
import hashlib
|
||||
import base64
|
||||
import time
|
||||
from subprocess import Popen, PIPE
|
||||
|
||||
# Import Salt Testing libs
|
||||
from salttesting import TestCase
|
||||
from salttesting.helpers import ensure_in_syspath, skip_if_binaries_missing
|
||||
|
||||
ensure_in_syspath('../../')
|
||||
|
||||
# Import Salt libs
|
||||
import salt.modules.k8s as k8s
|
||||
|
||||
|
||||
TestCase.maxDiff = None
|
||||
|
||||
|
||||
@ -294,7 +299,7 @@ spec:
|
||||
|
||||
|
||||
@skip_if_binaries_missing(['kubectl'])
|
||||
class TestK8SLimitrange(TestCase):
|
||||
class TestK8SLimitRange(TestCase):
|
||||
|
||||
def setUp(self):
|
||||
hash = hashlib.sha1()
|
||||
@ -391,6 +396,7 @@ spec:
|
||||
b = kubectl_out.get("metadata", {}).get("name", "b")
|
||||
self.assertEqual(a, b)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
from integration import run_tests
|
||||
run_tests(TestK8SNamespace,
|
||||
|
Loading…
Reference in New Issue
Block a user