Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Azure
GitHub Repository: Azure/Azure-Sentinel-Notebooks
Path: blob/master/src/SentinelUtilities/SentinelUtils/input_validation.py
3255 views
1
# -------------------------------------------------------------------------
2
# Copyright (c) Microsoft Corporation. All rights reserved.
3
# Licensed under the MIT License. See License.txt in the project root for
4
# license information.
5
# --------------------------------------------------------------------------
6
"""
7
input validation module:
8
This module validates user input, it throwes exceptions if validation fails
9
"""
10
11
from SentinelExceptions import InputError
12
13
# pylint: disable-msg=R0903
14
class InputValidation():
15
""" This class validates user inputs """
16
@staticmethod
17
18
def validate_input(name, text):
19
""" Validating input, no None or empty """
20
if not text:
21
raise InputError(name)
22
23