Collection of CheckMK checks (see https://checkmk.com/). All checks and plugins are provided as is. Absolutely no warranty. Send any comments to thl-cmk[at]outlook[dot]com

Skip to content
Snippets Groups Projects
Commit abc2ccb2 authored by thl-cmk's avatar thl-cmk :flag_na:
Browse files

fixed device.status

changed from status_class to staus
parent 8c8bd09f
No related branches found
No related tags found
No related merge requests found
# config files
pnp/configs/*.cfg
pnp/configs/*
# image files
pnp/images/*.bin
pnp/images/*
# log files
pnp/log/
......
{
"python.analysis.typeCheckingMode": "basic"
}
\ No newline at end of file
......@@ -177,7 +177,7 @@ class Device:
self.error_count: int = 0
self.error_message = ''
self.__hard_error: bool = False
self.__status_class: str = ''
self.__status: str = ''
@property
def pnp_flow(self) -> int:
......@@ -188,7 +188,7 @@ class Device:
self.__pnp_flow = pnp_flow
self.pnp_flow_readable = PNPFLOW.readable(pnp_flow)
if pnp_flow == PNPFLOW.FINISHED:
self.__status_class = 'finished'
self.__status = 'finished'
@property
def refresh_data(self) -> bool:
......@@ -210,7 +210,7 @@ class Device:
def error_code(self, error_code: int):
self.__error_code = error_code
self.error_code_readable = ERROR.readable(error_code)
self.__status_class = 'warning'
self.__status = 'warning'
@property
def hard_error(self) -> bool:
......@@ -219,15 +219,15 @@ class Device:
@hard_error.setter
def hard_error(self, hard_error: bool):
self.__hard_error = hard_error
self.__status_class = 'error'
self.__status = 'error'
@property
def status_class(self) -> str:
return self.__status_class
def status(self) -> str:
return self.__status
@status_class.setter
def status_class(self, status_class: str):
self.__status_class = status_class
@status.setter
def status(self, status: str):
self.__status = status
app = Flask(__name__, template_folder='./templates')
......@@ -315,7 +315,7 @@ def pnp_backoff(udi: str, correlator: str, minutes: Optional[int] = 1) -> str:
def pnp_backoff_terminate(udi: str, correlator: str) -> str:
device = devices[udi]
device.status = f'finished'
device.pnp_floe = PNPFLOW.FINISHED
device.pnp_flow = PNPFLOW.FINISHED
device.current_job = 'urn:cisco:pnp:backoff-terminate'
jinja_context = {
'udi': udi,
......
......@@ -73,7 +73,7 @@
<input type="submit" value="Remove" name="{{ device.udi }}"/>
</form>
</td>
<td class="{{ device.status_class}}">{{ device.serial }}</td>
<td class="{{ device.status}}">{{ device.serial }}</td>
<td>{{ device.platform }}</td>
<td>{{ device.hw_rev }}</td>
<td>{{ device.ip_address }}</td>
......
......@@ -25,8 +25,6 @@
background-color: #7cfc00;
}
input { width: 70px; }
</style>
</head>
<body>
......@@ -69,7 +67,7 @@
<input type="submit" value="Remove" name="{{ device.udi }}"/>
</form>
</td>
<td class="{{ device.status_class}}"><a href="{{ config_base_url }}/{{ device.serial }}.cfg" target="_blank">{{ device.serial }}</a></td>
<td class="{{ device.status}}"><a href="{{ config_base_url }}/{{ device.serial }}.cfg" target="_blank">{{ device.serial }}</a></td>
<td>{{ device.platform }}</td>
<td>{{ device.hw_rev }}</td>
<td>{{ device.ip_address }}</td>
......
......@@ -10,6 +10,12 @@ class SoftwareImage:
IMAGES = {
'dummy': SoftwareImage(
image='your_image_name.bin',
version='0.0.0',
md5='fdb9c92bae37f9130d0ee6761afe2919',
size=9999999999,
),
'CAT9K': SoftwareImage(
image='cat9k_iosxe.17.06.01.SPA.bin',
version='17.6.1',
......
......@@ -9,5 +9,5 @@ STATUS_REFRESH = 10
# DEBUG = True
# LOG_TO_FILE = True
# LOG_FILE = 'log/pnp_debug.log'
IMAGE_BASE_URL = 'http://192.168.10.135:8080/images'
CONFIG_BASE_URL = 'http://192.168.10.135:8080/configs'
IMAGE_BASE_URL = 'http://192.168.10.50:8080/images'
CONFIG_BASE_URL = 'http://192.168.10.50:8080/configs'
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment