예제 #1
0
def get_scripts():
    if os.environ.get("NOC_TEST_SCRIPT"):
        s_name = os.environ["NOC_TEST_SCRIPT"]
        return [x for x in loader.iter_scripts() if x == s_name]
    elif os.environ.get("NOC_TEST_PROFILE"):
        p_name = "%s." % os.environ["NOC_TEST_PROFILE"]
        return [x for x in loader.iter_scripts() if x.startswith(p_name)]
    else:
        return list(loader.iter_scripts())
예제 #2
0
파일: views.py 프로젝트: nbashev/noc
 def build_script(self):
     """
     Profile names
     :return: (script name, script name)
     """
     s = set(x.split(".")[-1] for x in script_loader.iter_scripts())
     return [{"id": n, "label": n} for n in sorted(s)]
예제 #3
0
def test_iter_scripts():
    assert len(list(loader.iter_scripts())) > 0