aboutsummaryrefslogtreecommitdiffstats
path: root/tools/sdv
diff options
context:
space:
mode:
Diffstat (limited to 'tools/sdv')
-rwxr-xr-xtools/sdv/NwLinksValid/__init__.py1
-rw-r--r--tools/sdv/NwLinksValid/nwlinksvalidator.py1
-rwxr-xr-xtools/sdv/SoftwarePostValid/__init__.py1
-rw-r--r--tools/sdv/SoftwarePostValid/swpostvalidator.py1
-rwxr-xr-xtools/sdv/SoftwarePreValid/__init__.py1
-rw-r--r--tools/sdv/SoftwarePreValid/airship.py20
-rw-r--r--tools/sdv/SoftwarePreValid/swprevalidator.py1
-rw-r--r--tools/sdv/conf/__init__.py24
-rw-r--r--tools/sdv/core/__init__.py2
-rw-r--r--tools/sdv/core/component_factory.py1
-rw-r--r--tools/sdv/core/loader/__init__.py2
-rw-r--r--tools/sdv/core/loader/loader.py1
-rw-r--r--tools/sdv/core/loader/loader_servant.py1
13 files changed, 39 insertions, 18 deletions
diff --git a/tools/sdv/NwLinksValid/__init__.py b/tools/sdv/NwLinksValid/__init__.py
index 87b6e58..99456db 100755
--- a/tools/sdv/NwLinksValid/__init__.py
+++ b/tools/sdv/NwLinksValid/__init__.py
@@ -13,4 +13,5 @@
"""Nework-Links Validator interface and helpers.
"""
+# flake8: noqa
from NwLinksValid.nwlinksvalidator import *
diff --git a/tools/sdv/NwLinksValid/nwlinksvalidator.py b/tools/sdv/NwLinksValid/nwlinksvalidator.py
index 3b84595..5e06590 100644
--- a/tools/sdv/NwLinksValid/nwlinksvalidator.py
+++ b/tools/sdv/NwLinksValid/nwlinksvalidator.py
@@ -17,6 +17,7 @@ Abstract class for N/W Lnks Prevalidations.
Implementors, please inherit from this class.
"""
+
class INwLinksValidator():
""" Model for a Links Validator """
def __init__(self):
diff --git a/tools/sdv/SoftwarePostValid/__init__.py b/tools/sdv/SoftwarePostValid/__init__.py
index 1c6f121..0a964b6 100755
--- a/tools/sdv/SoftwarePostValid/__init__.py
+++ b/tools/sdv/SoftwarePostValid/__init__.py
@@ -15,4 +15,5 @@
"""Sw Validator interface and helpers.
"""
+# flake8: noqa
from SoftwarePostValid.swpostvalidator import *
diff --git a/tools/sdv/SoftwarePostValid/swpostvalidator.py b/tools/sdv/SoftwarePostValid/swpostvalidator.py
index 2901cd4..4776123 100644
--- a/tools/sdv/SoftwarePostValid/swpostvalidator.py
+++ b/tools/sdv/SoftwarePostValid/swpostvalidator.py
@@ -17,6 +17,7 @@ Abstract class for Software Postvalidations.
Implementors, please inherit from this class.
"""
+
class ISwPostValidator():
""" Model for a Sw Validator """
def __init__(self):
diff --git a/tools/sdv/SoftwarePreValid/__init__.py b/tools/sdv/SoftwarePreValid/__init__.py
index e29c0af..8307b66 100755
--- a/tools/sdv/SoftwarePreValid/__init__.py
+++ b/tools/sdv/SoftwarePreValid/__init__.py
@@ -15,4 +15,5 @@
"""Sw Validator interface and helpers.
"""
+# flake8: noqa
from SoftwarePreValid.swprevalidator import *
diff --git a/tools/sdv/SoftwarePreValid/airship.py b/tools/sdv/SoftwarePreValid/airship.py
index 902b654..bd93aa2 100644
--- a/tools/sdv/SoftwarePreValid/airship.py
+++ b/tools/sdv/SoftwarePreValid/airship.py
@@ -25,6 +25,7 @@ import yaml
from conf import settings
from SoftwarePreValid import swprevalidator
+
def check_link(link):
"""
Function the check the availability of Hyperlinks
@@ -53,6 +54,7 @@ def check_link(link):
return False
return True
+
class Airship(swprevalidator.ISwPreValidator):
"""
Ariship Sw Validation
@@ -119,8 +121,6 @@ class Airship(swprevalidator.ISwPreValidator):
else:
print("The Link: %s is INVALID" % (location))
-
-
# pylint: disable=consider-using-enumerate
def find_locations(self, yamlfile):
"""
@@ -174,16 +174,16 @@ class Airship(swprevalidator.ISwPreValidator):
'maas.yaml')
with open(os_filename, 'r') as osref:
osfiles = yaml.load_all(osref, Loader=yaml.FullLoader)
- for osfile in osfiles:
- if ('data' in osfile and
- 'values' in osfile['data'] and
- 'conf' in osfile['data']['values'] and
- 'maas' in osfile['data']['values']['conf'] and
- 'images' in osfile['data']['values']['conf']['maas'] and
+ for osf in osfiles:
+ if ('data' in osf and
+ 'values' in osf['data'] and
+ 'conf' in osf['data']['values'] and
+ 'maas' in osf['data']['values']['conf'] and
+ 'images' in osf['data']['values']['conf']['maas'] and
('default_os' in
- osfile['data']['values']['conf']['maas']['images'])):
+ osf['data']['values']['conf']['maas']['images'])):
if (settings.getValue('OPERATING_SYSTEM') in
- osfile['data']['values']['conf']['maas']['images'][
+ osf['data']['values']['conf']['maas']['images'][
'default_os']):
print('Operating System is VALID')
os_done = True
diff --git a/tools/sdv/SoftwarePreValid/swprevalidator.py b/tools/sdv/SoftwarePreValid/swprevalidator.py
index 485fc2b..bef141b 100644
--- a/tools/sdv/SoftwarePreValid/swprevalidator.py
+++ b/tools/sdv/SoftwarePreValid/swprevalidator.py
@@ -17,6 +17,7 @@ Abstract class for Software Prevalidations.
Implementors, please inherit from this class.
"""
+
class ISwPreValidator():
""" Model for a Sw Validator """
def __init__(self):
diff --git a/tools/sdv/conf/__init__.py b/tools/sdv/conf/__init__.py
index 4e68c70..ef97aa7 100644
--- a/tools/sdv/conf/__init__.py
+++ b/tools/sdv/conf/__init__.py
@@ -25,8 +25,6 @@ import os
import re
import logging
import pprint
-import ast
-import netaddr
_LOGGER = logging.getLogger(__name__)
@@ -40,6 +38,7 @@ _LOGGER = logging.getLogger(__name__)
# #EVAL(2*#VMINDEX)
_PARSE_PATTERN = r'(#[A-Z]+)(\(([^(),]+)(,([0-9]+))?\))?'
+
class Settings(object):
"""Holding class for settings.
"""
@@ -52,15 +51,22 @@ class Settings(object):
"""
if isinstance(param, str):
# evaluate every #PARAM reference inside parameter itself
- macros = re.findall(r'#PARAM\((([\w\-]+)(\[[\w\[\]\-\'\"]+\])*)\)', param)
+ macros = re.findall(
+ r'#PARAM\((([\w\-]+)(\[[\w\[\]\-\'\"]+\])*)\)',
+ param)
if macros:
for macro in macros:
# pylint: disable=eval-used
try:
- tmp_val = str(eval("self.getValue('{}'){}".format(macro[1], macro[2])))
- param = param.replace('#PARAM({})'.format(macro[0]), tmp_val)
- # silently ignore that option required by PARAM macro can't be evaluated;
- # It is possible, that referred parameter will be constructed during runtime
+ tmp_val = str(
+ eval("self.getValue('{}'){}".format(macro[1],
+ macro[2])))
+ param = param.replace('#PARAM({})'.format(macro[0]),
+ tmp_val)
+ # silently ignore that option required by
+ # PARAM macro can't be evaluated;
+ # It is possible, that referred parameter
+ # will be constructed during runtime
# and re-read later.
except IndexError:
pass
@@ -133,7 +139,8 @@ class Settings(object):
:returns: None
"""
- regex = re.compile("^(?P<digit_part>[0-9]+)(?P<alfa_part>[a-z]?)_.*.conf$")
+ regex = re.compile(
+ "^(?P<digit_part>[0-9]+)(?P<alfa_part>[a-z]?)_.*.conf$")
def get_prefix(filename):
"""
@@ -224,6 +231,7 @@ class Settings(object):
assert value == self.__dict__[name]
return True
+
settings = Settings()
diff --git a/tools/sdv/core/__init__.py b/tools/sdv/core/__init__.py
index 6c1db43..2441d38 100644
--- a/tools/sdv/core/__init__.py
+++ b/tools/sdv/core/__init__.py
@@ -14,4 +14,6 @@
"""Core structural interfaces and their implementations
"""
+
+# flake8: noqa
import core.component_factory
diff --git a/tools/sdv/core/component_factory.py b/tools/sdv/core/component_factory.py
index 68ad460..396aa28 100644
--- a/tools/sdv/core/component_factory.py
+++ b/tools/sdv/core/component_factory.py
@@ -16,6 +16,7 @@
Create Components.
"""
+
def create_swprevalidator(swprevalidator_class):
""" Create Pre-Validators"""
return swprevalidator_class()
diff --git a/tools/sdv/core/loader/__init__.py b/tools/sdv/core/loader/__init__.py
index c3b60a4..e86c48e 100644
--- a/tools/sdv/core/loader/__init__.py
+++ b/tools/sdv/core/loader/__init__.py
@@ -13,4 +13,6 @@
"""
Core: Loader Component.
"""
+
+# flake8: noqa
from .loader import Loader
diff --git a/tools/sdv/core/loader/loader.py b/tools/sdv/core/loader/loader.py
index ea62d0c..c9f8e96 100644
--- a/tools/sdv/core/loader/loader.py
+++ b/tools/sdv/core/loader/loader.py
@@ -23,6 +23,7 @@ from SoftwarePreValid.swprevalidator import ISwPreValidator
from SoftwarePostValid.swpostvalidator import ISwPostValidator
from NwLinksValid.nwlinksvalidator import INwLinksValidator
+
# pylint: disable=too-many-public-methods
class Loader():
"""Loader class - main object context holder.
diff --git a/tools/sdv/core/loader/loader_servant.py b/tools/sdv/core/loader/loader_servant.py
index ba175d5..4e55c67 100644
--- a/tools/sdv/core/loader/loader_servant.py
+++ b/tools/sdv/core/loader/loader_servant.py
@@ -23,6 +23,7 @@ import fnmatch
import logging
from conf import settings
+
class LoaderServant():
"""Class implements basic dynamic import operations.
"""